@tmagic/form 1.8.0-beta.9 → 1.8.0-manmanyu.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/es/Form.vue_vue_type_script_setup_true_lang.js +44 -5
  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 +37 -12
  4. package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +22 -16
  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 +6 -2
  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 +4 -1
  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 +4 -1
  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 +4 -1
  17. package/dist/es/fields/DateTime.vue_vue_type_script_setup_true_lang.js +4 -1
  18. package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +4 -1
  19. package/dist/es/fields/Display.vue_vue_type_script_setup_true_lang.js +4 -1
  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 +8 -3
  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 +16 -8
  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 +4 -1
  31. package/dist/es/plugin.js +2 -0
  32. package/dist/es/style.css +121 -8
  33. package/dist/style.css +121 -8
  34. package/dist/themes/magic-admin.css +495 -0
  35. package/dist/tmagic-form.umd.cjs +448 -225
  36. package/package.json +4 -4
  37. package/src/Form.vue +53 -4
  38. package/src/FormDialog.vue +14 -3
  39. package/src/FormDrawer.vue +40 -12
  40. package/src/containers/Container.vue +16 -5
  41. package/src/containers/GroupList.vue +1 -1
  42. package/src/containers/GroupListItem.vue +28 -22
  43. package/src/containers/Panel.vue +10 -3
  44. package/src/containers/table/ActionsColumn.vue +10 -4
  45. package/src/containers/table/Table.vue +1 -0
  46. package/src/containers/table/useTableColumns.ts +10 -4
  47. package/src/containers/table-group-list/TableGroupList.vue +7 -1
  48. package/src/fields/Link.vue +17 -3
  49. package/src/fields/Number.vue +5 -2
  50. package/src/fields/RadioGroup.vue +11 -5
  51. package/src/fields/Text.vue +43 -19
  52. package/src/plugin.ts +2 -0
  53. package/src/theme/container.scss +3 -0
  54. package/src/theme/fieldset.scss +50 -0
  55. package/src/theme/form.scss +6 -0
  56. package/src/theme/group-list.scss +9 -7
  57. package/src/theme/index.scss +1 -0
  58. package/src/theme/link.scss +17 -0
  59. package/src/theme/panel.scss +1 -1
  60. package/src/theme/radio-group.scss +23 -0
  61. package/src/theme/tabs.scss +2 -2
  62. package/src/theme/text.scss +38 -0
  63. package/src/theme/themes/magic-admin/index.scss +91 -0
  64. package/types/index.d.ts +46 -1
@@ -2843,9 +2843,9 @@
2843
2843
  "align-items": "center"
2844
2844
  }
2845
2845
  };
2846
- var _hoisted_2$8 = ["innerHTML", "title"];
2847
- var _hoisted_3$7 = ["innerHTML"];
2848
- var _hoisted_4$5 = ["innerHTML", "title"];
2846
+ var _hoisted_2$9 = ["innerHTML", "title"];
2847
+ var _hoisted_3$8 = ["innerHTML"];
2848
+ var _hoisted_4$7 = ["innerHTML", "title"];
2849
2849
  //#endregion
2850
2850
  //#region packages/form/src/containers/FormLabel.vue
2851
2851
  var FormLabel_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -2862,11 +2862,11 @@
2862
2862
  return __props.tip ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$15, [(0, vue.createElementVNode)("span", {
2863
2863
  innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
2864
2864
  title: __props.labelTitle
2865
- }, null, 8, _hoisted_2$8), __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
2865
+ }, null, 8, _hoisted_2$9), __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
2866
2866
  key: 0,
2867
2867
  placement: "top"
2868
2868
  }, {
2869
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$7)]),
2869
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$8)]),
2870
2870
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
2871
2871
  "margin-left": "5px",
2872
2872
  "display": "flex"
@@ -2879,23 +2879,27 @@
2879
2879
  key: 1,
2880
2880
  innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
2881
2881
  title: __props.labelTitle
2882
- }, null, 8, _hoisted_4$5));
2882
+ }, null, 8, _hoisted_4$7));
2883
2883
  };
2884
2884
  }
2885
2885
  });
2886
2886
  //#endregion
2887
2887
  //#region packages/form/src/containers/Container.vue?vue&type=script&setup=true&lang.ts
2888
2888
  var _hoisted_1$14 = ["data-tmagic-id", "data-tmagic-form-item-prop"];
2889
- var _hoisted_2$7 = ["innerHTML"];
2890
- var _hoisted_3$6 = ["innerHTML"];
2891
- var _hoisted_4$4 = ["innerHTML"];
2892
- var _hoisted_5$3 = ["innerHTML"];
2893
- var _hoisted_6$1 = ["innerHTML"];
2894
- var _hoisted_7$1 = ["innerHTML"];
2895
- var _hoisted_8$1 = ["innerHTML"];
2896
- var _hoisted_9 = {
2889
+ var _hoisted_2$8 = {
2890
+ key: 0,
2891
+ class: "m-form-tip m-form-title-extra"
2892
+ };
2893
+ var _hoisted_3$7 = ["innerHTML"];
2894
+ var _hoisted_4$6 = ["innerHTML"];
2895
+ var _hoisted_5$4 = ["innerHTML"];
2896
+ var _hoisted_6$3 = ["innerHTML"];
2897
+ var _hoisted_7$2 = ["innerHTML"];
2898
+ var _hoisted_8$2 = ["innerHTML"];
2899
+ var _hoisted_9 = ["innerHTML"];
2900
+ var _hoisted_10 = {
2897
2901
  key: 5,
2898
- style: { "text-align": "center" }
2902
+ class: "m-form-container-expand"
2899
2903
  };
2900
2904
  //#endregion
2901
2905
  //#region packages/form/src/containers/Container.vue
@@ -3022,7 +3026,8 @@
3022
3026
  labelWidth: itemLabelWidth.value,
3023
3027
  labelPosition: props.config.labelPosition,
3024
3028
  rules: rule.value,
3025
- extra: filterFunction(mForm, props.config.extra, props)
3029
+ extra: filterFunction(mForm, props.config.extra, props),
3030
+ extraTips: props.config.extraTips
3026
3031
  }));
3027
3032
  const itemLabelWidth = (0, vue.computed)(() => props.config.labelWidth ?? props.labelWidth);
3028
3033
  (0, vue.watchEffect)(() => {
@@ -3175,12 +3180,12 @@
3175
3180
  "use-label",
3176
3181
  "label-title",
3177
3182
  "text"
3178
- ])])]),
3183
+ ]), __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)])]),
3179
3184
  default: (0, vue.withCtx)(() => [tooltip.value.text ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicTooltip), {
3180
3185
  key: 0,
3181
3186
  placement: tooltip.value.placement
3182
3187
  }, {
3183
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_2$7)]),
3188
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_3$7)]),
3184
3189
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3185
3190
  model: __props.model,
3186
3191
  "last-values": __props.lastValues,
@@ -3209,7 +3214,7 @@
3209
3214
  key: 0,
3210
3215
  placement: "top"
3211
3216
  }, {
3212
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_3$6)]),
3217
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_4$6)]),
3213
3218
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3214
3219
  "line-height": "40px",
3215
3220
  "margin-left": "5px"
@@ -3248,7 +3253,7 @@
3248
3253
  key: 0,
3249
3254
  placement: tooltip.value.placement
3250
3255
  }, {
3251
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_4$4)]),
3256
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_5$4)]),
3252
3257
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3253
3258
  model: __props.model,
3254
3259
  "last-values": __props.lastValues,
@@ -3301,7 +3306,7 @@
3301
3306
  key: 0,
3302
3307
  placement: tooltip.value.placement
3303
3308
  }, {
3304
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_5$3)]),
3309
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_6$3)]),
3305
3310
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3306
3311
  model: __props.lastValues,
3307
3312
  onChange: onChangeHandler
@@ -3317,7 +3322,7 @@
3317
3322
  key: 0,
3318
3323
  placement: "top"
3319
3324
  }, {
3320
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_6$1)]),
3325
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_7$2)]),
3321
3326
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3322
3327
  "line-height": "40px",
3323
3328
  "margin-left": "5px"
@@ -3358,7 +3363,7 @@
3358
3363
  key: 0,
3359
3364
  placement: tooltip.value.placement
3360
3365
  }, {
3361
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_7$1)]),
3366
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_8$2)]),
3362
3367
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
3363
3368
  model: __props.model,
3364
3369
  onChange: onChangeHandler
@@ -3374,7 +3379,7 @@
3374
3379
  key: 1,
3375
3380
  placement: "top"
3376
3381
  }, {
3377
- content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_8$1)]),
3382
+ content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: __props.config.tip }, null, 8, _hoisted_9)]),
3378
3383
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), { style: {
3379
3384
  "line-height": "40px",
3380
3385
  "margin-left": "5px"
@@ -3416,16 +3421,17 @@
3416
3421
  "label-width",
3417
3422
  "prop"
3418
3423
  ]);
3419
- }), 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), {
3424
+ }), 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), {
3420
3425
  type: "primary",
3421
3426
  size: "small",
3422
3427
  disabled: false,
3423
3428
  link: "",
3424
- onClick: expandHandler
3429
+ onClick: expandHandler,
3430
+ icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowUp) : (0, vue.unref)(_element_plus_icons_vue.ArrowDown)
3425
3431
  }, {
3426
3432
  default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(expand.value ? "收起配置" : "展开更多配置"), 1)]),
3427
3433
  _: 1
3428
- })])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
3434
+ }, 8, ["icon"])])) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$14);
3429
3435
  };
3430
3436
  }
3431
3437
  });
@@ -3461,7 +3467,8 @@
3461
3467
  preventSubmitDefault: { type: Boolean },
3462
3468
  extendState: {},
3463
3469
  showDiff: {},
3464
- selfDiffFieldTypes: {}
3470
+ selfDiffFieldTypes: {},
3471
+ theme: {}
3465
3472
  },
3466
3473
  emits: [
3467
3474
  "change",
@@ -3480,6 +3487,25 @@
3480
3487
  const fields = /* @__PURE__ */ new Map();
3481
3488
  const requestFuc = getConfig("request");
3482
3489
  /**
3490
+ * 当前表单生效的主题名称:
3491
+ * - 优先用本组件自己的 `props.theme`;
3492
+ * - 没设置时回退到最近祖先 `<MEditor>` / `<MForm>` provide 的主题,便于内嵌于编辑器
3493
+ * 时自动跟随外层主题,无需在每个 `MForm` 上重复传 `theme`。
3494
+ *
3495
+ * 同时把合并后的值再 provide 出去(见下方 `provide(M_THEME_KEY, ...)`),让 form 子树
3496
+ * 里再嵌套的 portal 组件(`TMagicPopover` 等)依然能拿到非空主题。
3497
+ */
3498
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
3499
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
3500
+ /**
3501
+ * 拼到 `formState.popperClass` 上的主题修饰类(仅 `m-theme--<theme>`,
3502
+ * 不带 `m-form` / `m-editor` 前缀,因为 Element Plus 弹层节点本身既不是 form 也不是 editor)。
3503
+ *
3504
+ * 这条类会随所有读 `mForm.popperClass` 的字段(Select / DateTime / Cascader 等)下发到
3505
+ * Element Plus 的 `popper-class`,让 portal 节点也命中 `m-theme--<theme>` 上的 CSS 变量。
3506
+ */
3507
+ const themeClass = (0, vue.computed)(() => effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : "");
3508
+ /**
3483
3509
  * formState 实现说明:
3484
3510
  *
3485
3511
  * 1. 与 props 直接对应的字段(config / initValues / lastValues / isCompare / parentValues /
@@ -3495,13 +3521,21 @@
3495
3521
  * 把最新值刷进 formState。
3496
3522
  * - accessor 描述符(`{ get stage() { return ... } }`)按原样写入,调用方可以控制
3497
3523
  * 读时求值,每次读取都会重新执行 getter。
3524
+ *
3525
+ * 4. `popperClass` 会自动拼接 `themeClass`:调用方传入的 `popperClass` + 当前主题
3526
+ * 修饰类(含祖先 `<MEditor>` provide 的主题)。这样所有透传到 Element Plus 弹层
3527
+ * `popper-class` 的字段(Select / DateTime / Cascader 等)能自带主题作用域。
3498
3528
  */
3499
3529
  const formState = (0, vue.reactive)({
3500
3530
  get keyProp() {
3501
3531
  return props.keyProp;
3502
3532
  },
3503
3533
  get popperClass() {
3504
- return props.popperClass;
3534
+ const userClass = props.popperClass ?? "";
3535
+ const tc = themeClass.value;
3536
+ if (!userClass) return tc;
3537
+ if (!tc) return userClass;
3538
+ return `${userClass} ${tc}`;
3505
3539
  },
3506
3540
  get config() {
3507
3541
  return props.config;
@@ -3577,6 +3611,12 @@
3577
3611
  }
3578
3612
  });
3579
3613
  (0, vue.provide)("mForm", formState);
3614
+ /**
3615
+ * 把生效主题(自身或祖先)再 provide 出去,供 form 子树内含 `Teleport` 的组件
3616
+ * (如 `TMagicPopover`)在传送目标上挂 `m-theme--<theme>` 类。
3617
+ * 详见 `@tmagic/design/theme.ts`。
3618
+ */
3619
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
3580
3620
  (0, vue.provide)(FORM_DIFF_CONFIG_KEY, {
3581
3621
  get showDiff() {
3582
3622
  return props.showDiff;
@@ -3680,7 +3720,11 @@
3680
3720
  });
3681
3721
  return (_ctx, _cache) => {
3682
3722
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicForm), {
3683
- class: "m-form",
3723
+ class: (0, vue.normalizeClass)([
3724
+ "m-form",
3725
+ effectiveTheme.value ? `m-form--${effectiveTheme.value}` : "",
3726
+ effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""
3727
+ ]),
3684
3728
  ref: "tMagicForm",
3685
3729
  model: values.value,
3686
3730
  "label-width": __props.labelWidth,
@@ -3718,6 +3762,7 @@
3718
3762
  }), 128)) : (0, vue.createCommentVNode)("v-if", true)]),
3719
3763
  _: 3
3720
3764
  }, 8, [
3765
+ "class",
3721
3766
  "model",
3722
3767
  "label-width",
3723
3768
  "style",
@@ -3866,7 +3911,8 @@
3866
3911
  type: Boolean,
3867
3912
  default: true
3868
3913
  },
3869
- extendState: {}
3914
+ extendState: {},
3915
+ theme: {}
3870
3916
  },
3871
3917
  emits: [
3872
3918
  "close",
@@ -3876,6 +3922,9 @@
3876
3922
  ],
3877
3923
  setup(__props, { expose: __expose, emit: __emit }) {
3878
3924
  const props = __props;
3925
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
3926
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
3927
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
3879
3928
  const emit = __emit;
3880
3929
  const form = (0, vue.ref)();
3881
3930
  const dialogVisible = (0, vue.ref)(false);
@@ -3935,7 +3984,7 @@
3935
3984
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDialog), {
3936
3985
  modelValue: dialogVisible.value,
3937
3986
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
3938
- class: "m-form-dialog",
3987
+ class: (0, vue.normalizeClass)(["m-form-dialog", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
3939
3988
  top: "20px",
3940
3989
  "append-to-body": "",
3941
3990
  title: __props.title,
@@ -4017,6 +4066,7 @@
4017
4066
  inline: __props.inline,
4018
4067
  "prevent-submit-default": __props.preventSubmitDefault,
4019
4068
  "extend-state": __props.extendState,
4069
+ theme: effectiveTheme.value,
4020
4070
  onChange: changeHandler
4021
4071
  }, null, 8, [
4022
4072
  "modelValue",
@@ -4029,11 +4079,13 @@
4029
4079
  "label-position",
4030
4080
  "inline",
4031
4081
  "prevent-submit-default",
4032
- "extend-state"
4082
+ "extend-state",
4083
+ "theme"
4033
4084
  ]), (0, vue.renderSlot)(_ctx.$slots, "default")], 4)) : (0, vue.createCommentVNode)("v-if", true)]),
4034
4085
  _: 3
4035
4086
  }, 8, [
4036
4087
  "modelValue",
4088
+ "class",
4037
4089
  "title",
4038
4090
  "width",
4039
4091
  "zIndex",
@@ -4052,7 +4104,7 @@
4052
4104
  //#endregion
4053
4105
  //#region packages/form/src/FormDrawer.vue
4054
4106
  var FormDrawer_default = /* @__PURE__ */ (0, vue.defineComponent)({
4055
- name: "MFormDialog",
4107
+ name: "MFormDrawer",
4056
4108
  __name: "FormDrawer",
4057
4109
  props: {
4058
4110
  config: { default: () => [] },
@@ -4073,7 +4125,8 @@
4073
4125
  labelPosition: {},
4074
4126
  preventSubmitDefault: { type: Boolean },
4075
4127
  beforeClose: {},
4076
- extendState: {}
4128
+ extendState: {},
4129
+ theme: {}
4077
4130
  },
4078
4131
  emits: [
4079
4132
  "close",
@@ -4085,11 +4138,15 @@
4085
4138
  "opened"
4086
4139
  ],
4087
4140
  setup(__props, { expose: __expose, emit: __emit }) {
4141
+ const props = __props;
4142
+ const ancestorTheme = (0, vue.inject)(_tmagic_design.M_THEME_KEY, null);
4143
+ const effectiveTheme = (0, vue.computed)(() => props.theme || ancestorTheme?.value || "");
4144
+ (0, vue.provide)(_tmagic_design.M_THEME_KEY, effectiveTheme);
4088
4145
  const emit = __emit;
4089
4146
  const drawer = (0, vue.ref)();
4090
4147
  const form = (0, vue.ref)();
4091
4148
  const drawerBody = (0, vue.ref)();
4092
- const visible = (0, vue.ref)(false);
4149
+ const dialogVisible = (0, vue.ref)(false);
4093
4150
  const saveFetch = (0, vue.ref)(false);
4094
4151
  const bodyHeight = (0, vue.ref)(0);
4095
4152
  (0, vue.watchEffect)(() => {
@@ -4119,30 +4176,47 @@
4119
4176
  emit("closed");
4120
4177
  };
4121
4178
  const show = () => {
4122
- visible.value = true;
4179
+ dialogVisible.value = true;
4123
4180
  };
4124
4181
  const hide = () => {
4125
- visible.value = false;
4182
+ dialogVisible.value = false;
4183
+ };
4184
+ const close = () => {
4185
+ dialogVisible.value = false;
4186
+ };
4187
+ const cancel = () => {
4188
+ hide();
4126
4189
  };
4127
4190
  /** 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */
4128
4191
  const handleClose = () => {
4129
4192
  drawer.value?.handleClose();
4130
4193
  };
4194
+ const save = async () => {
4195
+ try {
4196
+ const changeRecords = [...form.value?.changeRecords || []];
4197
+ emit("submit", await form.value?.submitForm(), { changeRecords });
4198
+ } catch (e) {
4199
+ emit("error", e);
4200
+ }
4201
+ };
4131
4202
  __expose({
4132
4203
  form,
4133
4204
  saveFetch,
4134
4205
  bodyHeight,
4206
+ close,
4135
4207
  show,
4136
4208
  hide,
4209
+ save,
4210
+ cancel,
4137
4211
  handleClose
4138
4212
  });
4139
4213
  return (_ctx, _cache) => {
4140
4214
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicDrawer), {
4141
- class: "m-form-drawer",
4215
+ class: (0, vue.normalizeClass)(["m-form-drawer", effectiveTheme.value ? `m-theme--${effectiveTheme.value}` : ""]),
4142
4216
  ref_key: "drawer",
4143
4217
  ref: drawer,
4144
- modelValue: visible.value,
4145
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
4218
+ modelValue: dialogVisible.value,
4219
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dialogVisible.value = $event),
4146
4220
  title: __props.title,
4147
4221
  "close-on-press-escape": __props.closeOnPressEscape,
4148
4222
  "append-to-body": true,
@@ -4180,7 +4254,7 @@
4180
4254
  })]),
4181
4255
  _: 3
4182
4256
  })]),
4183
- default: (0, vue.withCtx)(() => [visible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4257
+ default: (0, vue.withCtx)(() => [dialogVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4184
4258
  key: 0,
4185
4259
  ref_key: "drawerBody",
4186
4260
  ref: drawerBody,
@@ -4198,6 +4272,7 @@
4198
4272
  inline: __props.inline,
4199
4273
  "prevent-submit-default": __props.preventSubmitDefault,
4200
4274
  "extend-state": __props.extendState,
4275
+ theme: effectiveTheme.value,
4201
4276
  onChange: changeHandler
4202
4277
  }, null, 8, [
4203
4278
  "size",
@@ -4209,10 +4284,12 @@
4209
4284
  "label-position",
4210
4285
  "inline",
4211
4286
  "prevent-submit-default",
4212
- "extend-state"
4287
+ "extend-state",
4288
+ "theme"
4213
4289
  ]), (0, vue.renderSlot)(_ctx.$slots, "default")], 512)) : (0, vue.createCommentVNode)("v-if", true)]),
4214
4290
  _: 3
4215
4291
  }, 8, [
4292
+ "class",
4216
4293
  "modelValue",
4217
4294
  "title",
4218
4295
  "close-on-press-escape",
@@ -4344,16 +4421,16 @@
4344
4421
  //#endregion
4345
4422
  //#region packages/form/src/containers/Fieldset.vue?vue&type=script&setup=true&lang.ts
4346
4423
  var _hoisted_1$11 = ["innerHTML"];
4347
- var _hoisted_2$6 = ["innerHTML"];
4348
- var _hoisted_3$5 = { key: 1 };
4349
- var _hoisted_4$3 = ["innerHTML"];
4350
- var _hoisted_5$2 = ["innerHTML"];
4351
- var _hoisted_6 = {
4424
+ var _hoisted_2$7 = ["innerHTML"];
4425
+ var _hoisted_3$6 = { key: 1 };
4426
+ var _hoisted_4$5 = ["innerHTML"];
4427
+ var _hoisted_5$3 = ["innerHTML"];
4428
+ var _hoisted_6$2 = {
4352
4429
  key: 2,
4353
4430
  style: { "display": "flex" }
4354
4431
  };
4355
- var _hoisted_7 = { style: { "flex": "1" } };
4356
- var _hoisted_8 = ["src"];
4432
+ var _hoisted_7$1 = { style: { "flex": "1" } };
4433
+ var _hoisted_8$1 = ["src"];
4357
4434
  //#endregion
4358
4435
  //#region packages/form/src/containers/Fieldset.vue
4359
4436
  var Fieldset_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -4423,7 +4500,7 @@
4423
4500
  key: 0,
4424
4501
  innerHTML: __props.config.extra,
4425
4502
  class: "m-form-tip"
4426
- }, null, 8, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true)]),
4503
+ }, null, 8, _hoisted_2$7)) : (0, vue.createCommentVNode)("v-if", true)]),
4427
4504
  _: 1
4428
4505
  }, 8, [
4429
4506
  "model-value",
@@ -4432,11 +4509,11 @@
4432
4509
  "false-value"
4433
4510
  ])]),
4434
4511
  _: 1
4435
- })) : ((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", {
4512
+ })) : ((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", {
4436
4513
  key: 0,
4437
4514
  innerHTML: __props.config.extra,
4438
4515
  class: "m-form-tip"
4439
- }, 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) => {
4516
+ }, 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) => {
4440
4517
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
4441
4518
  key: key(item, index),
4442
4519
  model: name.value ? __props.model[name.value] : __props.model,
@@ -4464,7 +4541,7 @@
4464
4541
  }), 128))]), (0, vue.createElementVNode)("img", {
4465
4542
  class: "m-form-schematic",
4466
4543
  src: __props.config.schematic
4467
- }, 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) => {
4544
+ }, 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) => {
4468
4545
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
4469
4546
  key: key(item, index),
4470
4547
  model: name.value ? __props.model[name.value] : __props.model,
@@ -4561,13 +4638,13 @@
4561
4638
  "display": "flex",
4562
4639
  "align-items": "center"
4563
4640
  } };
4564
- var _hoisted_2$5 = ["innerHTML"];
4565
- var _hoisted_3$4 = {
4641
+ var _hoisted_2$6 = ["innerHTML"];
4642
+ var _hoisted_3$5 = {
4566
4643
  key: 0,
4567
4644
  style: { "display": "flex" }
4568
4645
  };
4569
- var _hoisted_4$2 = { style: { "flex": "1" } };
4570
- var _hoisted_5$1 = ["src"];
4646
+ var _hoisted_4$4 = { style: { "flex": "1" } };
4647
+ var _hoisted_5$2 = ["src"];
4571
4648
  //#endregion
4572
4649
  //#region packages/form/src/containers/Panel.vue
4573
4650
  var Panel_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -4582,7 +4659,8 @@
4582
4659
  labelWidth: {},
4583
4660
  prop: {},
4584
4661
  size: {},
4585
- disabled: { type: Boolean }
4662
+ disabled: { type: Boolean },
4663
+ hideExpand: { type: Boolean }
4586
4664
  },
4587
4665
  emits: ["change", "addDiffCount"],
4588
4666
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -4606,26 +4684,31 @@
4606
4684
  return items.value && items.value.length ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
4607
4685
  key: 0,
4608
4686
  class: "box-card m-form-panel",
4609
- "body-style": { display: expand.value ? "block" : "none" }
4687
+ "body-style": { display: expand.value ? "block" : "none" },
4688
+ flat: __props.config.flat
4610
4689
  }, {
4611
4690
  header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$10, [
4612
- (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
4613
- style: { "padding": "0" },
4691
+ !__props.hideExpand ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
4692
+ key: 0,
4693
+ style: {
4694
+ "padding": "0",
4695
+ "margin-right": "10px"
4696
+ },
4614
4697
  link: "",
4615
- icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.CaretBottom) : (0, vue.unref)(_element_plus_icons_vue.CaretRight),
4698
+ icon: expand.value ? (0, vue.unref)(_element_plus_icons_vue.ArrowDown) : (0, vue.unref)(_element_plus_icons_vue.ArrowRight),
4616
4699
  onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
4617
- }, null, 8, ["icon"]),
4700
+ }, null, 8, ["icon"])) : (0, vue.createCommentVNode)("v-if", true),
4618
4701
  (0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createElementVNode)("span", {
4619
4702
  style: { "cursor": "pointer" },
4620
4703
  onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
4621
4704
  }, (0, vue.toDisplayString)(filter(__props.config.title)), 1)]),
4622
4705
  __props.config && __props.config.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
4623
- key: 0,
4706
+ key: 1,
4624
4707
  innerHTML: __props.config.extra,
4625
4708
  class: "m-form-tip"
4626
- }, null, 8, _hoisted_2$5)) : (0, vue.createCommentVNode)("v-if", true)
4709
+ }, null, 8, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true)
4627
4710
  ])]),
4628
- 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) => {
4711
+ 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) => {
4629
4712
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
4630
4713
  key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
4631
4714
  config: item,
@@ -4651,7 +4734,7 @@
4651
4734
  }), 128))]), (0, vue.createElementVNode)("img", {
4652
4735
  class: "m-form-schematic",
4653
4736
  src: __props.config.schematic
4654
- }, null, 8, _hoisted_5$1)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(items.value, (item, index) => {
4737
+ }, null, 8, _hoisted_5$2)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(items.value, (item, index) => {
4655
4738
  return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
4656
4739
  key: item[(0, vue.unref)(mForm)?.keyProp || "__key"] ?? index,
4657
4740
  config: item,
@@ -4676,7 +4759,7 @@
4676
4759
  ]);
4677
4760
  }), 128))])]),
4678
4761
  _: 3
4679
- }, 8, ["body-style"])) : (0, vue.createCommentVNode)("v-if", true);
4762
+ }, 8, ["body-style", "flat"])) : (0, vue.createCommentVNode)("v-if", true);
4680
4763
  };
4681
4764
  }
4682
4765
  });
@@ -4990,12 +5073,13 @@
4990
5073
  });
4991
5074
  //#endregion
4992
5075
  //#region packages/form/src/containers/GroupListItem.vue?vue&type=script&setup=true&lang.ts
4993
- var _hoisted_1$9 = ["innerHTML"];
4994
- var _hoisted_2$4 = { style: {
5076
+ var _hoisted_1$9 = { class: "m-fields-group-list-item-header" };
5077
+ var _hoisted_2$5 = ["innerHTML"];
5078
+ var _hoisted_3$4 = { style: {
4995
5079
  "text-align": "right",
4996
5080
  "margin-top": "20px"
4997
5081
  } };
4998
- var _hoisted_3$3 = ["innerHTML"];
5082
+ var _hoisted_4$3 = ["innerHTML"];
4999
5083
  //#endregion
5000
5084
  //#region packages/form/src/containers/GroupListItem.vue
5001
5085
  var GroupListItem_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -5034,7 +5118,10 @@
5034
5118
  [mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
5035
5119
  }));
5036
5120
  const title = (0, vue.computed)(() => {
5037
- if (props.config.titleKey && props.model[props.config.titleKey]) return props.model[props.config.titleKey];
5121
+ if (props.config.titleKey && props.model[props.config.titleKey]) {
5122
+ const { titlePrefix } = props.config;
5123
+ return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
5124
+ }
5038
5125
  if (props.config.title) return filterFunction(mForm, props.config.title, props);
5039
5126
  return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
5040
5127
  });
@@ -5073,33 +5160,39 @@
5073
5160
  return (_ctx, _cache) => {
5074
5161
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCard), {
5075
5162
  class: "m-fields-group-list-item",
5163
+ flat: __props.config.flat,
5076
5164
  "body-style": { display: expand.value ? "block" : "none" }
5077
5165
  }, {
5078
- header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [
5166
+ header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$9, [
5079
5167
  (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
5080
5168
  link: "",
5081
5169
  disabled: __props.disabled,
5082
- onClick: expandHandler
5170
+ onClick: expandHandler,
5171
+ class: "expand-button"
5083
5172
  }, {
5084
5173
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), null, {
5085
- 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 }))]),
5174
+ 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 }))]),
5086
5175
  _: 1
5087
- }), (0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_1$9)]),
5176
+ })]),
5088
5177
  _: 1
5089
5178
  }, 8, ["disabled"]),
5090
- !__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5091
- key: 0,
5092
- type: "danger",
5093
- size: "small",
5094
- link: "",
5095
- icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
5096
- disabled: __props.disabled,
5097
- onClick: removeHandler
5098
- }, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true),
5179
+ (0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_2$5),
5180
+ (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicTooltip), { content: `删除 ${title.value}` }, {
5181
+ default: (0, vue.withCtx)(() => [!__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5182
+ key: 0,
5183
+ size: "default",
5184
+ link: "",
5185
+ class: "delete-button",
5186
+ icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
5187
+ disabled: __props.disabled,
5188
+ onClick: removeHandler
5189
+ }, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true)]),
5190
+ _: 1
5191
+ }, 8, ["content"]),
5099
5192
  copyable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5100
- key: 1,
5193
+ key: 0,
5101
5194
  link: "",
5102
- size: "small",
5195
+ size: "default",
5103
5196
  type: "primary",
5104
5197
  icon: (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
5105
5198
  disabled: __props.disabled,
@@ -5108,27 +5201,27 @@
5108
5201
  default: (0, vue.withCtx)(() => [..._cache[6] || (_cache[6] = [(0, vue.createTextVNode)("复制", -1)])]),
5109
5202
  _: 1
5110
5203
  }, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true),
5111
- 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), {
5204
+ 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), {
5112
5205
  link: "",
5113
- size: "small",
5206
+ size: "default",
5114
5207
  disabled: __props.disabled,
5115
- icon: (0, vue.unref)(_element_plus_icons_vue.CaretTop),
5208
+ icon: (0, vue.unref)(_element_plus_icons_vue.Top),
5116
5209
  onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
5117
5210
  }, {
5118
5211
  default: (0, vue.withCtx)(() => [..._cache[7] || (_cache[7] = [(0, vue.createTextVNode)("上移", -1)])]),
5119
5212
  _: 1
5120
5213
  }, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== 0]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
5121
5214
  link: "",
5122
- size: "small",
5215
+ size: "default",
5123
5216
  disabled: __props.disabled,
5124
- icon: (0, vue.unref)(_element_plus_icons_vue.CaretBottom),
5217
+ icon: (0, vue.unref)(_element_plus_icons_vue.Bottom),
5125
5218
  onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
5126
5219
  }, {
5127
5220
  default: (0, vue.withCtx)(() => [..._cache[8] || (_cache[8] = [(0, vue.createTextVNode)("下移", -1)])]),
5128
5221
  _: 1
5129
5222
  }, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== length.value - 1]])], 64)) : (0, vue.createCommentVNode)("v-if", true),
5130
5223
  __props.config.moveSpecifyLocation && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicPopover), {
5131
- key: 3,
5224
+ key: 2,
5132
5225
  trigger: "click",
5133
5226
  placement: "top",
5134
5227
  width: "200",
@@ -5156,7 +5249,7 @@
5156
5249
  disabled: __props.disabled
5157
5250
  }, null, 8, ["modelValue", "disabled"]),
5158
5251
  _cache[11] || (_cache[11] = (0, vue.createTextVNode)("行 ", -1))
5159
- ]), (0, vue.createElementVNode)("div", _hoisted_2$4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
5252
+ ]), (0, vue.createElementVNode)("div", _hoisted_3$4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
5160
5253
  size: "small",
5161
5254
  text: "",
5162
5255
  onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
@@ -5174,10 +5267,10 @@
5174
5267
  _: 1
5175
5268
  }, 8, ["visible"])) : (0, vue.createCommentVNode)("v-if", true),
5176
5269
  itemExtra.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
5177
- key: 4,
5270
+ key: 3,
5178
5271
  innerHTML: itemExtra.value,
5179
5272
  class: "m-form-tip"
5180
- }, null, 8, _hoisted_3$3)) : (0, vue.createCommentVNode)("v-if", true)
5273
+ }, null, 8, _hoisted_4$3)) : (0, vue.createCommentVNode)("v-if", true)
5181
5274
  ])]),
5182
5275
  default: (0, vue.withCtx)(() => [expand.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
5183
5276
  key: 0,
@@ -5202,23 +5295,24 @@
5202
5295
  "disabled"
5203
5296
  ])) : (0, vue.createCommentVNode)("v-if", true)]),
5204
5297
  _: 1
5205
- }, 8, ["body-style"]);
5298
+ }, 8, ["flat", "body-style"]);
5206
5299
  };
5207
5300
  }
5208
5301
  });
5209
5302
  //#endregion
5210
5303
  //#region packages/form/src/containers/GroupList.vue?vue&type=script&setup=true&lang.ts
5211
5304
  var _hoisted_1$8 = { class: "m-fields-group-list" };
5212
- var _hoisted_2$3 = ["innerHTML"];
5213
- var _hoisted_3$2 = {
5305
+ var _hoisted_2$4 = ["innerHTML"];
5306
+ var _hoisted_3$3 = {
5214
5307
  key: 1,
5215
5308
  class: "el-table__empty-block"
5216
5309
  };
5217
- var _hoisted_4$1 = {
5310
+ var _hoisted_4$2 = { class: "el-table__empty-text t-table__empty" };
5311
+ var _hoisted_5$1 = {
5218
5312
  key: 3,
5219
5313
  class: "m-fields-group-list-footer"
5220
5314
  };
5221
- var _hoisted_5 = { style: {
5315
+ var _hoisted_6$1 = { style: {
5222
5316
  "display": "flex",
5223
5317
  "justify-content": "flex-end",
5224
5318
  "flex": "1"
@@ -5270,8 +5364,8 @@
5270
5364
  key: 0,
5271
5365
  innerHTML: __props.config.extra,
5272
5366
  style: { "color": "rgba(0, 0, 0, 0.45)" }
5273
- }, null, 8, _hoisted_2$3)) : (0, vue.createCommentVNode)("v-if", true),
5274
- !__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) => {
5367
+ }, null, 8, _hoisted_2$4)) : (0, vue.createCommentVNode)("v-if", true),
5368
+ !__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) => {
5275
5369
  return (0, vue.openBlock)(), (0, vue.createBlock)(GroupListItem_default, {
5276
5370
  key: index,
5277
5371
  model: item,
@@ -5302,7 +5396,7 @@
5302
5396
  "group-model"
5303
5397
  ]);
5304
5398
  }), 128)),
5305
- !__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)
5399
+ !__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)
5306
5400
  ]);
5307
5401
  };
5308
5402
  }
@@ -5464,7 +5558,8 @@
5464
5558
  index: {},
5465
5559
  row: {},
5466
5560
  prop: {},
5467
- sortKey: {}
5561
+ sortKey: {},
5562
+ flat: { type: Boolean }
5468
5563
  },
5469
5564
  emits: ["change"],
5470
5565
  setup(__props, { emit: __emit }) {
@@ -5535,19 +5630,25 @@
5535
5630
  type: "danger",
5536
5631
  link: "",
5537
5632
  title: "删除",
5538
- icon: __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
5633
+ icon: __props.flat ? void 0 : __props.config.deleteActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.Delete),
5539
5634
  onClick: _cache[0] || (_cache[0] = ($event) => removeHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
5540
- }, null, 8, ["icon"]), [[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
5635
+ }, {
5636
+ 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)]),
5637
+ _: 1
5638
+ }, 8, ["icon"]), [[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]]),
5541
5639
  copyable(__props.index + 1 + __props.currentPage * __props.pageSize - 1) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5542
5640
  key: 1,
5543
5641
  link: "",
5544
5642
  size: "small",
5545
5643
  type: "primary",
5546
5644
  title: "复制",
5547
- icon: __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
5645
+ icon: __props.flat ? void 0 : __props.config.copyActionButtonIcon || (0, vue.unref)(_element_plus_icons_vue.DocumentCopy),
5548
5646
  disabled: __props.disabled,
5549
5647
  onClick: _cache[1] || (_cache[1] = ($event) => copyHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
5550
- }, null, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
5648
+ }, {
5649
+ 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)]),
5650
+ _: 1
5651
+ }, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
5551
5652
  ], 64);
5552
5653
  };
5553
5654
  }
@@ -5640,6 +5741,7 @@
5640
5741
  //#region packages/form/src/containers/table/useTableColumns.ts
5641
5742
  var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
5642
5743
  const mForm = (0, vue.inject)("mForm");
5744
+ const isMagicAdmin = (0, _tmagic_design.isMagicAdminTheme)();
5643
5745
  const display$1 = (fuc) => display(mForm, fuc, props);
5644
5746
  const lastData = (0, vue.computed)(() => props.config.pagination ? getDataByPage(props.lastValues[modelName.value], currentPage.value, pageSize.value) : props.lastValues[modelName.value] || []);
5645
5747
  const itemExtra = (fuc, index) => {
@@ -5697,8 +5799,10 @@
5697
5799
  type: "selection",
5698
5800
  width: 45
5699
5801
  } });
5700
- let actionFixed = props.config.fixed === false ? void 0 : "left";
5802
+ const defaultFixed = isMagicAdmin.value ? "right" : "left";
5803
+ let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
5701
5804
  if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
5805
+ const actionFlat = props.config.flat === void 0 && isMagicAdmin.value ? true : props.config.flat;
5702
5806
  const actionColumn = {
5703
5807
  props: {
5704
5808
  label: "操作",
@@ -5708,6 +5812,7 @@
5708
5812
  },
5709
5813
  cell: ({ row, $index }) => (0, vue.h)(ActionsColumn_default, {
5710
5814
  row,
5815
+ flat: actionFlat,
5711
5816
  index: $index,
5712
5817
  model: props.model,
5713
5818
  config: props.config,
@@ -5790,13 +5895,13 @@
5790
5895
  //#endregion
5791
5896
  //#region packages/form/src/containers/table/Table.vue?vue&type=script&setup=true&lang.ts
5792
5897
  var _hoisted_1$7 = ["innerHTML"];
5793
- var _hoisted_2$2 = { style: {
5898
+ var _hoisted_2$3 = { style: {
5794
5899
  "display": "flex",
5795
5900
  "justify-content": "space-between",
5796
5901
  "margin": "10px 0"
5797
5902
  } };
5798
- var _hoisted_3$1 = { style: { "display": "flex" } };
5799
- var _hoisted_4 = {
5903
+ var _hoisted_3$2 = { style: { "display": "flex" } };
5904
+ var _hoisted_4$1 = {
5800
5905
  key: 1,
5801
5906
  class: "bottom",
5802
5907
  style: { "text-align": "right" }
@@ -5881,19 +5986,21 @@
5881
5986
  "default-expand-all": true,
5882
5987
  key: updateKey.value,
5883
5988
  onSelect: (0, vue.unref)(selectHandle),
5884
- onSortChange: sortChangeHandler
5989
+ onSortChange: sortChangeHandler,
5990
+ "empty-text": `暂无${__props.config.titlePrefix || ""}数据`
5885
5991
  }, null, 8, [
5886
5992
  "row-key",
5887
5993
  "columns",
5888
5994
  "data",
5889
5995
  "border",
5890
5996
  "max-height",
5891
- "onSelect"
5997
+ "onSelect",
5998
+ "empty-text"
5892
5999
  ])) : (0, vue.createCommentVNode)("v-if", true)]),
5893
6000
  _: 1
5894
6001
  }, 8, ["disabled"]),
5895
6002
  (0, vue.renderSlot)(_ctx.$slots, "default"),
5896
- (0, vue.createElementVNode)("div", _hoisted_2$2, [(0, vue.createElementVNode)("div", _hoisted_3$1, [
6003
+ (0, vue.createElementVNode)("div", _hoisted_2$3, [(0, vue.createElementVNode)("div", _hoisted_3$2, [
5897
6004
  !(0, vue.unref)(isFullscreen) ? (0, vue.renderSlot)(_ctx.$slots, "toggle-button", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true),
5898
6005
  __props.config.enableFullscreen !== false ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
5899
6006
  key: 1,
@@ -5936,7 +6043,7 @@
5936
6043
  _: 1
5937
6044
  }, 8, ["disabled", "onClick"])) : (0, vue.createCommentVNode)("v-if", true)
5938
6045
  ]), !__props.isCompare ? (0, vue.renderSlot)(_ctx.$slots, "add-button", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true)]),
5939
- __props.config.pagination ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicPagination), {
6046
+ __props.config.pagination ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$1, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicPagination), {
5940
6047
  layout: "total, sizes, prev, pager, next, jumper",
5941
6048
  "hide-on-single-page": __props.model[modelName.value].length < (0, vue.unref)(pageSize),
5942
6049
  "current-page": (0, vue.unref)(currentPage) + 1,
@@ -6156,9 +6263,10 @@
6156
6263
  size: addButtonSize.value,
6157
6264
  plain: displayMode.value === "table",
6158
6265
  icon: (0, vue.unref)(_element_plus_icons_vue.Plus),
6266
+ text: "",
6159
6267
  disabled: __props.disabled
6160
6268
  }, currentConfig.value.addButtonConfig?.props || { type: "primary" }, { onClick: (0, vue.unref)(newHandler) }), {
6161
- default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? "新增一行" : "新增")), 1)]),
6269
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentConfig.value.addButtonConfig?.text || (displayMode.value === "table" ? `新增一行${groupListConfig.value.titlePrefix || ""}` : `新增${groupListConfig.value.titlePrefix || ""}`)), 1)]),
6162
6270
  _: 1
6163
6271
  }, 16, [
6164
6272
  "class",
@@ -6188,9 +6296,17 @@
6188
6296
  });
6189
6297
  //#endregion
6190
6298
  //#region packages/form/src/fields/Text.vue?vue&type=script&setup=true&lang.ts
6191
- var _hoisted_1$6 = { class: "m-fields-text" };
6192
- var _hoisted_2$1 = { key: 1 };
6193
- var _hoisted_3 = { style: {
6299
+ var _hoisted_1$6 = { key: 0 };
6300
+ var _hoisted_2$2 = {
6301
+ key: 0,
6302
+ class: "m-fields-text__prepend"
6303
+ };
6304
+ var _hoisted_3$1 = { class: "m-fields-text__value" };
6305
+ var _hoisted_4 = ["src"];
6306
+ var _hoisted_5 = { key: 2 };
6307
+ var _hoisted_6 = ["src"];
6308
+ var _hoisted_7 = { key: 2 };
6309
+ var _hoisted_8 = { style: {
6194
6310
  "display": "flex",
6195
6311
  "justify-content": "flex-end"
6196
6312
  } };
@@ -6209,7 +6325,10 @@
6209
6325
  disabled: { type: Boolean },
6210
6326
  size: {},
6211
6327
  lastValues: {},
6212
- isCompare: { type: Boolean }
6328
+ isCompare: { type: Boolean },
6329
+ text: {},
6330
+ labelWidth: {},
6331
+ labelPosition: {}
6213
6332
  },
6214
6333
  emits: ["change", "input"],
6215
6334
  setup(__props, { emit: __emit }) {
@@ -6222,21 +6341,15 @@
6222
6341
  value.value = v;
6223
6342
  }, { immediate: true });
6224
6343
  const appendConfig = (0, vue.computed)(() => {
6225
- if (typeof props.config.append === "string") return {
6344
+ const { append } = props.config;
6345
+ if (typeof append === "string") return {
6226
6346
  type: "text",
6227
- text: props.config.append,
6347
+ text: append,
6228
6348
  handler: void 0
6229
6349
  };
6230
- if (typeof props.config.append === "object") {
6231
- if (typeof props.config.append?.handler === "function") return {
6232
- type: "button",
6233
- text: props.config.append.text,
6234
- handler: props.config.append.handler
6235
- };
6236
- if (props.config.append) {
6237
- if (props.config.append.value === 0) return false;
6238
- return props.config.append;
6239
- }
6350
+ if (typeof append === "object" && append) {
6351
+ if (append.value === 0) return false;
6352
+ return append;
6240
6353
  }
6241
6354
  return false;
6242
6355
  });
@@ -6332,67 +6445,97 @@
6332
6445
  instanceRef.value = void 0;
6333
6446
  };
6334
6447
  return (_ctx, _cache) => {
6335
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicInput), {
6336
- modelValue: value.value,
6337
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
6338
- ref_key: "input",
6339
- ref: input,
6340
- clearable: __props.config.clearable ?? true,
6341
- size: __props.size,
6342
- placeholder: __props.config.placeholder,
6343
- disabled: __props.disabled,
6344
- onChange: changeHandler,
6345
- onInput: inputHandler,
6346
- onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
6347
- }, (0, vue.createSlots)({ _: 2 }, [__props.config.prepend ? {
6348
- name: "prepend",
6349
- fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.config.prepend), 1)]),
6350
- key: "0"
6351
- } : void 0, appendConfig.value ? {
6352
- name: "append",
6353
- fn: (0, vue.withCtx)(() => [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6354
- key: 0,
6355
- style: { "color": "#409eff" },
6448
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["m-fields-text", { "m-fields-text--static": __props.config.static }]) }, [
6449
+ __props.config.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6)) : (0, vue.createCommentVNode)("v-if", true),
6450
+ (0, vue.createCommentVNode)(" 新增静态展示文本样式 "),
6451
+ __props.config.static ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [
6452
+ __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),
6453
+ (0, vue.createElementVNode)("span", _hoisted_3$1, (0, vue.toDisplayString)(value.value), 1),
6454
+ 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), {
6455
+ key: 0,
6456
+ style: { "color": "#0056ea" },
6457
+ size: __props.size,
6458
+ onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
6459
+ }, {
6460
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
6461
+ _: 1
6462
+ }, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
6463
+ key: 1,
6464
+ class: "m-fields-text__icon",
6465
+ src: appendConfig.value.text,
6466
+ onClick: buttonClickHandler
6467
+ }, 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)
6468
+ ], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicInput), {
6469
+ key: 2,
6470
+ modelValue: value.value,
6471
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
6472
+ ref_key: "input",
6473
+ ref: input,
6474
+ clearable: __props.config.clearable ?? true,
6356
6475
  size: __props.size,
6357
- onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
6358
- }, {
6359
- default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
6360
- _: 1
6361
- }, 8, ["size"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$1, (0, vue.toDisplayString)(appendConfig.value.text), 1))]),
6362
- key: "1"
6363
- } : void 0]), 1032, [
6364
- "modelValue",
6365
- "clearable",
6366
- "size",
6367
- "placeholder",
6368
- "disabled"
6369
- ]), ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, { to: "body" }, [popoverVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
6370
- key: 0,
6371
- class: "tmagic-form-text-popper m-form-item__content",
6372
- ref_key: "popoverEl",
6373
- ref: popoverEl
6374
- }, [
6375
- _cache[5] || (_cache[5] = (0, vue.createElementVNode)("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
6376
- (0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6377
- link: "",
6378
- size: "small",
6379
- onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
6380
- }, {
6381
- default: (0, vue.withCtx)(() => [..._cache[3] || (_cache[3] = [(0, vue.createTextVNode)("保持原样", -1)])]),
6382
- _: 1
6383
- }), (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6384
- type: "primary",
6385
- size: "small",
6386
- onClick: confirmTrimHandler
6387
- }, {
6388
- default: (0, vue.withCtx)(() => [..._cache[4] || (_cache[4] = [(0, vue.createTextVNode)("移除空格", -1)])]),
6389
- _: 1
6390
- })]),
6391
- _cache[6] || (_cache[6] = (0, vue.createElementVNode)("span", {
6392
- class: "tmagic-form-text-popper-arrow",
6393
- "data-popper-arrow": ""
6394
- }, null, -1))
6395
- ], 512)) : (0, vue.createCommentVNode)("v-if", true)]))]);
6476
+ placeholder: __props.config.placeholder,
6477
+ disabled: __props.disabled,
6478
+ onChange: changeHandler,
6479
+ onInput: inputHandler,
6480
+ onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
6481
+ }, (0, vue.createSlots)({ _: 2 }, [__props.config.prepend ? {
6482
+ name: "prepend",
6483
+ fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.config.prepend), 1)]),
6484
+ key: "0"
6485
+ } : void 0, appendConfig.value ? {
6486
+ name: "append",
6487
+ fn: (0, vue.withCtx)(() => [appendConfig.value.type === "button" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
6488
+ key: 0,
6489
+ style: { "color": "#0056ea" },
6490
+ size: __props.size,
6491
+ onClick: (0, vue.withModifiers)(buttonClickHandler, ["prevent"])
6492
+ }, {
6493
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(appendConfig.value.text), 1)]),
6494
+ _: 1
6495
+ }, 8, ["size"])) : appendConfig.value.type === "icon" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
6496
+ key: 1,
6497
+ src: appendConfig.value.text,
6498
+ onClick: buttonClickHandler
6499
+ }, null, 8, _hoisted_6)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7, (0, vue.toDisplayString)(appendConfig.value.text), 1))]),
6500
+ key: "1"
6501
+ } : void 0]), 1032, [
6502
+ "modelValue",
6503
+ "clearable",
6504
+ "size",
6505
+ "placeholder",
6506
+ "disabled"
6507
+ ])),
6508
+ !__props.config.static ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
6509
+ key: 3,
6510
+ to: "body"
6511
+ }, [popoverVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
6512
+ key: 0,
6513
+ class: "tmagic-form-text-popper m-form-item__content",
6514
+ ref_key: "popoverEl",
6515
+ ref: popoverEl
6516
+ }, [
6517
+ _cache[5] || (_cache[5] = (0, vue.createElementVNode)("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
6518
+ (0, vue.createElementVNode)("div", _hoisted_8, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6519
+ link: "",
6520
+ size: "small",
6521
+ onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
6522
+ }, {
6523
+ default: (0, vue.withCtx)(() => [..._cache[3] || (_cache[3] = [(0, vue.createTextVNode)("保持原样", -1)])]),
6524
+ _: 1
6525
+ }), (0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
6526
+ type: "primary",
6527
+ size: "small",
6528
+ onClick: confirmTrimHandler
6529
+ }, {
6530
+ default: (0, vue.withCtx)(() => [..._cache[4] || (_cache[4] = [(0, vue.createTextVNode)("移除空格", -1)])]),
6531
+ _: 1
6532
+ })]),
6533
+ _cache[6] || (_cache[6] = (0, vue.createElementVNode)("span", {
6534
+ class: "tmagic-form-text-popper-arrow",
6535
+ "data-popper-arrow": ""
6536
+ }, null, -1))
6537
+ ], 512)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true)
6538
+ ], 2);
6396
6539
  };
6397
6540
  }
6398
6541
  });
@@ -6411,12 +6554,16 @@
6411
6554
  disabled: { type: Boolean },
6412
6555
  size: {},
6413
6556
  lastValues: {},
6414
- isCompare: { type: Boolean }
6557
+ isCompare: { type: Boolean },
6558
+ text: {},
6559
+ labelWidth: {},
6560
+ labelPosition: {}
6415
6561
  },
6416
6562
  emits: ["change", "input"],
6417
6563
  setup(__props, { emit: __emit }) {
6418
6564
  const props = __props;
6419
6565
  const emit = __emit;
6566
+ const isMagicAdmin = (0, _tmagic_design.isMagicAdminTheme)();
6420
6567
  const value = (0, vue.ref)();
6421
6568
  (0, vue.watch)(() => props.model[props.name], (v) => {
6422
6569
  value.value = v;
@@ -6436,7 +6583,7 @@
6436
6583
  modelValue: value.value,
6437
6584
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
6438
6585
  clearable: "",
6439
- "controls-position": "right",
6586
+ "controls-position": (0, vue.unref)(isMagicAdmin) ? "" : "right",
6440
6587
  size: __props.size,
6441
6588
  max: __props.config.max,
6442
6589
  min: __props.config.min,
@@ -6447,6 +6594,7 @@
6447
6594
  onInput: inputHandler
6448
6595
  }, null, 8, [
6449
6596
  "modelValue",
6597
+ "controls-position",
6450
6598
  "size",
6451
6599
  "max",
6452
6600
  "min",
@@ -6475,7 +6623,10 @@
6475
6623
  disabled: { type: Boolean },
6476
6624
  size: {},
6477
6625
  lastValues: {},
6478
- isCompare: { type: Boolean }
6626
+ isCompare: { type: Boolean },
6627
+ text: {},
6628
+ labelWidth: {},
6629
+ labelPosition: {}
6479
6630
  },
6480
6631
  emits: ["change"],
6481
6632
  setup(__props, { emit: __emit }) {
@@ -6546,7 +6697,10 @@
6546
6697
  disabled: { type: Boolean },
6547
6698
  size: {},
6548
6699
  lastValues: {},
6549
- isCompare: { type: Boolean }
6700
+ isCompare: { type: Boolean },
6701
+ text: {},
6702
+ labelWidth: {},
6703
+ labelPosition: {}
6550
6704
  },
6551
6705
  emits: ["change", "input"],
6552
6706
  setup(__props, { emit: __emit }) {
@@ -6602,7 +6756,10 @@
6602
6756
  disabled: { type: Boolean },
6603
6757
  size: {},
6604
6758
  lastValues: {},
6605
- isCompare: { type: Boolean }
6759
+ isCompare: { type: Boolean },
6760
+ text: {},
6761
+ labelWidth: {},
6762
+ labelPosition: {}
6606
6763
  },
6607
6764
  emits: ["change"],
6608
6765
  setup(__props, { emit: __emit }) {
@@ -6649,7 +6806,10 @@
6649
6806
  disabled: { type: Boolean },
6650
6807
  size: {},
6651
6808
  lastValues: {},
6652
- isCompare: { type: Boolean }
6809
+ isCompare: { type: Boolean },
6810
+ text: {},
6811
+ labelWidth: {},
6812
+ labelPosition: {}
6653
6813
  },
6654
6814
  emits: ["change"],
6655
6815
  setup(__props, { emit: __emit }) {
@@ -6701,7 +6861,10 @@
6701
6861
  disabled: { type: Boolean },
6702
6862
  size: {},
6703
6863
  lastValues: {},
6704
- isCompare: { type: Boolean }
6864
+ isCompare: { type: Boolean },
6865
+ text: {},
6866
+ labelWidth: {},
6867
+ labelPosition: {}
6705
6868
  },
6706
6869
  emits: ["change"],
6707
6870
  setup(__props, { emit: __emit }) {
@@ -6746,7 +6909,10 @@
6746
6909
  disabled: { type: Boolean },
6747
6910
  size: {},
6748
6911
  lastValues: {},
6749
- isCompare: { type: Boolean }
6912
+ isCompare: { type: Boolean },
6913
+ text: {},
6914
+ labelWidth: {},
6915
+ labelPosition: {}
6750
6916
  },
6751
6917
  emits: ["change"],
6752
6918
  setup(__props, { emit: __emit }) {
@@ -6803,7 +6969,10 @@
6803
6969
  disabled: { type: Boolean },
6804
6970
  size: {},
6805
6971
  lastValues: {},
6806
- isCompare: { type: Boolean }
6972
+ isCompare: { type: Boolean },
6973
+ text: {},
6974
+ labelWidth: {},
6975
+ labelPosition: {}
6807
6976
  },
6808
6977
  emits: ["change"],
6809
6978
  setup(__props, { emit: __emit }) {
@@ -6858,7 +7027,10 @@
6858
7027
  disabled: { type: Boolean },
6859
7028
  size: {},
6860
7029
  lastValues: {},
6861
- isCompare: { type: Boolean }
7030
+ isCompare: { type: Boolean },
7031
+ text: {},
7032
+ labelWidth: {},
7033
+ labelPosition: {}
6862
7034
  },
6863
7035
  emits: ["change"],
6864
7036
  setup(__props, { emit: __emit }) {
@@ -6952,7 +7124,10 @@
6952
7124
  disabled: { type: Boolean },
6953
7125
  size: {},
6954
7126
  lastValues: {},
6955
- isCompare: { type: Boolean }
7127
+ isCompare: { type: Boolean },
7128
+ text: {},
7129
+ labelWidth: {},
7130
+ labelPosition: {}
6956
7131
  },
6957
7132
  emits: ["change"],
6958
7133
  setup(__props, { emit: __emit }) {
@@ -7046,7 +7221,10 @@
7046
7221
  disabled: { type: Boolean },
7047
7222
  size: {},
7048
7223
  lastValues: {},
7049
- isCompare: { type: Boolean }
7224
+ isCompare: { type: Boolean },
7225
+ text: {},
7226
+ labelWidth: {},
7227
+ labelPosition: {}
7050
7228
  },
7051
7229
  emits: ["change"],
7052
7230
  setup(__props, { emit: __emit }) {
@@ -7084,7 +7262,10 @@
7084
7262
  disabled: { type: Boolean },
7085
7263
  size: {},
7086
7264
  lastValues: {},
7087
- isCompare: { type: Boolean }
7265
+ isCompare: { type: Boolean },
7266
+ text: {},
7267
+ labelWidth: {},
7268
+ labelPosition: {}
7088
7269
  },
7089
7270
  emits: ["change"],
7090
7271
  setup(__props, { emit: __emit }) {
@@ -7129,7 +7310,11 @@
7129
7310
  });
7130
7311
  //#endregion
7131
7312
  //#region packages/form/src/fields/RadioGroup.vue?vue&type=script&setup=true&lang.ts
7132
- var _hoisted_1$4 = { key: 1 };
7313
+ var _hoisted_1$4 = { class: "m-fields-radio-group__option" };
7314
+ var _hoisted_2$1 = {
7315
+ key: 1,
7316
+ class: "m-fields-radio-group__text"
7317
+ };
7133
7318
  //#endregion
7134
7319
  //#region packages/form/src/fields/RadioGroup.vue
7135
7320
  var RadioGroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -7145,7 +7330,10 @@
7145
7330
  disabled: { type: Boolean },
7146
7331
  size: {},
7147
7332
  lastValues: {},
7148
- isCompare: { type: Boolean }
7333
+ isCompare: { type: Boolean },
7334
+ text: {},
7335
+ labelWidth: {},
7336
+ labelPosition: {}
7149
7337
  },
7150
7338
  emits: ["change"],
7151
7339
  setup(__props, { emit: __emit }) {
@@ -7157,9 +7345,9 @@
7157
7345
  };
7158
7346
  useAddField(props.prop);
7159
7347
  const iconSize = (0, vue.computed)(() => {
7160
- if (props.size === "small") return "12";
7348
+ if (props.size === "small") return "14";
7161
7349
  if (props.size === "large") return "16";
7162
- return "14";
7350
+ return "16";
7163
7351
  });
7164
7352
  return (_ctx, _cache) => {
7165
7353
  return __props.model ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicRadioGroup), {
@@ -7179,13 +7367,14 @@
7179
7367
  placement: "top-start",
7180
7368
  content: option.tooltip
7181
7369
  }, {
7182
- default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [option.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicIcon), {
7370
+ 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), {
7183
7371
  key: 0,
7184
- size: iconSize.value
7372
+ size: iconSize.value,
7373
+ class: (0, vue.normalizeClass)({ "m-fields-radio-group__icon_with_text": !!option.text })
7185
7374
  }, {
7186
7375
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(option.icon)))]),
7187
7376
  _: 2
7188
- }, 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)])]),
7377
+ }, 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)])]),
7189
7378
  _: 2
7190
7379
  }, 1032, ["disabled", "content"])]),
7191
7380
  _: 2
@@ -7218,7 +7407,10 @@
7218
7407
  disabled: { type: Boolean },
7219
7408
  size: {},
7220
7409
  lastValues: {},
7221
- isCompare: { type: Boolean }
7410
+ isCompare: { type: Boolean },
7411
+ text: {},
7412
+ labelWidth: {},
7413
+ labelPosition: {}
7222
7414
  },
7223
7415
  setup(__props) {
7224
7416
  const props = __props;
@@ -7237,8 +7429,9 @@
7237
7429
  //#endregion
7238
7430
  //#region packages/form/src/fields/Link.vue?vue&type=script&setup=true&lang.ts
7239
7431
  var _hoisted_1$2 = ["href"];
7240
- var _hoisted_2 = {
7241
- key: 2,
7432
+ var _hoisted_2 = ["href"];
7433
+ var _hoisted_3 = {
7434
+ key: 3,
7242
7435
  class: "m-fields-link"
7243
7436
  };
7244
7437
  //#endregion
@@ -7256,12 +7449,17 @@
7256
7449
  disabled: { type: Boolean },
7257
7450
  size: {},
7258
7451
  lastValues: {},
7259
- isCompare: { type: Boolean }
7452
+ isCompare: { type: Boolean },
7453
+ text: {},
7454
+ labelWidth: {},
7455
+ labelPosition: {},
7456
+ theme: {}
7260
7457
  },
7261
7458
  emits: ["change"],
7262
7459
  setup(__props, { emit: __emit }) {
7263
7460
  const props = __props;
7264
7461
  const emit = __emit;
7462
+ const isMagicAdmin = (0, _tmagic_design.isMagicAdminTheme)(props);
7265
7463
  useAddField(props.prop);
7266
7464
  const formValue = (0, vue.ref)({});
7267
7465
  const editor = (0, vue.ref)();
@@ -7299,15 +7497,30 @@
7299
7497
  editor.value && (editor.value.dialogVisible = false);
7300
7498
  };
7301
7499
  return (_ctx, _cache) => {
7302
- return __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
7500
+ return (0, vue.unref)(isMagicAdmin) && __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
7303
7501
  key: 0,
7304
7502
  target: "_blank",
7305
7503
  href: href.value,
7504
+ class: "magic-admin-link",
7306
7505
  style: (0, vue.normalizeStyle)(__props.config.css || {})
7307
- }, (0, vue.toDisplayString)(displayText.value), 13, _hoisted_1$2)) : __props.config.href && __props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
7506
+ }, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7507
+ link: "",
7508
+ type: "primary"
7509
+ }, {
7510
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicIcon), null, {
7511
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_element_plus_icons_vue.Notebook))]),
7512
+ _: 1
7513
+ }), (0, vue.createTextVNode)((0, vue.toDisplayString)(displayText.value), 1)]),
7514
+ _: 1
7515
+ })], 12, _hoisted_1$2)) : __props.config.href && !__props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
7308
7516
  key: 1,
7517
+ target: "_blank",
7518
+ href: href.value,
7519
+ style: (0, vue.normalizeStyle)(__props.config.css || {})
7520
+ }, (0, vue.toDisplayString)(displayText.value), 13, _hoisted_2)) : __props.config.href && __props.disabled ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
7521
+ key: 2,
7309
7522
  style: (0, vue.normalizeStyle)(__props.config.disabledCss || {})
7310
- }, (0, vue.toDisplayString)(displayText.value), 5)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7523
+ }, (0, vue.toDisplayString)(displayText.value), 5)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
7311
7524
  link: "",
7312
7525
  type: "primary",
7313
7526
  onClick: editHandler
@@ -7353,7 +7566,10 @@
7353
7566
  disabled: { type: Boolean },
7354
7567
  size: {},
7355
7568
  lastValues: {},
7356
- isCompare: { type: Boolean }
7569
+ isCompare: { type: Boolean },
7570
+ text: {},
7571
+ labelWidth: {},
7572
+ labelPosition: {}
7357
7573
  },
7358
7574
  emits: ["change"],
7359
7575
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -7701,7 +7917,10 @@
7701
7917
  disabled: { type: Boolean },
7702
7918
  size: {},
7703
7919
  lastValues: {},
7704
- isCompare: { type: Boolean }
7920
+ isCompare: { type: Boolean },
7921
+ text: {},
7922
+ labelWidth: {},
7923
+ labelPosition: {}
7705
7924
  },
7706
7925
  emits: ["change"],
7707
7926
  setup(__props, { emit: __emit }) {
@@ -7821,7 +8040,10 @@
7821
8040
  disabled: { type: Boolean },
7822
8041
  size: {},
7823
8042
  lastValues: {},
7824
- isCompare: { type: Boolean }
8043
+ isCompare: { type: Boolean },
8044
+ text: {},
8045
+ labelWidth: {},
8046
+ labelPosition: {}
7825
8047
  },
7826
8048
  emits: ["change"],
7827
8049
  setup(__props, { emit: __emit }) {
@@ -7981,6 +8203,7 @@
7981
8203
  setConfig(option);
7982
8204
  app.component("m-form", Form_default);
7983
8205
  app.component("m-form-dialog", FormDialog_default);
8206
+ app.component("m-form-drawer", FormDrawer_default);
7984
8207
  app.component("m-form-container", Container_default);
7985
8208
  app.component("m-form-fieldset", Fieldset_default);
7986
8209
  app.component("m-form-group-list", TableGroupList_default);