@tmagic/form 1.8.0-beta.13 → 1.8.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Form.vue_vue_type_script_setup_true_lang.js +51 -16
- package/dist/es/FormDialog.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/es/FormDrawer.vue_vue_type_script_setup_true_lang.js +38 -12
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +23 -17
- package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +41 -31
- package/dist/es/containers/Panel.vue_vue_type_script_setup_true_lang.js +16 -10
- package/dist/es/containers/table/ActionsColumn.vue_vue_type_script_setup_true_lang.js +13 -6
- package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/containers/table/useTableColumns.js +5 -1
- package/dist/es/containers/table-group-list/TableGroupList.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/fields/Cascader.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Checkbox.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/ColorPicker.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Date.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/DateTime.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Display.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/DynamicField.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Link.vue_vue_type_script_setup_true_lang.js +29 -7
- package/dist/es/fields/Number.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/es/fields/NumberRange.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/RadioGroup.vue_vue_type_script_setup_true_lang.js +19 -9
- package/dist/es/fields/Select.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Switch.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Text.vue_vue_type_script_setup_true_lang.js +112 -77
- package/dist/es/fields/Textarea.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Time.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Timerange.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/index.js +3 -3
- package/dist/es/plugin.js +3 -1
- package/dist/es/style.css +122 -8
- package/dist/es/submitForm.js +2 -8
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/form.js +33 -3
- package/dist/es/utils/typeMatch.js +1 -1
- package/dist/style.css +122 -8
- package/dist/themes/magic-admin.css +499 -0
- package/dist/tmagic-form.umd.cjs +541 -296
- package/package.json +4 -4
- package/src/Form.vue +71 -18
- package/src/FormDialog.vue +14 -3
- package/src/FormDrawer.vue +40 -12
- package/src/containers/Container.vue +16 -5
- package/src/containers/GroupList.vue +1 -1
- package/src/containers/GroupListItem.vue +28 -22
- package/src/containers/Panel.vue +10 -3
- package/src/containers/table/ActionsColumn.vue +10 -4
- package/src/containers/table/Table.vue +1 -0
- package/src/containers/table/useTableColumns.ts +7 -3
- package/src/containers/table-group-list/TableGroupList.vue +7 -1
- package/src/fields/Link.vue +16 -3
- package/src/fields/Number.vue +2 -1
- package/src/fields/RadioGroup.vue +21 -6
- package/src/fields/Text.vue +43 -19
- package/src/plugin.ts +3 -0
- package/src/submitForm.ts +5 -11
- package/src/theme/container.scss +3 -0
- package/src/theme/fieldset.scss +51 -0
- package/src/theme/form.scss +6 -0
- package/src/theme/group-list.scss +9 -7
- package/src/theme/index.scss +1 -0
- package/src/theme/link.scss +17 -0
- package/src/theme/panel.scss +1 -1
- package/src/theme/radio-group.scss +23 -0
- package/src/theme/tabs.scss +2 -2
- package/src/theme/text.scss +38 -0
- package/src/theme/themes/magic-admin/index.scss +95 -0
- package/src/utils/config.ts +7 -1
- package/src/utils/form.ts +37 -0
- package/types/index.d.ts +64 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { filterFunction } from "../utils/form.js";
|
|
2
2
|
import Container_default from "./Container.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode,
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, inject, openBlock, ref, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
4
|
import { TMagicButton, TMagicCard } from "@tmagic/design";
|
|
5
|
-
import {
|
|
5
|
+
import { ArrowDown, ArrowRight } from "@element-plus/icons-vue";
|
|
6
6
|
//#region packages/form/src/containers/Panel.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = { style: {
|
|
8
8
|
"width": "100%",
|
|
@@ -28,7 +28,8 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
28
28
|
labelWidth: {},
|
|
29
29
|
prop: {},
|
|
30
30
|
size: {},
|
|
31
|
-
disabled: { type: Boolean }
|
|
31
|
+
disabled: { type: Boolean },
|
|
32
|
+
hideExpand: { type: Boolean }
|
|
32
33
|
},
|
|
33
34
|
emits: ["change", "addDiffCount"],
|
|
34
35
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -52,21 +53,26 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
52
53
|
return items.value && items.value.length ? (openBlock(), createBlock(unref(TMagicCard), {
|
|
53
54
|
key: 0,
|
|
54
55
|
class: "box-card m-form-panel",
|
|
55
|
-
"body-style": { display: expand.value ? "block" : "none" }
|
|
56
|
+
"body-style": { display: expand.value ? "block" : "none" },
|
|
57
|
+
flat: __props.config.flat
|
|
56
58
|
}, {
|
|
57
59
|
header: withCtx(() => [createElementVNode("div", _hoisted_1, [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
!__props.hideExpand ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
61
|
+
key: 0,
|
|
62
|
+
style: {
|
|
63
|
+
"padding": "0",
|
|
64
|
+
"margin-right": "10px"
|
|
65
|
+
},
|
|
60
66
|
link: "",
|
|
61
|
-
icon: expand.value ? unref(
|
|
67
|
+
icon: expand.value ? unref(ArrowDown) : unref(ArrowRight),
|
|
62
68
|
onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
|
|
63
|
-
}, null, 8, ["icon"]),
|
|
69
|
+
}, null, 8, ["icon"])) : createCommentVNode("v-if", true),
|
|
64
70
|
renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("span", {
|
|
65
71
|
style: { "cursor": "pointer" },
|
|
66
72
|
onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
|
|
67
73
|
}, toDisplayString(filter(__props.config.title)), 1)]),
|
|
68
74
|
__props.config && __props.config.extra ? (openBlock(), createElementBlock("span", {
|
|
69
|
-
key:
|
|
75
|
+
key: 1,
|
|
70
76
|
innerHTML: __props.config.extra,
|
|
71
77
|
class: "m-form-tip"
|
|
72
78
|
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
@@ -122,7 +128,7 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
122
128
|
]);
|
|
123
129
|
}), 128))])]),
|
|
124
130
|
_: 3
|
|
125
|
-
}, 8, ["body-style"])) : createCommentVNode("v-if", true);
|
|
131
|
+
}, 8, ["body-style", "flat"])) : createCommentVNode("v-if", true);
|
|
126
132
|
};
|
|
127
133
|
}
|
|
128
134
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, inject, normalizeClass, openBlock, renderSlot, unref, vShow, withCtx, withDirectives } from "vue";
|
|
1
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, renderSlot, unref, vShow, withCtx, withDirectives } from "vue";
|
|
2
2
|
import { cloneDeep } from "lodash-es";
|
|
3
3
|
import { TMagicButton, TMagicTooltip } from "@tmagic/design";
|
|
4
4
|
import { Delete, DocumentCopy, Sort } from "@element-plus/icons-vue";
|
|
@@ -15,7 +15,8 @@ var ActionsColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
15
15
|
index: {},
|
|
16
16
|
row: {},
|
|
17
17
|
prop: {},
|
|
18
|
-
sortKey: {}
|
|
18
|
+
sortKey: {},
|
|
19
|
+
flat: { type: Boolean }
|
|
19
20
|
},
|
|
20
21
|
emits: ["change"],
|
|
21
22
|
setup(__props, { emit: __emit }) {
|
|
@@ -86,19 +87,25 @@ var ActionsColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
86
87
|
type: "danger",
|
|
87
88
|
link: "",
|
|
88
89
|
title: "删除",
|
|
89
|
-
icon: __props.config.deleteActionButtonIcon || unref(Delete),
|
|
90
|
+
icon: __props.flat ? void 0 : __props.config.deleteActionButtonIcon || unref(Delete),
|
|
90
91
|
onClick: _cache[0] || (_cache[0] = ($event) => removeHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
91
|
-
},
|
|
92
|
+
}, {
|
|
93
|
+
default: withCtx(() => [__props.flat ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode("删除")], 64)) : createCommentVNode("v-if", true)]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["icon"]), [[vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
|
|
92
96
|
copyable(__props.index + 1 + __props.currentPage * __props.pageSize - 1) ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
93
97
|
key: 1,
|
|
94
98
|
link: "",
|
|
95
99
|
size: "small",
|
|
96
100
|
type: "primary",
|
|
97
101
|
title: "复制",
|
|
98
|
-
icon: __props.config.copyActionButtonIcon || unref(DocumentCopy),
|
|
102
|
+
icon: __props.flat ? void 0 : __props.config.copyActionButtonIcon || unref(DocumentCopy),
|
|
99
103
|
disabled: __props.disabled,
|
|
100
104
|
onClick: _cache[1] || (_cache[1] = ($event) => copyHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
101
|
-
},
|
|
105
|
+
}, {
|
|
106
|
+
default: withCtx(() => [__props.flat ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode("复制")], 64)) : createCommentVNode("v-if", true)]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true)
|
|
102
109
|
], 64);
|
|
103
110
|
};
|
|
104
111
|
}
|
|
@@ -99,14 +99,16 @@ var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
99
99
|
"default-expand-all": true,
|
|
100
100
|
key: updateKey.value,
|
|
101
101
|
onSelect: unref(selectHandle),
|
|
102
|
-
onSortChange: sortChangeHandler
|
|
102
|
+
onSortChange: sortChangeHandler,
|
|
103
|
+
"empty-text": `暂无${__props.config.titlePrefix || ""}数据`
|
|
103
104
|
}, null, 8, [
|
|
104
105
|
"row-key",
|
|
105
106
|
"columns",
|
|
106
107
|
"data",
|
|
107
108
|
"border",
|
|
108
109
|
"max-height",
|
|
109
|
-
"onSelect"
|
|
110
|
+
"onSelect",
|
|
111
|
+
"empty-text"
|
|
110
112
|
])) : createCommentVNode("v-if", true)]),
|
|
111
113
|
_: 1
|
|
112
114
|
}, 8, ["disabled"]),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { display, getDataByPage, sortArray } from "../../utils/form.js";
|
|
2
|
+
import { isGlobalFlat } from "../../utils/config.js";
|
|
2
3
|
import Container_default from "../Container.js";
|
|
3
4
|
import ActionsColumn_default from "./ActionsColumn.js";
|
|
4
5
|
import SortColumn_default from "./SortColumn.js";
|
|
@@ -66,8 +67,10 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
66
67
|
type: "selection",
|
|
67
68
|
width: 45
|
|
68
69
|
} });
|
|
69
|
-
|
|
70
|
+
const defaultFixed = isGlobalFlat.value ? "right" : "left";
|
|
71
|
+
let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
|
|
70
72
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
|
|
73
|
+
const actionFlat = props.config.flat === void 0 && isGlobalFlat.value ? true : props.config.flat;
|
|
71
74
|
const actionColumn = {
|
|
72
75
|
props: {
|
|
73
76
|
label: "操作",
|
|
@@ -77,6 +80,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
77
80
|
},
|
|
78
81
|
cell: ({ row, $index }) => h(ActionsColumn_default, {
|
|
79
82
|
row,
|
|
83
|
+
flat: actionFlat,
|
|
80
84
|
index: $index,
|
|
81
85
|
model: props.model,
|
|
82
86
|
config: props.config,
|
package/dist/es/containers/table-group-list/TableGroupList.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -127,9 +127,10 @@ var TableGroupList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
127
127
|
size: addButtonSize.value,
|
|
128
128
|
plain: displayMode.value === "table",
|
|
129
129
|
icon: unref(Plus),
|
|
130
|
+
text: "",
|
|
130
131
|
disabled: __props.disabled
|
|
131
132
|
}, currentConfig.value.addButtonConfig?.props || { type: "primary" }, { onClick: unref(newHandler) }), {
|
|
132
|
-
default: withCtx(() => [createTextVNode(toDisplayString(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? "
|
|
133
|
+
default: withCtx(() => [createTextVNode(toDisplayString(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? `新增一行${groupListConfig.value.titlePrefix || ""}` : `新增${groupListConfig.value.titlePrefix || ""}`)), 1)]),
|
|
133
134
|
_: 1
|
|
134
135
|
}, 16, [
|
|
135
136
|
"class",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { filterFunction } from "../utils/form.js";
|
|
1
2
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
3
|
import { getConfig } from "../utils/config.js";
|
|
3
|
-
import { filterFunction } from "../utils/form.js";
|
|
4
4
|
import { computed, createBlock, defineComponent, inject, openBlock, ref, unref, watchEffect } from "vue";
|
|
5
5
|
import { TMagicCascader } from "@tmagic/design";
|
|
6
6
|
//#region packages/form/src/fields/Cascader.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -17,7 +17,10 @@ var Cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
17
17
|
disabled: { type: Boolean },
|
|
18
18
|
size: {},
|
|
19
19
|
lastValues: {},
|
|
20
|
-
isCompare: { type: Boolean }
|
|
20
|
+
isCompare: { type: Boolean },
|
|
21
|
+
text: {},
|
|
22
|
+
labelWidth: {},
|
|
23
|
+
labelPosition: {}
|
|
21
24
|
},
|
|
22
25
|
emits: ["change"],
|
|
23
26
|
setup(__props, { emit: __emit }) {
|
|
@@ -15,7 +15,10 @@ var Checkbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
15
15
|
disabled: { type: Boolean },
|
|
16
16
|
size: {},
|
|
17
17
|
lastValues: {},
|
|
18
|
-
isCompare: { type: Boolean }
|
|
18
|
+
isCompare: { type: Boolean },
|
|
19
|
+
text: {},
|
|
20
|
+
labelWidth: {},
|
|
21
|
+
labelPosition: {}
|
|
19
22
|
},
|
|
20
23
|
emits: ["change"],
|
|
21
24
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAddField } from "../utils/useAddField.js";
|
|
2
1
|
import { filterFunction } from "../utils/form.js";
|
|
2
|
+
import { useAddField } from "../utils/useAddField.js";
|
|
3
3
|
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, defineComponent, inject, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
4
4
|
import { TMagicCheckbox, TMagicCheckboxGroup } from "@tmagic/design";
|
|
5
5
|
//#region packages/form/src/fields/CheckboxGroup.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,7 +16,10 @@ var CheckboxGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["change"],
|
|
22
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -15,7 +15,10 @@ var ColorPicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
15
15
|
disabled: { type: Boolean },
|
|
16
16
|
size: {},
|
|
17
17
|
lastValues: {},
|
|
18
|
-
isCompare: { type: Boolean }
|
|
18
|
+
isCompare: { type: Boolean },
|
|
19
|
+
text: {},
|
|
20
|
+
labelWidth: {},
|
|
21
|
+
labelPosition: {}
|
|
19
22
|
},
|
|
20
23
|
emits: ["change"],
|
|
21
24
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAddField } from "../utils/useAddField.js";
|
|
2
1
|
import { datetimeFormatter } from "../utils/form.js";
|
|
2
|
+
import { useAddField } from "../utils/useAddField.js";
|
|
3
3
|
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
4
4
|
import { TMagicDatePicker } from "@tmagic/design";
|
|
5
5
|
//#region packages/form/src/fields/Date.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,7 +16,10 @@ var Date_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["change"],
|
|
22
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAddField } from "../utils/useAddField.js";
|
|
2
1
|
import { datetimeFormatter } from "../utils/form.js";
|
|
2
|
+
import { useAddField } from "../utils/useAddField.js";
|
|
3
3
|
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
4
4
|
import { TMagicDatePicker } from "@tmagic/design";
|
|
5
5
|
//#region packages/form/src/fields/DateTime.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,7 +16,10 @@ var DateTime_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["change"],
|
|
22
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAddField } from "../utils/useAddField.js";
|
|
2
1
|
import { datetimeFormatter } from "../utils/form.js";
|
|
2
|
+
import { useAddField } from "../utils/useAddField.js";
|
|
3
3
|
import { createBlock, defineComponent, onUnmounted, openBlock, ref, unref, watch } from "vue";
|
|
4
4
|
import { TMagicDatePicker } from "@tmagic/design";
|
|
5
5
|
//#region packages/form/src/fields/Daterange.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,7 +16,10 @@ var Daterange_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["change"],
|
|
22
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAddField } from "../utils/useAddField.js";
|
|
2
1
|
import { filterFunction } from "../utils/form.js";
|
|
2
|
+
import { useAddField } from "../utils/useAddField.js";
|
|
3
3
|
import { computed, createCommentVNode, createElementBlock, defineComponent, inject, openBlock, toDisplayString } from "vue";
|
|
4
4
|
//#region packages/form/src/fields/Display.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = { key: 0 };
|
|
@@ -16,7 +16,10 @@ var Display_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
setup(__props) {
|
|
22
25
|
const props = __props;
|
|
@@ -17,7 +17,10 @@ var DynamicField_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
17
17
|
disabled: { type: Boolean },
|
|
18
18
|
size: {},
|
|
19
19
|
lastValues: {},
|
|
20
|
-
isCompare: { type: Boolean }
|
|
20
|
+
isCompare: { type: Boolean },
|
|
21
|
+
text: {},
|
|
22
|
+
labelWidth: {},
|
|
23
|
+
labelPosition: {}
|
|
21
24
|
},
|
|
22
25
|
emits: ["change"],
|
|
23
26
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
|
+
import { isGlobalFlat } from "../utils/config.js";
|
|
2
3
|
import FormDialog_default from "../FormDialog.js";
|
|
3
4
|
import { computed, createElementBlock, createTextVNode, createVNode, defineComponent, inject, normalizeStyle, openBlock, readonly, ref, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
-
import { TMagicButton } from "@tmagic/design";
|
|
5
|
+
import { TMagicButton, TMagicIcon } from "@tmagic/design";
|
|
6
|
+
import { Notebook } from "@element-plus/icons-vue";
|
|
5
7
|
//#region packages/form/src/fields/Link.vue?vue&type=script&setup=true&lang.ts
|
|
6
8
|
var _hoisted_1 = ["href"];
|
|
7
|
-
var _hoisted_2 =
|
|
8
|
-
|
|
9
|
+
var _hoisted_2 = ["href"];
|
|
10
|
+
var _hoisted_3 = {
|
|
11
|
+
key: 3,
|
|
9
12
|
class: "m-fields-link"
|
|
10
13
|
};
|
|
11
14
|
var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -21,7 +24,11 @@ var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
21
24
|
disabled: { type: Boolean },
|
|
22
25
|
size: {},
|
|
23
26
|
lastValues: {},
|
|
24
|
-
isCompare: { type: Boolean }
|
|
27
|
+
isCompare: { type: Boolean },
|
|
28
|
+
text: {},
|
|
29
|
+
labelWidth: {},
|
|
30
|
+
labelPosition: {},
|
|
31
|
+
theme: {}
|
|
25
32
|
},
|
|
26
33
|
emits: ["change"],
|
|
27
34
|
setup(__props, { emit: __emit }) {
|
|
@@ -64,15 +71,30 @@ var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
64
71
|
editor.value && (editor.value.dialogVisible = false);
|
|
65
72
|
};
|
|
66
73
|
return (_ctx, _cache) => {
|
|
67
|
-
return __props.config.href && !__props.disabled ? (openBlock(), createElementBlock("a", {
|
|
74
|
+
return unref(isGlobalFlat) && __props.config.href && !__props.disabled ? (openBlock(), createElementBlock("a", {
|
|
68
75
|
key: 0,
|
|
69
76
|
target: "_blank",
|
|
70
77
|
href: href.value,
|
|
78
|
+
class: "magic-admin-link",
|
|
71
79
|
style: normalizeStyle(__props.config.css || {})
|
|
72
|
-
},
|
|
80
|
+
}, [createVNode(unref(TMagicButton), {
|
|
81
|
+
link: "",
|
|
82
|
+
type: "primary"
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [createVNode(unref(TMagicIcon), null, {
|
|
85
|
+
default: withCtx(() => [createVNode(unref(Notebook))]),
|
|
86
|
+
_: 1
|
|
87
|
+
}), createTextVNode(toDisplayString(displayText.value), 1)]),
|
|
88
|
+
_: 1
|
|
89
|
+
})], 12, _hoisted_1)) : __props.config.href && !__props.disabled ? (openBlock(), createElementBlock("a", {
|
|
73
90
|
key: 1,
|
|
91
|
+
target: "_blank",
|
|
92
|
+
href: href.value,
|
|
93
|
+
style: normalizeStyle(__props.config.css || {})
|
|
94
|
+
}, toDisplayString(displayText.value), 13, _hoisted_2)) : __props.config.href && __props.disabled ? (openBlock(), createElementBlock("span", {
|
|
95
|
+
key: 2,
|
|
74
96
|
style: normalizeStyle(__props.config.disabledCss || {})
|
|
75
|
-
}, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div",
|
|
97
|
+
}, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(TMagicButton), {
|
|
76
98
|
link: "",
|
|
77
99
|
type: "primary",
|
|
78
100
|
onClick: editHandler
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
|
+
import { isGlobalFlat } from "../utils/config.js";
|
|
2
3
|
import { createBlock, createCommentVNode, defineComponent, inject, openBlock, ref, unref, watch } from "vue";
|
|
3
4
|
import { TMagicInputNumber } from "@tmagic/design";
|
|
4
5
|
//#region packages/form/src/fields/Number.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -15,7 +16,10 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
15
16
|
disabled: { type: Boolean },
|
|
16
17
|
size: {},
|
|
17
18
|
lastValues: {},
|
|
18
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
19
23
|
},
|
|
20
24
|
emits: ["change", "input"],
|
|
21
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -40,7 +44,7 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
40
44
|
modelValue: value.value,
|
|
41
45
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
42
46
|
clearable: "",
|
|
43
|
-
"controls-position": "right",
|
|
47
|
+
"controls-position": unref(isGlobalFlat) ? "" : "right",
|
|
44
48
|
size: __props.size,
|
|
45
49
|
max: __props.config.max,
|
|
46
50
|
min: __props.config.min,
|
|
@@ -51,6 +55,7 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
51
55
|
onInput: inputHandler
|
|
52
56
|
}, null, 8, [
|
|
53
57
|
"modelValue",
|
|
58
|
+
"controls-position",
|
|
54
59
|
"size",
|
|
55
60
|
"max",
|
|
56
61
|
"min",
|
|
@@ -16,7 +16,10 @@ var NumberRange_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
size: {},
|
|
18
18
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
19
|
+
isCompare: { type: Boolean },
|
|
20
|
+
text: {},
|
|
21
|
+
labelWidth: {},
|
|
22
|
+
labelPosition: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["change"],
|
|
22
25
|
setup(__props, { emit: __emit }) {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderList, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
|
|
3
3
|
import { TMagicIcon, TMagicRadio, TMagicRadioButton, TMagicRadioGroup, TMagicTooltip } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var _hoisted_1 = {
|
|
5
|
+
var _hoisted_1 = { class: "m-fields-radio-group__option" };
|
|
6
|
+
var _hoisted_2 = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "m-fields-radio-group__text"
|
|
9
|
+
};
|
|
6
10
|
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
11
|
name: "MFormRadioGroup",
|
|
8
12
|
__name: "RadioGroup",
|
|
@@ -16,7 +20,10 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
16
20
|
disabled: { type: Boolean },
|
|
17
21
|
size: {},
|
|
18
22
|
lastValues: {},
|
|
19
|
-
isCompare: { type: Boolean }
|
|
23
|
+
isCompare: { type: Boolean },
|
|
24
|
+
text: {},
|
|
25
|
+
labelWidth: {},
|
|
26
|
+
labelPosition: {}
|
|
20
27
|
},
|
|
21
28
|
emits: ["change"],
|
|
22
29
|
setup(__props, { emit: __emit }) {
|
|
@@ -29,16 +36,18 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
29
36
|
};
|
|
30
37
|
useAddField(props.prop);
|
|
31
38
|
const iconSize = computed(() => {
|
|
32
|
-
if (props.
|
|
39
|
+
if (props.config.iconSize) return props.config.iconSize;
|
|
40
|
+
if (props.size === "small") return "14";
|
|
33
41
|
if (props.size === "large") return "16";
|
|
34
|
-
return "
|
|
42
|
+
return "16";
|
|
35
43
|
});
|
|
36
44
|
return (_ctx, _cache) => {
|
|
37
45
|
return __props.model ? (openBlock(), createBlock(unref(TMagicRadioGroup), {
|
|
38
46
|
key: 0,
|
|
39
47
|
"model-value": __props.model[__props.name],
|
|
40
48
|
size: __props.size,
|
|
41
|
-
disabled: __props.disabled
|
|
49
|
+
disabled: __props.disabled,
|
|
50
|
+
class: "icon-{{ iconSize }}"
|
|
42
51
|
}, {
|
|
43
52
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.config.options, (option) => {
|
|
44
53
|
return openBlock(), createBlock(resolveDynamicComponent(itemComponent.value), {
|
|
@@ -51,13 +60,14 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
51
60
|
placement: "top-start",
|
|
52
61
|
content: option.tooltip
|
|
53
62
|
}, {
|
|
54
|
-
default: withCtx(() => [createElementVNode("div",
|
|
63
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [option.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
|
|
55
64
|
key: 0,
|
|
56
|
-
size: iconSize.value
|
|
65
|
+
size: iconSize.value,
|
|
66
|
+
class: normalizeClass({ "m-fields-radio-group__icon_with_text": !!option.text })
|
|
57
67
|
}, {
|
|
58
68
|
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(option.icon)))]),
|
|
59
69
|
_: 2
|
|
60
|
-
}, 1032, ["size"])) : createCommentVNode("v-if", true), option.text ? (openBlock(), createElementBlock("span",
|
|
70
|
+
}, 1032, ["size", "class"])) : createCommentVNode("v-if", true), option.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(option.text), 1)) : createCommentVNode("v-if", true)])]),
|
|
61
71
|
_: 2
|
|
62
72
|
}, 1032, ["disabled", "content"])]),
|
|
63
73
|
_: 2
|
|
@@ -18,7 +18,10 @@ var Select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
18
18
|
disabled: { type: Boolean },
|
|
19
19
|
size: {},
|
|
20
20
|
lastValues: {},
|
|
21
|
-
isCompare: { type: Boolean }
|
|
21
|
+
isCompare: { type: Boolean },
|
|
22
|
+
text: {},
|
|
23
|
+
labelWidth: {},
|
|
24
|
+
labelPosition: {}
|
|
22
25
|
},
|
|
23
26
|
emits: ["change"],
|
|
24
27
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -15,7 +15,10 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
15
15
|
disabled: { type: Boolean },
|
|
16
16
|
size: {},
|
|
17
17
|
lastValues: {},
|
|
18
|
-
isCompare: { type: Boolean }
|
|
18
|
+
isCompare: { type: Boolean },
|
|
19
|
+
text: {},
|
|
20
|
+
labelWidth: {},
|
|
21
|
+
labelPosition: {}
|
|
19
22
|
},
|
|
20
23
|
emits: ["change"],
|
|
21
24
|
setup(__props, { emit: __emit }) {
|