@tmagic/form 1.8.0-beta.13 → 1.8.0-beta.15
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/Col.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +27 -19
- 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 +4 -4
- package/dist/es/plugin.js +3 -1
- package/dist/es/schema.js +11 -1
- package/dist/es/style.css +122 -8
- package/dist/es/submitForm.js +13 -11
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/form.js +33 -3
- package/dist/es/utils/typeMatch.js +3 -1
- package/dist/style.css +122 -8
- package/dist/themes/magic-admin.css +499 -0
- package/dist/tmagic-form.umd.cjs +568 -300
- 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/Col.vue +1 -0
- package/src/containers/Container.vue +21 -6
- 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/schema.ts +11 -0
- package/src/submitForm.ts +34 -15
- 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/src/utils/typeMatch.ts +10 -1
- package/types/index.d.ts +77 -5
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("dayjs"), require("dayjs/plugin/utc"), require("@tmagic/design"), require("@tmagic/utils"), require("dayjs/plugin/customParseFormat"), require("@element-plus/icons-vue"), require("@popperjs/core")) : typeof define === "function" && define.amd ? define([
|
|
3
3
|
"exports",
|
|
4
4
|
"vue",
|
|
5
|
-
"@tmagic/design",
|
|
6
|
-
"@tmagic/utils",
|
|
7
|
-
"@element-plus/icons-vue",
|
|
8
5
|
"dayjs",
|
|
9
6
|
"dayjs/plugin/utc",
|
|
7
|
+
"@tmagic/design",
|
|
8
|
+
"@tmagic/utils",
|
|
10
9
|
"dayjs/plugin/customParseFormat",
|
|
10
|
+
"@element-plus/icons-vue",
|
|
11
11
|
"@popperjs/core"
|
|
12
|
-
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.
|
|
13
|
-
})(this, function(exports, vue,
|
|
12
|
+
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.dayjs, global.dayjs_plugin_utc, global._tmagic_design, global._tmagic_utils, global.dayjs_plugin_customParseFormat, global._element_plus_icons_vue, global._popperjs_core));
|
|
13
|
+
})(this, function(exports, vue, dayjs, dayjs_plugin_utc, _tmagic_design, _tmagic_utils, dayjs_plugin_customParseFormat, _element_plus_icons_vue, _popperjs_core) {
|
|
14
14
|
Object.defineProperties(exports, {
|
|
15
15
|
__esModule: { value: true },
|
|
16
16
|
[Symbol.toStringTag]: { value: "Module" }
|
|
@@ -43,6 +43,16 @@
|
|
|
43
43
|
//#region packages/form/src/schema.ts
|
|
44
44
|
var FORM_DIFF_CONFIG_KEY = Symbol("mFormDiffConfig");
|
|
45
45
|
var FORM_TYPE_MATCH_VALID_KEY = Symbol("mFormTypeMatchValid");
|
|
46
|
+
/**
|
|
47
|
+
* 静默模式标记,由 `submitForm` / `validateForm` 以隐藏方式挂载临时表单时 provide(debug 弹层模式不提供)。
|
|
48
|
+
*
|
|
49
|
+
* 重型字段组件(如 vs-code)可 inject 该标记并跳过自身渲染:字段校验由 FormItem 基于 model 值完成,
|
|
50
|
+
* 与叶子 UI 组件实例无关,跳过可省去无谓的实例化开销(如 monaco worker / model 的创建)。
|
|
51
|
+
*
|
|
52
|
+
* 注意:仅「挂载无值副作用」(不在 onMounted/watch immediate 中 emit change、不依赖 DOM 计算值)的
|
|
53
|
+
* 字段组件可以安全跳过,接入前需逐一审计。
|
|
54
|
+
*/
|
|
55
|
+
var FORM_SILENT_MODE_KEY = Symbol("mFormSilentMode");
|
|
46
56
|
//#endregion
|
|
47
57
|
//#region node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
|
|
48
58
|
/** Detect free variable `global` from Node.js. */
|
|
@@ -2720,52 +2730,6 @@
|
|
|
2720
2730
|
return baseIsEqual(value, other);
|
|
2721
2731
|
}
|
|
2722
2732
|
//#endregion
|
|
2723
|
-
//#region packages/form/src/utils/useAddField.ts
|
|
2724
|
-
var useAddField = (prop) => {
|
|
2725
|
-
if (!prop) return;
|
|
2726
|
-
const mForm = (0, vue.inject)("mForm");
|
|
2727
|
-
const instance = (0, vue.getCurrentInstance)();
|
|
2728
|
-
(0, vue.watch)(() => instance?.proxy, (vm) => {
|
|
2729
|
-
if (vm) mForm?.setField(prop, vm);
|
|
2730
|
-
else mForm?.deleteField(prop);
|
|
2731
|
-
}, { immediate: true });
|
|
2732
|
-
};
|
|
2733
|
-
//#endregion
|
|
2734
|
-
//#region packages/form/src/fields/Hidden.vue
|
|
2735
|
-
var Hidden_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2736
|
-
name: "MFormHidden",
|
|
2737
|
-
__name: "Hidden",
|
|
2738
|
-
props: {
|
|
2739
|
-
model: {},
|
|
2740
|
-
name: {},
|
|
2741
|
-
prop: {}
|
|
2742
|
-
},
|
|
2743
|
-
setup(__props) {
|
|
2744
|
-
useAddField(__props.prop);
|
|
2745
|
-
return (_ctx, _cache) => {
|
|
2746
|
-
return __props.model ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
|
|
2747
|
-
key: 0,
|
|
2748
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
2749
|
-
type: "hidden"
|
|
2750
|
-
}, null, 512)), [[vue.vModelText, __props.model[__props.name]]]) : (0, vue.createCommentVNode)("v-if", true);
|
|
2751
|
-
};
|
|
2752
|
-
}
|
|
2753
|
-
});
|
|
2754
|
-
//#endregion
|
|
2755
|
-
//#region packages/form/src/utils/config.ts
|
|
2756
|
-
var $MAGIC_FORM = {};
|
|
2757
|
-
var setConfig = (option) => {
|
|
2758
|
-
$MAGIC_FORM = option;
|
|
2759
|
-
};
|
|
2760
|
-
var getConfig = (key) => $MAGIC_FORM[key];
|
|
2761
|
-
var fieldRegistry = /* @__PURE__ */ new Map();
|
|
2762
|
-
var registerField = (tagName, component) => {
|
|
2763
|
-
if (fieldRegistry.has(tagName)) return;
|
|
2764
|
-
fieldRegistry.set(tagName, component);
|
|
2765
|
-
};
|
|
2766
|
-
var getField = (tagName) => fieldRegistry.get(tagName);
|
|
2767
|
-
var deleteField = (tagName) => fieldRegistry.delete(tagName);
|
|
2768
|
-
//#endregion
|
|
2769
2733
|
//#region packages/form/src/utils/typeMatch.ts
|
|
2770
2734
|
dayjs.default.extend(dayjs_plugin_customParseFormat.default);
|
|
2771
2735
|
var typeMatchRuleRegistry = /* @__PURE__ */ new Map();
|
|
@@ -3076,6 +3040,7 @@
|
|
|
3076
3040
|
return;
|
|
3077
3041
|
}
|
|
3078
3042
|
if (typeof config.filter === "function") return;
|
|
3043
|
+
if (fieldType === "text" && isNumberValue(value)) return;
|
|
3079
3044
|
if (typeof value !== "string") return defaultMessage(message, `${value} 类型应为字符串`, typeExampleSuggestion(mForm, props, "\"文本内容\"", isStringValue));
|
|
3080
3045
|
return;
|
|
3081
3046
|
}
|
|
@@ -3125,6 +3090,7 @@
|
|
|
3125
3090
|
};
|
|
3126
3091
|
var validateTypeMatch = (value, mForm, props, message) => {
|
|
3127
3092
|
if (isEmptyValue(value) || isEmptyArray(value)) return;
|
|
3093
|
+
if (!props.config?.name) return;
|
|
3128
3094
|
const rawFieldType = "type" in (props.config || {}) ? props.config.type : "";
|
|
3129
3095
|
if (typeof rawFieldType !== "string" || !rawFieldType) return;
|
|
3130
3096
|
const fieldType = (0, _tmagic_utils.toLine)(rawFieldType);
|
|
@@ -3366,6 +3332,36 @@
|
|
|
3366
3332
|
if (order === "ascending") data.sort((a, b) => a[prop] - b[prop]);
|
|
3367
3333
|
else if (order === "descending") data.sort((a, b) => b[prop] - a[prop]);
|
|
3368
3334
|
};
|
|
3335
|
+
/**
|
|
3336
|
+
* 将 extendState 返回的扩展字段合并进 formState。
|
|
3337
|
+
*
|
|
3338
|
+
* - data 描述符(普通字段)通过 `formState[key] = value` 写入,走 reactive proxy 的 set,
|
|
3339
|
+
* 触发依赖通知;
|
|
3340
|
+
* - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
|
|
3341
|
+
* 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
|
|
3342
|
+
*
|
|
3343
|
+
* 注意:formState 上由 props 派生的字段(keyProp / popperClass / config / initValues /
|
|
3344
|
+
* isCompare / lastValues / parentValues)是只读 getter(无 setter),extendState 若以
|
|
3345
|
+
* 普通字段形式返回同名 key,直接赋值会让 proxy 的 set trap 失败并抛出
|
|
3346
|
+
* `TypeError: 'set' on proxy: trap returned falsish`,这里统一跳过并告警;
|
|
3347
|
+
* 如确需覆盖,可在 extendState 中以 get 访问器形式返回。
|
|
3348
|
+
*/
|
|
3349
|
+
var applyExtendState = (formState, state) => {
|
|
3350
|
+
if (!state) return;
|
|
3351
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) {
|
|
3352
|
+
if (!("value" in descriptor)) {
|
|
3353
|
+
descriptor.configurable = true;
|
|
3354
|
+
Object.defineProperty(formState, key, descriptor);
|
|
3355
|
+
continue;
|
|
3356
|
+
}
|
|
3357
|
+
const targetDescriptor = Object.getOwnPropertyDescriptor(formState, key);
|
|
3358
|
+
if (targetDescriptor && !("value" in targetDescriptor) && typeof targetDescriptor.set !== "function") {
|
|
3359
|
+
console.warn(`[MForm] extendState: "${key}" is a read-only field derived from props and cannot be assigned a plain value. Return it as a getter accessor if you really need to override it.`);
|
|
3360
|
+
continue;
|
|
3361
|
+
}
|
|
3362
|
+
formState[key] = state[key];
|
|
3363
|
+
}
|
|
3364
|
+
};
|
|
3369
3365
|
var createObjectProp = (prop, key, name) => {
|
|
3370
3366
|
if (prop === "") return key;
|
|
3371
3367
|
const itemPath = `${prop}`.split(".");
|
|
@@ -3375,6 +3371,54 @@
|
|
|
3375
3371
|
return `${[...itemPath, key].join(".")}`;
|
|
3376
3372
|
};
|
|
3377
3373
|
//#endregion
|
|
3374
|
+
//#region packages/form/src/utils/useAddField.ts
|
|
3375
|
+
var useAddField = (prop) => {
|
|
3376
|
+
if (!prop) return;
|
|
3377
|
+
const mForm = (0, vue.inject)("mForm");
|
|
3378
|
+
const instance = (0, vue.getCurrentInstance)();
|
|
3379
|
+
(0, vue.watch)(() => instance?.proxy, (vm) => {
|
|
3380
|
+
if (vm) mForm?.setField(prop, vm);
|
|
3381
|
+
else mForm?.deleteField(prop);
|
|
3382
|
+
}, { immediate: true });
|
|
3383
|
+
};
|
|
3384
|
+
//#endregion
|
|
3385
|
+
//#region packages/form/src/fields/Hidden.vue
|
|
3386
|
+
var Hidden_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
3387
|
+
name: "MFormHidden",
|
|
3388
|
+
__name: "Hidden",
|
|
3389
|
+
props: {
|
|
3390
|
+
model: {},
|
|
3391
|
+
name: {},
|
|
3392
|
+
prop: {}
|
|
3393
|
+
},
|
|
3394
|
+
setup(__props) {
|
|
3395
|
+
useAddField(__props.prop);
|
|
3396
|
+
return (_ctx, _cache) => {
|
|
3397
|
+
return __props.model ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
|
|
3398
|
+
key: 0,
|
|
3399
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
3400
|
+
type: "hidden"
|
|
3401
|
+
}, null, 512)), [[vue.vModelText, __props.model[__props.name]]]) : (0, vue.createCommentVNode)("v-if", true);
|
|
3402
|
+
};
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
//#endregion
|
|
3406
|
+
//#region packages/form/src/utils/config.ts
|
|
3407
|
+
var $MAGIC_FORM = {};
|
|
3408
|
+
var isGlobalFlat = (0, vue.ref)(false);
|
|
3409
|
+
var setConfig = (option) => {
|
|
3410
|
+
$MAGIC_FORM = option;
|
|
3411
|
+
isGlobalFlat.value = option.flat ?? false;
|
|
3412
|
+
};
|
|
3413
|
+
var getConfig = (key) => $MAGIC_FORM[key];
|
|
3414
|
+
var fieldRegistry = /* @__PURE__ */ new Map();
|
|
3415
|
+
var registerField = (tagName, component) => {
|
|
3416
|
+
if (fieldRegistry.has(tagName)) return;
|
|
3417
|
+
fieldRegistry.set(tagName, component);
|
|
3418
|
+
};
|
|
3419
|
+
var getField = (tagName) => fieldRegistry.get(tagName);
|
|
3420
|
+
var deleteField = (tagName) => fieldRegistry.delete(tagName);
|
|
3421
|
+
//#endregion
|
|
3378
3422
|
//#region packages/form/src/containers/FormLabel.vue?vue&type=script&setup=true&lang.ts
|
|
3379
3423
|
var _hoisted_1$15 = {
|
|
3380
3424
|
key: 0,
|
|
@@ -3383,9 +3427,9 @@
|
|
|
3383
3427
|
"align-items": "center"
|
|
3384
3428
|
}
|
|
3385
3429
|
};
|
|
3386
|
-
var _hoisted_2$
|
|
3387
|
-
var _hoisted_3$
|
|
3388
|
-
var _hoisted_4$
|
|
3430
|
+
var _hoisted_2$9 = ["innerHTML", "title"];
|
|
3431
|
+
var _hoisted_3$8 = ["innerHTML"];
|
|
3432
|
+
var _hoisted_4$7 = ["innerHTML", "title"];
|
|
3389
3433
|
//#endregion
|
|
3390
3434
|
//#region packages/form/src/containers/FormLabel.vue
|
|
3391
3435
|
var FormLabel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -3402,11 +3446,11 @@
|
|
|
3402
3446
|
return __props.tip ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$15, [(0, vue.createElementVNode)("span", {
|
|
3403
3447
|
innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
|
|
3404
3448
|
title: __props.labelTitle
|
|
3405
|
-
}, null, 8, _hoisted_2$
|
|
3449
|
+
}, null, 8, _hoisted_2$9), __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
|
|
3406
3450
|
key: 0,
|
|
3407
3451
|
placement: "top"
|
|
3408
3452
|
}, {
|
|
3409
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$
|
|
3453
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$8)]),
|
|
3410
3454
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
|
|
3411
3455
|
"margin-left": "5px",
|
|
3412
3456
|
"display": "flex"
|
|
@@ -3419,23 +3463,27 @@
|
|
|
3419
3463
|
key: 1,
|
|
3420
3464
|
innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
|
|
3421
3465
|
title: __props.labelTitle
|
|
3422
|
-
}, null, 8, _hoisted_4$
|
|
3466
|
+
}, null, 8, _hoisted_4$7));
|
|
3423
3467
|
};
|
|
3424
3468
|
}
|
|
3425
3469
|
});
|
|
3426
3470
|
//#endregion
|
|
3427
3471
|
//#region packages/form/src/containers/Container.vue?vue&type=script&setup=true&lang.ts
|
|
3428
3472
|
var _hoisted_1$14 = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
3429
|
-
var _hoisted_2$
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
var
|
|
3434
|
-
var
|
|
3435
|
-
var
|
|
3436
|
-
var
|
|
3473
|
+
var _hoisted_2$8 = {
|
|
3474
|
+
key: 0,
|
|
3475
|
+
class: "m-form-tip m-form-title-extra"
|
|
3476
|
+
};
|
|
3477
|
+
var _hoisted_3$7 = ["innerHTML"];
|
|
3478
|
+
var _hoisted_4$6 = ["innerHTML"];
|
|
3479
|
+
var _hoisted_5$4 = ["innerHTML"];
|
|
3480
|
+
var _hoisted_6$3 = ["innerHTML"];
|
|
3481
|
+
var _hoisted_7$2 = ["innerHTML"];
|
|
3482
|
+
var _hoisted_8$2 = ["innerHTML"];
|
|
3483
|
+
var _hoisted_9 = ["innerHTML"];
|
|
3484
|
+
var _hoisted_10 = {
|
|
3437
3485
|
key: 5,
|
|
3438
|
-
|
|
3486
|
+
class: "m-form-container-expand"
|
|
3439
3487
|
};
|
|
3440
3488
|
//#endregion
|
|
3441
3489
|
//#region packages/form/src/containers/Container.vue
|
|
@@ -3458,7 +3506,8 @@
|
|
|
3458
3506
|
isCompare: {
|
|
3459
3507
|
type: Boolean,
|
|
3460
3508
|
default: false
|
|
3461
|
-
}
|
|
3509
|
+
},
|
|
3510
|
+
isInRow: { type: Boolean }
|
|
3462
3511
|
},
|
|
3463
3512
|
emits: ["change", "addDiffCount"],
|
|
3464
3513
|
setup(__props, { emit: __emit }) {
|
|
@@ -3563,7 +3612,8 @@
|
|
|
3563
3612
|
labelWidth: itemLabelWidth.value,
|
|
3564
3613
|
labelPosition: props.config.labelPosition,
|
|
3565
3614
|
rules: rule.value,
|
|
3566
|
-
extra: filterFunction(mForm, props.config.extra, props)
|
|
3615
|
+
extra: filterFunction(mForm, props.config.extra, props),
|
|
3616
|
+
extraTips: props.config.extraTips
|
|
3567
3617
|
}));
|
|
3568
3618
|
const itemLabelWidth = (0, vue.computed)(() => props.config.labelWidth ?? props.labelWidth);
|
|
3569
3619
|
(0, vue.watchEffect)(() => {
|
|
@@ -3574,6 +3624,7 @@
|
|
|
3574
3624
|
if (items.value && !text.value && type.value && display$3.value) return;
|
|
3575
3625
|
if (display$3.value && showDiff && type.value) emit("addDiffCount");
|
|
3576
3626
|
}, { immediate: true });
|
|
3627
|
+
(0, vue.provide)("isInRow", props.isInRow ?? false);
|
|
3577
3628
|
const expandHandler = () => expand.value = !expand.value;
|
|
3578
3629
|
const key = (config) => config[mForm?.keyProps];
|
|
3579
3630
|
const filterHandler = (filter, value) => {
|
|
@@ -3721,12 +3772,12 @@
|
|
|
3721
3772
|
"use-label",
|
|
3722
3773
|
"label-title",
|
|
3723
3774
|
"text"
|
|
3724
|
-
])])]),
|
|
3775
|
+
]), __props.config.titleExtra && __props.config.labelPosition === "top" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$8, (0, vue.toDisplayString)(__props.config.titleExtra), 1)) : (0, vue.createCommentVNode)("v-if", true)])]),
|
|
3725
3776
|
default: (0, vue.withCtx)(() => [tooltip.value.text ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
|
|
3726
3777
|
key: 0,
|
|
3727
3778
|
placement: tooltip.value.placement
|
|
3728
3779
|
}, {
|
|
3729
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8,
|
|
3780
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_3$7)]),
|
|
3730
3781
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
|
|
3731
3782
|
model: __props.model,
|
|
3732
3783
|
"last-values": __props.lastValues,
|
|
@@ -3755,7 +3806,7 @@
|
|
|
3755
3806
|
key: 0,
|
|
3756
3807
|
placement: "top"
|
|
3757
3808
|
}, {
|
|
3758
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8,
|
|
3809
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_4$6)]),
|
|
3759
3810
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
|
|
3760
3811
|
"line-height": "40px",
|
|
3761
3812
|
"margin-left": "5px"
|
|
@@ -3794,7 +3845,7 @@
|
|
|
3794
3845
|
key: 0,
|
|
3795
3846
|
placement: tooltip.value.placement
|
|
3796
3847
|
}, {
|
|
3797
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8,
|
|
3848
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_5$4)]),
|
|
3798
3849
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
|
|
3799
3850
|
model: __props.model,
|
|
3800
3851
|
"last-values": __props.lastValues,
|
|
@@ -3847,7 +3898,7 @@
|
|
|
3847
3898
|
key: 0,
|
|
3848
3899
|
placement: tooltip.value.placement
|
|
3849
3900
|
}, {
|
|
3850
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8,
|
|
3901
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_6$3)]),
|
|
3851
3902
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
|
|
3852
3903
|
model: __props.lastValues,
|
|
3853
3904
|
onChange: onChangeHandler
|
|
@@ -3863,7 +3914,7 @@
|
|
|
3863
3914
|
key: 0,
|
|
3864
3915
|
placement: "top"
|
|
3865
3916
|
}, {
|
|
3866
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8,
|
|
3917
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_7$2)]),
|
|
3867
3918
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
|
|
3868
3919
|
"line-height": "40px",
|
|
3869
3920
|
"margin-left": "5px"
|
|
@@ -3904,7 +3955,7 @@
|
|
|
3904
3955
|
key: 0,
|
|
3905
3956
|
placement: tooltip.value.placement
|
|
3906
3957
|
}, {
|
|
3907
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8,
|
|
3958
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_8$2)]),
|
|
3908
3959
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
|
|
3909
3960
|
model: __props.model,
|
|
3910
3961
|
onChange: onChangeHandler
|
|
@@ -3920,7 +3971,7 @@
|
|
|
3920
3971
|
key: 1,
|
|
3921
3972
|
placement: "top"
|
|
3922
3973
|
}, {
|
|
3923
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8,
|
|
3974
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_9)]),
|
|
3924
3975
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
|
|
3925
3976
|
"line-height": "40px",
|
|
3926
3977
|
"margin-left": "5px"
|
|
@@ -3962,16 +4013,17 @@
|
|
|
3962
4013
|
"label-width",
|
|
3963
4014
|
"prop"
|
|
3964
4015
|
]);
|
|
3965
|
-
}), 128)) : (0, vue.createCommentVNode)("v-if", true)], 64)) : (0, vue.createCommentVNode)("v-if", true), __props.config.expand && type.value !== "fieldset" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4016
|
+
}), 128)) : (0, vue.createCommentVNode)("v-if", true)], 64)) : (0, vue.createCommentVNode)("v-if", true), __props.config.expand && type.value !== "fieldset" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_10, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
3966
4017
|
type: "primary",
|
|
3967
4018
|
size: "small",
|
|
3968
4019
|
disabled: false,
|
|
3969
4020
|
link: "",
|
|
3970
|
-
onClick: expandHandler
|
|
4021
|
+
onClick: expandHandler,
|
|
4022
|
+
icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowUp) : (0, vue.unref)(_element_plus_icons_vue.ArrowDown)
|
|
3971
4023
|
}, {
|
|
3972
4024
|
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(expand.value ? "收起配置" : "展开更多配置"), 1)]),
|
|
3973
4025
|
_: 1
|
|
3974
|
-
})])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
|
|
4026
|
+
}, 8, ["icon"])])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
|
|
3975
4027
|
};
|
|
3976
4028
|
}
|
|
3977
4029
|
});
|
|
@@ -4012,7 +4064,8 @@
|
|
|
4012
4064
|
},
|
|
4013
4065
|
extendState: {},
|
|
4014
4066
|
showDiff: {},
|
|
4015
|
-
selfDiffFieldTypes: {}
|
|
4067
|
+
selfDiffFieldTypes: {},
|
|
4068
|
+
theme: {}
|
|
4016
4069
|
},
|
|
4017
4070
|
emits: [
|
|
4018
4071
|
"change",
|
|
@@ -4032,6 +4085,25 @@
|
|
|
4032
4085
|
const fields = /* @__PURE__ */ new Map();
|
|
4033
4086
|
const requestFuc = getConfig("request");
|
|
4034
4087
|
/**
|
|
4088
|
+
* 当前表单生效的主题名称:
|
|
4089
|
+
* - 优先用本组件自己的 `props.theme`;
|
|
4090
|
+
* - 没设置时回退到最近祖先 `<MEditor>` / `<MForm>` provide 的主题,便于内嵌于编辑器
|
|
4091
|
+
* 时自动跟随外层主题,无需在每个 `MForm` 上重复传 `theme`。
|
|
4092
|
+
*
|
|
4093
|
+
* 同时把合并后的值再 provide 出去(见下方 `provide(M_THEME_KEY, ...)`),让 form 子树
|
|
4094
|
+
* 里再嵌套的 portal 组件(`TMagicPopover` 等)依然能拿到非空主题。
|
|
4095
|
+
*/
|
|
4096
|
+
const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
|
|
4097
|
+
const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
|
|
4098
|
+
/**
|
|
4099
|
+
* 拼到 `formState.popperClass` 上的主题修饰类(仅 `m-theme--<theme>`,
|
|
4100
|
+
* 不带 `m-form` / `m-editor` 前缀,因为 Element Plus 弹层节点本身既不是 form 也不是 editor)。
|
|
4101
|
+
*
|
|
4102
|
+
* 这条类会随所有读 `mForm.popperClass` 的字段(Select / DateTime / Cascader 等)下发到
|
|
4103
|
+
* Element Plus 的 `popper-class`,让 portal 节点也命中 `m-theme--<theme>` 上的 CSS 变量。
|
|
4104
|
+
*/
|
|
4105
|
+
const themeClass = (0, vue.computed)(() => effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : "");
|
|
4106
|
+
/**
|
|
4035
4107
|
* formState 实现说明:
|
|
4036
4108
|
*
|
|
4037
4109
|
* 1. 与 props 直接对应的字段(config / initValues / lastValues / isCompare / parentValues /
|
|
@@ -4047,13 +4119,21 @@
|
|
|
4047
4119
|
* 把最新值刷进 formState。
|
|
4048
4120
|
* - accessor 描述符(`{ get stage() { return ... } }`)按原样写入,调用方可以控制
|
|
4049
4121
|
* 读时求值,每次读取都会重新执行 getter。
|
|
4122
|
+
*
|
|
4123
|
+
* 4. `popperClass` 会自动拼接 `themeClass`:调用方传入的 `popperClass` + 当前主题
|
|
4124
|
+
* 修饰类(含祖先 `<MEditor>` provide 的主题)。这样所有透传到 Element Plus 弹层
|
|
4125
|
+
* `popper-class` 的字段(Select / DateTime / Cascader 等)能自带主题作用域。
|
|
4050
4126
|
*/
|
|
4051
4127
|
const formState = (0, vue.reactive)({
|
|
4052
4128
|
get keyProp() {
|
|
4053
4129
|
return props.keyProp;
|
|
4054
4130
|
},
|
|
4055
4131
|
get popperClass() {
|
|
4056
|
-
|
|
4132
|
+
const userClass = props.popperClass ?? "";
|
|
4133
|
+
const tc = themeClass.value;
|
|
4134
|
+
if (!userClass) return tc;
|
|
4135
|
+
if (!tc) return userClass;
|
|
4136
|
+
return `${userClass} ${tc}`;
|
|
4057
4137
|
},
|
|
4058
4138
|
get config() {
|
|
4059
4139
|
return props.config;
|
|
@@ -4101,11 +4181,10 @@
|
|
|
4101
4181
|
* 这里不再重复同步;因此 `props.initValues` 这类高频变化也不会再触发
|
|
4102
4182
|
* `extendState` 重跑(旧版的性能问题修复点)。
|
|
4103
4183
|
*
|
|
4104
|
-
*
|
|
4105
|
-
*
|
|
4106
|
-
*
|
|
4107
|
-
*
|
|
4108
|
-
* 可以自行控制读时求值;强制 `configurable: true` 以便下一次重跑可再 define。
|
|
4184
|
+
* 实现细节:合并逻辑统一收口在 `applyExtendState`(utils/form)——
|
|
4185
|
+
* data 描述符走 reactive proxy 的 set 触发依赖通知(与旧版「逐项赋值」语义等价),
|
|
4186
|
+
* accessor 描述符按原样 defineProperty 支持读时求值;
|
|
4187
|
+
* props 派生的只读 getter 字段(keyProp 等)以普通字段形式返回时会被跳过并告警。
|
|
4109
4188
|
*/
|
|
4110
4189
|
(0, vue.watchEffect)(async (onCleanup) => {
|
|
4111
4190
|
const { extendState } = props;
|
|
@@ -4122,13 +4201,16 @@
|
|
|
4122
4201
|
return;
|
|
4123
4202
|
}
|
|
4124
4203
|
if (stale) return;
|
|
4125
|
-
|
|
4126
|
-
else {
|
|
4127
|
-
descriptor.configurable = true;
|
|
4128
|
-
Object.defineProperty(formState, key, descriptor);
|
|
4129
|
-
}
|
|
4204
|
+
applyExtendState(formState, state);
|
|
4130
4205
|
});
|
|
4131
4206
|
(0, vue.provide)("mForm", formState);
|
|
4207
|
+
/**
|
|
4208
|
+
* 把生效主题(自身或祖先)再 provide 出去,供 form 子树内含 `Teleport` 的组件
|
|
4209
|
+
* (如 `TMagicPopover`)在传送目标上挂 `m-theme--<theme>` 类。
|
|
4210
|
+
* 详见 `@tmagic/design/theme.ts`。
|
|
4211
|
+
*/
|
|
4212
|
+
(0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
|
|
4213
|
+
(0, vue.provide)("formInline", props.inline);
|
|
4132
4214
|
(0, vue.provide)(FORM_DIFF_CONFIG_KEY, {
|
|
4133
4215
|
get showDiff() {
|
|
4134
4216
|
return props.showDiff;
|
|
@@ -4269,7 +4351,11 @@
|
|
|
4269
4351
|
});
|
|
4270
4352
|
return (_ctx, _cache) => {
|
|
4271
4353
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicForm), {
|
|
4272
|
-
class:
|
|
4354
|
+
class: (0, vue.normalizeClass)([
|
|
4355
|
+
"m-form",
|
|
4356
|
+
effectiveTheme.value ? `m-form--${effectiveTheme.value}` : "",
|
|
4357
|
+
effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""
|
|
4358
|
+
]),
|
|
4273
4359
|
ref: "tMagicForm",
|
|
4274
4360
|
model: values.value,
|
|
4275
4361
|
"label-width": __props.labelWidth,
|
|
@@ -4307,6 +4393,7 @@
|
|
|
4307
4393
|
}), 128)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
4308
4394
|
_: 3
|
|
4309
4395
|
}, 8, [
|
|
4396
|
+
"class",
|
|
4310
4397
|
"model",
|
|
4311
4398
|
"label-width",
|
|
4312
4399
|
"style",
|
|
@@ -4357,7 +4444,7 @@
|
|
|
4357
4444
|
resolve,
|
|
4358
4445
|
reject
|
|
4359
4446
|
});
|
|
4360
|
-
const
|
|
4447
|
+
const wrapperComponent = typeof extendState === "function" ? (0, vue.defineComponent)({
|
|
4361
4448
|
name: "MFormExtendStateInjector",
|
|
4362
4449
|
setup() {
|
|
4363
4450
|
(0, vue.watch)(() => formRef.value, (form) => {
|
|
@@ -4369,14 +4456,7 @@
|
|
|
4369
4456
|
console.error("[MForm] extendState failed:", e);
|
|
4370
4457
|
return;
|
|
4371
4458
|
}
|
|
4372
|
-
const apply = (state) =>
|
|
4373
|
-
if (!state) return;
|
|
4374
|
-
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) if ("value" in descriptor) form.formState[key] = state[key];
|
|
4375
|
-
else {
|
|
4376
|
-
descriptor.configurable = true;
|
|
4377
|
-
Object.defineProperty(form.formState, key, descriptor);
|
|
4378
|
-
}
|
|
4379
|
-
};
|
|
4459
|
+
const apply = (state) => applyExtendState(form.formState, state);
|
|
4380
4460
|
if (result && typeof result.then === "function") result.then(apply, (e) => console.error("[MForm] extendState failed:", e));
|
|
4381
4461
|
else apply(result);
|
|
4382
4462
|
}, {
|
|
@@ -4385,7 +4465,14 @@
|
|
|
4385
4465
|
});
|
|
4386
4466
|
return () => (0, vue.h)(userWrapper);
|
|
4387
4467
|
}
|
|
4388
|
-
}) : userWrapper
|
|
4468
|
+
}) : userWrapper;
|
|
4469
|
+
const app = (0, vue.createApp)(hidden ? (0, vue.defineComponent)({
|
|
4470
|
+
name: "MFormSilentProvider",
|
|
4471
|
+
setup() {
|
|
4472
|
+
(0, vue.provide)(FORM_SILENT_MODE_KEY, true);
|
|
4473
|
+
return () => (0, vue.h)(wrapperComponent);
|
|
4474
|
+
}
|
|
4475
|
+
}) : wrapperComponent);
|
|
4389
4476
|
instance.app = app;
|
|
4390
4477
|
if (appContext) Object.assign(app._context, appContext);
|
|
4391
4478
|
if (timeout > 0 && !skipTimeout) timer = setTimeout(() => {
|
|
@@ -4783,7 +4870,8 @@
|
|
|
4783
4870
|
type: Boolean,
|
|
4784
4871
|
default: true
|
|
4785
4872
|
},
|
|
4786
|
-
extendState: {}
|
|
4873
|
+
extendState: {},
|
|
4874
|
+
theme: {}
|
|
4787
4875
|
},
|
|
4788
4876
|
emits: [
|
|
4789
4877
|
"close",
|
|
@@ -4793,6 +4881,9 @@
|
|
|
4793
4881
|
],
|
|
4794
4882
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
4795
4883
|
const props = __props;
|
|
4884
|
+
const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
|
|
4885
|
+
const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
|
|
4886
|
+
(0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
|
|
4796
4887
|
const emit = __emit;
|
|
4797
4888
|
const form = (0, vue.ref)();
|
|
4798
4889
|
const dialogVisible = (0, vue.ref)(false);
|
|
@@ -4853,7 +4944,7 @@
|
|
|
4853
4944
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDialog), {
|
|
4854
4945
|
modelValue: dialogVisible.value,
|
|
4855
4946
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
|
|
4856
|
-
class: "m-form-dialog",
|
|
4947
|
+
class: (0, vue.normalizeClass)(["m-form-dialog", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
|
|
4857
4948
|
top: "20px",
|
|
4858
4949
|
"append-to-body": "",
|
|
4859
4950
|
title: __props.title,
|
|
@@ -4937,6 +5028,7 @@
|
|
|
4937
5028
|
"use-field-text-in-error": __props.useFieldTextInError,
|
|
4938
5029
|
"type-match-valid": __props.typeMatchValid,
|
|
4939
5030
|
"extend-state": __props.extendState,
|
|
5031
|
+
theme: effectiveTheme.value,
|
|
4940
5032
|
onChange: changeHandler
|
|
4941
5033
|
}, null, 8, [
|
|
4942
5034
|
"modelValue",
|
|
@@ -4951,11 +5043,13 @@
|
|
|
4951
5043
|
"prevent-submit-default",
|
|
4952
5044
|
"use-field-text-in-error",
|
|
4953
5045
|
"type-match-valid",
|
|
4954
|
-
"extend-state"
|
|
5046
|
+
"extend-state",
|
|
5047
|
+
"theme"
|
|
4955
5048
|
]), (0, vue.renderSlot)(_ctx.$slots, "default")], 4)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
4956
5049
|
_: 3
|
|
4957
5050
|
}, 8, [
|
|
4958
5051
|
"modelValue",
|
|
5052
|
+
"class",
|
|
4959
5053
|
"title",
|
|
4960
5054
|
"width",
|
|
4961
5055
|
"zIndex",
|
|
@@ -4974,7 +5068,7 @@
|
|
|
4974
5068
|
//#endregion
|
|
4975
5069
|
//#region packages/form/src/FormDrawer.vue
|
|
4976
5070
|
var FormDrawer_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
4977
|
-
name: "
|
|
5071
|
+
name: "MFormDrawer",
|
|
4978
5072
|
__name: "FormDrawer",
|
|
4979
5073
|
props: {
|
|
4980
5074
|
config: { default: () => [] },
|
|
@@ -5000,7 +5094,8 @@
|
|
|
5000
5094
|
default: true
|
|
5001
5095
|
},
|
|
5002
5096
|
beforeClose: {},
|
|
5003
|
-
extendState: {}
|
|
5097
|
+
extendState: {},
|
|
5098
|
+
theme: {}
|
|
5004
5099
|
},
|
|
5005
5100
|
emits: [
|
|
5006
5101
|
"close",
|
|
@@ -5012,11 +5107,15 @@
|
|
|
5012
5107
|
"opened"
|
|
5013
5108
|
],
|
|
5014
5109
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5110
|
+
const props = __props;
|
|
5111
|
+
const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
|
|
5112
|
+
const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
|
|
5113
|
+
(0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
|
|
5015
5114
|
const emit = __emit;
|
|
5016
5115
|
const drawer = (0, vue.ref)();
|
|
5017
5116
|
const form = (0, vue.ref)();
|
|
5018
5117
|
const drawerBody = (0, vue.ref)();
|
|
5019
|
-
const
|
|
5118
|
+
const dialogVisible = (0, vue.ref)(false);
|
|
5020
5119
|
const saveFetch = (0, vue.ref)(false);
|
|
5021
5120
|
const bodyHeight = (0, vue.ref)(0);
|
|
5022
5121
|
(0, vue.watchEffect)(() => {
|
|
@@ -5047,30 +5146,48 @@
|
|
|
5047
5146
|
emit("closed");
|
|
5048
5147
|
};
|
|
5049
5148
|
const show = () => {
|
|
5050
|
-
|
|
5149
|
+
dialogVisible.value = true;
|
|
5051
5150
|
};
|
|
5052
5151
|
const hide = () => {
|
|
5053
|
-
|
|
5152
|
+
dialogVisible.value = false;
|
|
5153
|
+
};
|
|
5154
|
+
const close = () => {
|
|
5155
|
+
dialogVisible.value = false;
|
|
5156
|
+
};
|
|
5157
|
+
const cancel = () => {
|
|
5158
|
+
hide();
|
|
5054
5159
|
};
|
|
5055
5160
|
/** 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */
|
|
5056
5161
|
const handleClose = () => {
|
|
5057
5162
|
drawer.value?.handleClose();
|
|
5058
5163
|
};
|
|
5164
|
+
const save = async () => {
|
|
5165
|
+
try {
|
|
5166
|
+
const changeRecords = [...form.value?.changeRecords || []];
|
|
5167
|
+
const values = await form.value?.submitForm();
|
|
5168
|
+
emit("submit", values, { changeRecords });
|
|
5169
|
+
} catch (e) {
|
|
5170
|
+
emit("error", e);
|
|
5171
|
+
}
|
|
5172
|
+
};
|
|
5059
5173
|
__expose({
|
|
5060
5174
|
form,
|
|
5061
5175
|
saveFetch,
|
|
5062
5176
|
bodyHeight,
|
|
5177
|
+
close,
|
|
5063
5178
|
show,
|
|
5064
5179
|
hide,
|
|
5180
|
+
save,
|
|
5181
|
+
cancel,
|
|
5065
5182
|
handleClose
|
|
5066
5183
|
});
|
|
5067
5184
|
return (_ctx, _cache) => {
|
|
5068
5185
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDrawer), {
|
|
5069
|
-
class: "m-form-drawer",
|
|
5186
|
+
class: (0, vue.normalizeClass)(["m-form-drawer", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
|
|
5070
5187
|
ref_key: "drawer",
|
|
5071
5188
|
ref: drawer,
|
|
5072
|
-
modelValue:
|
|
5073
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
5189
|
+
modelValue: dialogVisible.value,
|
|
5190
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dialogVisible.value = $event),
|
|
5074
5191
|
title: __props.title,
|
|
5075
5192
|
"close-on-press-escape": __props.closeOnPressEscape,
|
|
5076
5193
|
"append-to-body": true,
|
|
@@ -5108,7 +5225,7 @@
|
|
|
5108
5225
|
})]),
|
|
5109
5226
|
_: 3
|
|
5110
5227
|
})]),
|
|
5111
|
-
default: (0, vue.withCtx)(() => [
|
|
5228
|
+
default: (0, vue.withCtx)(() => [dialogVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
5112
5229
|
key: 0,
|
|
5113
5230
|
ref_key: "drawerBody",
|
|
5114
5231
|
ref: drawerBody,
|
|
@@ -5128,6 +5245,7 @@
|
|
|
5128
5245
|
"use-field-text-in-error": __props.useFieldTextInError,
|
|
5129
5246
|
"type-match-valid": __props.typeMatchValid,
|
|
5130
5247
|
"extend-state": __props.extendState,
|
|
5248
|
+
theme: effectiveTheme.value,
|
|
5131
5249
|
onChange: changeHandler
|
|
5132
5250
|
}, null, 8, [
|
|
5133
5251
|
"size",
|
|
@@ -5141,10 +5259,12 @@
|
|
|
5141
5259
|
"prevent-submit-default",
|
|
5142
5260
|
"use-field-text-in-error",
|
|
5143
5261
|
"type-match-valid",
|
|
5144
|
-
"extend-state"
|
|
5262
|
+
"extend-state",
|
|
5263
|
+
"theme"
|
|
5145
5264
|
]), (0, vue.renderSlot)(_ctx.$slots, "default")], 512)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
5146
5265
|
_: 3
|
|
5147
5266
|
}, 8, [
|
|
5267
|
+
"class",
|
|
5148
5268
|
"modelValue",
|
|
5149
5269
|
"title",
|
|
5150
5270
|
"close-on-press-escape",
|
|
@@ -5286,16 +5406,16 @@
|
|
|
5286
5406
|
//#endregion
|
|
5287
5407
|
//#region packages/form/src/containers/Fieldset.vue?vue&type=script&setup=true&lang.ts
|
|
5288
5408
|
var _hoisted_1$11 = ["innerHTML"];
|
|
5289
|
-
var _hoisted_2$
|
|
5290
|
-
var _hoisted_3$
|
|
5291
|
-
var _hoisted_4$
|
|
5292
|
-
var _hoisted_5$
|
|
5293
|
-
var _hoisted_6 = {
|
|
5409
|
+
var _hoisted_2$7 = ["innerHTML"];
|
|
5410
|
+
var _hoisted_3$6 = { key: 1 };
|
|
5411
|
+
var _hoisted_4$5 = ["innerHTML"];
|
|
5412
|
+
var _hoisted_5$3 = ["innerHTML"];
|
|
5413
|
+
var _hoisted_6$2 = {
|
|
5294
5414
|
key: 2,
|
|
5295
5415
|
style: { "display": "flex" }
|
|
5296
5416
|
};
|
|
5297
|
-
var _hoisted_7 = { style: { "flex": "1" } };
|
|
5298
|
-
var _hoisted_8 = ["src"];
|
|
5417
|
+
var _hoisted_7$1 = { style: { "flex": "1" } };
|
|
5418
|
+
var _hoisted_8$1 = ["src"];
|
|
5299
5419
|
//#endregion
|
|
5300
5420
|
//#region packages/form/src/containers/Fieldset.vue
|
|
5301
5421
|
var Fieldset_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5365,7 +5485,7 @@
|
|
|
5365
5485
|
key: 0,
|
|
5366
5486
|
innerHTML: __props.config.extra,
|
|
5367
5487
|
class: "m-form-tip"
|
|
5368
|
-
}, null, 8, _hoisted_2$
|
|
5488
|
+
}, null, 8, _hoisted_2$7)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
5369
5489
|
_: 1
|
|
5370
5490
|
}, 8, [
|
|
5371
5491
|
"model-value",
|
|
@@ -5374,11 +5494,11 @@
|
|
|
5374
5494
|
"false-value"
|
|
5375
5495
|
])]),
|
|
5376
5496
|
_: 1
|
|
5377
|
-
})) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("legend", _hoisted_3$
|
|
5497
|
+
})) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("legend", _hoisted_3$6, [(0, vue.createElementVNode)("span", { innerHTML: legend.value }, null, 8, _hoisted_4$5), __props.config.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
5378
5498
|
key: 0,
|
|
5379
5499
|
innerHTML: __props.config.extra,
|
|
5380
5500
|
class: "m-form-tip"
|
|
5381
|
-
}, null, 8, _hoisted_5$
|
|
5501
|
+
}, null, 8, _hoisted_5$3)) : (0, vue.createCommentVNode)("v-if", true)])), __props.config.schematic && show.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$2, [(0, vue.createElementVNode)("div", _hoisted_7$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.config.items, (item, index) => {
|
|
5382
5502
|
return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
5383
5503
|
key: key(item, index),
|
|
5384
5504
|
model: name.value ? __props.model[name.value] : __props.model,
|
|
@@ -5406,7 +5526,7 @@
|
|
|
5406
5526
|
}), 128))]), (0, vue.createElementVNode)("img", {
|
|
5407
5527
|
class: "m-form-schematic",
|
|
5408
5528
|
src: __props.config.schematic
|
|
5409
|
-
}, null, 8, _hoisted_8)])) : show.value ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, (0, vue.renderList)(__props.config.items, (item, index) => {
|
|
5529
|
+
}, null, 8, _hoisted_8$1)])) : show.value ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, (0, vue.renderList)(__props.config.items, (item, index) => {
|
|
5410
5530
|
return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
5411
5531
|
key: key(item, index),
|
|
5412
5532
|
model: name.value ? __props.model[name.value] : __props.model,
|
|
@@ -5503,13 +5623,13 @@
|
|
|
5503
5623
|
"display": "flex",
|
|
5504
5624
|
"align-items": "center"
|
|
5505
5625
|
} };
|
|
5506
|
-
var _hoisted_2$
|
|
5507
|
-
var _hoisted_3$
|
|
5626
|
+
var _hoisted_2$6 = ["innerHTML"];
|
|
5627
|
+
var _hoisted_3$5 = {
|
|
5508
5628
|
key: 0,
|
|
5509
5629
|
style: { "display": "flex" }
|
|
5510
5630
|
};
|
|
5511
|
-
var _hoisted_4$
|
|
5512
|
-
var _hoisted_5$
|
|
5631
|
+
var _hoisted_4$4 = { style: { "flex": "1" } };
|
|
5632
|
+
var _hoisted_5$2 = ["src"];
|
|
5513
5633
|
//#endregion
|
|
5514
5634
|
//#region packages/form/src/containers/Panel.vue
|
|
5515
5635
|
var Panel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5524,7 +5644,8 @@
|
|
|
5524
5644
|
labelWidth: {},
|
|
5525
5645
|
prop: {},
|
|
5526
5646
|
size: {},
|
|
5527
|
-
disabled: { type: Boolean }
|
|
5647
|
+
disabled: { type: Boolean },
|
|
5648
|
+
hideExpand: { type: Boolean }
|
|
5528
5649
|
},
|
|
5529
5650
|
emits: ["change", "addDiffCount"],
|
|
5530
5651
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -5548,26 +5669,31 @@
|
|
|
5548
5669
|
return items.value && items.value.length ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
|
|
5549
5670
|
key: 0,
|
|
5550
5671
|
class: "box-card m-form-panel",
|
|
5551
|
-
"body-style": { display: expand.value ? "block" : "none" }
|
|
5672
|
+
"body-style": { display: expand.value ? "block" : "none" },
|
|
5673
|
+
flat: __props.config.flat
|
|
5552
5674
|
}, {
|
|
5553
5675
|
header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$10, [
|
|
5554
|
-
(0, vue.
|
|
5555
|
-
|
|
5676
|
+
!__props.hideExpand ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
5677
|
+
key: 0,
|
|
5678
|
+
style: {
|
|
5679
|
+
"padding": "0",
|
|
5680
|
+
"margin-right": "10px"
|
|
5681
|
+
},
|
|
5556
5682
|
link: "",
|
|
5557
|
-
icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.
|
|
5683
|
+
icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowDown) : (0, vue.unref)(_element_plus_icons_vue.ArrowRight),
|
|
5558
5684
|
onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
|
|
5559
|
-
}, null, 8, ["icon"]),
|
|
5685
|
+
}, null, 8, ["icon"])) : (0, vue.createCommentVNode)("v-if", true),
|
|
5560
5686
|
(0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createElementVNode)("span", {
|
|
5561
5687
|
style: { "cursor": "pointer" },
|
|
5562
5688
|
onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
|
|
5563
5689
|
}, (0, vue.toDisplayString)(filter(__props.config.title)), 1)]),
|
|
5564
5690
|
__props.config && __props.config.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
5565
|
-
key:
|
|
5691
|
+
key: 1,
|
|
5566
5692
|
innerHTML: __props.config.extra,
|
|
5567
5693
|
class: "m-form-tip"
|
|
5568
|
-
}, null, 8, _hoisted_2$
|
|
5694
|
+
}, null, 8, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true)
|
|
5569
5695
|
])]),
|
|
5570
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [(0, vue.renderSlot)(_ctx.$slots, "default"), __props.config.schematic ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$
|
|
5696
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [(0, vue.renderSlot)(_ctx.$slots, "default"), __props.config.schematic ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$5, [(0, vue.createElementVNode)("div", _hoisted_4$4, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(items.value, (item, index) => {
|
|
5571
5697
|
return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
5572
5698
|
key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
|
|
5573
5699
|
config: item,
|
|
@@ -5593,7 +5719,7 @@
|
|
|
5593
5719
|
}), 128))]), (0, vue.createElementVNode)("img", {
|
|
5594
5720
|
class: "m-form-schematic",
|
|
5595
5721
|
src: __props.config.schematic
|
|
5596
|
-
}, null, 8, _hoisted_5$
|
|
5722
|
+
}, null, 8, _hoisted_5$2)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(items.value, (item, index) => {
|
|
5597
5723
|
return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
5598
5724
|
key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
|
|
5599
5725
|
config: item,
|
|
@@ -5618,7 +5744,7 @@
|
|
|
5618
5744
|
]);
|
|
5619
5745
|
}), 128))])]),
|
|
5620
5746
|
_: 3
|
|
5621
|
-
}, 8, ["body-style"])) : (0, vue.createCommentVNode)("v-if", true);
|
|
5747
|
+
}, 8, ["body-style", "flat"])) : (0, vue.createCommentVNode)("v-if", true);
|
|
5622
5748
|
};
|
|
5623
5749
|
}
|
|
5624
5750
|
});
|
|
@@ -5661,7 +5787,8 @@
|
|
|
5661
5787
|
size: __props.size,
|
|
5662
5788
|
disabled: __props.disabled,
|
|
5663
5789
|
onChange: changeHandler,
|
|
5664
|
-
onAddDiffCount
|
|
5790
|
+
onAddDiffCount,
|
|
5791
|
+
"is-in-row": true
|
|
5665
5792
|
}, null, 8, [
|
|
5666
5793
|
"model",
|
|
5667
5794
|
"lastValues",
|
|
@@ -5932,12 +6059,13 @@
|
|
|
5932
6059
|
});
|
|
5933
6060
|
//#endregion
|
|
5934
6061
|
//#region packages/form/src/containers/GroupListItem.vue?vue&type=script&setup=true&lang.ts
|
|
5935
|
-
var _hoisted_1$9 =
|
|
5936
|
-
var _hoisted_2$
|
|
6062
|
+
var _hoisted_1$9 = { class: "m-fields-group-list-item-header" };
|
|
6063
|
+
var _hoisted_2$5 = ["innerHTML"];
|
|
6064
|
+
var _hoisted_3$4 = { style: {
|
|
5937
6065
|
"text-align": "right",
|
|
5938
6066
|
"margin-top": "20px"
|
|
5939
6067
|
} };
|
|
5940
|
-
var
|
|
6068
|
+
var _hoisted_4$3 = ["innerHTML"];
|
|
5941
6069
|
//#endregion
|
|
5942
6070
|
//#region packages/form/src/containers/GroupListItem.vue
|
|
5943
6071
|
var GroupListItem_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5976,7 +6104,10 @@
|
|
|
5976
6104
|
[mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
|
|
5977
6105
|
}));
|
|
5978
6106
|
const title = (0, vue.computed)(() => {
|
|
5979
|
-
if (props.config.titleKey && props.model[props.config.titleKey])
|
|
6107
|
+
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
6108
|
+
const { titlePrefix } = props.config;
|
|
6109
|
+
return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
|
|
6110
|
+
}
|
|
5980
6111
|
if (props.config.title) return filterFunction(mForm, props.config.title, props);
|
|
5981
6112
|
return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
|
|
5982
6113
|
});
|
|
@@ -6015,33 +6146,39 @@
|
|
|
6015
6146
|
return (_ctx, _cache) => {
|
|
6016
6147
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
|
|
6017
6148
|
class: "m-fields-group-list-item",
|
|
6149
|
+
flat: __props.config.flat,
|
|
6018
6150
|
"body-style": { display: expand.value ? "block" : "none" }
|
|
6019
6151
|
}, {
|
|
6020
|
-
header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div",
|
|
6152
|
+
header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$9, [
|
|
6021
6153
|
(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6022
6154
|
link: "",
|
|
6023
6155
|
disabled: __props.disabled,
|
|
6024
|
-
onClick: expandHandler
|
|
6156
|
+
onClick: expandHandler,
|
|
6157
|
+
class: "expand-button"
|
|
6025
6158
|
}, {
|
|
6026
6159
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), null, {
|
|
6027
|
-
default: (0, vue.withCtx)(() => [expand.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_element_plus_icons_vue.
|
|
6160
|
+
default: (0, vue.withCtx)(() => [expand.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_element_plus_icons_vue.ArrowDown), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_element_plus_icons_vue.ArrowRight), { key: 1 }))]),
|
|
6028
6161
|
_: 1
|
|
6029
|
-
})
|
|
6162
|
+
})]),
|
|
6030
6163
|
_: 1
|
|
6031
6164
|
}, 8, ["disabled"]),
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6165
|
+
(0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_2$5),
|
|
6166
|
+
(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicTooltip), { content: `删除 ${title.value}` }, {
|
|
6167
|
+
default: (0, vue.withCtx)(() => [!__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6168
|
+
key: 0,
|
|
6169
|
+
size: "default",
|
|
6170
|
+
link: "",
|
|
6171
|
+
class: "delete-button",
|
|
6172
|
+
icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
|
|
6173
|
+
disabled: __props.disabled,
|
|
6174
|
+
onClick: removeHandler
|
|
6175
|
+
}, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6176
|
+
_: 1
|
|
6177
|
+
}, 8, ["content"]),
|
|
6041
6178
|
copyable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6042
|
-
key:
|
|
6179
|
+
key: 0,
|
|
6043
6180
|
link: "",
|
|
6044
|
-
size: "
|
|
6181
|
+
size: "default",
|
|
6045
6182
|
type: "primary",
|
|
6046
6183
|
icon: (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
|
|
6047
6184
|
disabled: __props.disabled,
|
|
@@ -6050,27 +6187,27 @@
|
|
|
6050
6187
|
default: (0, vue.withCtx)(() => [..._cache[6] || (_cache[6] = [(0, vue.createTextVNode)("复制", -1)])]),
|
|
6051
6188
|
_: 1
|
|
6052
6189
|
}, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true),
|
|
6053
|
-
movable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key:
|
|
6190
|
+
movable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6054
6191
|
link: "",
|
|
6055
|
-
size: "
|
|
6192
|
+
size: "default",
|
|
6056
6193
|
disabled: __props.disabled,
|
|
6057
|
-
icon: (0, vue.unref)(_element_plus_icons_vue.
|
|
6194
|
+
icon: (0, vue.unref)(_element_plus_icons_vue.Top),
|
|
6058
6195
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
6059
6196
|
}, {
|
|
6060
6197
|
default: (0, vue.withCtx)(() => [..._cache[7] || (_cache[7] = [(0, vue.createTextVNode)("上移", -1)])]),
|
|
6061
6198
|
_: 1
|
|
6062
6199
|
}, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== 0]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6063
6200
|
link: "",
|
|
6064
|
-
size: "
|
|
6201
|
+
size: "default",
|
|
6065
6202
|
disabled: __props.disabled,
|
|
6066
|
-
icon: (0, vue.unref)(_element_plus_icons_vue.
|
|
6203
|
+
icon: (0, vue.unref)(_element_plus_icons_vue.Bottom),
|
|
6067
6204
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
6068
6205
|
}, {
|
|
6069
6206
|
default: (0, vue.withCtx)(() => [..._cache[8] || (_cache[8] = [(0, vue.createTextVNode)("下移", -1)])]),
|
|
6070
6207
|
_: 1
|
|
6071
6208
|
}, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== length.value - 1]])], 64)) : (0, vue.createCommentVNode)("v-if", true),
|
|
6072
6209
|
__props.config.moveSpecifyLocation && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicPopover), {
|
|
6073
|
-
key:
|
|
6210
|
+
key: 2,
|
|
6074
6211
|
trigger: "click",
|
|
6075
6212
|
placement: "top",
|
|
6076
6213
|
width: "200",
|
|
@@ -6098,7 +6235,7 @@
|
|
|
6098
6235
|
disabled: __props.disabled
|
|
6099
6236
|
}, null, 8, ["modelValue", "disabled"]),
|
|
6100
6237
|
_cache[11] || (_cache[11] = (0, vue.createTextVNode)("行 ", -1))
|
|
6101
|
-
]), (0, vue.createElementVNode)("div",
|
|
6238
|
+
]), (0, vue.createElementVNode)("div", _hoisted_3$4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6102
6239
|
size: "small",
|
|
6103
6240
|
text: "",
|
|
6104
6241
|
onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
|
|
@@ -6116,10 +6253,10 @@
|
|
|
6116
6253
|
_: 1
|
|
6117
6254
|
}, 8, ["visible"])) : (0, vue.createCommentVNode)("v-if", true),
|
|
6118
6255
|
itemExtra.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
6119
|
-
key:
|
|
6256
|
+
key: 3,
|
|
6120
6257
|
innerHTML: itemExtra.value,
|
|
6121
6258
|
class: "m-form-tip"
|
|
6122
|
-
}, null, 8,
|
|
6259
|
+
}, null, 8, _hoisted_4$3)) : (0, vue.createCommentVNode)("v-if", true)
|
|
6123
6260
|
])]),
|
|
6124
6261
|
default: (0, vue.withCtx)(() => [expand.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
6125
6262
|
key: 0,
|
|
@@ -6144,23 +6281,24 @@
|
|
|
6144
6281
|
"disabled"
|
|
6145
6282
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6146
6283
|
_: 1
|
|
6147
|
-
}, 8, ["body-style"]);
|
|
6284
|
+
}, 8, ["flat", "body-style"]);
|
|
6148
6285
|
};
|
|
6149
6286
|
}
|
|
6150
6287
|
});
|
|
6151
6288
|
//#endregion
|
|
6152
6289
|
//#region packages/form/src/containers/GroupList.vue?vue&type=script&setup=true&lang.ts
|
|
6153
6290
|
var _hoisted_1$8 = { class: "m-fields-group-list" };
|
|
6154
|
-
var _hoisted_2$
|
|
6155
|
-
var _hoisted_3$
|
|
6291
|
+
var _hoisted_2$4 = ["innerHTML"];
|
|
6292
|
+
var _hoisted_3$3 = {
|
|
6156
6293
|
key: 1,
|
|
6157
6294
|
class: "el-table__empty-block"
|
|
6158
6295
|
};
|
|
6159
|
-
var _hoisted_4$
|
|
6296
|
+
var _hoisted_4$2 = { class: "el-table__empty-text t-table__empty" };
|
|
6297
|
+
var _hoisted_5$1 = {
|
|
6160
6298
|
key: 3,
|
|
6161
6299
|
class: "m-fields-group-list-footer"
|
|
6162
6300
|
};
|
|
6163
|
-
var
|
|
6301
|
+
var _hoisted_6$1 = { style: {
|
|
6164
6302
|
"display": "flex",
|
|
6165
6303
|
"justify-content": "flex-end",
|
|
6166
6304
|
"flex": "1"
|
|
@@ -6212,8 +6350,8 @@
|
|
|
6212
6350
|
key: 0,
|
|
6213
6351
|
innerHTML: __props.config.extra,
|
|
6214
6352
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
6215
|
-
}, null, 8, _hoisted_2$
|
|
6216
|
-
!__props.model[__props.name] || !__props.model[__props.name].length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$
|
|
6353
|
+
}, null, 8, _hoisted_2$4)) : (0, vue.createCommentVNode)("v-if", true),
|
|
6354
|
+
!__props.model[__props.name] || !__props.model[__props.name].length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$3, [(0, vue.createElementVNode)("span", _hoisted_4$2, "暂无" + (0, vue.toDisplayString)(__props.config.titlePrefix || "") + "数据", 1)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, (0, vue.renderList)(__props.model[__props.name], (item, index) => {
|
|
6217
6355
|
return (0, vue.openBlock)(), (0, vue.createBlock)(GroupListItem_default, {
|
|
6218
6356
|
key: index,
|
|
6219
6357
|
model: item,
|
|
@@ -6244,7 +6382,7 @@
|
|
|
6244
6382
|
"group-model"
|
|
6245
6383
|
]);
|
|
6246
6384
|
}), 128)),
|
|
6247
|
-
!__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
6385
|
+
!__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$1, [(0, vue.renderSlot)(_ctx.$slots, "toggle-button"), (0, vue.createElementVNode)("div", _hoisted_6$1, [(0, vue.renderSlot)(_ctx.$slots, "add-button")])])) : (0, vue.createCommentVNode)("v-if", true)
|
|
6248
6386
|
]);
|
|
6249
6387
|
};
|
|
6250
6388
|
}
|
|
@@ -6406,7 +6544,8 @@
|
|
|
6406
6544
|
index: {},
|
|
6407
6545
|
row: {},
|
|
6408
6546
|
prop: {},
|
|
6409
|
-
sortKey: {}
|
|
6547
|
+
sortKey: {},
|
|
6548
|
+
flat: { type: Boolean }
|
|
6410
6549
|
},
|
|
6411
6550
|
emits: ["change"],
|
|
6412
6551
|
setup(__props, { emit: __emit }) {
|
|
@@ -6477,19 +6616,25 @@
|
|
|
6477
6616
|
type: "danger",
|
|
6478
6617
|
link: "",
|
|
6479
6618
|
title: "删除",
|
|
6480
|
-
icon: __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
|
|
6619
|
+
icon: __props.flat ? void 0 : __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
|
|
6481
6620
|
onClick: _cache[0] || (_cache[0] = ($event) => removeHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
6482
|
-
},
|
|
6621
|
+
}, {
|
|
6622
|
+
default: (0, vue.withCtx)(() => [__props.flat ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)("删除")], 64)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6623
|
+
_: 1
|
|
6624
|
+
}, 8, ["icon"]), [[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
|
|
6483
6625
|
copyable(__props.index + 1 + __props.currentPage * __props.pageSize - 1) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6484
6626
|
key: 1,
|
|
6485
6627
|
link: "",
|
|
6486
6628
|
size: "small",
|
|
6487
6629
|
type: "primary",
|
|
6488
6630
|
title: "复制",
|
|
6489
|
-
icon: __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
|
|
6631
|
+
icon: __props.flat ? void 0 : __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
|
|
6490
6632
|
disabled: __props.disabled,
|
|
6491
6633
|
onClick: _cache[1] || (_cache[1] = ($event) => copyHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
6492
|
-
},
|
|
6634
|
+
}, {
|
|
6635
|
+
default: (0, vue.withCtx)(() => [__props.flat ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)("复制")], 64)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6636
|
+
_: 1
|
|
6637
|
+
}, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
|
|
6493
6638
|
], 64);
|
|
6494
6639
|
};
|
|
6495
6640
|
}
|
|
@@ -6639,8 +6784,10 @@
|
|
|
6639
6784
|
type: "selection",
|
|
6640
6785
|
width: 45
|
|
6641
6786
|
} });
|
|
6642
|
-
|
|
6787
|
+
const defaultFixed = isGlobalFlat.value ? "right" : "left";
|
|
6788
|
+
let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
|
|
6643
6789
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
|
|
6790
|
+
const actionFlat = props.config.flat === void 0 && isGlobalFlat.value ? true : props.config.flat;
|
|
6644
6791
|
const actionColumn = {
|
|
6645
6792
|
props: {
|
|
6646
6793
|
label: "操作",
|
|
@@ -6650,6 +6797,7 @@
|
|
|
6650
6797
|
},
|
|
6651
6798
|
cell: ({ row, $index }) => (0, vue.h)(ActionsColumn_default, {
|
|
6652
6799
|
row,
|
|
6800
|
+
flat: actionFlat,
|
|
6653
6801
|
index: $index,
|
|
6654
6802
|
model: props.model,
|
|
6655
6803
|
config: props.config,
|
|
@@ -6732,13 +6880,13 @@
|
|
|
6732
6880
|
//#endregion
|
|
6733
6881
|
//#region packages/form/src/containers/table/Table.vue?vue&type=script&setup=true&lang.ts
|
|
6734
6882
|
var _hoisted_1$7 = ["innerHTML"];
|
|
6735
|
-
var _hoisted_2$
|
|
6883
|
+
var _hoisted_2$3 = { style: {
|
|
6736
6884
|
"display": "flex",
|
|
6737
6885
|
"justify-content": "space-between",
|
|
6738
6886
|
"margin": "10px 0"
|
|
6739
6887
|
} };
|
|
6740
|
-
var _hoisted_3$
|
|
6741
|
-
var _hoisted_4 = {
|
|
6888
|
+
var _hoisted_3$2 = { style: { "display": "flex" } };
|
|
6889
|
+
var _hoisted_4$1 = {
|
|
6742
6890
|
key: 1,
|
|
6743
6891
|
class: "bottom",
|
|
6744
6892
|
style: { "text-align": "right" }
|
|
@@ -6823,19 +6971,21 @@
|
|
|
6823
6971
|
"default-expand-all": true,
|
|
6824
6972
|
key: updateKey.value,
|
|
6825
6973
|
onSelect: (0, vue.unref)(selectHandle),
|
|
6826
|
-
onSortChange: sortChangeHandler
|
|
6974
|
+
onSortChange: sortChangeHandler,
|
|
6975
|
+
"empty-text": `暂无${__props.config.titlePrefix || ""}数据`
|
|
6827
6976
|
}, null, 8, [
|
|
6828
6977
|
"row-key",
|
|
6829
6978
|
"columns",
|
|
6830
6979
|
"data",
|
|
6831
6980
|
"border",
|
|
6832
6981
|
"max-height",
|
|
6833
|
-
"onSelect"
|
|
6982
|
+
"onSelect",
|
|
6983
|
+
"empty-text"
|
|
6834
6984
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6835
6985
|
_: 1
|
|
6836
6986
|
}, 8, ["disabled"]),
|
|
6837
6987
|
(0, vue.renderSlot)(_ctx.$slots, "default"),
|
|
6838
|
-
(0, vue.createElementVNode)("div", _hoisted_2$
|
|
6988
|
+
(0, vue.createElementVNode)("div", _hoisted_2$3, [(0, vue.createElementVNode)("div", _hoisted_3$2, [
|
|
6839
6989
|
!(0, vue.unref)(isFullscreen) ? (0, vue.renderSlot)(_ctx.$slots, "toggle-button", {}, void 0, void 0, 0) : (0, vue.createCommentVNode)("v-if", true),
|
|
6840
6990
|
__props.config.enableFullscreen !== false ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
6841
6991
|
key: 1,
|
|
@@ -6878,7 +7028,7 @@
|
|
|
6878
7028
|
_: 1
|
|
6879
7029
|
}, 8, ["disabled", "onClick"])) : (0, vue.createCommentVNode)("v-if", true)
|
|
6880
7030
|
]), !__props.isCompare ? (0, vue.renderSlot)(_ctx.$slots, "add-button", {}, void 0, void 0, 0) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
6881
|
-
__props.config.pagination ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicPagination), {
|
|
7031
|
+
__props.config.pagination ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$1, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicPagination), {
|
|
6882
7032
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
6883
7033
|
"hide-on-single-page": __props.model[modelName.value].length < (0, vue.unref)(pageSize),
|
|
6884
7034
|
"current-page": (0, vue.unref)(currentPage) + 1,
|
|
@@ -7098,9 +7248,10 @@
|
|
|
7098
7248
|
size: addButtonSize.value,
|
|
7099
7249
|
plain: displayMode.value === "table",
|
|
7100
7250
|
icon: (0, vue.unref)(_element_plus_icons_vue.Plus),
|
|
7251
|
+
text: "",
|
|
7101
7252
|
disabled: __props.disabled
|
|
7102
7253
|
}, currentConfig.value.addButtonConfig?.props || { type: "primary" }, { onClick: (0, vue.unref)(newHandler) }), {
|
|
7103
|
-
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? "
|
|
7254
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? `新增一行${groupListConfig.value.titlePrefix || ""}` : `新增${groupListConfig.value.titlePrefix || ""}`)), 1)]),
|
|
7104
7255
|
_: 1
|
|
7105
7256
|
}, 16, [
|
|
7106
7257
|
"class",
|
|
@@ -7130,9 +7281,17 @@
|
|
|
7130
7281
|
});
|
|
7131
7282
|
//#endregion
|
|
7132
7283
|
//#region packages/form/src/fields/Text.vue?vue&type=script&setup=true&lang.ts
|
|
7133
|
-
var _hoisted_1$6 = {
|
|
7134
|
-
var _hoisted_2$
|
|
7135
|
-
|
|
7284
|
+
var _hoisted_1$6 = { key: 0 };
|
|
7285
|
+
var _hoisted_2$2 = {
|
|
7286
|
+
key: 0,
|
|
7287
|
+
class: "m-fields-text__prepend"
|
|
7288
|
+
};
|
|
7289
|
+
var _hoisted_3$1 = { class: "m-fields-text__value" };
|
|
7290
|
+
var _hoisted_4 = ["src"];
|
|
7291
|
+
var _hoisted_5 = { key: 2 };
|
|
7292
|
+
var _hoisted_6 = ["src"];
|
|
7293
|
+
var _hoisted_7 = { key: 2 };
|
|
7294
|
+
var _hoisted_8 = { style: {
|
|
7136
7295
|
"display": "flex",
|
|
7137
7296
|
"justify-content": "flex-end"
|
|
7138
7297
|
} };
|
|
@@ -7151,7 +7310,10 @@
|
|
|
7151
7310
|
disabled: { type: Boolean },
|
|
7152
7311
|
size: {},
|
|
7153
7312
|
lastValues: {},
|
|
7154
|
-
isCompare: { type: Boolean }
|
|
7313
|
+
isCompare: { type: Boolean },
|
|
7314
|
+
text: {},
|
|
7315
|
+
labelWidth: {},
|
|
7316
|
+
labelPosition: {}
|
|
7155
7317
|
},
|
|
7156
7318
|
emits: ["change", "input"],
|
|
7157
7319
|
setup(__props, { emit: __emit }) {
|
|
@@ -7164,21 +7326,15 @@
|
|
|
7164
7326
|
value.value = v;
|
|
7165
7327
|
}, { immediate: true });
|
|
7166
7328
|
const appendConfig = (0, vue.computed)(() => {
|
|
7167
|
-
|
|
7329
|
+
const { append } = props.config;
|
|
7330
|
+
if (typeof append === "string") return {
|
|
7168
7331
|
type: "text",
|
|
7169
|
-
text:
|
|
7332
|
+
text: append,
|
|
7170
7333
|
handler: void 0
|
|
7171
7334
|
};
|
|
7172
|
-
if (typeof
|
|
7173
|
-
if (
|
|
7174
|
-
|
|
7175
|
-
text: props.config.append.text,
|
|
7176
|
-
handler: props.config.append.handler
|
|
7177
|
-
};
|
|
7178
|
-
if (props.config.append) {
|
|
7179
|
-
if (props.config.append.value === 0) return false;
|
|
7180
|
-
return props.config.append;
|
|
7181
|
-
}
|
|
7335
|
+
if (typeof append === "object" && append) {
|
|
7336
|
+
if (append.value === 0) return false;
|
|
7337
|
+
return append;
|
|
7182
7338
|
}
|
|
7183
7339
|
return false;
|
|
7184
7340
|
});
|
|
@@ -7274,67 +7430,97 @@
|
|
|
7274
7430
|
instanceRef.value = void 0;
|
|
7275
7431
|
};
|
|
7276
7432
|
return (_ctx, _cache) => {
|
|
7277
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7433
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["m-fields-text", { "m-fields-text--static": __props.config.static }]) }, [
|
|
7434
|
+
__props.config.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6)) : (0, vue.createCommentVNode)("v-if", true),
|
|
7435
|
+
(0, vue.createCommentVNode)(" 新增静态展示文本样式 "),
|
|
7436
|
+
__props.config.static ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [
|
|
7437
|
+
__props.config.prepend ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$2, (0, vue.toDisplayString)(__props.config.prepend), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
7438
|
+
(0, vue.createElementVNode)("span", _hoisted_3$1, (0, vue.toDisplayString)(value.value), 1),
|
|
7439
|
+
appendConfig.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
7440
|
+
key: 0,
|
|
7441
|
+
style: { "color": "#0056ea" },
|
|
7442
|
+
size: __props.size,
|
|
7443
|
+
onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
|
|
7444
|
+
}, {
|
|
7445
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
|
|
7446
|
+
_: 1
|
|
7447
|
+
}, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
|
|
7448
|
+
key: 1,
|
|
7449
|
+
class: "m-fields-text__icon",
|
|
7450
|
+
src: appendConfig.value.text,
|
|
7451
|
+
onClick: buttonClickHandler
|
|
7452
|
+
}, null, 8, _hoisted_4)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5, (0, vue.toDisplayString)(appendConfig.value.text), 1))], 64)) : (0, vue.createCommentVNode)("v-if", true)
|
|
7453
|
+
], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicInput), {
|
|
7454
|
+
key: 2,
|
|
7455
|
+
modelValue: value.value,
|
|
7456
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
7457
|
+
ref_key: "input",
|
|
7458
|
+
ref: input,
|
|
7459
|
+
clearable: __props.config.clearable ?? true,
|
|
7298
7460
|
size: __props.size,
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
size
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7461
|
+
placeholder: __props.config.placeholder,
|
|
7462
|
+
disabled: __props.disabled,
|
|
7463
|
+
onChange: changeHandler,
|
|
7464
|
+
onInput: inputHandler,
|
|
7465
|
+
onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
|
|
7466
|
+
}, (0, vue.createSlots)({ _: 2 }, [__props.config.prepend ? {
|
|
7467
|
+
name: "prepend",
|
|
7468
|
+
fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.config.prepend), 1)]),
|
|
7469
|
+
key: "0"
|
|
7470
|
+
} : void 0, appendConfig.value ? {
|
|
7471
|
+
name: "append",
|
|
7472
|
+
fn: (0, vue.withCtx)(() => [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
7473
|
+
key: 0,
|
|
7474
|
+
style: { "color": "#0056ea" },
|
|
7475
|
+
size: __props.size,
|
|
7476
|
+
onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
|
|
7477
|
+
}, {
|
|
7478
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
|
|
7479
|
+
_: 1
|
|
7480
|
+
}, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
|
|
7481
|
+
key: 1,
|
|
7482
|
+
src: appendConfig.value.text,
|
|
7483
|
+
onClick: buttonClickHandler
|
|
7484
|
+
}, null, 8, _hoisted_6)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7, (0, vue.toDisplayString)(appendConfig.value.text), 1))]),
|
|
7485
|
+
key: "1"
|
|
7486
|
+
} : void 0]), 1032, [
|
|
7487
|
+
"modelValue",
|
|
7488
|
+
"clearable",
|
|
7489
|
+
"size",
|
|
7490
|
+
"placeholder",
|
|
7491
|
+
"disabled"
|
|
7492
|
+
])),
|
|
7493
|
+
!__props.config.static ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
|
|
7494
|
+
key: 3,
|
|
7495
|
+
to: "body"
|
|
7496
|
+
}, [popoverVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
7497
|
+
key: 0,
|
|
7498
|
+
class: "tmagic-form-text-popper m-form-item__content",
|
|
7499
|
+
ref_key: "popoverEl",
|
|
7500
|
+
ref: popoverEl
|
|
7501
|
+
}, [
|
|
7502
|
+
_cache[5] || (_cache[5] = (0, vue.createElementVNode)("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
|
|
7503
|
+
(0, vue.createElementVNode)("div", _hoisted_8, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
7504
|
+
link: "",
|
|
7505
|
+
size: "small",
|
|
7506
|
+
onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
|
|
7507
|
+
}, {
|
|
7508
|
+
default: (0, vue.withCtx)(() => [..._cache[3] || (_cache[3] = [(0, vue.createTextVNode)("保持原样", -1)])]),
|
|
7509
|
+
_: 1
|
|
7510
|
+
}), (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
7511
|
+
type: "primary",
|
|
7512
|
+
size: "small",
|
|
7513
|
+
onClick: confirmTrimHandler
|
|
7514
|
+
}, {
|
|
7515
|
+
default: (0, vue.withCtx)(() => [..._cache[4] || (_cache[4] = [(0, vue.createTextVNode)("移除空格", -1)])]),
|
|
7516
|
+
_: 1
|
|
7517
|
+
})]),
|
|
7518
|
+
_cache[6] || (_cache[6] = (0, vue.createElementVNode)("span", {
|
|
7519
|
+
class: "tmagic-form-text-popper-arrow",
|
|
7520
|
+
"data-popper-arrow": ""
|
|
7521
|
+
}, null, -1))
|
|
7522
|
+
], 512)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true)
|
|
7523
|
+
], 2);
|
|
7338
7524
|
};
|
|
7339
7525
|
}
|
|
7340
7526
|
});
|
|
@@ -7353,7 +7539,10 @@
|
|
|
7353
7539
|
disabled: { type: Boolean },
|
|
7354
7540
|
size: {},
|
|
7355
7541
|
lastValues: {},
|
|
7356
|
-
isCompare: { type: Boolean }
|
|
7542
|
+
isCompare: { type: Boolean },
|
|
7543
|
+
text: {},
|
|
7544
|
+
labelWidth: {},
|
|
7545
|
+
labelPosition: {}
|
|
7357
7546
|
},
|
|
7358
7547
|
emits: ["change", "input"],
|
|
7359
7548
|
setup(__props, { emit: __emit }) {
|
|
@@ -7378,7 +7567,7 @@
|
|
|
7378
7567
|
modelValue: value.value,
|
|
7379
7568
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
7380
7569
|
clearable: "",
|
|
7381
|
-
"controls-position": "right",
|
|
7570
|
+
"controls-position": (0, vue.unref)(isGlobalFlat) ? "" : "right",
|
|
7382
7571
|
size: __props.size,
|
|
7383
7572
|
max: __props.config.max,
|
|
7384
7573
|
min: __props.config.min,
|
|
@@ -7389,6 +7578,7 @@
|
|
|
7389
7578
|
onInput: inputHandler
|
|
7390
7579
|
}, null, 8, [
|
|
7391
7580
|
"modelValue",
|
|
7581
|
+
"controls-position",
|
|
7392
7582
|
"size",
|
|
7393
7583
|
"max",
|
|
7394
7584
|
"min",
|
|
@@ -7417,7 +7607,10 @@
|
|
|
7417
7607
|
disabled: { type: Boolean },
|
|
7418
7608
|
size: {},
|
|
7419
7609
|
lastValues: {},
|
|
7420
|
-
isCompare: { type: Boolean }
|
|
7610
|
+
isCompare: { type: Boolean },
|
|
7611
|
+
text: {},
|
|
7612
|
+
labelWidth: {},
|
|
7613
|
+
labelPosition: {}
|
|
7421
7614
|
},
|
|
7422
7615
|
emits: ["change"],
|
|
7423
7616
|
setup(__props, { emit: __emit }) {
|
|
@@ -7488,7 +7681,10 @@
|
|
|
7488
7681
|
disabled: { type: Boolean },
|
|
7489
7682
|
size: {},
|
|
7490
7683
|
lastValues: {},
|
|
7491
|
-
isCompare: { type: Boolean }
|
|
7684
|
+
isCompare: { type: Boolean },
|
|
7685
|
+
text: {},
|
|
7686
|
+
labelWidth: {},
|
|
7687
|
+
labelPosition: {}
|
|
7492
7688
|
},
|
|
7493
7689
|
emits: ["change", "input"],
|
|
7494
7690
|
setup(__props, { emit: __emit }) {
|
|
@@ -7544,7 +7740,10 @@
|
|
|
7544
7740
|
disabled: { type: Boolean },
|
|
7545
7741
|
size: {},
|
|
7546
7742
|
lastValues: {},
|
|
7547
|
-
isCompare: { type: Boolean }
|
|
7743
|
+
isCompare: { type: Boolean },
|
|
7744
|
+
text: {},
|
|
7745
|
+
labelWidth: {},
|
|
7746
|
+
labelPosition: {}
|
|
7548
7747
|
},
|
|
7549
7748
|
emits: ["change"],
|
|
7550
7749
|
setup(__props, { emit: __emit }) {
|
|
@@ -7591,7 +7790,10 @@
|
|
|
7591
7790
|
disabled: { type: Boolean },
|
|
7592
7791
|
size: {},
|
|
7593
7792
|
lastValues: {},
|
|
7594
|
-
isCompare: { type: Boolean }
|
|
7793
|
+
isCompare: { type: Boolean },
|
|
7794
|
+
text: {},
|
|
7795
|
+
labelWidth: {},
|
|
7796
|
+
labelPosition: {}
|
|
7595
7797
|
},
|
|
7596
7798
|
emits: ["change"],
|
|
7597
7799
|
setup(__props, { emit: __emit }) {
|
|
@@ -7643,7 +7845,10 @@
|
|
|
7643
7845
|
disabled: { type: Boolean },
|
|
7644
7846
|
size: {},
|
|
7645
7847
|
lastValues: {},
|
|
7646
|
-
isCompare: { type: Boolean }
|
|
7848
|
+
isCompare: { type: Boolean },
|
|
7849
|
+
text: {},
|
|
7850
|
+
labelWidth: {},
|
|
7851
|
+
labelPosition: {}
|
|
7647
7852
|
},
|
|
7648
7853
|
emits: ["change"],
|
|
7649
7854
|
setup(__props, { emit: __emit }) {
|
|
@@ -7688,7 +7893,10 @@
|
|
|
7688
7893
|
disabled: { type: Boolean },
|
|
7689
7894
|
size: {},
|
|
7690
7895
|
lastValues: {},
|
|
7691
|
-
isCompare: { type: Boolean }
|
|
7896
|
+
isCompare: { type: Boolean },
|
|
7897
|
+
text: {},
|
|
7898
|
+
labelWidth: {},
|
|
7899
|
+
labelPosition: {}
|
|
7692
7900
|
},
|
|
7693
7901
|
emits: ["change"],
|
|
7694
7902
|
setup(__props, { emit: __emit }) {
|
|
@@ -7745,7 +7953,10 @@
|
|
|
7745
7953
|
disabled: { type: Boolean },
|
|
7746
7954
|
size: {},
|
|
7747
7955
|
lastValues: {},
|
|
7748
|
-
isCompare: { type: Boolean }
|
|
7956
|
+
isCompare: { type: Boolean },
|
|
7957
|
+
text: {},
|
|
7958
|
+
labelWidth: {},
|
|
7959
|
+
labelPosition: {}
|
|
7749
7960
|
},
|
|
7750
7961
|
emits: ["change"],
|
|
7751
7962
|
setup(__props, { emit: __emit }) {
|
|
@@ -7800,7 +8011,10 @@
|
|
|
7800
8011
|
disabled: { type: Boolean },
|
|
7801
8012
|
size: {},
|
|
7802
8013
|
lastValues: {},
|
|
7803
|
-
isCompare: { type: Boolean }
|
|
8014
|
+
isCompare: { type: Boolean },
|
|
8015
|
+
text: {},
|
|
8016
|
+
labelWidth: {},
|
|
8017
|
+
labelPosition: {}
|
|
7804
8018
|
},
|
|
7805
8019
|
emits: ["change"],
|
|
7806
8020
|
setup(__props, { emit: __emit }) {
|
|
@@ -7894,7 +8108,10 @@
|
|
|
7894
8108
|
disabled: { type: Boolean },
|
|
7895
8109
|
size: {},
|
|
7896
8110
|
lastValues: {},
|
|
7897
|
-
isCompare: { type: Boolean }
|
|
8111
|
+
isCompare: { type: Boolean },
|
|
8112
|
+
text: {},
|
|
8113
|
+
labelWidth: {},
|
|
8114
|
+
labelPosition: {}
|
|
7898
8115
|
},
|
|
7899
8116
|
emits: ["change"],
|
|
7900
8117
|
setup(__props, { emit: __emit }) {
|
|
@@ -7988,7 +8205,10 @@
|
|
|
7988
8205
|
disabled: { type: Boolean },
|
|
7989
8206
|
size: {},
|
|
7990
8207
|
lastValues: {},
|
|
7991
|
-
isCompare: { type: Boolean }
|
|
8208
|
+
isCompare: { type: Boolean },
|
|
8209
|
+
text: {},
|
|
8210
|
+
labelWidth: {},
|
|
8211
|
+
labelPosition: {}
|
|
7992
8212
|
},
|
|
7993
8213
|
emits: ["change"],
|
|
7994
8214
|
setup(__props, { emit: __emit }) {
|
|
@@ -8026,7 +8246,10 @@
|
|
|
8026
8246
|
disabled: { type: Boolean },
|
|
8027
8247
|
size: {},
|
|
8028
8248
|
lastValues: {},
|
|
8029
|
-
isCompare: { type: Boolean }
|
|
8249
|
+
isCompare: { type: Boolean },
|
|
8250
|
+
text: {},
|
|
8251
|
+
labelWidth: {},
|
|
8252
|
+
labelPosition: {}
|
|
8030
8253
|
},
|
|
8031
8254
|
emits: ["change"],
|
|
8032
8255
|
setup(__props, { emit: __emit }) {
|
|
@@ -8071,7 +8294,11 @@
|
|
|
8071
8294
|
});
|
|
8072
8295
|
//#endregion
|
|
8073
8296
|
//#region packages/form/src/fields/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
8074
|
-
var _hoisted_1$4 = {
|
|
8297
|
+
var _hoisted_1$4 = { class: "m-fields-radio-group__option" };
|
|
8298
|
+
var _hoisted_2$1 = {
|
|
8299
|
+
key: 1,
|
|
8300
|
+
class: "m-fields-radio-group__text"
|
|
8301
|
+
};
|
|
8075
8302
|
//#endregion
|
|
8076
8303
|
//#region packages/form/src/fields/RadioGroup.vue
|
|
8077
8304
|
var RadioGroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8087,7 +8314,10 @@
|
|
|
8087
8314
|
disabled: { type: Boolean },
|
|
8088
8315
|
size: {},
|
|
8089
8316
|
lastValues: {},
|
|
8090
|
-
isCompare: { type: Boolean }
|
|
8317
|
+
isCompare: { type: Boolean },
|
|
8318
|
+
text: {},
|
|
8319
|
+
labelWidth: {},
|
|
8320
|
+
labelPosition: {}
|
|
8091
8321
|
},
|
|
8092
8322
|
emits: ["change"],
|
|
8093
8323
|
setup(__props, { emit: __emit }) {
|
|
@@ -8100,16 +8330,18 @@
|
|
|
8100
8330
|
};
|
|
8101
8331
|
useAddField(props.prop);
|
|
8102
8332
|
const iconSize = (0, vue.computed)(() => {
|
|
8103
|
-
if (props.
|
|
8333
|
+
if (props.config.iconSize) return props.config.iconSize;
|
|
8334
|
+
if (props.size === "small") return "14";
|
|
8104
8335
|
if (props.size === "large") return "16";
|
|
8105
|
-
return "
|
|
8336
|
+
return "16";
|
|
8106
8337
|
});
|
|
8107
8338
|
return (_ctx, _cache) => {
|
|
8108
8339
|
return __props.model ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicRadioGroup), {
|
|
8109
8340
|
key: 0,
|
|
8110
8341
|
"model-value": __props.model[__props.name],
|
|
8111
8342
|
size: __props.size,
|
|
8112
|
-
disabled: __props.disabled
|
|
8343
|
+
disabled: __props.disabled,
|
|
8344
|
+
class: "icon-{{ iconSize }}"
|
|
8113
8345
|
}, {
|
|
8114
8346
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.config.options, (option) => {
|
|
8115
8347
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(itemComponent.value), {
|
|
@@ -8122,13 +8354,14 @@
|
|
|
8122
8354
|
placement: "top-start",
|
|
8123
8355
|
content: option.tooltip
|
|
8124
8356
|
}, {
|
|
8125
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div",
|
|
8357
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$4, [option.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicIcon), {
|
|
8126
8358
|
key: 0,
|
|
8127
|
-
size: iconSize.value
|
|
8359
|
+
size: iconSize.value,
|
|
8360
|
+
class: (0, vue.normalizeClass)({ "m-fields-radio-group__icon_with_text": !!option.text })
|
|
8128
8361
|
}, {
|
|
8129
8362
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(option.icon)))]),
|
|
8130
8363
|
_: 2
|
|
8131
|
-
}, 1032, ["size"])) : (0, vue.createCommentVNode)("v-if", true), option.text ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span",
|
|
8364
|
+
}, 1032, ["size", "class"])) : (0, vue.createCommentVNode)("v-if", true), option.text ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$1, (0, vue.toDisplayString)(option.text), 1)) : (0, vue.createCommentVNode)("v-if", true)])]),
|
|
8132
8365
|
_: 2
|
|
8133
8366
|
}, 1032, ["disabled", "content"])]),
|
|
8134
8367
|
_: 2
|
|
@@ -8161,7 +8394,10 @@
|
|
|
8161
8394
|
disabled: { type: Boolean },
|
|
8162
8395
|
size: {},
|
|
8163
8396
|
lastValues: {},
|
|
8164
|
-
isCompare: { type: Boolean }
|
|
8397
|
+
isCompare: { type: Boolean },
|
|
8398
|
+
text: {},
|
|
8399
|
+
labelWidth: {},
|
|
8400
|
+
labelPosition: {}
|
|
8165
8401
|
},
|
|
8166
8402
|
setup(__props) {
|
|
8167
8403
|
const props = __props;
|
|
@@ -8180,8 +8416,9 @@
|
|
|
8180
8416
|
//#endregion
|
|
8181
8417
|
//#region packages/form/src/fields/Link.vue?vue&type=script&setup=true&lang.ts
|
|
8182
8418
|
var _hoisted_1$2 = ["href"];
|
|
8183
|
-
var _hoisted_2 =
|
|
8184
|
-
|
|
8419
|
+
var _hoisted_2 = ["href"];
|
|
8420
|
+
var _hoisted_3 = {
|
|
8421
|
+
key: 3,
|
|
8185
8422
|
class: "m-fields-link"
|
|
8186
8423
|
};
|
|
8187
8424
|
//#endregion
|
|
@@ -8199,7 +8436,11 @@
|
|
|
8199
8436
|
disabled: { type: Boolean },
|
|
8200
8437
|
size: {},
|
|
8201
8438
|
lastValues: {},
|
|
8202
|
-
isCompare: { type: Boolean }
|
|
8439
|
+
isCompare: { type: Boolean },
|
|
8440
|
+
text: {},
|
|
8441
|
+
labelWidth: {},
|
|
8442
|
+
labelPosition: {},
|
|
8443
|
+
theme: {}
|
|
8203
8444
|
},
|
|
8204
8445
|
emits: ["change"],
|
|
8205
8446
|
setup(__props, { emit: __emit }) {
|
|
@@ -8242,15 +8483,30 @@
|
|
|
8242
8483
|
editor.value && (editor.value.dialogVisible = false);
|
|
8243
8484
|
};
|
|
8244
8485
|
return (_ctx, _cache) => {
|
|
8245
|
-
return __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
8486
|
+
return (0, vue.unref)(isGlobalFlat) && __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
8246
8487
|
key: 0,
|
|
8247
8488
|
target: "_blank",
|
|
8248
8489
|
href: href.value,
|
|
8490
|
+
class: "magic-admin-link",
|
|
8249
8491
|
style: (0, vue.normalizeStyle)(__props.config.css || {})
|
|
8250
|
-
}, (0, vue.
|
|
8492
|
+
}, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
8493
|
+
link: "",
|
|
8494
|
+
type: "primary"
|
|
8495
|
+
}, {
|
|
8496
|
+
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), null, {
|
|
8497
|
+
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_element_plus_icons_vue.Notebook))]),
|
|
8498
|
+
_: 1
|
|
8499
|
+
}), (0, vue.createTextVNode)((0, vue.toDisplayString)(displayText.value), 1)]),
|
|
8500
|
+
_: 1
|
|
8501
|
+
})], 12, _hoisted_1$2)) : __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
8251
8502
|
key: 1,
|
|
8503
|
+
target: "_blank",
|
|
8504
|
+
href: href.value,
|
|
8505
|
+
style: (0, vue.normalizeStyle)(__props.config.css || {})
|
|
8506
|
+
}, (0, vue.toDisplayString)(displayText.value), 13, _hoisted_2)) : __props.config.href && __props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
8507
|
+
key: 2,
|
|
8252
8508
|
style: (0, vue.normalizeStyle)(__props.config.disabledCss || {})
|
|
8253
|
-
}, (0, vue.toDisplayString)(displayText.value), 5)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
8509
|
+
}, (0, vue.toDisplayString)(displayText.value), 5)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
8254
8510
|
link: "",
|
|
8255
8511
|
type: "primary",
|
|
8256
8512
|
onClick: editHandler
|
|
@@ -8296,7 +8552,10 @@
|
|
|
8296
8552
|
disabled: { type: Boolean },
|
|
8297
8553
|
size: {},
|
|
8298
8554
|
lastValues: {},
|
|
8299
|
-
isCompare: { type: Boolean }
|
|
8555
|
+
isCompare: { type: Boolean },
|
|
8556
|
+
text: {},
|
|
8557
|
+
labelWidth: {},
|
|
8558
|
+
labelPosition: {}
|
|
8300
8559
|
},
|
|
8301
8560
|
emits: ["change"],
|
|
8302
8561
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -8645,7 +8904,10 @@
|
|
|
8645
8904
|
disabled: { type: Boolean },
|
|
8646
8905
|
size: {},
|
|
8647
8906
|
lastValues: {},
|
|
8648
|
-
isCompare: { type: Boolean }
|
|
8907
|
+
isCompare: { type: Boolean },
|
|
8908
|
+
text: {},
|
|
8909
|
+
labelWidth: {},
|
|
8910
|
+
labelPosition: {}
|
|
8649
8911
|
},
|
|
8650
8912
|
emits: ["change"],
|
|
8651
8913
|
setup(__props, { emit: __emit }) {
|
|
@@ -8765,7 +9027,10 @@
|
|
|
8765
9027
|
disabled: { type: Boolean },
|
|
8766
9028
|
size: {},
|
|
8767
9029
|
lastValues: {},
|
|
8768
|
-
isCompare: { type: Boolean }
|
|
9030
|
+
isCompare: { type: Boolean },
|
|
9031
|
+
text: {},
|
|
9032
|
+
labelWidth: {},
|
|
9033
|
+
labelPosition: {}
|
|
8769
9034
|
},
|
|
8770
9035
|
emits: ["change"],
|
|
8771
9036
|
setup(__props, { emit: __emit }) {
|
|
@@ -8926,6 +9191,7 @@
|
|
|
8926
9191
|
if (option.typeMatchRules) registerTypeMatchRules(option.typeMatchRules);
|
|
8927
9192
|
app.component("m-form", Form_default);
|
|
8928
9193
|
app.component("m-form-dialog", FormDialog_default);
|
|
9194
|
+
app.component("m-form-drawer", FormDrawer_default);
|
|
8929
9195
|
app.component("m-form-container", Container_default);
|
|
8930
9196
|
app.component("m-form-fieldset", Fieldset_default);
|
|
8931
9197
|
app.component("m-form-group-list", TableGroupList_default);
|
|
@@ -8960,6 +9226,7 @@
|
|
|
8960
9226
|
var createForm = (config) => config;
|
|
8961
9227
|
//#endregion
|
|
8962
9228
|
exports.FORM_DIFF_CONFIG_KEY = FORM_DIFF_CONFIG_KEY;
|
|
9229
|
+
exports.FORM_SILENT_MODE_KEY = FORM_SILENT_MODE_KEY;
|
|
8963
9230
|
exports.FORM_TYPE_MATCH_VALID_KEY = FORM_TYPE_MATCH_VALID_KEY;
|
|
8964
9231
|
exports.MCascader = Cascader_default;
|
|
8965
9232
|
exports.MCheckbox = Checkbox_default;
|
|
@@ -8995,6 +9262,7 @@
|
|
|
8995
9262
|
exports.MTime = Time_default;
|
|
8996
9263
|
exports.MTimerange = Timerange_default;
|
|
8997
9264
|
exports.adaptFormValidator = adaptFormValidator;
|
|
9265
|
+
exports.applyExtendState = applyExtendState;
|
|
8998
9266
|
exports.clearTypeMatchRules = clearTypeMatchRules;
|
|
8999
9267
|
exports.createForm = createForm;
|
|
9000
9268
|
exports.createObjectProp = createObjectProp;
|