@tmagic/form 1.8.0-beta.13 → 1.8.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/es/Form.vue_vue_type_script_setup_true_lang.js +51 -16
  2. package/dist/es/FormDialog.vue_vue_type_script_setup_true_lang.js +12 -5
  3. package/dist/es/FormDrawer.vue_vue_type_script_setup_true_lang.js +38 -12
  4. package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +23 -17
  5. package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +6 -5
  6. package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +41 -31
  7. package/dist/es/containers/Panel.vue_vue_type_script_setup_true_lang.js +16 -10
  8. package/dist/es/containers/table/ActionsColumn.vue_vue_type_script_setup_true_lang.js +13 -6
  9. package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +4 -2
  10. package/dist/es/containers/table/useTableColumns.js +5 -1
  11. package/dist/es/containers/table-group-list/TableGroupList.vue_vue_type_script_setup_true_lang.js +2 -1
  12. package/dist/es/fields/Cascader.vue_vue_type_script_setup_true_lang.js +5 -2
  13. package/dist/es/fields/Checkbox.vue_vue_type_script_setup_true_lang.js +4 -1
  14. package/dist/es/fields/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +5 -2
  15. package/dist/es/fields/ColorPicker.vue_vue_type_script_setup_true_lang.js +4 -1
  16. package/dist/es/fields/Date.vue_vue_type_script_setup_true_lang.js +5 -2
  17. package/dist/es/fields/DateTime.vue_vue_type_script_setup_true_lang.js +5 -2
  18. package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +5 -2
  19. package/dist/es/fields/Display.vue_vue_type_script_setup_true_lang.js +5 -2
  20. package/dist/es/fields/DynamicField.vue_vue_type_script_setup_true_lang.js +4 -1
  21. package/dist/es/fields/Link.vue_vue_type_script_setup_true_lang.js +29 -7
  22. package/dist/es/fields/Number.vue_vue_type_script_setup_true_lang.js +7 -2
  23. package/dist/es/fields/NumberRange.vue_vue_type_script_setup_true_lang.js +4 -1
  24. package/dist/es/fields/RadioGroup.vue_vue_type_script_setup_true_lang.js +19 -9
  25. package/dist/es/fields/Select.vue_vue_type_script_setup_true_lang.js +4 -1
  26. package/dist/es/fields/Switch.vue_vue_type_script_setup_true_lang.js +4 -1
  27. package/dist/es/fields/Text.vue_vue_type_script_setup_true_lang.js +112 -77
  28. package/dist/es/fields/Textarea.vue_vue_type_script_setup_true_lang.js +4 -1
  29. package/dist/es/fields/Time.vue_vue_type_script_setup_true_lang.js +4 -1
  30. package/dist/es/fields/Timerange.vue_vue_type_script_setup_true_lang.js +6 -3
  31. package/dist/es/index.js +3 -3
  32. package/dist/es/plugin.js +3 -1
  33. package/dist/es/style.css +122 -8
  34. package/dist/es/submitForm.js +2 -8
  35. package/dist/es/utils/config.js +4 -1
  36. package/dist/es/utils/form.js +33 -3
  37. package/dist/es/utils/typeMatch.js +1 -1
  38. package/dist/style.css +122 -8
  39. package/dist/themes/magic-admin.css +499 -0
  40. package/dist/tmagic-form.umd.cjs +541 -296
  41. package/package.json +4 -4
  42. package/src/Form.vue +71 -18
  43. package/src/FormDialog.vue +14 -3
  44. package/src/FormDrawer.vue +40 -12
  45. package/src/containers/Container.vue +16 -5
  46. package/src/containers/GroupList.vue +1 -1
  47. package/src/containers/GroupListItem.vue +28 -22
  48. package/src/containers/Panel.vue +10 -3
  49. package/src/containers/table/ActionsColumn.vue +10 -4
  50. package/src/containers/table/Table.vue +1 -0
  51. package/src/containers/table/useTableColumns.ts +7 -3
  52. package/src/containers/table-group-list/TableGroupList.vue +7 -1
  53. package/src/fields/Link.vue +16 -3
  54. package/src/fields/Number.vue +2 -1
  55. package/src/fields/RadioGroup.vue +21 -6
  56. package/src/fields/Text.vue +43 -19
  57. package/src/plugin.ts +3 -0
  58. package/src/submitForm.ts +5 -11
  59. package/src/theme/container.scss +3 -0
  60. package/src/theme/fieldset.scss +51 -0
  61. package/src/theme/form.scss +6 -0
  62. package/src/theme/group-list.scss +9 -7
  63. package/src/theme/index.scss +1 -0
  64. package/src/theme/link.scss +17 -0
  65. package/src/theme/panel.scss +1 -1
  66. package/src/theme/radio-group.scss +23 -0
  67. package/src/theme/tabs.scss +2 -2
  68. package/src/theme/text.scss +38 -0
  69. package/src/theme/themes/magic-admin/index.scss +95 -0
  70. package/src/utils/config.ts +7 -1
  71. package/src/utils/form.ts +37 -0
  72. package/types/index.d.ts +64 -3
@@ -1,16 +1,16 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("@tmagic/design"), require("@tmagic/utils"), require("@element-plus/icons-vue"), require("dayjs"), require("dayjs/plugin/utc"), require("dayjs/plugin/customParseFormat"), require("@popperjs/core")) : typeof define === "function" && define.amd ? define([
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._tmagic_design, global._tmagic_utils, global._element_plus_icons_vue, global.dayjs, global.dayjs_plugin_utc, global.dayjs_plugin_customParseFormat, global._popperjs_core));
13
- })(this, function(exports, vue, _tmagic_design, _tmagic_utils, _element_plus_icons_vue, dayjs, dayjs_plugin_utc, dayjs_plugin_customParseFormat, _popperjs_core) {
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" }
@@ -2720,52 +2720,6 @@
2720
2720
  return baseIsEqual(value, other);
2721
2721
  }
2722
2722
  //#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
2723
  //#region packages/form/src/utils/typeMatch.ts
2770
2724
  dayjs.default.extend(dayjs_plugin_customParseFormat.default);
2771
2725
  var typeMatchRuleRegistry = /* @__PURE__ */ new Map();
@@ -3366,6 +3320,36 @@
3366
3320
  if (order === "ascending") data.sort((a, b) => a[prop] - b[prop]);
3367
3321
  else if (order === "descending") data.sort((a, b) => b[prop] - a[prop]);
3368
3322
  };
3323
+ /**
3324
+ * 将 extendState 返回的扩展字段合并进 formState。
3325
+ *
3326
+ * - data 描述符(普通字段)通过 `formState[key] = value` 写入,走 reactive proxy 的 set,
3327
+ * 触发依赖通知;
3328
+ * - accessor 描述符(`{ get stage() { return ... } }`)按原样 defineProperty,调用方
3329
+ * 可控制读时求值;强制 `configurable: true` 以便下一次合并可再 define。
3330
+ *
3331
+ * 注意:formState 上由 props 派生的字段(keyProp / popperClass / config / initValues /
3332
+ * isCompare / lastValues / parentValues)是只读 getter(无 setter),extendState 若以
3333
+ * 普通字段形式返回同名 key,直接赋值会让 proxy 的 set trap 失败并抛出
3334
+ * `TypeError: 'set' on proxy: trap returned falsish`,这里统一跳过并告警;
3335
+ * 如确需覆盖,可在 extendState 中以 get 访问器形式返回。
3336
+ */
3337
+ var applyExtendState = (formState, state) => {
3338
+ if (!state) return;
3339
+ for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) {
3340
+ if (!("value" in descriptor)) {
3341
+ descriptor.configurable = true;
3342
+ Object.defineProperty(formState, key, descriptor);
3343
+ continue;
3344
+ }
3345
+ const targetDescriptor = Object.getOwnPropertyDescriptor(formState, key);
3346
+ if (targetDescriptor && !("value" in targetDescriptor) && typeof targetDescriptor.set !== "function") {
3347
+ 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.`);
3348
+ continue;
3349
+ }
3350
+ formState[key] = state[key];
3351
+ }
3352
+ };
3369
3353
  var createObjectProp = (prop, key, name) => {
3370
3354
  if (prop === "") return key;
3371
3355
  const itemPath = `${prop}`.split(".");
@@ -3375,6 +3359,54 @@
3375
3359
  return `${[...itemPath, key].join(".")}`;
3376
3360
  };
3377
3361
  //#endregion
3362
+ //#region packages/form/src/utils/useAddField.ts
3363
+ var useAddField = (prop) => {
3364
+ if (!prop) return;
3365
+ const mForm = (0, vue.inject)("mForm");
3366
+ const instance = (0, vue.getCurrentInstance)();
3367
+ (0, vue.watch)(() => instance?.proxy, (vm) => {
3368
+ if (vm) mForm?.setField(prop, vm);
3369
+ else mForm?.deleteField(prop);
3370
+ }, { immediate: true });
3371
+ };
3372
+ //#endregion
3373
+ //#region packages/form/src/fields/Hidden.vue
3374
+ var Hidden_default = /* @__PURE__ */ (0, vue.defineComponent)({
3375
+ name: "MFormHidden",
3376
+ __name: "Hidden",
3377
+ props: {
3378
+ model: {},
3379
+ name: {},
3380
+ prop: {}
3381
+ },
3382
+ setup(__props) {
3383
+ useAddField(__props.prop);
3384
+ return (_ctx, _cache) => {
3385
+ return __props.model ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
3386
+ key: 0,
3387
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3388
+ type: "hidden"
3389
+ }, null, 512)), [[vue.vModelText, __props.model[__props.name]]]) : (0, vue.createCommentVNode)("v-if", true);
3390
+ };
3391
+ }
3392
+ });
3393
+ //#endregion
3394
+ //#region packages/form/src/utils/config.ts
3395
+ var $MAGIC_FORM = {};
3396
+ var isGlobalFlat = (0, vue.ref)(false);
3397
+ var setConfig = (option) => {
3398
+ $MAGIC_FORM = option;
3399
+ isGlobalFlat.value = option.flat ?? false;
3400
+ };
3401
+ var getConfig = (key) => $MAGIC_FORM[key];
3402
+ var fieldRegistry = /* @__PURE__ */ new Map();
3403
+ var registerField = (tagName, component) => {
3404
+ if (fieldRegistry.has(tagName)) return;
3405
+ fieldRegistry.set(tagName, component);
3406
+ };
3407
+ var getField = (tagName) => fieldRegistry.get(tagName);
3408
+ var deleteField = (tagName) => fieldRegistry.delete(tagName);
3409
+ //#endregion
3378
3410
  //#region packages/form/src/containers/FormLabel.vue?vue&type=script&setup=true&lang.ts
3379
3411
  var _hoisted_1$15 = {
3380
3412
  key: 0,
@@ -3383,9 +3415,9 @@
3383
3415
  "align-items": "center"
3384
3416
  }
3385
3417
  };
3386
- var _hoisted_2$8 = ["innerHTML", "title"];
3387
- var _hoisted_3$7 = ["innerHTML"];
3388
- var _hoisted_4$5 = ["innerHTML", "title"];
3418
+ var _hoisted_2$9 = ["innerHTML", "title"];
3419
+ var _hoisted_3$8 = ["innerHTML"];
3420
+ var _hoisted_4$7 = ["innerHTML", "title"];
3389
3421
  //#endregion
3390
3422
  //#region packages/form/src/containers/FormLabel.vue
3391
3423
  var FormLabel_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -3402,11 +3434,11 @@
3402
3434
  return __props.tip ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$15, [(0, vue.createElementVNode)("span", {
3403
3435
  innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
3404
3436
  title: __props.labelTitle
3405
- }, null, 8, _hoisted_2$8), __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
3437
+ }, 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
3438
  key: 0,
3407
3439
  placement: "top"
3408
3440
  }, {
3409
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$7)]),
3441
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$8)]),
3410
3442
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3411
3443
  "margin-left": "5px",
3412
3444
  "display": "flex"
@@ -3419,23 +3451,27 @@
3419
3451
  key: 1,
3420
3452
  innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
3421
3453
  title: __props.labelTitle
3422
- }, null, 8, _hoisted_4$5));
3454
+ }, null, 8, _hoisted_4$7));
3423
3455
  };
3424
3456
  }
3425
3457
  });
3426
3458
  //#endregion
3427
3459
  //#region packages/form/src/containers/Container.vue?vue&type=script&setup=true&lang.ts
3428
3460
  var _hoisted_1$14 = ["data-tmagic-id", "data-tmagic-form-item-prop"];
3429
- var _hoisted_2$7 = ["innerHTML"];
3430
- var _hoisted_3$6 = ["innerHTML"];
3431
- var _hoisted_4$4 = ["innerHTML"];
3432
- var _hoisted_5$3 = ["innerHTML"];
3433
- var _hoisted_6$1 = ["innerHTML"];
3434
- var _hoisted_7$1 = ["innerHTML"];
3435
- var _hoisted_8$1 = ["innerHTML"];
3436
- var _hoisted_9 = {
3461
+ var _hoisted_2$8 = {
3462
+ key: 0,
3463
+ class: "m-form-tip m-form-title-extra"
3464
+ };
3465
+ var _hoisted_3$7 = ["innerHTML"];
3466
+ var _hoisted_4$6 = ["innerHTML"];
3467
+ var _hoisted_5$4 = ["innerHTML"];
3468
+ var _hoisted_6$3 = ["innerHTML"];
3469
+ var _hoisted_7$2 = ["innerHTML"];
3470
+ var _hoisted_8$2 = ["innerHTML"];
3471
+ var _hoisted_9 = ["innerHTML"];
3472
+ var _hoisted_10 = {
3437
3473
  key: 5,
3438
- style: { "text-align": "center" }
3474
+ class: "m-form-container-expand"
3439
3475
  };
3440
3476
  //#endregion
3441
3477
  //#region packages/form/src/containers/Container.vue
@@ -3563,7 +3599,8 @@
3563
3599
  labelWidth: itemLabelWidth.value,
3564
3600
  labelPosition: props.config.labelPosition,
3565
3601
  rules: rule.value,
3566
- extra: filterFunction(mForm, props.config.extra, props)
3602
+ extra: filterFunction(mForm, props.config.extra, props),
3603
+ extraTips: props.config.extraTips
3567
3604
  }));
3568
3605
  const itemLabelWidth = (0, vue.computed)(() => props.config.labelWidth ?? props.labelWidth);
3569
3606
  (0, vue.watchEffect)(() => {
@@ -3721,12 +3758,12 @@
3721
3758
  "use-label",
3722
3759
  "label-title",
3723
3760
  "text"
3724
- ])])]),
3761
+ ]), __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
3762
  default: (0, vue.withCtx)(() => [tooltip.value.text ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
3726
3763
  key: 0,
3727
3764
  placement: tooltip.value.placement
3728
3765
  }, {
3729
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_2$7)]),
3766
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_3$7)]),
3730
3767
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3731
3768
  model: __props.model,
3732
3769
  "last-values": __props.lastValues,
@@ -3755,7 +3792,7 @@
3755
3792
  key: 0,
3756
3793
  placement: "top"
3757
3794
  }, {
3758
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_3$6)]),
3795
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_4$6)]),
3759
3796
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3760
3797
  "line-height": "40px",
3761
3798
  "margin-left": "5px"
@@ -3794,7 +3831,7 @@
3794
3831
  key: 0,
3795
3832
  placement: tooltip.value.placement
3796
3833
  }, {
3797
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_4$4)]),
3834
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_5$4)]),
3798
3835
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3799
3836
  model: __props.model,
3800
3837
  "last-values": __props.lastValues,
@@ -3847,7 +3884,7 @@
3847
3884
  key: 0,
3848
3885
  placement: tooltip.value.placement
3849
3886
  }, {
3850
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_5$3)]),
3887
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_6$3)]),
3851
3888
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3852
3889
  model: __props.lastValues,
3853
3890
  onChange: onChangeHandler
@@ -3863,7 +3900,7 @@
3863
3900
  key: 0,
3864
3901
  placement: "top"
3865
3902
  }, {
3866
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_6$1)]),
3903
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_7$2)]),
3867
3904
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3868
3905
  "line-height": "40px",
3869
3906
  "margin-left": "5px"
@@ -3904,7 +3941,7 @@
3904
3941
  key: 0,
3905
3942
  placement: tooltip.value.placement
3906
3943
  }, {
3907
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_7$1)]),
3944
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_8$2)]),
3908
3945
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3909
3946
  model: __props.model,
3910
3947
  onChange: onChangeHandler
@@ -3920,7 +3957,7 @@
3920
3957
  key: 1,
3921
3958
  placement: "top"
3922
3959
  }, {
3923
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_8$1)]),
3960
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_9)]),
3924
3961
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3925
3962
  "line-height": "40px",
3926
3963
  "margin-left": "5px"
@@ -3962,16 +3999,17 @@
3962
3999
  "label-width",
3963
4000
  "prop"
3964
4001
  ]);
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", _hoisted_9, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
4002
+ }), 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
4003
  type: "primary",
3967
4004
  size: "small",
3968
4005
  disabled: false,
3969
4006
  link: "",
3970
- onClick: expandHandler
4007
+ onClick: expandHandler,
4008
+ icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowUp) : (0, vue.unref)(_element_plus_icons_vue.ArrowDown)
3971
4009
  }, {
3972
4010
  default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(expand.value ? "收起配置" : "展开更多配置"), 1)]),
3973
4011
  _: 1
3974
- })])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
4012
+ }, 8, ["icon"])])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
3975
4013
  };
3976
4014
  }
3977
4015
  });
@@ -4012,7 +4050,8 @@
4012
4050
  },
4013
4051
  extendState: {},
4014
4052
  showDiff: {},
4015
- selfDiffFieldTypes: {}
4053
+ selfDiffFieldTypes: {},
4054
+ theme: {}
4016
4055
  },
4017
4056
  emits: [
4018
4057
  "change",
@@ -4032,6 +4071,25 @@
4032
4071
  const fields = /* @__PURE__ */ new Map();
4033
4072
  const requestFuc = getConfig("request");
4034
4073
  /**
4074
+ * 当前表单生效的主题名称:
4075
+ * - 优先用本组件自己的 `props.theme`;
4076
+ * - 没设置时回退到最近祖先 `<MEditor>` / `<MForm>` provide 的主题,便于内嵌于编辑器
4077
+ * 时自动跟随外层主题,无需在每个 `MForm` 上重复传 `theme`。
4078
+ *
4079
+ * 同时把合并后的值再 provide 出去(见下方 `provide(M_THEME_KEY, ...)`),让 form 子树
4080
+ * 里再嵌套的 portal 组件(`TMagicPopover` 等)依然能拿到非空主题。
4081
+ */
4082
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
4083
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
4084
+ /**
4085
+ * 拼到 `formState.popperClass` 上的主题修饰类(仅 `m-theme--<theme>`,
4086
+ * 不带 `m-form` / `m-editor` 前缀,因为 Element Plus 弹层节点本身既不是 form 也不是 editor)。
4087
+ *
4088
+ * 这条类会随所有读 `mForm.popperClass` 的字段(Select / DateTime / Cascader 等)下发到
4089
+ * Element Plus 的 `popper-class`,让 portal 节点也命中 `m-theme--<theme>` 上的 CSS 变量。
4090
+ */
4091
+ const themeClass = (0, vue.computed)(() => effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : "");
4092
+ /**
4035
4093
  * formState 实现说明:
4036
4094
  *
4037
4095
  * 1. 与 props 直接对应的字段(config / initValues / lastValues / isCompare / parentValues /
@@ -4047,13 +4105,21 @@
4047
4105
  * 把最新值刷进 formState。
4048
4106
  * - accessor 描述符(`{ get stage() { return ... } }`)按原样写入,调用方可以控制
4049
4107
  * 读时求值,每次读取都会重新执行 getter。
4108
+ *
4109
+ * 4. `popperClass` 会自动拼接 `themeClass`:调用方传入的 `popperClass` + 当前主题
4110
+ * 修饰类(含祖先 `<MEditor>` provide 的主题)。这样所有透传到 Element Plus 弹层
4111
+ * `popper-class` 的字段(Select / DateTime / Cascader 等)能自带主题作用域。
4050
4112
  */
4051
4113
  const formState = (0, vue.reactive)({
4052
4114
  get keyProp() {
4053
4115
  return props.keyProp;
4054
4116
  },
4055
4117
  get popperClass() {
4056
- return props.popperClass;
4118
+ const userClass = props.popperClass ?? "";
4119
+ const tc = themeClass.value;
4120
+ if (!userClass) return tc;
4121
+ if (!tc) return userClass;
4122
+ return `${userClass} ${tc}`;
4057
4123
  },
4058
4124
  get config() {
4059
4125
  return props.config;
@@ -4101,11 +4167,10 @@
4101
4167
  * 这里不再重复同步;因此 `props.initValues` 这类高频变化也不会再触发
4102
4168
  * `extendState` 重跑(旧版的性能问题修复点)。
4103
4169
  *
4104
- * 实现细节:
4105
- * - data 描述符:通过 `formState[key] = value` 走 reactive proxy 的 set
4106
- * 触发依赖通知;与旧版「逐项赋值」语义完全等价。
4107
- * - accessor 描述符(`{ get stage() {...} }`)按原样写入 formState,调用方
4108
- * 可以自行控制读时求值;强制 `configurable: true` 以便下一次重跑可再 define。
4170
+ * 实现细节:合并逻辑统一收口在 `applyExtendState`(utils/form)——
4171
+ * data 描述符走 reactive proxy 的 set 触发依赖通知(与旧版「逐项赋值」语义等价),
4172
+ * accessor 描述符按原样 defineProperty 支持读时求值;
4173
+ * props 派生的只读 getter 字段(keyProp 等)以普通字段形式返回时会被跳过并告警。
4109
4174
  */
4110
4175
  (0, vue.watchEffect)(async (onCleanup) => {
4111
4176
  const { extendState } = props;
@@ -4122,13 +4187,16 @@
4122
4187
  return;
4123
4188
  }
4124
4189
  if (stale) return;
4125
- for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(state))) if ("value" in descriptor) formState[key] = state[key];
4126
- else {
4127
- descriptor.configurable = true;
4128
- Object.defineProperty(formState, key, descriptor);
4129
- }
4190
+ applyExtendState(formState, state);
4130
4191
  });
4131
4192
  (0, vue.provide)("mForm", formState);
4193
+ /**
4194
+ * 把生效主题(自身或祖先)再 provide 出去,供 form 子树内含 `Teleport` 的组件
4195
+ * (如 `TMagicPopover`)在传送目标上挂 `m-theme--<theme>` 类。
4196
+ * 详见 `@tmagic/design/theme.ts`。
4197
+ */
4198
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
4199
+ (0, vue.provide)("formInline", props.inline);
4132
4200
  (0, vue.provide)(FORM_DIFF_CONFIG_KEY, {
4133
4201
  get showDiff() {
4134
4202
  return props.showDiff;
@@ -4269,7 +4337,11 @@
4269
4337
  });
4270
4338
  return (_ctx, _cache) => {
4271
4339
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicForm), {
4272
- class: "m-form",
4340
+ class: (0, vue.normalizeClass)([
4341
+ "m-form",
4342
+ effectiveTheme.value ? `m-form--${effectiveTheme.value}` : "",
4343
+ effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""
4344
+ ]),
4273
4345
  ref: "tMagicForm",
4274
4346
  model: values.value,
4275
4347
  "label-width": __props.labelWidth,
@@ -4307,6 +4379,7 @@
4307
4379
  }), 128)) : (0, vue.createCommentVNode)("v-if", true)]),
4308
4380
  _: 3
4309
4381
  }, 8, [
4382
+ "class",
4310
4383
  "model",
4311
4384
  "label-width",
4312
4385
  "style",
@@ -4369,14 +4442,7 @@
4369
4442
  console.error("[MForm] extendState failed:", e);
4370
4443
  return;
4371
4444
  }
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
- };
4445
+ const apply = (state) => applyExtendState(form.formState, state);
4380
4446
  if (result && typeof result.then === "function") result.then(apply, (e) => console.error("[MForm] extendState failed:", e));
4381
4447
  else apply(result);
4382
4448
  }, {
@@ -4783,7 +4849,8 @@
4783
4849
  type: Boolean,
4784
4850
  default: true
4785
4851
  },
4786
- extendState: {}
4852
+ extendState: {},
4853
+ theme: {}
4787
4854
  },
4788
4855
  emits: [
4789
4856
  "close",
@@ -4793,6 +4860,9 @@
4793
4860
  ],
4794
4861
  setup(__props, { expose: __expose, emit: __emit }) {
4795
4862
  const props = __props;
4863
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
4864
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
4865
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
4796
4866
  const emit = __emit;
4797
4867
  const form = (0, vue.ref)();
4798
4868
  const dialogVisible = (0, vue.ref)(false);
@@ -4853,7 +4923,7 @@
4853
4923
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDialog), {
4854
4924
  modelValue: dialogVisible.value,
4855
4925
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
4856
- class: "m-form-dialog",
4926
+ class: (0, vue.normalizeClass)(["m-form-dialog", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
4857
4927
  top: "20px",
4858
4928
  "append-to-body": "",
4859
4929
  title: __props.title,
@@ -4937,6 +5007,7 @@
4937
5007
  "use-field-text-in-error": __props.useFieldTextInError,
4938
5008
  "type-match-valid": __props.typeMatchValid,
4939
5009
  "extend-state": __props.extendState,
5010
+ theme: effectiveTheme.value,
4940
5011
  onChange: changeHandler
4941
5012
  }, null, 8, [
4942
5013
  "modelValue",
@@ -4951,11 +5022,13 @@
4951
5022
  "prevent-submit-default",
4952
5023
  "use-field-text-in-error",
4953
5024
  "type-match-valid",
4954
- "extend-state"
5025
+ "extend-state",
5026
+ "theme"
4955
5027
  ]), (0, vue.renderSlot)(_ctx.$slots, "default")], 4)) : (0, vue.createCommentVNode)("v-if", true)]),
4956
5028
  _: 3
4957
5029
  }, 8, [
4958
5030
  "modelValue",
5031
+ "class",
4959
5032
  "title",
4960
5033
  "width",
4961
5034
  "zIndex",
@@ -4974,7 +5047,7 @@
4974
5047
  //#endregion
4975
5048
  //#region packages/form/src/FormDrawer.vue
4976
5049
  var FormDrawer_default = /* @__PURE__ */ (0, vue.defineComponent)({
4977
- name: "MFormDialog",
5050
+ name: "MFormDrawer",
4978
5051
  __name: "FormDrawer",
4979
5052
  props: {
4980
5053
  config: { default: () => [] },
@@ -5000,7 +5073,8 @@
5000
5073
  default: true
5001
5074
  },
5002
5075
  beforeClose: {},
5003
- extendState: {}
5076
+ extendState: {},
5077
+ theme: {}
5004
5078
  },
5005
5079
  emits: [
5006
5080
  "close",
@@ -5012,11 +5086,15 @@
5012
5086
  "opened"
5013
5087
  ],
5014
5088
  setup(__props, { expose: __expose, emit: __emit }) {
5089
+ const props = __props;
5090
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
5091
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
5092
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
5015
5093
  const emit = __emit;
5016
5094
  const drawer = (0, vue.ref)();
5017
5095
  const form = (0, vue.ref)();
5018
5096
  const drawerBody = (0, vue.ref)();
5019
- const visible = (0, vue.ref)(false);
5097
+ const dialogVisible = (0, vue.ref)(false);
5020
5098
  const saveFetch = (0, vue.ref)(false);
5021
5099
  const bodyHeight = (0, vue.ref)(0);
5022
5100
  (0, vue.watchEffect)(() => {
@@ -5047,30 +5125,48 @@
5047
5125
  emit("closed");
5048
5126
  };
5049
5127
  const show = () => {
5050
- visible.value = true;
5128
+ dialogVisible.value = true;
5051
5129
  };
5052
5130
  const hide = () => {
5053
- visible.value = false;
5131
+ dialogVisible.value = false;
5132
+ };
5133
+ const close = () => {
5134
+ dialogVisible.value = false;
5135
+ };
5136
+ const cancel = () => {
5137
+ hide();
5054
5138
  };
5055
5139
  /** 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */
5056
5140
  const handleClose = () => {
5057
5141
  drawer.value?.handleClose();
5058
5142
  };
5143
+ const save = async () => {
5144
+ try {
5145
+ const changeRecords = [...form.value?.changeRecords || []];
5146
+ const values = await form.value?.submitForm();
5147
+ emit("submit", values, { changeRecords });
5148
+ } catch (e) {
5149
+ emit("error", e);
5150
+ }
5151
+ };
5059
5152
  __expose({
5060
5153
  form,
5061
5154
  saveFetch,
5062
5155
  bodyHeight,
5156
+ close,
5063
5157
  show,
5064
5158
  hide,
5159
+ save,
5160
+ cancel,
5065
5161
  handleClose
5066
5162
  });
5067
5163
  return (_ctx, _cache) => {
5068
5164
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDrawer), {
5069
- class: "m-form-drawer",
5165
+ class: (0, vue.normalizeClass)(["m-form-drawer", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
5070
5166
  ref_key: "drawer",
5071
5167
  ref: drawer,
5072
- modelValue: visible.value,
5073
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
5168
+ modelValue: dialogVisible.value,
5169
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dialogVisible.value = $event),
5074
5170
  title: __props.title,
5075
5171
  "close-on-press-escape": __props.closeOnPressEscape,
5076
5172
  "append-to-body": true,
@@ -5108,7 +5204,7 @@
5108
5204
  })]),
5109
5205
  _: 3
5110
5206
  })]),
5111
- default: (0, vue.withCtx)(() => [visible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
5207
+ default: (0, vue.withCtx)(() => [dialogVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
5112
5208
  key: 0,
5113
5209
  ref_key: "drawerBody",
5114
5210
  ref: drawerBody,
@@ -5128,6 +5224,7 @@
5128
5224
  "use-field-text-in-error": __props.useFieldTextInError,
5129
5225
  "type-match-valid": __props.typeMatchValid,
5130
5226
  "extend-state": __props.extendState,
5227
+ theme: effectiveTheme.value,
5131
5228
  onChange: changeHandler
5132
5229
  }, null, 8, [
5133
5230
  "size",
@@ -5141,10 +5238,12 @@
5141
5238
  "prevent-submit-default",
5142
5239
  "use-field-text-in-error",
5143
5240
  "type-match-valid",
5144
- "extend-state"
5241
+ "extend-state",
5242
+ "theme"
5145
5243
  ]), (0, vue.renderSlot)(_ctx.$slots, "default")], 512)) : (0, vue.createCommentVNode)("v-if", true)]),
5146
5244
  _: 3
5147
5245
  }, 8, [
5246
+ "class",
5148
5247
  "modelValue",
5149
5248
  "title",
5150
5249
  "close-on-press-escape",
@@ -5286,16 +5385,16 @@
5286
5385
  //#endregion
5287
5386
  //#region packages/form/src/containers/Fieldset.vue?vue&type=script&setup=true&lang.ts
5288
5387
  var _hoisted_1$11 = ["innerHTML"];
5289
- var _hoisted_2$6 = ["innerHTML"];
5290
- var _hoisted_3$5 = { key: 1 };
5291
- var _hoisted_4$3 = ["innerHTML"];
5292
- var _hoisted_5$2 = ["innerHTML"];
5293
- var _hoisted_6 = {
5388
+ var _hoisted_2$7 = ["innerHTML"];
5389
+ var _hoisted_3$6 = { key: 1 };
5390
+ var _hoisted_4$5 = ["innerHTML"];
5391
+ var _hoisted_5$3 = ["innerHTML"];
5392
+ var _hoisted_6$2 = {
5294
5393
  key: 2,
5295
5394
  style: { "display": "flex" }
5296
5395
  };
5297
- var _hoisted_7 = { style: { "flex": "1" } };
5298
- var _hoisted_8 = ["src"];
5396
+ var _hoisted_7$1 = { style: { "flex": "1" } };
5397
+ var _hoisted_8$1 = ["src"];
5299
5398
  //#endregion
5300
5399
  //#region packages/form/src/containers/Fieldset.vue
5301
5400
  var Fieldset_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -5365,7 +5464,7 @@
5365
5464
  key: 0,
5366
5465
  innerHTML: __props.config.extra,
5367
5466
  class: "m-form-tip"
5368
- }, null, 8, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true)]),
5467
+ }, null, 8, _hoisted_2$7)) : (0, vue.createCommentVNode)("v-if", true)]),
5369
5468
  _: 1
5370
5469
  }, 8, [
5371
5470
  "model-value",
@@ -5374,11 +5473,11 @@
5374
5473
  "false-value"
5375
5474
  ])]),
5376
5475
  _: 1
5377
- })) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("legend", _hoisted_3$5, [(0, vue.createElementVNode)("span", { innerHTML: legend.value }, null, 8, _hoisted_4$3), __props.config.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
5476
+ })) : ((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
5477
  key: 0,
5379
5478
  innerHTML: __props.config.extra,
5380
5479
  class: "m-form-tip"
5381
- }, null, 8, _hoisted_5$2)) : (0, vue.createCommentVNode)("v-if", true)])), __props.config.schematic && show.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [(0, vue.createElementVNode)("div", _hoisted_7, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.config.items, (item, index) => {
5480
+ }, 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
5481
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
5383
5482
  key: key(item, index),
5384
5483
  model: name.value ? __props.model[name.value] : __props.model,
@@ -5406,7 +5505,7 @@
5406
5505
  }), 128))]), (0, vue.createElementVNode)("img", {
5407
5506
  class: "m-form-schematic",
5408
5507
  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) => {
5508
+ }, 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
5509
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
5411
5510
  key: key(item, index),
5412
5511
  model: name.value ? __props.model[name.value] : __props.model,
@@ -5503,13 +5602,13 @@
5503
5602
  "display": "flex",
5504
5603
  "align-items": "center"
5505
5604
  } };
5506
- var _hoisted_2$5 = ["innerHTML"];
5507
- var _hoisted_3$4 = {
5605
+ var _hoisted_2$6 = ["innerHTML"];
5606
+ var _hoisted_3$5 = {
5508
5607
  key: 0,
5509
5608
  style: { "display": "flex" }
5510
5609
  };
5511
- var _hoisted_4$2 = { style: { "flex": "1" } };
5512
- var _hoisted_5$1 = ["src"];
5610
+ var _hoisted_4$4 = { style: { "flex": "1" } };
5611
+ var _hoisted_5$2 = ["src"];
5513
5612
  //#endregion
5514
5613
  //#region packages/form/src/containers/Panel.vue
5515
5614
  var Panel_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -5524,7 +5623,8 @@
5524
5623
  labelWidth: {},
5525
5624
  prop: {},
5526
5625
  size: {},
5527
- disabled: { type: Boolean }
5626
+ disabled: { type: Boolean },
5627
+ hideExpand: { type: Boolean }
5528
5628
  },
5529
5629
  emits: ["change", "addDiffCount"],
5530
5630
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -5548,26 +5648,31 @@
5548
5648
  return items.value && items.value.length ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
5549
5649
  key: 0,
5550
5650
  class: "box-card m-form-panel",
5551
- "body-style": { display: expand.value ? "block" : "none" }
5651
+ "body-style": { display: expand.value ? "block" : "none" },
5652
+ flat: __props.config.flat
5552
5653
  }, {
5553
5654
  header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$10, [
5554
- (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
5555
- style: { "padding": "0" },
5655
+ !__props.hideExpand ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5656
+ key: 0,
5657
+ style: {
5658
+ "padding": "0",
5659
+ "margin-right": "10px"
5660
+ },
5556
5661
  link: "",
5557
- icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.CaretBottom) : (0, vue.unref)(_element_plus_icons_vue.CaretRight),
5662
+ icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowDown) : (0, vue.unref)(_element_plus_icons_vue.ArrowRight),
5558
5663
  onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
5559
- }, null, 8, ["icon"]),
5664
+ }, null, 8, ["icon"])) : (0, vue.createCommentVNode)("v-if", true),
5560
5665
  (0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createElementVNode)("span", {
5561
5666
  style: { "cursor": "pointer" },
5562
5667
  onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
5563
5668
  }, (0, vue.toDisplayString)(filter(__props.config.title)), 1)]),
5564
5669
  __props.config && __props.config.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
5565
- key: 0,
5670
+ key: 1,
5566
5671
  innerHTML: __props.config.extra,
5567
5672
  class: "m-form-tip"
5568
- }, null, 8, _hoisted_2$5)) : (0, vue.createCommentVNode)("v-if", true)
5673
+ }, null, 8, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true)
5569
5674
  ])]),
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$4, [(0, vue.createElementVNode)("div", _hoisted_4$2, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(items.value, (item, index) => {
5675
+ 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
5676
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
5572
5677
  key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
5573
5678
  config: item,
@@ -5593,7 +5698,7 @@
5593
5698
  }), 128))]), (0, vue.createElementVNode)("img", {
5594
5699
  class: "m-form-schematic",
5595
5700
  src: __props.config.schematic
5596
- }, null, 8, _hoisted_5$1)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(items.value, (item, index) => {
5701
+ }, null, 8, _hoisted_5$2)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(items.value, (item, index) => {
5597
5702
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
5598
5703
  key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
5599
5704
  config: item,
@@ -5618,7 +5723,7 @@
5618
5723
  ]);
5619
5724
  }), 128))])]),
5620
5725
  _: 3
5621
- }, 8, ["body-style"])) : (0, vue.createCommentVNode)("v-if", true);
5726
+ }, 8, ["body-style", "flat"])) : (0, vue.createCommentVNode)("v-if", true);
5622
5727
  };
5623
5728
  }
5624
5729
  });
@@ -5932,12 +6037,13 @@
5932
6037
  });
5933
6038
  //#endregion
5934
6039
  //#region packages/form/src/containers/GroupListItem.vue?vue&type=script&setup=true&lang.ts
5935
- var _hoisted_1$9 = ["innerHTML"];
5936
- var _hoisted_2$4 = { style: {
6040
+ var _hoisted_1$9 = { class: "m-fields-group-list-item-header" };
6041
+ var _hoisted_2$5 = ["innerHTML"];
6042
+ var _hoisted_3$4 = { style: {
5937
6043
  "text-align": "right",
5938
6044
  "margin-top": "20px"
5939
6045
  } };
5940
- var _hoisted_3$3 = ["innerHTML"];
6046
+ var _hoisted_4$3 = ["innerHTML"];
5941
6047
  //#endregion
5942
6048
  //#region packages/form/src/containers/GroupListItem.vue
5943
6049
  var GroupListItem_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -5976,7 +6082,10 @@
5976
6082
  [mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
5977
6083
  }));
5978
6084
  const title = (0, vue.computed)(() => {
5979
- if (props.config.titleKey && props.model[props.config.titleKey]) return props.model[props.config.titleKey];
6085
+ if (props.config.titleKey && props.model[props.config.titleKey]) {
6086
+ const { titlePrefix } = props.config;
6087
+ return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
6088
+ }
5980
6089
  if (props.config.title) return filterFunction(mForm, props.config.title, props);
5981
6090
  return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
5982
6091
  });
@@ -6015,33 +6124,39 @@
6015
6124
  return (_ctx, _cache) => {
6016
6125
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
6017
6126
  class: "m-fields-group-list-item",
6127
+ flat: __props.config.flat,
6018
6128
  "body-style": { display: expand.value ? "block" : "none" }
6019
6129
  }, {
6020
- header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [
6130
+ header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$9, [
6021
6131
  (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6022
6132
  link: "",
6023
6133
  disabled: __props.disabled,
6024
- onClick: expandHandler
6134
+ onClick: expandHandler,
6135
+ class: "expand-button"
6025
6136
  }, {
6026
6137
  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.CaretBottom), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_element_plus_icons_vue.CaretRight), { key: 1 }))]),
6138
+ 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
6139
  _: 1
6029
- }), (0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_1$9)]),
6140
+ })]),
6030
6141
  _: 1
6031
6142
  }, 8, ["disabled"]),
6032
- !__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6033
- key: 0,
6034
- type: "danger",
6035
- size: "small",
6036
- link: "",
6037
- icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
6038
- disabled: __props.disabled,
6039
- onClick: removeHandler
6040
- }, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true),
6143
+ (0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_2$5),
6144
+ (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicTooltip), { content: `删除 ${title.value}` }, {
6145
+ default: (0, vue.withCtx)(() => [!__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6146
+ key: 0,
6147
+ size: "default",
6148
+ link: "",
6149
+ class: "delete-button",
6150
+ icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
6151
+ disabled: __props.disabled,
6152
+ onClick: removeHandler
6153
+ }, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true)]),
6154
+ _: 1
6155
+ }, 8, ["content"]),
6041
6156
  copyable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6042
- key: 1,
6157
+ key: 0,
6043
6158
  link: "",
6044
- size: "small",
6159
+ size: "default",
6045
6160
  type: "primary",
6046
6161
  icon: (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
6047
6162
  disabled: __props.disabled,
@@ -6050,27 +6165,27 @@
6050
6165
  default: (0, vue.withCtx)(() => [..._cache[6] || (_cache[6] = [(0, vue.createTextVNode)("复制", -1)])]),
6051
6166
  _: 1
6052
6167
  }, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true),
6053
- movable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6168
+ 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
6169
  link: "",
6055
- size: "small",
6170
+ size: "default",
6056
6171
  disabled: __props.disabled,
6057
- icon: (0, vue.unref)(_element_plus_icons_vue.CaretTop),
6172
+ icon: (0, vue.unref)(_element_plus_icons_vue.Top),
6058
6173
  onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
6059
6174
  }, {
6060
6175
  default: (0, vue.withCtx)(() => [..._cache[7] || (_cache[7] = [(0, vue.createTextVNode)("上移", -1)])]),
6061
6176
  _: 1
6062
6177
  }, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== 0]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6063
6178
  link: "",
6064
- size: "small",
6179
+ size: "default",
6065
6180
  disabled: __props.disabled,
6066
- icon: (0, vue.unref)(_element_plus_icons_vue.CaretBottom),
6181
+ icon: (0, vue.unref)(_element_plus_icons_vue.Bottom),
6067
6182
  onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
6068
6183
  }, {
6069
6184
  default: (0, vue.withCtx)(() => [..._cache[8] || (_cache[8] = [(0, vue.createTextVNode)("下移", -1)])]),
6070
6185
  _: 1
6071
6186
  }, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== length.value - 1]])], 64)) : (0, vue.createCommentVNode)("v-if", true),
6072
6187
  __props.config.moveSpecifyLocation && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicPopover), {
6073
- key: 3,
6188
+ key: 2,
6074
6189
  trigger: "click",
6075
6190
  placement: "top",
6076
6191
  width: "200",
@@ -6098,7 +6213,7 @@
6098
6213
  disabled: __props.disabled
6099
6214
  }, null, 8, ["modelValue", "disabled"]),
6100
6215
  _cache[11] || (_cache[11] = (0, vue.createTextVNode)("行 ", -1))
6101
- ]), (0, vue.createElementVNode)("div", _hoisted_2$4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6216
+ ]), (0, vue.createElementVNode)("div", _hoisted_3$4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6102
6217
  size: "small",
6103
6218
  text: "",
6104
6219
  onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
@@ -6116,10 +6231,10 @@
6116
6231
  _: 1
6117
6232
  }, 8, ["visible"])) : (0, vue.createCommentVNode)("v-if", true),
6118
6233
  itemExtra.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
6119
- key: 4,
6234
+ key: 3,
6120
6235
  innerHTML: itemExtra.value,
6121
6236
  class: "m-form-tip"
6122
- }, null, 8, _hoisted_3$3)) : (0, vue.createCommentVNode)("v-if", true)
6237
+ }, null, 8, _hoisted_4$3)) : (0, vue.createCommentVNode)("v-if", true)
6123
6238
  ])]),
6124
6239
  default: (0, vue.withCtx)(() => [expand.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
6125
6240
  key: 0,
@@ -6144,23 +6259,24 @@
6144
6259
  "disabled"
6145
6260
  ])) : (0, vue.createCommentVNode)("v-if", true)]),
6146
6261
  _: 1
6147
- }, 8, ["body-style"]);
6262
+ }, 8, ["flat", "body-style"]);
6148
6263
  };
6149
6264
  }
6150
6265
  });
6151
6266
  //#endregion
6152
6267
  //#region packages/form/src/containers/GroupList.vue?vue&type=script&setup=true&lang.ts
6153
6268
  var _hoisted_1$8 = { class: "m-fields-group-list" };
6154
- var _hoisted_2$3 = ["innerHTML"];
6155
- var _hoisted_3$2 = {
6269
+ var _hoisted_2$4 = ["innerHTML"];
6270
+ var _hoisted_3$3 = {
6156
6271
  key: 1,
6157
6272
  class: "el-table__empty-block"
6158
6273
  };
6159
- var _hoisted_4$1 = {
6274
+ var _hoisted_4$2 = { class: "el-table__empty-text t-table__empty" };
6275
+ var _hoisted_5$1 = {
6160
6276
  key: 3,
6161
6277
  class: "m-fields-group-list-footer"
6162
6278
  };
6163
- var _hoisted_5 = { style: {
6279
+ var _hoisted_6$1 = { style: {
6164
6280
  "display": "flex",
6165
6281
  "justify-content": "flex-end",
6166
6282
  "flex": "1"
@@ -6212,8 +6328,8 @@
6212
6328
  key: 0,
6213
6329
  innerHTML: __props.config.extra,
6214
6330
  style: { "color": "rgba(0, 0, 0, 0.45)" }
6215
- }, null, 8, _hoisted_2$3)) : (0, vue.createCommentVNode)("v-if", true),
6216
- !__props.model[__props.name] || !__props.model[__props.name].length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$2, [..._cache[1] || (_cache[1] = [(0, vue.createElementVNode)("span", { class: "el-table__empty-text t-table__empty" }, "暂无数据", -1)])])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, (0, vue.renderList)(__props.model[__props.name], (item, index) => {
6331
+ }, null, 8, _hoisted_2$4)) : (0, vue.createCommentVNode)("v-if", true),
6332
+ !__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
6333
  return (0, vue.openBlock)(), (0, vue.createBlock)(GroupListItem_default, {
6218
6334
  key: index,
6219
6335
  model: item,
@@ -6244,7 +6360,7 @@
6244
6360
  "group-model"
6245
6361
  ]);
6246
6362
  }), 128)),
6247
- !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$1, [(0, vue.renderSlot)(_ctx.$slots, "toggle-button"), (0, vue.createElementVNode)("div", _hoisted_5, [(0, vue.renderSlot)(_ctx.$slots, "add-button")])])) : (0, vue.createCommentVNode)("v-if", true)
6363
+ !__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
6364
  ]);
6249
6365
  };
6250
6366
  }
@@ -6406,7 +6522,8 @@
6406
6522
  index: {},
6407
6523
  row: {},
6408
6524
  prop: {},
6409
- sortKey: {}
6525
+ sortKey: {},
6526
+ flat: { type: Boolean }
6410
6527
  },
6411
6528
  emits: ["change"],
6412
6529
  setup(__props, { emit: __emit }) {
@@ -6477,19 +6594,25 @@
6477
6594
  type: "danger",
6478
6595
  link: "",
6479
6596
  title: "删除",
6480
- icon: __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
6597
+ icon: __props.flat ? void 0 : __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
6481
6598
  onClick: _cache[0] || (_cache[0] = ($event) => removeHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
6482
- }, null, 8, ["icon"]), [[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
6599
+ }, {
6600
+ 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)]),
6601
+ _: 1
6602
+ }, 8, ["icon"]), [[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
6483
6603
  copyable(__props.index + 1 + __props.currentPage * __props.pageSize - 1) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6484
6604
  key: 1,
6485
6605
  link: "",
6486
6606
  size: "small",
6487
6607
  type: "primary",
6488
6608
  title: "复制",
6489
- icon: __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
6609
+ icon: __props.flat ? void 0 : __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
6490
6610
  disabled: __props.disabled,
6491
6611
  onClick: _cache[1] || (_cache[1] = ($event) => copyHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
6492
- }, null, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
6612
+ }, {
6613
+ 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)]),
6614
+ _: 1
6615
+ }, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
6493
6616
  ], 64);
6494
6617
  };
6495
6618
  }
@@ -6639,8 +6762,10 @@
6639
6762
  type: "selection",
6640
6763
  width: 45
6641
6764
  } });
6642
- let actionFixed = props.config.fixed === false ? void 0 : "left";
6765
+ const defaultFixed = isGlobalFlat.value ? "right" : "left";
6766
+ let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
6643
6767
  if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
6768
+ const actionFlat = props.config.flat === void 0 && isGlobalFlat.value ? true : props.config.flat;
6644
6769
  const actionColumn = {
6645
6770
  props: {
6646
6771
  label: "操作",
@@ -6650,6 +6775,7 @@
6650
6775
  },
6651
6776
  cell: ({ row, $index }) => (0, vue.h)(ActionsColumn_default, {
6652
6777
  row,
6778
+ flat: actionFlat,
6653
6779
  index: $index,
6654
6780
  model: props.model,
6655
6781
  config: props.config,
@@ -6732,13 +6858,13 @@
6732
6858
  //#endregion
6733
6859
  //#region packages/form/src/containers/table/Table.vue?vue&type=script&setup=true&lang.ts
6734
6860
  var _hoisted_1$7 = ["innerHTML"];
6735
- var _hoisted_2$2 = { style: {
6861
+ var _hoisted_2$3 = { style: {
6736
6862
  "display": "flex",
6737
6863
  "justify-content": "space-between",
6738
6864
  "margin": "10px 0"
6739
6865
  } };
6740
- var _hoisted_3$1 = { style: { "display": "flex" } };
6741
- var _hoisted_4 = {
6866
+ var _hoisted_3$2 = { style: { "display": "flex" } };
6867
+ var _hoisted_4$1 = {
6742
6868
  key: 1,
6743
6869
  class: "bottom",
6744
6870
  style: { "text-align": "right" }
@@ -6823,19 +6949,21 @@
6823
6949
  "default-expand-all": true,
6824
6950
  key: updateKey.value,
6825
6951
  onSelect: (0, vue.unref)(selectHandle),
6826
- onSortChange: sortChangeHandler
6952
+ onSortChange: sortChangeHandler,
6953
+ "empty-text": `暂无${__props.config.titlePrefix || ""}数据`
6827
6954
  }, null, 8, [
6828
6955
  "row-key",
6829
6956
  "columns",
6830
6957
  "data",
6831
6958
  "border",
6832
6959
  "max-height",
6833
- "onSelect"
6960
+ "onSelect",
6961
+ "empty-text"
6834
6962
  ])) : (0, vue.createCommentVNode)("v-if", true)]),
6835
6963
  _: 1
6836
6964
  }, 8, ["disabled"]),
6837
6965
  (0, vue.renderSlot)(_ctx.$slots, "default"),
6838
- (0, vue.createElementVNode)("div", _hoisted_2$2, [(0, vue.createElementVNode)("div", _hoisted_3$1, [
6966
+ (0, vue.createElementVNode)("div", _hoisted_2$3, [(0, vue.createElementVNode)("div", _hoisted_3$2, [
6839
6967
  !(0, vue.unref)(isFullscreen) ? (0, vue.renderSlot)(_ctx.$slots, "toggle-button", {}, void 0, void 0, 0) : (0, vue.createCommentVNode)("v-if", true),
6840
6968
  __props.config.enableFullscreen !== false ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6841
6969
  key: 1,
@@ -6878,7 +7006,7 @@
6878
7006
  _: 1
6879
7007
  }, 8, ["disabled", "onClick"])) : (0, vue.createCommentVNode)("v-if", true)
6880
7008
  ]), !__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), {
7009
+ __props.config.pagination ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$1, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicPagination), {
6882
7010
  layout: "total, sizes, prev, pager, next, jumper",
6883
7011
  "hide-on-single-page": __props.model[modelName.value].length < (0, vue.unref)(pageSize),
6884
7012
  "current-page": (0, vue.unref)(currentPage) + 1,
@@ -7098,9 +7226,10 @@
7098
7226
  size: addButtonSize.value,
7099
7227
  plain: displayMode.value === "table",
7100
7228
  icon: (0, vue.unref)(_element_plus_icons_vue.Plus),
7229
+ text: "",
7101
7230
  disabled: __props.disabled
7102
7231
  }, 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" ? "新增一行" : "新增")), 1)]),
7232
+ 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
7233
  _: 1
7105
7234
  }, 16, [
7106
7235
  "class",
@@ -7130,9 +7259,17 @@
7130
7259
  });
7131
7260
  //#endregion
7132
7261
  //#region packages/form/src/fields/Text.vue?vue&type=script&setup=true&lang.ts
7133
- var _hoisted_1$6 = { class: "m-fields-text" };
7134
- var _hoisted_2$1 = { key: 1 };
7135
- var _hoisted_3 = { style: {
7262
+ var _hoisted_1$6 = { key: 0 };
7263
+ var _hoisted_2$2 = {
7264
+ key: 0,
7265
+ class: "m-fields-text__prepend"
7266
+ };
7267
+ var _hoisted_3$1 = { class: "m-fields-text__value" };
7268
+ var _hoisted_4 = ["src"];
7269
+ var _hoisted_5 = { key: 2 };
7270
+ var _hoisted_6 = ["src"];
7271
+ var _hoisted_7 = { key: 2 };
7272
+ var _hoisted_8 = { style: {
7136
7273
  "display": "flex",
7137
7274
  "justify-content": "flex-end"
7138
7275
  } };
@@ -7151,7 +7288,10 @@
7151
7288
  disabled: { type: Boolean },
7152
7289
  size: {},
7153
7290
  lastValues: {},
7154
- isCompare: { type: Boolean }
7291
+ isCompare: { type: Boolean },
7292
+ text: {},
7293
+ labelWidth: {},
7294
+ labelPosition: {}
7155
7295
  },
7156
7296
  emits: ["change", "input"],
7157
7297
  setup(__props, { emit: __emit }) {
@@ -7164,21 +7304,15 @@
7164
7304
  value.value = v;
7165
7305
  }, { immediate: true });
7166
7306
  const appendConfig = (0, vue.computed)(() => {
7167
- if (typeof props.config.append === "string") return {
7307
+ const { append } = props.config;
7308
+ if (typeof append === "string") return {
7168
7309
  type: "text",
7169
- text: props.config.append,
7310
+ text: append,
7170
7311
  handler: void 0
7171
7312
  };
7172
- if (typeof props.config.append === "object") {
7173
- if (typeof props.config.append?.handler === "function") return {
7174
- type: "button",
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
- }
7313
+ if (typeof append === "object" && append) {
7314
+ if (append.value === 0) return false;
7315
+ return append;
7182
7316
  }
7183
7317
  return false;
7184
7318
  });
@@ -7274,67 +7408,97 @@
7274
7408
  instanceRef.value = void 0;
7275
7409
  };
7276
7410
  return (_ctx, _cache) => {
7277
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicInput), {
7278
- modelValue: value.value,
7279
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
7280
- ref_key: "input",
7281
- ref: input,
7282
- clearable: __props.config.clearable ?? true,
7283
- size: __props.size,
7284
- placeholder: __props.config.placeholder,
7285
- disabled: __props.disabled,
7286
- onChange: changeHandler,
7287
- onInput: inputHandler,
7288
- onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
7289
- }, (0, vue.createSlots)({ _: 2 }, [__props.config.prepend ? {
7290
- name: "prepend",
7291
- fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.config.prepend), 1)]),
7292
- key: "0"
7293
- } : void 0, appendConfig.value ? {
7294
- name: "append",
7295
- fn: (0, vue.withCtx)(() => [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
7296
- key: 0,
7297
- style: { "color": "#409eff" },
7411
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["m-fields-text", { "m-fields-text--static": __props.config.static }]) }, [
7412
+ __props.config.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6)) : (0, vue.createCommentVNode)("v-if", true),
7413
+ (0, vue.createCommentVNode)(" 新增静态展示文本样式 "),
7414
+ __props.config.static ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [
7415
+ __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),
7416
+ (0, vue.createElementVNode)("span", _hoisted_3$1, (0, vue.toDisplayString)(value.value), 1),
7417
+ 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), {
7418
+ key: 0,
7419
+ style: { "color": "#0056ea" },
7420
+ size: __props.size,
7421
+ onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
7422
+ }, {
7423
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
7424
+ _: 1
7425
+ }, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
7426
+ key: 1,
7427
+ class: "m-fields-text__icon",
7428
+ src: appendConfig.value.text,
7429
+ onClick: buttonClickHandler
7430
+ }, 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)
7431
+ ], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicInput), {
7432
+ key: 2,
7433
+ modelValue: value.value,
7434
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
7435
+ ref_key: "input",
7436
+ ref: input,
7437
+ clearable: __props.config.clearable ?? true,
7298
7438
  size: __props.size,
7299
- onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
7300
- }, {
7301
- default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
7302
- _: 1
7303
- }, 8, ["size"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$1, (0, vue.toDisplayString)(appendConfig.value.text), 1))]),
7304
- key: "1"
7305
- } : void 0]), 1032, [
7306
- "modelValue",
7307
- "clearable",
7308
- "size",
7309
- "placeholder",
7310
- "disabled"
7311
- ]), ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, { to: "body" }, [popoverVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
7312
- key: 0,
7313
- class: "tmagic-form-text-popper m-form-item__content",
7314
- ref_key: "popoverEl",
7315
- ref: popoverEl
7316
- }, [
7317
- _cache[5] || (_cache[5] = (0, vue.createElementVNode)("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
7318
- (0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7319
- link: "",
7320
- size: "small",
7321
- onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
7322
- }, {
7323
- default: (0, vue.withCtx)(() => [..._cache[3] || (_cache[3] = [(0, vue.createTextVNode)("保持原样", -1)])]),
7324
- _: 1
7325
- }), (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7326
- type: "primary",
7327
- size: "small",
7328
- onClick: confirmTrimHandler
7329
- }, {
7330
- default: (0, vue.withCtx)(() => [..._cache[4] || (_cache[4] = [(0, vue.createTextVNode)("移除空格", -1)])]),
7331
- _: 1
7332
- })]),
7333
- _cache[6] || (_cache[6] = (0, vue.createElementVNode)("span", {
7334
- class: "tmagic-form-text-popper-arrow",
7335
- "data-popper-arrow": ""
7336
- }, null, -1))
7337
- ], 512)) : (0, vue.createCommentVNode)("v-if", true)]))]);
7439
+ placeholder: __props.config.placeholder,
7440
+ disabled: __props.disabled,
7441
+ onChange: changeHandler,
7442
+ onInput: inputHandler,
7443
+ onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
7444
+ }, (0, vue.createSlots)({ _: 2 }, [__props.config.prepend ? {
7445
+ name: "prepend",
7446
+ fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.config.prepend), 1)]),
7447
+ key: "0"
7448
+ } : void 0, appendConfig.value ? {
7449
+ name: "append",
7450
+ fn: (0, vue.withCtx)(() => [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
7451
+ key: 0,
7452
+ style: { "color": "#0056ea" },
7453
+ size: __props.size,
7454
+ onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
7455
+ }, {
7456
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
7457
+ _: 1
7458
+ }, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
7459
+ key: 1,
7460
+ src: appendConfig.value.text,
7461
+ onClick: buttonClickHandler
7462
+ }, null, 8, _hoisted_6)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7, (0, vue.toDisplayString)(appendConfig.value.text), 1))]),
7463
+ key: "1"
7464
+ } : void 0]), 1032, [
7465
+ "modelValue",
7466
+ "clearable",
7467
+ "size",
7468
+ "placeholder",
7469
+ "disabled"
7470
+ ])),
7471
+ !__props.config.static ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
7472
+ key: 3,
7473
+ to: "body"
7474
+ }, [popoverVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
7475
+ key: 0,
7476
+ class: "tmagic-form-text-popper m-form-item__content",
7477
+ ref_key: "popoverEl",
7478
+ ref: popoverEl
7479
+ }, [
7480
+ _cache[5] || (_cache[5] = (0, vue.createElementVNode)("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
7481
+ (0, vue.createElementVNode)("div", _hoisted_8, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7482
+ link: "",
7483
+ size: "small",
7484
+ onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
7485
+ }, {
7486
+ default: (0, vue.withCtx)(() => [..._cache[3] || (_cache[3] = [(0, vue.createTextVNode)("保持原样", -1)])]),
7487
+ _: 1
7488
+ }), (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7489
+ type: "primary",
7490
+ size: "small",
7491
+ onClick: confirmTrimHandler
7492
+ }, {
7493
+ default: (0, vue.withCtx)(() => [..._cache[4] || (_cache[4] = [(0, vue.createTextVNode)("移除空格", -1)])]),
7494
+ _: 1
7495
+ })]),
7496
+ _cache[6] || (_cache[6] = (0, vue.createElementVNode)("span", {
7497
+ class: "tmagic-form-text-popper-arrow",
7498
+ "data-popper-arrow": ""
7499
+ }, null, -1))
7500
+ ], 512)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true)
7501
+ ], 2);
7338
7502
  };
7339
7503
  }
7340
7504
  });
@@ -7353,7 +7517,10 @@
7353
7517
  disabled: { type: Boolean },
7354
7518
  size: {},
7355
7519
  lastValues: {},
7356
- isCompare: { type: Boolean }
7520
+ isCompare: { type: Boolean },
7521
+ text: {},
7522
+ labelWidth: {},
7523
+ labelPosition: {}
7357
7524
  },
7358
7525
  emits: ["change", "input"],
7359
7526
  setup(__props, { emit: __emit }) {
@@ -7378,7 +7545,7 @@
7378
7545
  modelValue: value.value,
7379
7546
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
7380
7547
  clearable: "",
7381
- "controls-position": "right",
7548
+ "controls-position": (0, vue.unref)(isGlobalFlat) ? "" : "right",
7382
7549
  size: __props.size,
7383
7550
  max: __props.config.max,
7384
7551
  min: __props.config.min,
@@ -7389,6 +7556,7 @@
7389
7556
  onInput: inputHandler
7390
7557
  }, null, 8, [
7391
7558
  "modelValue",
7559
+ "controls-position",
7392
7560
  "size",
7393
7561
  "max",
7394
7562
  "min",
@@ -7417,7 +7585,10 @@
7417
7585
  disabled: { type: Boolean },
7418
7586
  size: {},
7419
7587
  lastValues: {},
7420
- isCompare: { type: Boolean }
7588
+ isCompare: { type: Boolean },
7589
+ text: {},
7590
+ labelWidth: {},
7591
+ labelPosition: {}
7421
7592
  },
7422
7593
  emits: ["change"],
7423
7594
  setup(__props, { emit: __emit }) {
@@ -7488,7 +7659,10 @@
7488
7659
  disabled: { type: Boolean },
7489
7660
  size: {},
7490
7661
  lastValues: {},
7491
- isCompare: { type: Boolean }
7662
+ isCompare: { type: Boolean },
7663
+ text: {},
7664
+ labelWidth: {},
7665
+ labelPosition: {}
7492
7666
  },
7493
7667
  emits: ["change", "input"],
7494
7668
  setup(__props, { emit: __emit }) {
@@ -7544,7 +7718,10 @@
7544
7718
  disabled: { type: Boolean },
7545
7719
  size: {},
7546
7720
  lastValues: {},
7547
- isCompare: { type: Boolean }
7721
+ isCompare: { type: Boolean },
7722
+ text: {},
7723
+ labelWidth: {},
7724
+ labelPosition: {}
7548
7725
  },
7549
7726
  emits: ["change"],
7550
7727
  setup(__props, { emit: __emit }) {
@@ -7591,7 +7768,10 @@
7591
7768
  disabled: { type: Boolean },
7592
7769
  size: {},
7593
7770
  lastValues: {},
7594
- isCompare: { type: Boolean }
7771
+ isCompare: { type: Boolean },
7772
+ text: {},
7773
+ labelWidth: {},
7774
+ labelPosition: {}
7595
7775
  },
7596
7776
  emits: ["change"],
7597
7777
  setup(__props, { emit: __emit }) {
@@ -7643,7 +7823,10 @@
7643
7823
  disabled: { type: Boolean },
7644
7824
  size: {},
7645
7825
  lastValues: {},
7646
- isCompare: { type: Boolean }
7826
+ isCompare: { type: Boolean },
7827
+ text: {},
7828
+ labelWidth: {},
7829
+ labelPosition: {}
7647
7830
  },
7648
7831
  emits: ["change"],
7649
7832
  setup(__props, { emit: __emit }) {
@@ -7688,7 +7871,10 @@
7688
7871
  disabled: { type: Boolean },
7689
7872
  size: {},
7690
7873
  lastValues: {},
7691
- isCompare: { type: Boolean }
7874
+ isCompare: { type: Boolean },
7875
+ text: {},
7876
+ labelWidth: {},
7877
+ labelPosition: {}
7692
7878
  },
7693
7879
  emits: ["change"],
7694
7880
  setup(__props, { emit: __emit }) {
@@ -7745,7 +7931,10 @@
7745
7931
  disabled: { type: Boolean },
7746
7932
  size: {},
7747
7933
  lastValues: {},
7748
- isCompare: { type: Boolean }
7934
+ isCompare: { type: Boolean },
7935
+ text: {},
7936
+ labelWidth: {},
7937
+ labelPosition: {}
7749
7938
  },
7750
7939
  emits: ["change"],
7751
7940
  setup(__props, { emit: __emit }) {
@@ -7800,7 +7989,10 @@
7800
7989
  disabled: { type: Boolean },
7801
7990
  size: {},
7802
7991
  lastValues: {},
7803
- isCompare: { type: Boolean }
7992
+ isCompare: { type: Boolean },
7993
+ text: {},
7994
+ labelWidth: {},
7995
+ labelPosition: {}
7804
7996
  },
7805
7997
  emits: ["change"],
7806
7998
  setup(__props, { emit: __emit }) {
@@ -7894,7 +8086,10 @@
7894
8086
  disabled: { type: Boolean },
7895
8087
  size: {},
7896
8088
  lastValues: {},
7897
- isCompare: { type: Boolean }
8089
+ isCompare: { type: Boolean },
8090
+ text: {},
8091
+ labelWidth: {},
8092
+ labelPosition: {}
7898
8093
  },
7899
8094
  emits: ["change"],
7900
8095
  setup(__props, { emit: __emit }) {
@@ -7988,7 +8183,10 @@
7988
8183
  disabled: { type: Boolean },
7989
8184
  size: {},
7990
8185
  lastValues: {},
7991
- isCompare: { type: Boolean }
8186
+ isCompare: { type: Boolean },
8187
+ text: {},
8188
+ labelWidth: {},
8189
+ labelPosition: {}
7992
8190
  },
7993
8191
  emits: ["change"],
7994
8192
  setup(__props, { emit: __emit }) {
@@ -8026,7 +8224,10 @@
8026
8224
  disabled: { type: Boolean },
8027
8225
  size: {},
8028
8226
  lastValues: {},
8029
- isCompare: { type: Boolean }
8227
+ isCompare: { type: Boolean },
8228
+ text: {},
8229
+ labelWidth: {},
8230
+ labelPosition: {}
8030
8231
  },
8031
8232
  emits: ["change"],
8032
8233
  setup(__props, { emit: __emit }) {
@@ -8071,7 +8272,11 @@
8071
8272
  });
8072
8273
  //#endregion
8073
8274
  //#region packages/form/src/fields/RadioGroup.vue?vue&type=script&setup=true&lang.ts
8074
- var _hoisted_1$4 = { key: 1 };
8275
+ var _hoisted_1$4 = { class: "m-fields-radio-group__option" };
8276
+ var _hoisted_2$1 = {
8277
+ key: 1,
8278
+ class: "m-fields-radio-group__text"
8279
+ };
8075
8280
  //#endregion
8076
8281
  //#region packages/form/src/fields/RadioGroup.vue
8077
8282
  var RadioGroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -8087,7 +8292,10 @@
8087
8292
  disabled: { type: Boolean },
8088
8293
  size: {},
8089
8294
  lastValues: {},
8090
- isCompare: { type: Boolean }
8295
+ isCompare: { type: Boolean },
8296
+ text: {},
8297
+ labelWidth: {},
8298
+ labelPosition: {}
8091
8299
  },
8092
8300
  emits: ["change"],
8093
8301
  setup(__props, { emit: __emit }) {
@@ -8100,16 +8308,18 @@
8100
8308
  };
8101
8309
  useAddField(props.prop);
8102
8310
  const iconSize = (0, vue.computed)(() => {
8103
- if (props.size === "small") return "12";
8311
+ if (props.config.iconSize) return props.config.iconSize;
8312
+ if (props.size === "small") return "14";
8104
8313
  if (props.size === "large") return "16";
8105
- return "14";
8314
+ return "16";
8106
8315
  });
8107
8316
  return (_ctx, _cache) => {
8108
8317
  return __props.model ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicRadioGroup), {
8109
8318
  key: 0,
8110
8319
  "model-value": __props.model[__props.name],
8111
8320
  size: __props.size,
8112
- disabled: __props.disabled
8321
+ disabled: __props.disabled,
8322
+ class: "icon-{{ iconSize }}"
8113
8323
  }, {
8114
8324
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.config.options, (option) => {
8115
8325
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(itemComponent.value), {
@@ -8122,13 +8332,14 @@
8122
8332
  placement: "top-start",
8123
8333
  content: option.tooltip
8124
8334
  }, {
8125
- default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [option.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicIcon), {
8335
+ 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
8336
  key: 0,
8127
- size: iconSize.value
8337
+ size: iconSize.value,
8338
+ class: (0, vue.normalizeClass)({ "m-fields-radio-group__icon_with_text": !!option.text })
8128
8339
  }, {
8129
8340
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(option.icon)))]),
8130
8341
  _: 2
8131
- }, 1032, ["size"])) : (0, vue.createCommentVNode)("v-if", true), option.text ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$4, (0, vue.toDisplayString)(option.text), 1)) : (0, vue.createCommentVNode)("v-if", true)])]),
8342
+ }, 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
8343
  _: 2
8133
8344
  }, 1032, ["disabled", "content"])]),
8134
8345
  _: 2
@@ -8161,7 +8372,10 @@
8161
8372
  disabled: { type: Boolean },
8162
8373
  size: {},
8163
8374
  lastValues: {},
8164
- isCompare: { type: Boolean }
8375
+ isCompare: { type: Boolean },
8376
+ text: {},
8377
+ labelWidth: {},
8378
+ labelPosition: {}
8165
8379
  },
8166
8380
  setup(__props) {
8167
8381
  const props = __props;
@@ -8180,8 +8394,9 @@
8180
8394
  //#endregion
8181
8395
  //#region packages/form/src/fields/Link.vue?vue&type=script&setup=true&lang.ts
8182
8396
  var _hoisted_1$2 = ["href"];
8183
- var _hoisted_2 = {
8184
- key: 2,
8397
+ var _hoisted_2 = ["href"];
8398
+ var _hoisted_3 = {
8399
+ key: 3,
8185
8400
  class: "m-fields-link"
8186
8401
  };
8187
8402
  //#endregion
@@ -8199,7 +8414,11 @@
8199
8414
  disabled: { type: Boolean },
8200
8415
  size: {},
8201
8416
  lastValues: {},
8202
- isCompare: { type: Boolean }
8417
+ isCompare: { type: Boolean },
8418
+ text: {},
8419
+ labelWidth: {},
8420
+ labelPosition: {},
8421
+ theme: {}
8203
8422
  },
8204
8423
  emits: ["change"],
8205
8424
  setup(__props, { emit: __emit }) {
@@ -8242,15 +8461,30 @@
8242
8461
  editor.value && (editor.value.dialogVisible = false);
8243
8462
  };
8244
8463
  return (_ctx, _cache) => {
8245
- return __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
8464
+ return (0, vue.unref)(isGlobalFlat) && __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
8246
8465
  key: 0,
8247
8466
  target: "_blank",
8248
8467
  href: href.value,
8468
+ class: "magic-admin-link",
8249
8469
  style: (0, vue.normalizeStyle)(__props.config.css || {})
8250
- }, (0, vue.toDisplayString)(displayText.value), 13, _hoisted_1$2)) : __props.config.href && __props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
8470
+ }, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
8471
+ link: "",
8472
+ type: "primary"
8473
+ }, {
8474
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), null, {
8475
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_element_plus_icons_vue.Notebook))]),
8476
+ _: 1
8477
+ }), (0, vue.createTextVNode)((0, vue.toDisplayString)(displayText.value), 1)]),
8478
+ _: 1
8479
+ })], 12, _hoisted_1$2)) : __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
8251
8480
  key: 1,
8481
+ target: "_blank",
8482
+ href: href.value,
8483
+ style: (0, vue.normalizeStyle)(__props.config.css || {})
8484
+ }, (0, vue.toDisplayString)(displayText.value), 13, _hoisted_2)) : __props.config.href && __props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
8485
+ key: 2,
8252
8486
  style: (0, vue.normalizeStyle)(__props.config.disabledCss || {})
8253
- }, (0, vue.toDisplayString)(displayText.value), 5)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
8487
+ }, (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
8488
  link: "",
8255
8489
  type: "primary",
8256
8490
  onClick: editHandler
@@ -8296,7 +8530,10 @@
8296
8530
  disabled: { type: Boolean },
8297
8531
  size: {},
8298
8532
  lastValues: {},
8299
- isCompare: { type: Boolean }
8533
+ isCompare: { type: Boolean },
8534
+ text: {},
8535
+ labelWidth: {},
8536
+ labelPosition: {}
8300
8537
  },
8301
8538
  emits: ["change"],
8302
8539
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -8645,7 +8882,10 @@
8645
8882
  disabled: { type: Boolean },
8646
8883
  size: {},
8647
8884
  lastValues: {},
8648
- isCompare: { type: Boolean }
8885
+ isCompare: { type: Boolean },
8886
+ text: {},
8887
+ labelWidth: {},
8888
+ labelPosition: {}
8649
8889
  },
8650
8890
  emits: ["change"],
8651
8891
  setup(__props, { emit: __emit }) {
@@ -8765,7 +9005,10 @@
8765
9005
  disabled: { type: Boolean },
8766
9006
  size: {},
8767
9007
  lastValues: {},
8768
- isCompare: { type: Boolean }
9008
+ isCompare: { type: Boolean },
9009
+ text: {},
9010
+ labelWidth: {},
9011
+ labelPosition: {}
8769
9012
  },
8770
9013
  emits: ["change"],
8771
9014
  setup(__props, { emit: __emit }) {
@@ -8926,6 +9169,7 @@
8926
9169
  if (option.typeMatchRules) registerTypeMatchRules(option.typeMatchRules);
8927
9170
  app.component("m-form", Form_default);
8928
9171
  app.component("m-form-dialog", FormDialog_default);
9172
+ app.component("m-form-drawer", FormDrawer_default);
8929
9173
  app.component("m-form-container", Container_default);
8930
9174
  app.component("m-form-fieldset", Fieldset_default);
8931
9175
  app.component("m-form-group-list", TableGroupList_default);
@@ -8995,6 +9239,7 @@
8995
9239
  exports.MTime = Time_default;
8996
9240
  exports.MTimerange = Timerange_default;
8997
9241
  exports.adaptFormValidator = adaptFormValidator;
9242
+ exports.applyExtendState = applyExtendState;
8998
9243
  exports.clearTypeMatchRules = clearTypeMatchRules;
8999
9244
  exports.createForm = createForm;
9000
9245
  exports.createObjectProp = createObjectProp;