@tmagic/form 1.8.0-beta.9 → 1.8.0-manmanyu.11
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 +44 -5
- 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 +37 -12
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +22 -16
- 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 +6 -2
- 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 +4 -1
- 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 +4 -1
- 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 +4 -1
- package/dist/es/fields/DateTime.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/Display.vue_vue_type_script_setup_true_lang.js +4 -1
- 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 +8 -3
- 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 +16 -8
- 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 +4 -1
- package/dist/es/plugin.js +2 -0
- package/dist/es/style.css +121 -8
- package/dist/style.css +121 -8
- package/dist/themes/magic-admin.css +495 -0
- package/dist/tmagic-form.umd.cjs +448 -225
- package/package.json +4 -4
- package/src/Form.vue +53 -4
- 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 +10 -4
- package/src/containers/table-group-list/TableGroupList.vue +7 -1
- package/src/fields/Link.vue +17 -3
- package/src/fields/Number.vue +5 -2
- package/src/fields/RadioGroup.vue +11 -5
- package/src/fields/Text.vue +43 -19
- package/src/plugin.ts +2 -0
- package/src/theme/container.scss +3 -0
- package/src/theme/fieldset.scss +50 -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 +91 -0
- package/types/index.d.ts +46 -1
|
@@ -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"]),
|
|
@@ -4,11 +4,12 @@ import ActionsColumn_default from "./ActionsColumn.js";
|
|
|
4
4
|
import SortColumn_default from "./SortColumn.js";
|
|
5
5
|
import { computed, h, inject } from "vue";
|
|
6
6
|
import { cloneDeep } from "lodash-es";
|
|
7
|
-
import { TMagicIcon, TMagicTooltip } from "@tmagic/design";
|
|
7
|
+
import { TMagicIcon, TMagicTooltip, isMagicAdminTheme } from "@tmagic/design";
|
|
8
8
|
import { WarningFilled } from "@element-plus/icons-vue";
|
|
9
9
|
//#region packages/form/src/containers/table/useTableColumns.ts
|
|
10
10
|
var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
11
11
|
const mForm = inject("mForm");
|
|
12
|
+
const isMagicAdmin = isMagicAdminTheme();
|
|
12
13
|
const display$1 = (fuc) => display(mForm, fuc, props);
|
|
13
14
|
const lastData = computed(() => props.config.pagination ? getDataByPage(props.lastValues[modelName.value], currentPage.value, pageSize.value) : props.lastValues[modelName.value] || []);
|
|
14
15
|
const itemExtra = (fuc, index) => {
|
|
@@ -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 = isMagicAdmin.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 && isMagicAdmin.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",
|
|
@@ -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 }) {
|
|
@@ -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 }) {
|
|
@@ -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 }) {
|
|
@@ -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 }) {
|
|
@@ -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 }) {
|
|
@@ -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,13 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
2
|
import FormDialog_default from "../FormDialog.js";
|
|
3
3
|
import { computed, createElementBlock, createTextVNode, createVNode, defineComponent, inject, normalizeStyle, openBlock, readonly, ref, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
-
import { TMagicButton } from "@tmagic/design";
|
|
4
|
+
import { TMagicButton, TMagicIcon, isMagicAdminTheme } from "@tmagic/design";
|
|
5
|
+
import { Notebook } from "@element-plus/icons-vue";
|
|
5
6
|
//#region packages/form/src/fields/Link.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = ["href"];
|
|
7
|
-
var _hoisted_2 =
|
|
8
|
-
|
|
8
|
+
var _hoisted_2 = ["href"];
|
|
9
|
+
var _hoisted_3 = {
|
|
10
|
+
key: 3,
|
|
9
11
|
class: "m-fields-link"
|
|
10
12
|
};
|
|
11
13
|
var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -21,12 +23,17 @@ var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
21
23
|
disabled: { type: Boolean },
|
|
22
24
|
size: {},
|
|
23
25
|
lastValues: {},
|
|
24
|
-
isCompare: { type: Boolean }
|
|
26
|
+
isCompare: { type: Boolean },
|
|
27
|
+
text: {},
|
|
28
|
+
labelWidth: {},
|
|
29
|
+
labelPosition: {},
|
|
30
|
+
theme: {}
|
|
25
31
|
},
|
|
26
32
|
emits: ["change"],
|
|
27
33
|
setup(__props, { emit: __emit }) {
|
|
28
34
|
const props = __props;
|
|
29
35
|
const emit = __emit;
|
|
36
|
+
const isMagicAdmin = isMagicAdminTheme(props);
|
|
30
37
|
useAddField(props.prop);
|
|
31
38
|
const formValue = ref({});
|
|
32
39
|
const editor = ref();
|
|
@@ -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(isMagicAdmin) && __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,6 +1,6 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
2
|
import { createBlock, createCommentVNode, defineComponent, inject, openBlock, ref, unref, watch } from "vue";
|
|
3
|
-
import { TMagicInputNumber } from "@tmagic/design";
|
|
3
|
+
import { TMagicInputNumber, isMagicAdminTheme } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/Number.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormNumber",
|
|
@@ -15,12 +15,16 @@ var Number_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", "input"],
|
|
21
24
|
setup(__props, { emit: __emit }) {
|
|
22
25
|
const props = __props;
|
|
23
26
|
const emit = __emit;
|
|
27
|
+
const isMagicAdmin = isMagicAdminTheme();
|
|
24
28
|
const value = ref();
|
|
25
29
|
watch(() => props.model[props.name], (v) => {
|
|
26
30
|
value.value = v;
|
|
@@ -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(isMagicAdmin) ? "" : "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 }) {
|
|
@@ -28,9 +35,9 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
28
35
|
};
|
|
29
36
|
useAddField(props.prop);
|
|
30
37
|
const iconSize = computed(() => {
|
|
31
|
-
if (props.size === "small") return "
|
|
38
|
+
if (props.size === "small") return "14";
|
|
32
39
|
if (props.size === "large") return "16";
|
|
33
|
-
return "
|
|
40
|
+
return "16";
|
|
34
41
|
});
|
|
35
42
|
return (_ctx, _cache) => {
|
|
36
43
|
return __props.model ? (openBlock(), createBlock(unref(TMagicRadioGroup), {
|
|
@@ -50,13 +57,14 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
50
57
|
placement: "top-start",
|
|
51
58
|
content: option.tooltip
|
|
52
59
|
}, {
|
|
53
|
-
default: withCtx(() => [createElementVNode("div",
|
|
60
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [option.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
|
|
54
61
|
key: 0,
|
|
55
|
-
size: iconSize.value
|
|
62
|
+
size: iconSize.value,
|
|
63
|
+
class: normalizeClass({ "m-fields-radio-group__icon_with_text": !!option.text })
|
|
56
64
|
}, {
|
|
57
65
|
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(option.icon)))]),
|
|
58
66
|
_: 2
|
|
59
|
-
}, 1032, ["size"])) : createCommentVNode("v-if", true), option.text ? (openBlock(), createElementBlock("span",
|
|
67
|
+
}, 1032, ["size", "class"])) : createCommentVNode("v-if", true), option.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(option.text), 1)) : createCommentVNode("v-if", true)])]),
|
|
60
68
|
_: 2
|
|
61
69
|
}, 1032, ["disabled", "content"])]),
|
|
62
70
|
_: 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 }) {
|