@tmagic/form 1.7.0-beta.3 → 1.7.0-beta.5

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.
@@ -3145,7 +3145,7 @@
3145
3145
  newData[v][sortKey] = i;
3146
3146
  }
3147
3147
  }
3148
- return newData;
3148
+ return cloneDeep(newData);
3149
3149
  };
3150
3150
  const sortChange = (data, { prop, order }) => {
3151
3151
  if (order === "ascending") {
@@ -3155,17 +3155,65 @@
3155
3155
  }
3156
3156
  };
3157
3157
 
3158
+ const _hoisted_1$e = {
3159
+ key: 0,
3160
+ style: { "display": "inline-flex", "align-items": "center" }
3161
+ };
3162
+ const _hoisted_2$8 = ["innerHTML", "title"];
3163
+ const _hoisted_3$6 = ["innerHTML"];
3164
+ const _hoisted_4$5 = ["innerHTML", "title"];
3165
+ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
3166
+ __name: "FormLabel",
3167
+ props: {
3168
+ tip: {},
3169
+ type: {},
3170
+ useLabel: { type: Boolean },
3171
+ text: {},
3172
+ labelTitle: {}
3173
+ },
3174
+ setup(__props) {
3175
+ return (_ctx, _cache) => {
3176
+ return __props.tip ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$e, [
3177
+ vue.createElementVNode("span", {
3178
+ innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
3179
+ title: __props.labelTitle
3180
+ }, null, 8, _hoisted_2$8),
3181
+ __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3182
+ key: 0,
3183
+ placement: "top"
3184
+ }, {
3185
+ content: vue.withCtx(() => [
3186
+ vue.createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$6)
3187
+ ]),
3188
+ default: vue.withCtx(() => [
3189
+ vue.createVNode(vue.unref(design.TMagicIcon), { style: { "margin-left": "5px", "display": "flex" } }, {
3190
+ default: vue.withCtx(() => [
3191
+ vue.createVNode(vue.unref(iconsVue.WarningFilled))
3192
+ ]),
3193
+ _: 1
3194
+ /* STABLE */
3195
+ })
3196
+ ]),
3197
+ _: 1
3198
+ /* STABLE */
3199
+ })) : vue.createCommentVNode("v-if", true)
3200
+ ])) : (vue.openBlock(), vue.createElementBlock("span", {
3201
+ key: 1,
3202
+ innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
3203
+ title: __props.labelTitle
3204
+ }, null, 8, _hoisted_4$5));
3205
+ };
3206
+ }
3207
+ });
3208
+
3158
3209
  const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
3159
- const _hoisted_2$7 = ["innerHTML", "title"];
3210
+ const _hoisted_2$7 = ["innerHTML"];
3160
3211
  const _hoisted_3$5 = ["innerHTML"];
3161
3212
  const _hoisted_4$4 = ["innerHTML"];
3162
- const _hoisted_5$3 = ["innerHTML", "title"];
3213
+ const _hoisted_5$3 = ["innerHTML"];
3163
3214
  const _hoisted_6$1 = ["innerHTML"];
3164
3215
  const _hoisted_7$1 = ["innerHTML"];
3165
- const _hoisted_8$1 = ["innerHTML", "title"];
3166
- const _hoisted_9 = ["innerHTML"];
3167
- const _hoisted_10 = ["innerHTML"];
3168
- const _hoisted_11 = {
3216
+ const _hoisted_8$1 = {
3169
3217
  key: 5,
3170
3218
  style: { "text-align": "center" }
3171
3219
  };
@@ -3412,10 +3460,13 @@
3412
3460
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }
3413
3461
  }), {
3414
3462
  label: vue.withCtx(() => [
3415
- vue.createElementVNode("span", {
3416
- innerHTML: type.value === "checkbox" && !__props.config.useLabel ? "" : text.value,
3417
- title: __props.config.labelTitle
3418
- }, null, 8, _hoisted_2$7)
3463
+ vue.createVNode(_sfc_main$B, {
3464
+ tip: __props.config.tip,
3465
+ type: type.value,
3466
+ "use-label": __props.config.useLabel,
3467
+ "label-title": __props.config.labelTitle,
3468
+ text: text.value
3469
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
3419
3470
  ]),
3420
3471
  default: vue.withCtx(() => [
3421
3472
  tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
@@ -3425,36 +3476,38 @@
3425
3476
  content: vue.withCtx(() => [
3426
3477
  vue.createElementVNode("div", {
3427
3478
  innerHTML: tooltip.value.text
3428
- }, null, 8, _hoisted_3$5)
3479
+ }, null, 8, _hoisted_2$7)
3429
3480
  ]),
3430
3481
  default: vue.withCtx(() => [
3431
3482
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
3432
3483
  model: __props.model,
3433
3484
  "last-values": __props.lastValues,
3485
+ "is-compare": __props.isCompare,
3434
3486
  onChange: onChangeHandler,
3435
3487
  onAddDiffCount
3436
- }), null, 16, ["model", "last-values"]))
3488
+ }), null, 16, ["model", "last-values", "is-compare"]))
3437
3489
  ]),
3438
3490
  _: 1
3439
3491
  /* STABLE */
3440
3492
  }, 8, ["placement"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps({ key: 1 }, fieldsProps.value, {
3441
3493
  model: __props.model,
3442
3494
  "last-values": __props.lastValues,
3495
+ "is-compare": __props.isCompare,
3443
3496
  onChange: onChangeHandler,
3444
3497
  onAddDiffCount
3445
- }), null, 16, ["model", "last-values"]))
3498
+ }), null, 16, ["model", "last-values", "is-compare"]))
3446
3499
  ]),
3447
3500
  _: 1
3448
3501
  /* STABLE */
3449
3502
  }, 16, ["class"]),
3450
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3503
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3451
3504
  key: 0,
3452
- placement: "left"
3505
+ placement: "top"
3453
3506
  }, {
3454
3507
  content: vue.withCtx(() => [
3455
3508
  vue.createElementVNode("div", {
3456
3509
  innerHTML: __props.config.tip
3457
- }, null, 8, _hoisted_4$4)
3510
+ }, null, 8, _hoisted_3$5)
3458
3511
  ]),
3459
3512
  default: vue.withCtx(() => [
3460
3513
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -3481,10 +3534,13 @@
3481
3534
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
3482
3535
  }), {
3483
3536
  label: vue.withCtx(() => [
3484
- vue.createElementVNode("span", {
3485
- innerHTML: type.value === "checkbox" ? "" : text.value,
3486
- title: __props.config.labelTitle
3487
- }, null, 8, _hoisted_5$3)
3537
+ vue.createVNode(_sfc_main$B, {
3538
+ tip: __props.config.tip,
3539
+ type: type.value,
3540
+ "use-label": __props.config.useLabel,
3541
+ "label-title": __props.config.labelTitle,
3542
+ text: text.value
3543
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
3488
3544
  ]),
3489
3545
  default: vue.withCtx(() => [
3490
3546
  tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
@@ -3494,7 +3550,7 @@
3494
3550
  content: vue.withCtx(() => [
3495
3551
  vue.createElementVNode("div", {
3496
3552
  innerHTML: tooltip.value.text
3497
- }, null, 8, _hoisted_6$1)
3553
+ }, null, 8, _hoisted_4$4)
3498
3554
  ]),
3499
3555
  default: vue.withCtx(() => [
3500
3556
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
@@ -3512,14 +3568,14 @@
3512
3568
  _: 1
3513
3569
  /* STABLE */
3514
3570
  }, 16, ["class"]),
3515
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3571
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3516
3572
  key: 0,
3517
- placement: "left"
3573
+ placement: "top"
3518
3574
  }, {
3519
3575
  content: vue.withCtx(() => [
3520
3576
  vue.createElementVNode("div", {
3521
3577
  innerHTML: __props.config.tip
3522
- }, null, 8, _hoisted_7$1)
3578
+ }, null, 8, _hoisted_5$3)
3523
3579
  ]),
3524
3580
  default: vue.withCtx(() => [
3525
3581
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -3539,10 +3595,13 @@
3539
3595
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
3540
3596
  }), {
3541
3597
  label: vue.withCtx(() => [
3542
- vue.createElementVNode("span", {
3543
- innerHTML: type.value === "checkbox" ? "" : text.value,
3544
- title: __props.config.labelTitle
3545
- }, null, 8, _hoisted_8$1)
3598
+ vue.createVNode(_sfc_main$B, {
3599
+ tip: __props.config.tip,
3600
+ type: type.value,
3601
+ "use-label": __props.config.useLabel,
3602
+ "label-title": __props.config.labelTitle,
3603
+ text: text.value
3604
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
3546
3605
  ]),
3547
3606
  default: vue.withCtx(() => [
3548
3607
  tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
@@ -3552,7 +3611,7 @@
3552
3611
  content: vue.withCtx(() => [
3553
3612
  vue.createElementVNode("div", {
3554
3613
  innerHTML: tooltip.value.text
3555
- }, null, 8, _hoisted_9)
3614
+ }, null, 8, _hoisted_6$1)
3556
3615
  ]),
3557
3616
  default: vue.withCtx(() => [
3558
3617
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
@@ -3570,14 +3629,14 @@
3570
3629
  _: 1
3571
3630
  /* STABLE */
3572
3631
  }, 16, ["style", "class"]),
3573
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3632
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3574
3633
  key: 1,
3575
- placement: "left"
3634
+ placement: "top"
3576
3635
  }, {
3577
3636
  content: vue.withCtx(() => [
3578
3637
  vue.createElementVNode("div", {
3579
3638
  innerHTML: __props.config.tip
3580
- }, null, 8, _hoisted_10)
3639
+ }, null, 8, _hoisted_7$1)
3581
3640
  ]),
3582
3641
  default: vue.withCtx(() => [
3583
3642
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -3625,7 +3684,7 @@
3625
3684
  64
3626
3685
  /* STABLE_FRAGMENT */
3627
3686
  )) : vue.createCommentVNode("v-if", true),
3628
- __props.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
3687
+ __props.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, [
3629
3688
  vue.createVNode(vue.unref(design.TMagicButton), {
3630
3689
  type: "primary",
3631
3690
  size: "small",
@@ -4338,23 +4397,24 @@
4338
4397
  /* STABLE */
4339
4398
  }, 8, ["icon"])) : vue.createCommentVNode("v-if", true),
4340
4399
  vue.createElementVNode("div", _hoisted_5$1, [
4341
- addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
4400
+ addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), vue.mergeProps({
4342
4401
  key: 0,
4343
- type: "primary",
4344
4402
  size: __props.config.enableToggleMode ? "small" : "default",
4403
+ icon: vue.unref(iconsVue.Plus)
4404
+ }, __props.config.addButtonConfig?.props || { type: "primary" }, {
4345
4405
  disabled: __props.disabled,
4346
4406
  onClick: addHandler
4347
- }, {
4348
- default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
4407
+ }), {
4408
+ default: vue.withCtx(() => [
4349
4409
  vue.createTextVNode(
4350
- "新增",
4351
- -1
4352
- /* CACHED */
4410
+ vue.toDisplayString(__props.config.addButtonConfig?.text || "新增"),
4411
+ 1
4412
+ /* TEXT */
4353
4413
  )
4354
- ])]),
4414
+ ]),
4355
4415
  _: 1
4356
4416
  /* STABLE */
4357
- }, 8, ["size", "disabled"])) : vue.createCommentVNode("v-if", true)
4417
+ }, 16, ["size", "icon", "disabled"])) : vue.createCommentVNode("v-if", true)
4358
4418
  ])
4359
4419
  ])
4360
4420
  ]);
@@ -4387,7 +4447,7 @@
4387
4447
  disabled: { type: Boolean }
4388
4448
  },
4389
4449
  emits: ["change", "addDiffCount"],
4390
- setup(__props, { emit: __emit }) {
4450
+ setup(__props, { expose: __expose, emit: __emit }) {
4391
4451
  const props = __props;
4392
4452
  const emit = __emit;
4393
4453
  const mForm = vue.inject("mForm");
@@ -4398,6 +4458,12 @@
4398
4458
  emit("change", props.model, eventData);
4399
4459
  };
4400
4460
  const onAddDiffCount = () => emit("addDiffCount");
4461
+ __expose({
4462
+ getExpand: () => expand.value,
4463
+ setExpand: (v) => {
4464
+ expand.value = v;
4465
+ }
4466
+ });
4401
4467
  return (_ctx, _cache) => {
4402
4468
  return items.value && items.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), {
4403
4469
  key: 0,
@@ -4412,18 +4478,23 @@
4412
4478
  icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
4413
4479
  onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
4414
4480
  }, null, 8, ["icon"]),
4415
- __props.config && __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
4416
- key: 0,
4417
- innerHTML: __props.config.extra,
4418
- class: "m-form-tip"
4419
- }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("v-if", true),
4420
4481
  vue.renderSlot(_ctx.$slots, "header", {}, () => [
4421
- vue.createTextVNode(
4482
+ vue.createElementVNode(
4483
+ "span",
4484
+ {
4485
+ style: { "cursor": "pointer" },
4486
+ onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
4487
+ },
4422
4488
  vue.toDisplayString(filter(__props.config.title)),
4423
4489
  1
4424
4490
  /* TEXT */
4425
4491
  )
4426
- ])
4492
+ ]),
4493
+ __props.config && __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
4494
+ key: 0,
4495
+ innerHTML: __props.config.extra,
4496
+ class: "m-form-tip"
4497
+ }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("v-if", true)
4427
4498
  ])
4428
4499
  ]),
4429
4500
  default: vue.withCtx(() => [
@@ -4446,7 +4517,7 @@
4446
4517
  disabled: __props.disabled,
4447
4518
  "label-width": __props.config.labelWidth || __props.labelWidth,
4448
4519
  onChange: changeHandler,
4449
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
4520
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
4450
4521
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
4451
4522
  }),
4452
4523
  128
@@ -4472,7 +4543,7 @@
4472
4543
  disabled: __props.disabled,
4473
4544
  "label-width": __props.config.labelWidth || __props.labelWidth,
4474
4545
  onChange: changeHandler,
4475
- onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
4546
+ onAddDiffCount: _cache[3] || (_cache[3] = ($event) => onAddDiffCount())
4476
4547
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
4477
4548
  }),
4478
4549
  128
@@ -4966,7 +5037,8 @@
4966
5037
  prop: {},
4967
5038
  disabled: { type: Boolean },
4968
5039
  size: {},
4969
- lastValues: {}
5040
+ lastValues: {},
5041
+ isCompare: { type: Boolean }
4970
5042
  },
4971
5043
  emits: ["change"],
4972
5044
  setup(__props, { emit: __emit }) {
@@ -5093,7 +5165,8 @@
5093
5165
  prop: {},
5094
5166
  disabled: { type: Boolean },
5095
5167
  size: {},
5096
- lastValues: {}
5168
+ lastValues: {},
5169
+ isCompare: { type: Boolean }
5097
5170
  },
5098
5171
  emits: ["change"],
5099
5172
  setup(__props, { emit: __emit }) {
@@ -5165,7 +5238,8 @@
5165
5238
  prop: {},
5166
5239
  disabled: { type: Boolean },
5167
5240
  size: {},
5168
- lastValues: {}
5241
+ lastValues: {},
5242
+ isCompare: { type: Boolean }
5169
5243
  },
5170
5244
  emits: ["change"],
5171
5245
  setup(__props, { emit: __emit }) {
@@ -5238,7 +5312,8 @@
5238
5312
  prop: {},
5239
5313
  disabled: { type: Boolean },
5240
5314
  size: {},
5241
- lastValues: {}
5315
+ lastValues: {},
5316
+ isCompare: { type: Boolean }
5242
5317
  },
5243
5318
  emits: ["change"],
5244
5319
  setup(__props, { emit: __emit }) {
@@ -5272,7 +5347,8 @@
5272
5347
  prop: {},
5273
5348
  disabled: { type: Boolean },
5274
5349
  size: {},
5275
- lastValues: {}
5350
+ lastValues: {},
5351
+ isCompare: { type: Boolean }
5276
5352
  },
5277
5353
  emits: ["change"],
5278
5354
  setup(__props, { emit: __emit }) {
@@ -5312,7 +5388,8 @@
5312
5388
  prop: {},
5313
5389
  disabled: { type: Boolean },
5314
5390
  size: {},
5315
- lastValues: {}
5391
+ lastValues: {},
5392
+ isCompare: { type: Boolean }
5316
5393
  },
5317
5394
  emits: ["change"],
5318
5395
  setup(__props, { emit: __emit }) {
@@ -5424,7 +5501,8 @@
5424
5501
  prop: {},
5425
5502
  disabled: { type: Boolean },
5426
5503
  size: {},
5427
- lastValues: {}
5504
+ lastValues: {},
5505
+ isCompare: { type: Boolean }
5428
5506
  },
5429
5507
  emits: ["change"],
5430
5508
  setup(__props, { emit: __emit }) {
@@ -5478,7 +5556,8 @@
5478
5556
  prop: {},
5479
5557
  disabled: { type: Boolean },
5480
5558
  size: {},
5481
- lastValues: {}
5559
+ lastValues: {},
5560
+ isCompare: { type: Boolean }
5482
5561
  },
5483
5562
  setup(__props) {
5484
5563
  const props = __props;
@@ -5513,7 +5592,8 @@
5513
5592
  prop: {},
5514
5593
  disabled: { type: Boolean },
5515
5594
  size: {},
5516
- lastValues: {}
5595
+ lastValues: {},
5596
+ isCompare: { type: Boolean }
5517
5597
  },
5518
5598
  emits: ["change"],
5519
5599
  setup(__props, { emit: __emit }) {
@@ -5614,7 +5694,8 @@
5614
5694
  prop: {},
5615
5695
  disabled: { type: Boolean },
5616
5696
  size: {},
5617
- lastValues: {}
5697
+ lastValues: {},
5698
+ isCompare: { type: Boolean }
5618
5699
  },
5619
5700
  setup(__props) {
5620
5701
  const props = __props;
@@ -5879,7 +5960,12 @@
5879
5960
  zIndex: {},
5880
5961
  size: {},
5881
5962
  confirmText: { default: "确定" },
5882
- preventSubmitDefault: { type: Boolean }
5963
+ preventSubmitDefault: { type: Boolean },
5964
+ closeOnClickModal: { type: Boolean, default: false },
5965
+ closeOnPressEscape: { type: Boolean, default: false },
5966
+ destroyOnClose: { type: Boolean, default: false },
5967
+ showClose: { type: Boolean, default: true },
5968
+ showCancel: { type: Boolean, default: true }
5883
5969
  },
5884
5970
  emits: ["close", "submit", "error", "change"],
5885
5971
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -5959,7 +6045,10 @@
5959
6045
  width: __props.width,
5960
6046
  zIndex: __props.zIndex,
5961
6047
  fullscreen: __props.fullscreen,
5962
- "close-on-click-modal": false,
6048
+ "close-on-click-modal": __props.closeOnClickModal,
6049
+ "close-on-press-escape": __props.closeOnPressEscape,
6050
+ "destroy-on-close": __props.destroyOnClose,
6051
+ "show-close": __props.showClose,
5963
6052
  onClose: closeHandler
5964
6053
  }, {
5965
6054
  footer: vue.withCtx(() => [
@@ -5980,7 +6069,8 @@
5980
6069
  vue.createVNode(vue.unref(design.TMagicCol), { span: 12 }, {
5981
6070
  default: vue.withCtx(() => [
5982
6071
  vue.renderSlot(_ctx.$slots, "footer", {}, () => [
5983
- vue.createVNode(vue.unref(design.TMagicButton), {
6072
+ __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
6073
+ key: 0,
5984
6074
  onClick: cancel,
5985
6075
  size: "small"
5986
6076
  }, {
@@ -5993,9 +6083,9 @@
5993
6083
  ])]),
5994
6084
  _: 1
5995
6085
  /* STABLE */
5996
- }),
6086
+ })) : vue.createCommentVNode("v-if", true),
5997
6087
  hasStep.value && stepActive.value > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
5998
- key: 0,
6088
+ key: 1,
5999
6089
  type: "info",
6000
6090
  size: "small",
6001
6091
  onClick: preStep
@@ -6011,7 +6101,7 @@
6011
6101
  /* STABLE */
6012
6102
  })) : vue.createCommentVNode("v-if", true),
6013
6103
  hasStep.value && stepCount.value > stepActive.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
6014
- key: 1,
6104
+ key: 2,
6015
6105
  type: "info",
6016
6106
  size: "small",
6017
6107
  onClick: nextStep
@@ -6026,7 +6116,7 @@
6026
6116
  _: 1
6027
6117
  /* STABLE */
6028
6118
  })) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
6029
- key: 2,
6119
+ key: 3,
6030
6120
  type: "primary",
6031
6121
  size: "small",
6032
6122
  disabled: __props.disabled,
@@ -6086,7 +6176,7 @@
6086
6176
  ]),
6087
6177
  _: 3
6088
6178
  /* FORWARDED */
6089
- }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen"]);
6179
+ }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen", "close-on-click-modal", "close-on-press-escape", "destroy-on-close", "show-close"]);
6090
6180
  };
6091
6181
  }
6092
6182
  });
@@ -6110,7 +6200,8 @@
6110
6200
  prop: {},
6111
6201
  disabled: { type: Boolean },
6112
6202
  size: {},
6113
- lastValues: {}
6203
+ lastValues: {},
6204
+ isCompare: { type: Boolean }
6114
6205
  },
6115
6206
  emits: ["change"],
6116
6207
  setup(__props, { emit: __emit }) {
@@ -6221,16 +6312,27 @@
6221
6312
  prop: {},
6222
6313
  disabled: { type: Boolean },
6223
6314
  size: {},
6224
- lastValues: {}
6315
+ lastValues: {},
6316
+ isCompare: { type: Boolean }
6225
6317
  },
6226
6318
  emits: ["change", "input"],
6227
6319
  setup(__props, { emit: __emit }) {
6228
6320
  const props = __props;
6229
6321
  const emit = __emit;
6322
+ const value = vue.ref();
6323
+ vue.watch(
6324
+ () => props.model[props.name],
6325
+ (v) => {
6326
+ value.value = v;
6327
+ },
6328
+ {
6329
+ immediate: true
6330
+ }
6331
+ );
6230
6332
  useAddField(props.prop);
6231
6333
  const mForm = vue.inject("mForm");
6232
- const changeHandler = (value) => {
6233
- emit("change", value);
6334
+ const changeHandler = (value2) => {
6335
+ emit("change", value2);
6234
6336
  };
6235
6337
  const inputHandler = (v) => {
6236
6338
  emit("input", v);
@@ -6239,7 +6341,8 @@
6239
6341
  return (_ctx, _cache) => {
6240
6342
  return __props.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInputNumber), {
6241
6343
  key: 0,
6242
- "model-value": __props.model[__props.name],
6344
+ modelValue: value.value,
6345
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
6243
6346
  clearable: "",
6244
6347
  "controls-position": "right",
6245
6348
  size: __props.size,
@@ -6248,9 +6351,9 @@
6248
6351
  step: __props.config.step,
6249
6352
  placeholder: __props.config.placeholder,
6250
6353
  disabled: __props.disabled,
6251
- "onUpdate:modelValue": changeHandler,
6354
+ onChange: changeHandler,
6252
6355
  onInput: inputHandler
6253
- }, null, 8, ["model-value", "size", "max", "min", "step", "placeholder", "disabled"])) : vue.createCommentVNode("v-if", true);
6356
+ }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : vue.createCommentVNode("v-if", true);
6254
6357
  };
6255
6358
  }
6256
6359
  });
@@ -6270,12 +6373,26 @@
6270
6373
  prop: {},
6271
6374
  disabled: { type: Boolean },
6272
6375
  size: {},
6273
- lastValues: {}
6376
+ lastValues: {},
6377
+ isCompare: { type: Boolean }
6274
6378
  },
6275
6379
  emits: ["change"],
6276
6380
  setup(__props, { emit: __emit }) {
6277
6381
  const props = __props;
6278
6382
  const emit = __emit;
6383
+ const firstValue = vue.ref();
6384
+ const secondValue = vue.ref();
6385
+ vue.watch(
6386
+ () => props.model[props.name],
6387
+ ([first, second]) => {
6388
+ firstValue.value = first;
6389
+ secondValue.value = second;
6390
+ },
6391
+ {
6392
+ immediate: true,
6393
+ deep: true
6394
+ }
6395
+ );
6279
6396
  useAddField(props.prop);
6280
6397
  if (!Array.isArray(props.model[props.name])) {
6281
6398
  props.model[props.name] = [];
@@ -6289,13 +6406,14 @@
6289
6406
  return (_ctx, _cache) => {
6290
6407
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
6291
6408
  vue.createVNode(vue.unref(design.TMagicInput), {
6292
- "model-value": __props.model[__props.name][0],
6409
+ modelValue: firstValue.value,
6410
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => firstValue.value = $event),
6293
6411
  clearable: __props.config.clearable ?? true,
6294
6412
  size: __props.size,
6295
6413
  disabled: __props.disabled,
6296
- "onUpdate:modelValue": minChangeHandler
6297
- }, null, 8, ["model-value", "clearable", "size", "disabled"]),
6298
- _cache[0] || (_cache[0] = vue.createElementVNode(
6414
+ onChange: minChangeHandler
6415
+ }, null, 8, ["modelValue", "clearable", "size", "disabled"]),
6416
+ _cache[2] || (_cache[2] = vue.createElementVNode(
6299
6417
  "span",
6300
6418
  { class: "split-tag" },
6301
6419
  "-",
@@ -6303,12 +6421,13 @@
6303
6421
  /* CACHED */
6304
6422
  )),
6305
6423
  vue.createVNode(vue.unref(design.TMagicInput), {
6306
- "model-value": __props.model[__props.name][1],
6424
+ modelValue: secondValue.value,
6425
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => secondValue.value = $event),
6307
6426
  clearable: __props.config.clearable ?? true,
6308
6427
  size: __props.size,
6309
6428
  disabled: __props.disabled,
6310
- "onUpdate:modelValue": maxChangeHandler
6311
- }, null, 8, ["model-value", "clearable", "size", "disabled"])
6429
+ onChange: maxChangeHandler
6430
+ }, null, 8, ["modelValue", "clearable", "size", "disabled"])
6312
6431
  ]);
6313
6432
  };
6314
6433
  }
@@ -6328,7 +6447,8 @@
6328
6447
  prop: {},
6329
6448
  disabled: { type: Boolean },
6330
6449
  size: {},
6331
- lastValues: {}
6450
+ lastValues: {},
6451
+ isCompare: { type: Boolean }
6332
6452
  },
6333
6453
  emits: ["change"],
6334
6454
  setup(__props, { emit: __emit }) {
@@ -6426,7 +6546,8 @@
6426
6546
  prop: {},
6427
6547
  disabled: { type: Boolean },
6428
6548
  size: {},
6429
- lastValues: {}
6549
+ lastValues: {},
6550
+ isCompare: { type: Boolean }
6430
6551
  },
6431
6552
  emits: ["change"],
6432
6553
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -6877,7 +6998,8 @@
6877
6998
  prop: {},
6878
6999
  disabled: { type: Boolean },
6879
7000
  size: {},
6880
- lastValues: {}
7001
+ lastValues: {},
7002
+ isCompare: { type: Boolean }
6881
7003
  },
6882
7004
  emits: ["change"],
6883
7005
  setup(__props, { emit: __emit }) {
@@ -6937,7 +7059,8 @@
6937
7059
  prop: {},
6938
7060
  disabled: { type: Boolean },
6939
7061
  size: {},
6940
- lastValues: {}
7062
+ lastValues: {},
7063
+ isCompare: { type: Boolean }
6941
7064
  },
6942
7065
  emits: ["change", "input"],
6943
7066
  setup(__props, { emit: __emit }) {
@@ -6945,6 +7068,16 @@
6945
7068
  const emit = __emit;
6946
7069
  useAddField(props.prop);
6947
7070
  const mForm = vue.inject("mForm");
7071
+ const value = vue.ref("");
7072
+ vue.watch(
7073
+ () => props.model[props.name],
7074
+ (v) => {
7075
+ value.value = v;
7076
+ },
7077
+ {
7078
+ immediate: true
7079
+ }
7080
+ );
6948
7081
  const appendConfig = vue.computed(() => {
6949
7082
  if (typeof props.config.append === "string") {
6950
7083
  return {
@@ -6975,13 +7108,13 @@
6975
7108
  emit("change", props.model[props.name].trim() || "");
6976
7109
  popoverVisible.value = false;
6977
7110
  };
6978
- const checkWhiteSpace = debounce((value) => {
6979
- if (typeof value === "string" && !props.config.trim) {
6980
- popoverVisible.value = value.trim() !== value;
7111
+ const checkWhiteSpace = debounce((value2) => {
7112
+ if (typeof value2 === "string" && !props.config.trim) {
7113
+ popoverVisible.value = value2.trim() !== value2;
6981
7114
  }
6982
7115
  }, 300);
6983
- const changeHandler = (value) => {
6984
- emit("change", value);
7116
+ const changeHandler = (value2) => {
7117
+ emit("change", value2);
6985
7118
  };
6986
7119
  const inputHandler = (v) => {
6987
7120
  checkWhiteSpace(v);
@@ -6992,11 +7125,11 @@
6992
7125
  if (!appendConfig.value) return;
6993
7126
  if (typeof appendConfig.value.handler === "function") {
6994
7127
  const newChangeRecords = [];
6995
- const setModel = (key, value) => {
6996
- newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value });
7128
+ const setModel = (key, value2) => {
7129
+ newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value: value2 });
6997
7130
  };
6998
- const setFormValue = (key, value) => {
6999
- newChangeRecords.push({ propPath: key, value });
7131
+ const setFormValue = (key, value2) => {
7132
+ newChangeRecords.push({ propPath: key, value: value2 });
7000
7133
  };
7001
7134
  appendConfig.value.handler(mForm, {
7002
7135
  model: props.model,
@@ -7020,13 +7153,13 @@
7020
7153
  if (!arrowUp && !arrowDown) {
7021
7154
  return;
7022
7155
  }
7023
- const value = props.model[props.name];
7156
+ const value2 = props.model[props.name];
7024
7157
  let num;
7025
7158
  let unit;
7026
- if (utils.isNumber(value)) {
7027
- num = +value;
7159
+ if (utils.isNumber(value2)) {
7160
+ num = +value2;
7028
7161
  } else {
7029
- value.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
7162
+ value2.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
7030
7163
  num = +$1;
7031
7164
  unit = $2;
7032
7165
  });
@@ -7088,16 +7221,17 @@
7088
7221
  return (_ctx, _cache) => {
7089
7222
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
7090
7223
  vue.createVNode(vue.unref(design.TMagicInput), {
7091
- "model-value": __props.model[__props.name],
7224
+ modelValue: value.value,
7225
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
7092
7226
  ref_key: "input",
7093
7227
  ref: input,
7094
7228
  clearable: "",
7095
7229
  size: __props.size,
7096
7230
  placeholder: __props.config.placeholder,
7097
7231
  disabled: __props.disabled,
7098
- "onUpdate:modelValue": changeHandler,
7232
+ onChange: changeHandler,
7099
7233
  onInput: inputHandler,
7100
- onKeyup: _cache[0] || (_cache[0] = ($event) => keyUpHandler($event))
7234
+ onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
7101
7235
  }, vue.createSlots({
7102
7236
  _: 2
7103
7237
  /* DYNAMIC */
@@ -7143,7 +7277,7 @@
7143
7277
  ]),
7144
7278
  key: "1"
7145
7279
  } : void 0
7146
- ]), 1032, ["model-value", "size", "placeholder", "disabled"]),
7280
+ ]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
7147
7281
  (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
7148
7282
  popoverVisible.value ? (vue.openBlock(), vue.createElementBlock(
7149
7283
  "div",
@@ -7154,7 +7288,7 @@
7154
7288
  ref: popoverEl
7155
7289
  },
7156
7290
  [
7157
- _cache[4] || (_cache[4] = vue.createElementVNode(
7291
+ _cache[5] || (_cache[5] = vue.createElementVNode(
7158
7292
  "div",
7159
7293
  { class: "m-form-validate__warning" },
7160
7294
  "输入内容前后有空格,是否移除空格?",
@@ -7165,9 +7299,9 @@
7165
7299
  vue.createVNode(vue.unref(design.TMagicButton), {
7166
7300
  link: "",
7167
7301
  size: "small",
7168
- onClick: _cache[1] || (_cache[1] = ($event) => popoverVisible.value = false)
7302
+ onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
7169
7303
  }, {
7170
- default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
7304
+ default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
7171
7305
  vue.createTextVNode(
7172
7306
  "保持原样",
7173
7307
  -1
@@ -7182,7 +7316,7 @@
7182
7316
  size: "small",
7183
7317
  onClick: confirmTrimHandler
7184
7318
  }, {
7185
- default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
7319
+ default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
7186
7320
  vue.createTextVNode(
7187
7321
  "移除空格",
7188
7322
  -1
@@ -7193,7 +7327,7 @@
7193
7327
  /* STABLE */
7194
7328
  })
7195
7329
  ]),
7196
- _cache[5] || (_cache[5] = vue.createElementVNode(
7330
+ _cache[6] || (_cache[6] = vue.createElementVNode(
7197
7331
  "span",
7198
7332
  {
7199
7333
  class: "tmagic-form-text-popper-arrow",
@@ -7227,16 +7361,27 @@
7227
7361
  prop: {},
7228
7362
  disabled: { type: Boolean },
7229
7363
  size: {},
7230
- lastValues: {}
7364
+ lastValues: {},
7365
+ isCompare: { type: Boolean }
7231
7366
  },
7232
7367
  emits: ["change", "input"],
7233
7368
  setup(__props, { emit: __emit }) {
7234
7369
  const props = __props;
7235
7370
  const emit = __emit;
7371
+ const value = vue.ref("");
7372
+ vue.watch(
7373
+ () => props.model[props.name],
7374
+ (v) => {
7375
+ value.value = v;
7376
+ },
7377
+ {
7378
+ immediate: true
7379
+ }
7380
+ );
7236
7381
  useAddField(props.prop);
7237
7382
  const mForm = vue.inject("mForm");
7238
- const changeHandler = (value) => {
7239
- emit("change", value);
7383
+ const changeHandler = (value2) => {
7384
+ emit("change", value2);
7240
7385
  };
7241
7386
  const inputHandler = (v) => {
7242
7387
  emit("input", v);
@@ -7244,16 +7389,17 @@
7244
7389
  };
7245
7390
  return (_ctx, _cache) => {
7246
7391
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
7247
- "model-value": __props.model[__props.name],
7392
+ modelValue: value.value,
7393
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
7248
7394
  type: "textarea",
7249
7395
  size: __props.size,
7250
7396
  clearable: "",
7251
7397
  placeholder: __props.config.placeholder,
7252
7398
  disabled: __props.disabled,
7253
7399
  rows: __props.config.rows,
7254
- "onUpdate:modelValue": changeHandler,
7400
+ onChange: changeHandler,
7255
7401
  onInput: inputHandler
7256
- }, null, 8, ["model-value", "size", "placeholder", "disabled", "rows"]);
7402
+ }, null, 8, ["modelValue", "size", "placeholder", "disabled", "rows"]);
7257
7403
  };
7258
7404
  }
7259
7405
  });
@@ -7272,7 +7418,8 @@
7272
7418
  prop: {},
7273
7419
  disabled: { type: Boolean },
7274
7420
  size: {},
7275
- lastValues: {}
7421
+ lastValues: {},
7422
+ isCompare: { type: Boolean }
7276
7423
  },
7277
7424
  emits: ["change"],
7278
7425
  setup(__props, { emit: __emit }) {
@@ -7310,7 +7457,8 @@
7310
7457
  prop: {},
7311
7458
  disabled: { type: Boolean },
7312
7459
  size: {},
7313
- lastValues: {}
7460
+ lastValues: {},
7461
+ isCompare: { type: Boolean }
7314
7462
  },
7315
7463
  emits: ["change"],
7316
7464
  setup(__props, { emit: __emit }) {
@@ -7571,7 +7719,7 @@
7571
7719
  const rowDrop = () => {
7572
7720
  sortable?.destroy();
7573
7721
  const tableEl = tMagicTableRef.value?.getEl();
7574
- const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
7722
+ const tBodyEl = tableEl?.querySelector(".el-table__body > tbody") || tableEl?.querySelector(".t-table__body");
7575
7723
  if (!tBodyEl) {
7576
7724
  return;
7577
7725
  }
@@ -7818,6 +7966,17 @@
7818
7966
  }
7819
7967
  return fuc;
7820
7968
  };
7969
+ const titleTip = (fuc) => {
7970
+ if (typeof fuc === "function") {
7971
+ return fuc(mForm, {
7972
+ values: mForm?.initValues,
7973
+ model: props.model,
7974
+ formValue: mForm ? mForm.values : props.model,
7975
+ prop: props.prop
7976
+ });
7977
+ }
7978
+ return fuc;
7979
+ };
7821
7980
  const selection = vue.computed(() => {
7822
7981
  if (typeof props.config.selection === "function") {
7823
7982
  return props.config.selection(mForm, { model: props.model[modelName.value] });
@@ -7854,10 +8013,14 @@
7854
8013
  })
7855
8014
  });
7856
8015
  }
7857
- columns2.push({
8016
+ let actionFixed = props.config.fixed === false ? void 0 : "left";
8017
+ if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) {
8018
+ actionFixed = props.config.fixed;
8019
+ }
8020
+ const actionClumn = {
7858
8021
  props: {
7859
8022
  label: "操作",
7860
- fixed: props.config.fixed === false ? void 0 : "left",
8023
+ fixed: actionFixed,
7861
8024
  width: props.config.operateColWidth || 112,
7862
8025
  align: "center"
7863
8026
  },
@@ -7876,7 +8039,10 @@
7876
8039
  emit("change", v);
7877
8040
  }
7878
8041
  })
7879
- });
8042
+ };
8043
+ if (actionFixed !== "right") {
8044
+ columns2.push(actionClumn);
8045
+ }
7880
8046
  if (props.sort && props.model[modelName.value] && props.model[modelName.value].length > 1) {
7881
8047
  columns2.push({
7882
8048
  props: {
@@ -7919,6 +8085,7 @@
7919
8085
  }
7920
8086
  for (const column of props.config.items) {
7921
8087
  if (column.type !== "hidden" && display$1(column.display)) {
8088
+ const titleTipValue = titleTip(column.titleTip);
7922
8089
  columns2.push({
7923
8090
  props: {
7924
8091
  prop: column.name,
@@ -7940,10 +8107,33 @@
7940
8107
  size: props.size,
7941
8108
  onChange: changeHandler,
7942
8109
  onAddDiffCount
7943
- })
8110
+ }),
8111
+ title: titleTipValue ? () => vue.h(
8112
+ design.TMagicTooltip,
8113
+ { placement: "top" },
8114
+ {
8115
+ default: () => vue.h(
8116
+ "span",
8117
+ {
8118
+ style: {
8119
+ display: "inline-flex",
8120
+ alignItems: "center",
8121
+ gap: "5px"
8122
+ }
8123
+ },
8124
+ [vue.h("span", column.label), vue.h(design.TMagicIcon, {}, { default: () => vue.h(iconsVue.WarningFilled) })]
8125
+ ),
8126
+ content: () => vue.h("div", {
8127
+ innerHTML: titleTipValue
8128
+ })
8129
+ }
8130
+ ) : void 0
7944
8131
  });
7945
8132
  }
7946
8133
  }
8134
+ if (actionFixed === "right") {
8135
+ columns2.push(actionClumn);
8136
+ }
7947
8137
  return columns2;
7948
8138
  });
7949
8139
  return {
@@ -8158,24 +8348,26 @@
8158
8348
  /* STABLE */
8159
8349
  }, 8, ["disabled", "onClick"])) : vue.createCommentVNode("v-if", true)
8160
8350
  ]),
8161
- vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
8351
+ vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), vue.mergeProps({
8162
8352
  key: 0,
8353
+ class: "m-form-table-add-button",
8163
8354
  size: "small",
8164
- type: "primary",
8165
- disabled: __props.disabled,
8166
8355
  plain: "",
8356
+ icon: vue.unref(iconsVue.Plus)
8357
+ }, __props.config.addButtonConfig?.props || { type: "primary" }, {
8358
+ disabled: __props.disabled,
8167
8359
  onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(newHandler)())
8168
- }, {
8169
- default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
8360
+ }), {
8361
+ default: vue.withCtx(() => [
8170
8362
  vue.createTextVNode(
8171
- "新增一行",
8172
- -1
8173
- /* CACHED */
8363
+ vue.toDisplayString(__props.config.addButtonConfig?.text || "新增一行"),
8364
+ 1
8365
+ /* TEXT */
8174
8366
  )
8175
- ])]),
8367
+ ]),
8176
8368
  _: 1
8177
8369
  /* STABLE */
8178
- }, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
8370
+ }, 16, ["icon", "disabled"])) : vue.createCommentVNode("v-if", true)
8179
8371
  ]),
8180
8372
  __props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
8181
8373
  vue.createVNode(vue.unref(design.TMagicPagination), {