@tmagic/form 1.8.0-beta.2 → 1.8.0-beta.21
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 +120 -27
- package/dist/es/FormBox.vue_vue_type_script_setup_true_lang.js +19 -3
- package/dist/es/FormDialog.vue_vue_type_script_setup_true_lang.js +30 -7
- package/dist/es/FormDrawer.vue_vue_type_script_setup_true_lang.js +56 -14
- package/dist/es/containers/Col.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +51 -36
- package/dist/es/containers/Fieldset.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/es/containers/FlexLayout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/FormLabel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +42 -32
- package/dist/es/containers/Panel.vue_vue_type_script_setup_true_lang.js +17 -11
- package/dist/es/containers/Row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/Step.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/Tabs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/table/ActionsColumn.vue_vue_type_script_setup_true_lang.js +14 -7
- package/dist/es/containers/table/SortColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +7 -5
- 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 +3 -2
- package/dist/es/fields/Cascader.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/Checkbox.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/ColorPicker.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Date.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/DateTime.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/Display.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/DynamicField.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Hidden.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Link.vue_vue_type_script_setup_true_lang.js +30 -8
- 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 +5 -2
- package/dist/es/fields/RadioGroup.vue_vue_type_script_setup_true_lang.js +21 -10
- package/dist/es/fields/Select.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/es/fields/Switch.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Text.vue_vue_type_script_setup_true_lang.js +113 -78
- package/dist/es/fields/Textarea.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Time.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Timerange.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/es/index.js +5 -4
- package/dist/es/plugin.js +4 -0
- package/dist/es/schema.js +12 -1
- package/dist/es/style.css +133 -11
- package/dist/es/submitForm.js +415 -56
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/form.js +84 -9
- package/dist/es/utils/typeMatch.js +487 -0
- package/dist/style.css +133 -11
- package/dist/themes/magic-admin.css +509 -0
- package/dist/tmagic-form.umd.cjs +1773 -399
- package/package.json +5 -5
- package/src/Form.vue +163 -30
- package/src/FormBox.vue +11 -0
- package/src/FormDialog.vue +25 -3
- package/src/FormDrawer.vue +51 -12
- package/src/containers/Col.vue +1 -0
- package/src/containers/Container.vue +32 -11
- package/src/containers/Fieldset.vue +5 -2
- 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 +24 -6
- package/src/fields/Text.vue +43 -19
- package/src/index.ts +11 -0
- package/src/plugin.ts +12 -0
- package/src/schema.ts +13 -1
- package/src/submitForm.ts +699 -66
- package/src/theme/container.scss +3 -0
- package/src/theme/fieldset.scss +51 -0
- package/src/theme/form-dialog.scss +1 -1
- package/src/theme/form.scss +6 -0
- package/src/theme/group-list.scss +19 -8
- 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/table.scss +11 -1
- package/src/theme/tabs.scss +2 -2
- package/src/theme/text.scss +38 -0
- package/src/theme/themes/magic-admin/index.scss +106 -0
- package/src/utils/config.ts +7 -1
- package/src/utils/form.ts +144 -22
- package/src/utils/typeMatch.ts +870 -0
- package/types/index.d.ts +408 -21
|
@@ -1,9 +1,9 @@
|
|
|
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";
|
|
5
5
|
//#region packages/form/src/containers/table/ActionsColumn.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var ActionsColumn_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var ActionsColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "ActionsColumn",
|
|
8
8
|
props: {
|
|
9
9
|
config: {},
|
|
@@ -15,7 +15,8 @@ var ActionsColumn_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
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__ */
|
|
|
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
|
}
|
|
@@ -2,7 +2,7 @@ import { Fragment, createBlock, createCommentVNode, createElementBlock, createVN
|
|
|
2
2
|
import { TMagicButton, TMagicTooltip } from "@tmagic/design";
|
|
3
3
|
import { ArrowDown, ArrowUp } from "@element-plus/icons-vue";
|
|
4
4
|
//#region packages/form/src/containers/table/SortColumn.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var SortColumn_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var SortColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "SortColumn",
|
|
7
7
|
props: {
|
|
8
8
|
index: {},
|
|
@@ -21,7 +21,7 @@ var _hoisted_4 = {
|
|
|
21
21
|
class: "bottom",
|
|
22
22
|
style: { "text-align": "right" }
|
|
23
23
|
};
|
|
24
|
-
var Table_vue_vue_type_script_setup_true_lang_default =
|
|
24
|
+
var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
25
25
|
name: "MFormTable",
|
|
26
26
|
__name: "Table",
|
|
27
27
|
props: {
|
|
@@ -99,20 +99,22 @@ var Table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
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"]),
|
|
113
115
|
renderSlot(_ctx.$slots, "default"),
|
|
114
116
|
createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [
|
|
115
|
-
!unref(isFullscreen) ? renderSlot(_ctx.$slots, "toggle-button", {
|
|
117
|
+
!unref(isFullscreen) ? renderSlot(_ctx.$slots, "toggle-button", {}, void 0, void 0, 0) : createCommentVNode("v-if", true),
|
|
116
118
|
__props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
117
119
|
key: 1,
|
|
118
120
|
icon: unref(FullScreen),
|
|
@@ -153,7 +155,7 @@ var Table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
153
155
|
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("清空", -1)])]),
|
|
154
156
|
_: 1
|
|
155
157
|
}, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
|
|
156
|
-
]), !__props.isCompare ? renderSlot(_ctx.$slots, "add-button", {
|
|
158
|
+
]), !__props.isCompare ? renderSlot(_ctx.$slots, "add-button", {}, void 0, void 0, 0) : createCommentVNode("v-if", true)]),
|
|
157
159
|
__props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(TMagicPagination), {
|
|
158
160
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
159
161
|
"hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
|
|
@@ -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
|
@@ -5,7 +5,7 @@ import { computed, createBlock, createCommentVNode, createSlots, createTextVNode
|
|
|
5
5
|
import { TMagicButton } from "@tmagic/design";
|
|
6
6
|
import { Grid, Plus } from "@element-plus/icons-vue";
|
|
7
7
|
//#region packages/form/src/containers/table-group-list/TableGroupList.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var TableGroupList_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var TableGroupList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
name: "MFormTableGroupList",
|
|
10
10
|
inheritAttrs: false,
|
|
11
11
|
__name: "TableGroupList",
|
|
@@ -127,9 +127,10 @@ var TableGroupList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
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,10 +1,10 @@
|
|
|
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
|
|
7
|
-
var Cascader_vue_vue_type_script_setup_true_lang_default =
|
|
7
|
+
var Cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "MFormCascader",
|
|
9
9
|
__name: "Cascader",
|
|
10
10
|
props: {
|
|
@@ -17,7 +17,10 @@ var Cascader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
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 }) {
|
|
@@ -2,7 +2,7 @@ import { useAddField } from "../utils/useAddField.js";
|
|
|
2
2
|
import { computed, createBlock, createSlots, createTextVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
3
3
|
import { TMagicCheckbox } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var Checkbox_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var Checkbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormCheckbox",
|
|
7
7
|
__name: "Checkbox",
|
|
8
8
|
props: {
|
|
@@ -15,7 +15,10 @@ var Checkbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
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,9 +1,9 @@
|
|
|
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
|
|
6
|
-
var CheckboxGroup_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var CheckboxGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormCheckGroup",
|
|
8
8
|
__name: "CheckboxGroup",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var CheckboxGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
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 }) {
|
|
@@ -2,7 +2,7 @@ import { useAddField } from "../utils/useAddField.js";
|
|
|
2
2
|
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
3
3
|
import { TMagicColorPicker } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var ColorPicker_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var ColorPicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormColorPicker",
|
|
7
7
|
__name: "ColorPicker",
|
|
8
8
|
props: {
|
|
@@ -15,7 +15,10 @@ var ColorPicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
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,9 +1,9 @@
|
|
|
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
|
|
6
|
-
var Date_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var Date_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormDate",
|
|
8
8
|
__name: "Date",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var Date_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
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,9 +1,9 @@
|
|
|
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
|
|
6
|
-
var DateTime_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var DateTime_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormDateTime",
|
|
8
8
|
__name: "DateTime",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var DateTime_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
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,9 +1,9 @@
|
|
|
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
|
|
6
|
-
var Daterange_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var Daterange_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormDateRange",
|
|
8
8
|
__name: "Daterange",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var Daterange_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,9 +1,9 @@
|
|
|
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 };
|
|
6
|
-
var Display_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var Display_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormDisplay",
|
|
8
8
|
__name: "Display",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var Display_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
|
setup(__props) {
|
|
22
25
|
const props = __props;
|
|
@@ -4,7 +4,7 @@ import { Fragment, createBlock, createElementBlock, createVNode, defineComponent
|
|
|
4
4
|
import { TMagicForm, TMagicFormItem, TMagicInput } from "@tmagic/design";
|
|
5
5
|
//#region packages/form/src/fields/DynamicField.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = { class: "m-fields-dynamic-field" };
|
|
7
|
-
var DynamicField_vue_vue_type_script_setup_true_lang_default =
|
|
7
|
+
var DynamicField_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "MFormDynamicField",
|
|
9
9
|
__name: "DynamicField",
|
|
10
10
|
props: {
|
|
@@ -17,7 +17,10 @@ var DynamicField_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, defineComponent, openBlock, vModelText, withDirectives } from "vue";
|
|
3
3
|
//#region packages/form/src/fields/Hidden.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var Hidden_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var Hidden_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
name: "MFormHidden",
|
|
6
6
|
__name: "Hidden",
|
|
7
7
|
props: {
|
|
@@ -1,14 +1,17 @@
|
|
|
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
|
-
var Link_vue_vue_type_script_setup_true_lang_default =
|
|
14
|
+
var Link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
12
15
|
name: "MFormLink",
|
|
13
16
|
__name: "Link",
|
|
14
17
|
props: {
|
|
@@ -21,7 +24,11 @@ var Link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
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__ */ defineCom
|
|
|
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,8 +1,9 @@
|
|
|
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
|
|
5
|
-
var Number_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
7
|
name: "MFormNumber",
|
|
7
8
|
__name: "Number",
|
|
8
9
|
props: {
|
|
@@ -15,7 +16,10 @@ var Number_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
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__ */ defineC
|
|
|
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__ */ defineC
|
|
|
51
55
|
onInput: inputHandler
|
|
52
56
|
}, null, 8, [
|
|
53
57
|
"modelValue",
|
|
58
|
+
"controls-position",
|
|
54
59
|
"size",
|
|
55
60
|
"max",
|
|
56
61
|
"min",
|
|
@@ -3,7 +3,7 @@ import { createElementBlock, createElementVNode, createVNode, defineComponent, o
|
|
|
3
3
|
import { TMagicInput } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/NumberRange.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = { class: "m-fields-number-range" };
|
|
6
|
-
var NumberRange_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var NumberRange_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "MFormNumberRange",
|
|
8
8
|
__name: "NumberRange",
|
|
9
9
|
props: {
|
|
@@ -16,7 +16,10 @@ var NumberRange_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 }) {
|
|
@@ -1,9 +1,13 @@
|
|
|
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 = {
|
|
6
|
-
var
|
|
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
|
+
};
|
|
10
|
+
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
11
|
name: "MFormRadioGroup",
|
|
8
12
|
__name: "RadioGroup",
|
|
9
13
|
props: {
|
|
@@ -16,7 +20,10 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
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 }) {
|
|
@@ -24,20 +31,23 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
24
31
|
const itemComponent = computed(() => props.config.childType === "button" ? TMagicRadioButton : TMagicRadio);
|
|
25
32
|
const emit = __emit;
|
|
26
33
|
const clickHandler = (item) => {
|
|
34
|
+
if (props.disabled) return;
|
|
27
35
|
emit("change", props.model[props.name] === item ? "" : item);
|
|
28
36
|
};
|
|
29
37
|
useAddField(props.prop);
|
|
30
38
|
const iconSize = computed(() => {
|
|
31
|
-
if (props.
|
|
39
|
+
if (props.config.iconSize) return props.config.iconSize;
|
|
40
|
+
if (props.size === "small") return "14";
|
|
32
41
|
if (props.size === "large") return "16";
|
|
33
|
-
return "
|
|
42
|
+
return "16";
|
|
34
43
|
});
|
|
35
44
|
return (_ctx, _cache) => {
|
|
36
45
|
return __props.model ? (openBlock(), createBlock(unref(TMagicRadioGroup), {
|
|
37
46
|
key: 0,
|
|
38
47
|
"model-value": __props.model[__props.name],
|
|
39
48
|
size: __props.size,
|
|
40
|
-
disabled: __props.disabled
|
|
49
|
+
disabled: __props.disabled,
|
|
50
|
+
class: "icon-{{ iconSize }}"
|
|
41
51
|
}, {
|
|
42
52
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.config.options, (option) => {
|
|
43
53
|
return openBlock(), createBlock(resolveDynamicComponent(itemComponent.value), {
|
|
@@ -50,13 +60,14 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
50
60
|
placement: "top-start",
|
|
51
61
|
content: option.tooltip
|
|
52
62
|
}, {
|
|
53
|
-
default: withCtx(() => [createElementVNode("div",
|
|
63
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [option.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
|
|
54
64
|
key: 0,
|
|
55
|
-
size: iconSize.value
|
|
65
|
+
size: iconSize.value,
|
|
66
|
+
class: normalizeClass({ "m-fields-radio-group__icon_with_text": !!option.text })
|
|
56
67
|
}, {
|
|
57
68
|
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(option.icon)))]),
|
|
58
69
|
_: 2
|
|
59
|
-
}, 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)])]),
|
|
60
71
|
_: 2
|
|
61
72
|
}, 1032, ["disabled", "content"])]),
|
|
62
73
|
_: 2
|
|
@@ -5,7 +5,7 @@ import { TMagicSelect, getDesignConfig } from "@tmagic/design";
|
|
|
5
5
|
import { getValueByKeyPath } from "@tmagic/utils";
|
|
6
6
|
//#region packages/form/src/fields/Select.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = { key: 2 };
|
|
8
|
-
var Select_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var Select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
name: "MFormSelect",
|
|
10
10
|
__name: "Select",
|
|
11
11
|
props: {
|
|
@@ -18,7 +18,10 @@ var Select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
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 }) {
|
|
@@ -227,7 +230,8 @@ var Select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
227
230
|
const v = props.model[props.name];
|
|
228
231
|
if (Array.isArray(v) ? !v.length : typeof v === "undefined") return;
|
|
229
232
|
if (typeof v === "undefined" || hasOption(v)) return;
|
|
230
|
-
|
|
233
|
+
const data = await getInitOption();
|
|
234
|
+
setOptions(data);
|
|
231
235
|
};
|
|
232
236
|
watch(() => props.model?.[props.name], () => {
|
|
233
237
|
initOption();
|
|
@@ -2,7 +2,7 @@ import { useAddField } from "../utils/useAddField.js";
|
|
|
2
2
|
import { computed, createBlock, defineComponent, openBlock, unref } from "vue";
|
|
3
3
|
import { TMagicSwitch } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/Switch.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var Switch_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var Switch_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormSwitch",
|
|
7
7
|
__name: "Switch",
|
|
8
8
|
props: {
|
|
@@ -15,7 +15,10 @@ var Switch_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 }) {
|