@tmagic/form 1.3.0-alpha.2 → 1.3.0-alpha.20

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 (85) hide show
  1. package/dist/style.css +21 -0
  2. package/dist/tmagic-form.js +1400 -1187
  3. package/dist/tmagic-form.js.map +1 -1
  4. package/dist/tmagic-form.umd.cjs +1425 -1210
  5. package/dist/tmagic-form.umd.cjs.map +1 -1
  6. package/package.json +10 -11
  7. package/src/Form.vue +14 -2
  8. package/src/FormDialog.vue +20 -6
  9. package/src/FormDrawer.vue +134 -0
  10. package/src/containers/Col.vue +5 -1
  11. package/src/containers/Container.vue +16 -11
  12. package/src/containers/Fieldset.vue +5 -1
  13. package/src/containers/GroupList.vue +7 -2
  14. package/src/containers/GroupListItem.vue +15 -9
  15. package/src/containers/Panel.vue +5 -1
  16. package/src/containers/Row.vue +5 -1
  17. package/src/containers/Step.vue +5 -1
  18. package/src/containers/Table.vue +153 -151
  19. package/src/containers/Tabs.vue +14 -8
  20. package/src/fields/Cascader.vue +7 -13
  21. package/src/fields/Checkbox.vue +7 -13
  22. package/src/fields/CheckboxGroup.vue +9 -15
  23. package/src/fields/ColorPicker.vue +10 -14
  24. package/src/fields/Date.vue +11 -15
  25. package/src/fields/DateTime.vue +12 -16
  26. package/src/fields/Daterange.vue +7 -13
  27. package/src/fields/Display.vue +7 -11
  28. package/src/fields/DynamicField.vue +8 -14
  29. package/src/fields/Hidden.vue +7 -11
  30. package/src/fields/Link.vue +7 -13
  31. package/src/fields/Number.vue +12 -15
  32. package/src/fields/NumberRange.vue +50 -0
  33. package/src/fields/RadioGroup.vue +7 -13
  34. package/src/fields/Select.vue +28 -30
  35. package/src/fields/SelectOptionGroups.vue +7 -3
  36. package/src/fields/SelectOptions.vue +5 -1
  37. package/src/fields/Switch.vue +11 -15
  38. package/src/fields/Text.vue +12 -15
  39. package/src/fields/Textarea.vue +12 -15
  40. package/src/fields/Time.vue +10 -14
  41. package/src/index.ts +43 -37
  42. package/src/schema.ts +27 -5
  43. package/src/theme/form-drawer.scss +11 -0
  44. package/src/theme/index.scss +2 -0
  45. package/src/theme/number-range.scss +8 -0
  46. package/src/theme/panel.scss +6 -0
  47. package/src/utils/config.ts +1 -1
  48. package/src/utils/form.ts +2 -1
  49. package/types/Form.vue.d.ts +11 -6
  50. package/types/FormDialog.vue.d.ts +89 -125
  51. package/types/FormDrawer.vue.d.ts +338 -0
  52. package/types/containers/Col.vue.d.ts +1 -1
  53. package/types/containers/Container.vue.d.ts +6 -3
  54. package/types/containers/Fieldset.vue.d.ts +6 -3
  55. package/types/containers/GroupList.vue.d.ts +1 -1
  56. package/types/containers/GroupListItem.vue.d.ts +1 -1
  57. package/types/containers/Panel.vue.d.ts +3 -3
  58. package/types/containers/Row.vue.d.ts +1 -1
  59. package/types/containers/Step.vue.d.ts +6 -3
  60. package/types/containers/Table.vue.d.ts +9 -6
  61. package/types/containers/Tabs.vue.d.ts +6 -3
  62. package/types/fields/Cascader.vue.d.ts +3 -23
  63. package/types/fields/Checkbox.vue.d.ts +3 -23
  64. package/types/fields/CheckboxGroup.vue.d.ts +3 -23
  65. package/types/fields/ColorPicker.vue.d.ts +2 -24
  66. package/types/fields/Date.vue.d.ts +2 -24
  67. package/types/fields/DateTime.vue.d.ts +2 -24
  68. package/types/fields/Daterange.vue.d.ts +3 -23
  69. package/types/fields/Display.vue.d.ts +2 -18
  70. package/types/fields/DynamicField.vue.d.ts +3 -32
  71. package/types/fields/Hidden.vue.d.ts +2 -18
  72. package/types/fields/Link.vue.d.ts +3 -23
  73. package/types/fields/Number.vue.d.ts +2 -25
  74. package/types/fields/NumberRange.vue.d.ts +12 -0
  75. package/types/fields/RadioGroup.vue.d.ts +3 -23
  76. package/types/fields/Select.vue.d.ts +3 -23
  77. package/types/fields/SelectOptionGroups.vue.d.ts +2 -2
  78. package/types/fields/SelectOptions.vue.d.ts +2 -2
  79. package/types/fields/Switch.vue.d.ts +2 -24
  80. package/types/fields/Text.vue.d.ts +2 -25
  81. package/types/fields/Textarea.vue.d.ts +2 -25
  82. package/types/fields/Time.vue.d.ts +2 -24
  83. package/types/index.d.ts +6 -1
  84. package/types/schema.d.ts +25 -5
  85. package/types/utils/config.d.ts +1 -1
@@ -90,7 +90,7 @@
90
90
  if (["switch", "checkbox"].includes(type)) {
91
91
  return false;
92
92
  }
93
- if (multiple) {
93
+ if (multiple || type === "number-range") {
94
94
  return [];
95
95
  }
96
96
  return "";
@@ -105,7 +105,8 @@
105
105
  parent: mForm?.parentValues || {},
106
106
  formValue: mForm?.values || props.model,
107
107
  prop: props.prop,
108
- config: props.config
108
+ config: props.config,
109
+ index: props.index
109
110
  });
110
111
  };
111
112
  const display = function(mForm, config, props) {
@@ -164,36 +165,36 @@
164
165
  return valuesTmp || {};
165
166
  };
166
167
 
167
- const _hoisted_1$b = ["innerHTML"];
168
+ const _hoisted_1$d = ["innerHTML"];
168
169
  const _hoisted_2$7 = ["innerHTML"];
169
- const _hoisted_3$7 = ["innerHTML"];
170
- const _hoisted_4$6 = ["innerHTML"];
171
- const _hoisted_5$4 = ["innerHTML"];
172
- const _hoisted_6$3 = ["innerHTML"];
173
- const _hoisted_7$3 = ["innerHTML"];
174
- const _hoisted_8$2 = ["innerHTML"];
175
- const _hoisted_9$1 = ["innerHTML"];
176
- const _hoisted_10$1 = ["innerHTML"];
170
+ const _hoisted_3$4 = ["innerHTML"];
171
+ const _hoisted_4$3 = ["innerHTML"];
172
+ const _hoisted_5$3 = ["innerHTML"];
173
+ const _hoisted_6$1 = ["innerHTML"];
174
+ const _hoisted_7$1 = ["innerHTML"];
175
+ const _hoisted_8$1 = ["innerHTML"];
176
+ const _hoisted_9 = ["innerHTML"];
177
+ const _hoisted_10 = ["innerHTML"];
177
178
  const _hoisted_11 = ["innerHTML"];
178
179
  const _hoisted_12 = ["innerHTML"];
179
180
  const _hoisted_13 = {
180
181
  key: 5,
181
182
  style: { "text-align": "center" }
182
183
  };
183
- const __default__$v = vue.defineComponent({
184
- name: "MFormContainer"
185
- });
186
- const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
187
- ...__default__$v,
184
+ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
185
+ ...{
186
+ name: "MFormContainer"
187
+ },
188
+ __name: "Container",
188
189
  props: {
189
- model: null,
190
+ model: {},
190
191
  lastValues: { default: () => ({}) },
191
- config: null,
192
+ config: {},
192
193
  prop: { default: "" },
193
194
  disabled: { type: Boolean },
194
- labelWidth: null,
195
+ labelWidth: {},
195
196
  expandMore: { type: Boolean, default: false },
196
- stepActive: null,
197
+ stepActive: {},
197
198
  size: { default: "small" },
198
199
  isCompare: { type: Boolean, default: false }
199
200
  },
@@ -230,6 +231,7 @@
230
231
  return "m-fields-text";
231
232
  });
232
233
  const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
234
+ const text = vue.computed(() => filterFunction(mForm, props.config.text, props));
233
235
  const tooltip = vue.computed(() => filterFunction(mForm, props.config.tooltip, props));
234
236
  const extra = vue.computed(() => filterFunction(mForm, props.config.extra, props));
235
237
  const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
@@ -260,7 +262,7 @@
260
262
  (showDiff2) => {
261
263
  if (type.value === "hidden")
262
264
  return;
263
- if (items.value && !props.config.text && type.value && display$1.value)
265
+ if (items.value && !text.value && type.value && display$1.value)
264
266
  return;
265
267
  if (display$1.value && showDiff2 && type.value) {
266
268
  emit("addDiffCount");
@@ -325,94 +327,94 @@
325
327
  return (_ctx, _cache) => {
326
328
  const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
327
329
  const _component_Container = vue.resolveComponent("Container", true);
328
- return __props.config ? (vue.openBlock(), vue.createElementBlock("div", {
330
+ return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
329
331
  key: 0,
330
- style: vue.normalizeStyle(__props.config.tip ? "display: flex;align-items: baseline;" : ""),
331
- class: vue.normalizeClass([__props.config.className, "m-form-container"])
332
+ style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
333
+ class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
332
334
  }, [
333
- vue.unref(type) === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
335
+ type.value === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
334
336
  key: 0,
335
- model: __props.model,
336
- config: __props.config,
337
- name: __props.config.name,
338
- disabled: vue.unref(disabled),
339
- prop: vue.unref(itemProp)
340
- }, null, 8, ["model", "config", "name", "disabled", "prop"])) : vue.unref(items) && !__props.config.text && vue.unref(type) && vue.unref(display$1) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
341
- key: key(__props.config),
342
- size: __props.size,
343
- model: __props.model,
344
- "last-values": __props.lastValues,
345
- "is-compare": __props.isCompare,
346
- config: __props.config,
347
- disabled: vue.unref(disabled),
348
- name: vue.unref(name),
349
- prop: vue.unref(itemProp),
350
- "step-active": __props.stepActive,
337
+ model: _ctx.model,
338
+ config: _ctx.config,
339
+ name: _ctx.config.name,
340
+ disabled: disabled.value,
341
+ prop: itemProp.value
342
+ }, null, 8, ["model", "config", "name", "disabled", "prop"])) : items.value && !text.value && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
343
+ key: key(_ctx.config),
344
+ size: _ctx.size,
345
+ model: _ctx.model,
346
+ "last-values": _ctx.lastValues,
347
+ "is-compare": _ctx.isCompare,
348
+ config: _ctx.config,
349
+ disabled: disabled.value,
350
+ name: name.value,
351
+ prop: itemProp.value,
352
+ "step-active": _ctx.stepActive,
351
353
  "expand-more": expand.value,
352
- "label-width": vue.unref(itemLabelWidth),
354
+ "label-width": itemLabelWidth.value,
353
355
  onChange: onChangeHandler,
354
356
  onAddDiffCount
355
- }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : vue.unref(type) && vue.unref(display$1) && !vue.unref(showDiff) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
357
+ }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : type.value && display$1.value && !showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
356
358
  vue.createVNode(vue.unref(design.TMagicFormItem), {
357
- style: vue.normalizeStyle(__props.config.tip ? "flex: 1" : ""),
358
- class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
359
- prop: vue.unref(itemProp),
360
- "label-width": vue.unref(itemLabelWidth),
361
- rules: vue.unref(rule)
359
+ style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
360
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
361
+ prop: itemProp.value,
362
+ "label-width": itemLabelWidth.value,
363
+ rules: rule.value
362
364
  }, {
363
365
  label: vue.withCtx(() => [
364
366
  vue.createElementVNode("span", {
365
- innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
366
- }, null, 8, _hoisted_1$b)
367
+ innerHTML: type.value === "checkbox" ? "" : text.value
368
+ }, null, 8, _hoisted_1$d)
367
369
  ]),
368
370
  default: vue.withCtx(() => [
369
- vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
371
+ tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
370
372
  content: vue.withCtx(() => [
371
- vue.createElementVNode("div", { innerHTML: vue.unref(tooltip) }, null, 8, _hoisted_2$7)
373
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$7)
372
374
  ]),
373
375
  default: vue.withCtx(() => [
374
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
375
- key: key(__props.config),
376
- size: __props.size,
377
- model: __props.model,
378
- "last-values": __props.lastValues,
379
- config: __props.config,
380
- name: vue.unref(name),
381
- disabled: vue.unref(disabled),
382
- prop: vue.unref(itemProp),
376
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
377
+ key: key(_ctx.config),
378
+ size: _ctx.size,
379
+ model: _ctx.model,
380
+ "last-values": _ctx.lastValues,
381
+ config: _ctx.config,
382
+ name: name.value,
383
+ disabled: disabled.value,
384
+ prop: itemProp.value,
383
385
  onChange: onChangeHandler,
384
386
  onAddDiffCount
385
387
  }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"]))
386
388
  ]),
387
389
  _: 1
388
- })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
389
- key: key(__props.config),
390
- size: __props.size,
391
- model: __props.model,
392
- "last-values": __props.lastValues,
393
- config: __props.config,
394
- name: vue.unref(name),
395
- disabled: vue.unref(disabled),
396
- prop: vue.unref(itemProp),
390
+ })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
391
+ key: key(_ctx.config),
392
+ size: _ctx.size,
393
+ model: _ctx.model,
394
+ "last-values": _ctx.lastValues,
395
+ config: _ctx.config,
396
+ name: name.value,
397
+ disabled: disabled.value,
398
+ prop: itemProp.value,
397
399
  onChange: onChangeHandler,
398
400
  onAddDiffCount
399
401
  }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"])),
400
- vue.unref(extra) && vue.unref(type) !== "table" ? (vue.openBlock(), vue.createElementBlock("div", {
402
+ extra.value && type.value !== "table" ? (vue.openBlock(), vue.createElementBlock("div", {
401
403
  key: 2,
402
- innerHTML: vue.unref(extra),
404
+ innerHTML: extra.value,
403
405
  class: "m-form-tip"
404
- }, null, 8, _hoisted_3$7)) : vue.createCommentVNode("", true)
406
+ }, null, 8, _hoisted_3$4)) : vue.createCommentVNode("", true)
405
407
  ]),
406
408
  _: 1
407
409
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
408
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
410
+ _ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
409
411
  key: 0,
410
412
  placement: "left"
411
413
  }, {
412
414
  content: vue.withCtx(() => [
413
415
  vue.createElementVNode("div", {
414
- innerHTML: __props.config.tip
415
- }, null, 8, _hoisted_4$6)
416
+ innerHTML: _ctx.config.tip
417
+ }, null, 8, _hoisted_4$3)
416
418
  ]),
417
419
  default: vue.withCtx(() => [
418
420
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -424,63 +426,63 @@
424
426
  ]),
425
427
  _: 1
426
428
  })) : vue.createCommentVNode("", true)
427
- ], 64)) : vue.unref(type) && vue.unref(display$1) && vue.unref(showDiff) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
429
+ ], 64)) : type.value && display$1.value && showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
428
430
  vue.createVNode(vue.unref(design.TMagicFormItem), {
429
- style: vue.normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
430
- class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
431
- prop: vue.unref(itemProp),
432
- "label-width": vue.unref(itemLabelWidth),
433
- rules: vue.unref(rule)
431
+ style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
432
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
433
+ prop: itemProp.value,
434
+ "label-width": itemLabelWidth.value,
435
+ rules: rule.value
434
436
  }, {
435
437
  label: vue.withCtx(() => [
436
438
  vue.createElementVNode("span", {
437
- innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
438
- }, null, 8, _hoisted_5$4)
439
+ innerHTML: type.value === "checkbox" ? "" : text.value
440
+ }, null, 8, _hoisted_5$3)
439
441
  ]),
440
442
  default: vue.withCtx(() => [
441
- vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
443
+ tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
442
444
  content: vue.withCtx(() => [
443
- vue.createElementVNode("div", { innerHTML: vue.unref(tooltip) }, null, 8, _hoisted_6$3)
445
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_6$1)
444
446
  ]),
445
447
  default: vue.withCtx(() => [
446
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
447
- key: key(__props.config),
448
- size: __props.size,
449
- model: __props.lastValues,
450
- config: __props.config,
451
- name: vue.unref(name),
452
- disabled: vue.unref(disabled),
453
- prop: vue.unref(itemProp),
448
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
449
+ key: key(_ctx.config),
450
+ size: _ctx.size,
451
+ model: _ctx.lastValues,
452
+ config: _ctx.config,
453
+ name: name.value,
454
+ disabled: disabled.value,
455
+ prop: itemProp.value,
454
456
  onChange: onChangeHandler
455
457
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
456
458
  ]),
457
459
  _: 1
458
- })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
459
- key: key(__props.config),
460
- size: __props.size,
461
- model: __props.lastValues,
462
- config: __props.config,
463
- name: vue.unref(name),
464
- disabled: vue.unref(disabled),
465
- prop: vue.unref(itemProp),
460
+ })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
461
+ key: key(_ctx.config),
462
+ size: _ctx.size,
463
+ model: _ctx.lastValues,
464
+ config: _ctx.config,
465
+ name: name.value,
466
+ disabled: disabled.value,
467
+ prop: itemProp.value,
466
468
  onChange: onChangeHandler
467
469
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
468
- vue.unref(extra) ? (vue.openBlock(), vue.createElementBlock("div", {
470
+ extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
469
471
  key: 2,
470
- innerHTML: vue.unref(extra),
472
+ innerHTML: extra.value,
471
473
  class: "m-form-tip"
472
- }, null, 8, _hoisted_7$3)) : vue.createCommentVNode("", true)
474
+ }, null, 8, _hoisted_7$1)) : vue.createCommentVNode("", true)
473
475
  ]),
474
476
  _: 1
475
477
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
476
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
478
+ _ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
477
479
  key: 0,
478
480
  placement: "left"
479
481
  }, {
480
482
  content: vue.withCtx(() => [
481
483
  vue.createElementVNode("div", {
482
- innerHTML: __props.config.tip
483
- }, null, 8, _hoisted_8$2)
484
+ innerHTML: _ctx.config.tip
485
+ }, null, 8, _hoisted_8$1)
484
486
  ]),
485
487
  default: vue.withCtx(() => [
486
488
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -493,60 +495,60 @@
493
495
  _: 1
494
496
  })) : vue.createCommentVNode("", true),
495
497
  vue.createVNode(vue.unref(design.TMagicFormItem), {
496
- style: vue.normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
497
- class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
498
- prop: vue.unref(itemProp),
499
- "label-width": vue.unref(itemLabelWidth),
500
- rules: vue.unref(rule)
498
+ style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
499
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
500
+ prop: itemProp.value,
501
+ "label-width": itemLabelWidth.value,
502
+ rules: rule.value
501
503
  }, {
502
504
  label: vue.withCtx(() => [
503
505
  vue.createElementVNode("span", {
504
- innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
505
- }, null, 8, _hoisted_9$1)
506
+ innerHTML: type.value === "checkbox" ? "" : text.value
507
+ }, null, 8, _hoisted_9)
506
508
  ]),
507
509
  default: vue.withCtx(() => [
508
- vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
510
+ tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
509
511
  content: vue.withCtx(() => [
510
- vue.createElementVNode("div", { innerHTML: vue.unref(tooltip) }, null, 8, _hoisted_10$1)
512
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_10)
511
513
  ]),
512
514
  default: vue.withCtx(() => [
513
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
514
- key: key(__props.config),
515
- size: __props.size,
516
- model: __props.model,
517
- config: __props.config,
518
- name: vue.unref(name),
519
- disabled: vue.unref(disabled),
520
- prop: vue.unref(itemProp),
515
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
516
+ key: key(_ctx.config),
517
+ size: _ctx.size,
518
+ model: _ctx.model,
519
+ config: _ctx.config,
520
+ name: name.value,
521
+ disabled: disabled.value,
522
+ prop: itemProp.value,
521
523
  onChange: onChangeHandler
522
524
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
523
525
  ]),
524
526
  _: 1
525
- })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
526
- key: key(__props.config),
527
- size: __props.size,
528
- model: __props.model,
529
- config: __props.config,
530
- name: vue.unref(name),
531
- disabled: vue.unref(disabled),
532
- prop: vue.unref(itemProp),
527
+ })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
528
+ key: key(_ctx.config),
529
+ size: _ctx.size,
530
+ model: _ctx.model,
531
+ config: _ctx.config,
532
+ name: name.value,
533
+ disabled: disabled.value,
534
+ prop: itemProp.value,
533
535
  onChange: onChangeHandler
534
536
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
535
- vue.unref(extra) ? (vue.openBlock(), vue.createElementBlock("div", {
537
+ extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
536
538
  key: 2,
537
- innerHTML: vue.unref(extra),
539
+ innerHTML: extra.value,
538
540
  class: "m-form-tip"
539
541
  }, null, 8, _hoisted_11)) : vue.createCommentVNode("", true)
540
542
  ]),
541
543
  _: 1
542
544
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
543
- __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
545
+ _ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
544
546
  key: 1,
545
547
  placement: "left"
546
548
  }, {
547
549
  content: vue.withCtx(() => [
548
550
  vue.createElementVNode("div", {
549
- innerHTML: __props.config.tip
551
+ innerHTML: _ctx.config.tip
550
552
  }, null, 8, _hoisted_12)
551
553
  ]),
552
554
  default: vue.withCtx(() => [
@@ -559,26 +561,26 @@
559
561
  ]),
560
562
  _: 1
561
563
  })) : vue.createCommentVNode("", true)
562
- ], 64)) : vue.unref(items) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
563
- (vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(items), (item) => {
564
+ ], 64)) : items.value && display$1.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
565
+ (name.value || name.value === 0 ? _ctx.model[name.value] : _ctx.model) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(items.value, (item) => {
564
566
  return vue.openBlock(), vue.createBlock(_component_Container, {
565
567
  key: key(item),
566
- model: vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model,
567
- "last-values": vue.unref(name) || vue.unref(name) === 0 ? __props.lastValues[vue.unref(name)] || {} : __props.lastValues,
568
- "is-compare": __props.isCompare,
568
+ model: name.value || name.value === 0 ? _ctx.model[name.value] : _ctx.model,
569
+ "last-values": name.value || name.value === 0 ? _ctx.lastValues[name.value] || {} : _ctx.lastValues,
570
+ "is-compare": _ctx.isCompare,
569
571
  config: item,
570
- size: __props.size,
571
- disabled: vue.unref(disabled),
572
- "step-active": __props.stepActive,
572
+ size: _ctx.size,
573
+ disabled: disabled.value,
574
+ "step-active": _ctx.stepActive,
573
575
  "expand-more": expand.value,
574
- "label-width": vue.unref(itemLabelWidth),
575
- prop: vue.unref(itemProp),
576
+ "label-width": itemLabelWidth.value,
577
+ prop: itemProp.value,
576
578
  onChange: onChangeHandler,
577
579
  onAddDiffCount
578
580
  }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
579
581
  }), 128)) : vue.createCommentVNode("", true)
580
582
  ], 64)) : vue.createCommentVNode("", true),
581
- __props.config.expand && vue.unref(type) !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
583
+ _ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
582
584
  vue.createVNode(vue.unref(design.TMagicButton), {
583
585
  type: "primary",
584
586
  size: "small",
@@ -597,30 +599,30 @@
597
599
  }
598
600
  });
599
601
 
600
- const _hoisted_1$a = ["innerHTML"];
602
+ const _hoisted_1$c = ["innerHTML"];
601
603
  const _hoisted_2$6 = ["innerHTML"];
602
- const _hoisted_3$6 = { key: 1 };
603
- const _hoisted_4$5 = ["innerHTML"];
604
- const _hoisted_5$3 = ["innerHTML"];
605
- const _hoisted_6$2 = {
604
+ const _hoisted_3$3 = { key: 1 };
605
+ const _hoisted_4$2 = ["innerHTML"];
606
+ const _hoisted_5$2 = ["innerHTML"];
607
+ const _hoisted_6 = {
606
608
  key: 2,
607
609
  style: { "display": "flex" }
608
610
  };
609
- const _hoisted_7$2 = { style: { "flex": "1" } };
610
- const _hoisted_8$1 = ["src"];
611
- const __default__$u = vue.defineComponent({
612
- name: "MFormFieldset"
613
- });
614
- const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
615
- ...__default__$u,
611
+ const _hoisted_7 = { style: { "flex": "1" } };
612
+ const _hoisted_8 = ["src"];
613
+ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
614
+ ...{
615
+ name: "MFormFieldset"
616
+ },
617
+ __name: "Fieldset",
616
618
  props: {
617
- labelWidth: null,
619
+ labelWidth: {},
618
620
  prop: { default: "" },
619
- size: null,
620
- model: null,
621
+ size: {},
622
+ model: {},
621
623
  lastValues: { default: () => ({}) },
622
624
  isCompare: { type: Boolean, default: false },
623
- config: null,
625
+ config: {},
624
626
  rules: { default: {} },
625
627
  disabled: { type: Boolean }
626
628
  },
@@ -647,30 +649,30 @@
647
649
  const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
648
650
  const onAddDiffCount = () => emit("addDiffCount");
649
651
  return (_ctx, _cache) => {
650
- return (vue.unref(name) ? __props.model[vue.unref(name)] : __props.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
652
+ return (name.value ? _ctx.model[name.value] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
651
653
  key: 0,
652
654
  class: "m-fieldset",
653
- style: vue.normalizeStyle(vue.unref(show) ? "padding: 15px 15px 0 5px;" : "border: 0")
655
+ style: vue.normalizeStyle(show.value ? "padding: 15px 15px 0 5px;" : "border: 0")
654
656
  }, [
655
- vue.unref(name) && __props.config.checkbox ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!vue.unref(show) ? "div" : "legend"), { key: 0 }, {
657
+ name.value && _ctx.config.checkbox ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
656
658
  default: vue.withCtx(() => [
657
659
  vue.createVNode(vue.unref(design.TMagicCheckbox), {
658
- modelValue: __props.model[vue.unref(name)].value,
660
+ modelValue: _ctx.model[name.value].value,
659
661
  "onUpdate:modelValue": [
660
- _cache[0] || (_cache[0] = ($event) => __props.model[vue.unref(name)].value = $event),
662
+ _cache[0] || (_cache[0] = ($event) => _ctx.model[name.value].value = $event),
661
663
  change
662
664
  ],
663
- prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.value`,
665
+ prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
664
666
  "true-label": 1,
665
667
  "false-label": 0
666
668
  }, {
667
669
  default: vue.withCtx(() => [
668
670
  vue.createElementVNode("span", {
669
- innerHTML: __props.config.legend
670
- }, null, 8, _hoisted_1$a),
671
- __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
671
+ innerHTML: _ctx.config.legend
672
+ }, null, 8, _hoisted_1$c),
673
+ _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
672
674
  key: 0,
673
- innerHTML: __props.config.extra,
675
+ innerHTML: _ctx.config.extra,
674
676
  class: "m-form-tip"
675
677
  }, null, 8, _hoisted_2$6)) : vue.createCommentVNode("", true)
676
678
  ]),
@@ -678,30 +680,30 @@
678
680
  }, 8, ["modelValue", "prop"])
679
681
  ]),
680
682
  _: 1
681
- })) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$6, [
683
+ })) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$3, [
682
684
  vue.createElementVNode("span", {
683
- innerHTML: __props.config.legend
684
- }, null, 8, _hoisted_4$5),
685
- __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
685
+ innerHTML: _ctx.config.legend
686
+ }, null, 8, _hoisted_4$2),
687
+ _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
686
688
  key: 0,
687
- innerHTML: __props.config.extra,
689
+ innerHTML: _ctx.config.extra,
688
690
  class: "m-form-tip"
689
- }, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
691
+ }, null, 8, _hoisted_5$2)) : vue.createCommentVNode("", true)
690
692
  ])),
691
- __props.config.schematic && vue.unref(show) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
692
- vue.createElementVNode("div", _hoisted_7$2, [
693
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.items, (item, index) => {
694
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
693
+ _ctx.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
694
+ vue.createElementVNode("div", _hoisted_7, [
695
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
696
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
695
697
  key: key(item, index),
696
- model: vue.unref(name) ? __props.model[vue.unref(name)] : __props.model,
697
- lastValues: vue.unref(name) ? __props.lastValues[vue.unref(name)] : __props.lastValues,
698
- "is-compare": __props.isCompare,
699
- rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
698
+ model: name.value ? _ctx.model[name.value] : _ctx.model,
699
+ lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
700
+ "is-compare": _ctx.isCompare,
701
+ rules: name.value ? _ctx.rules[name.value] : [],
700
702
  config: item,
701
- prop: __props.prop,
702
- disabled: __props.disabled,
703
- labelWidth: vue.unref(lWidth),
704
- size: __props.size,
703
+ prop: _ctx.prop,
704
+ disabled: _ctx.disabled,
705
+ labelWidth: lWidth.value,
706
+ size: _ctx.size,
705
707
  onChange: change,
706
708
  onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
707
709
  }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
@@ -709,20 +711,20 @@
709
711
  ]),
710
712
  vue.createElementVNode("img", {
711
713
  class: "m-form-schematic",
712
- src: __props.config.schematic
713
- }, null, 8, _hoisted_8$1)
714
- ])) : vue.unref(show) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(__props.config.items, (item, index) => {
715
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
714
+ src: _ctx.config.schematic
715
+ }, null, 8, _hoisted_8)
716
+ ])) : show.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.config.items, (item, index) => {
717
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
716
718
  key: key(item, index),
717
- model: vue.unref(name) ? __props.model[vue.unref(name)] : __props.model,
718
- lastValues: vue.unref(name) ? __props.lastValues[vue.unref(name)] : __props.lastValues,
719
- "is-compare": __props.isCompare,
720
- rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
719
+ model: name.value ? _ctx.model[name.value] : _ctx.model,
720
+ lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
721
+ "is-compare": _ctx.isCompare,
722
+ rules: name.value ? _ctx.rules[name.value] : [],
721
723
  config: item,
722
- prop: __props.prop,
723
- labelWidth: vue.unref(lWidth),
724
- size: __props.size,
725
- disabled: __props.disabled,
724
+ prop: _ctx.prop,
725
+ labelWidth: lWidth.value,
726
+ size: _ctx.size,
727
+ disabled: _ctx.disabled,
726
728
  onChange: change,
727
729
  onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
728
730
  }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
@@ -732,35 +734,30 @@
732
734
  }
733
735
  });
734
736
 
735
- const _hoisted_1$9 = { class: "m-fields-group-list-item" };
736
- const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("上移");
737
- const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("下移");
738
- const _hoisted_4$4 = ["innerHTML"];
739
- const __default__$t = vue.defineComponent({
740
- name: "MFormGroupListItem"
741
- });
742
- const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
743
- ...__default__$t,
737
+ const _hoisted_1$b = { class: "m-fields-group-list-item" };
738
+ const _hoisted_2$5 = ["innerHTML"];
739
+ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
740
+ ...{
741
+ name: "MFormGroupListItem"
742
+ },
743
+ __name: "GroupListItem",
744
744
  props: {
745
- model: null,
746
- lastValues: null,
745
+ model: {},
746
+ lastValues: {},
747
747
  isCompare: { type: Boolean },
748
- groupModel: null,
749
- config: null,
750
- labelWidth: null,
751
- prop: null,
752
- size: null,
753
- index: null,
748
+ groupModel: {},
749
+ config: {},
750
+ labelWidth: {},
751
+ prop: {},
752
+ size: {},
753
+ index: {},
754
754
  disabled: { type: Boolean }
755
755
  },
756
756
  emits: ["swap-item", "remove-item", "change", "addDiffCount"],
757
757
  setup(__props, { emit }) {
758
758
  const props = __props;
759
759
  const mForm = vue.inject("mForm");
760
- const expand = vue.ref(false);
761
- vue.watchEffect(() => {
762
- expand.value = !props.index;
763
- });
760
+ const expand = vue.ref(props.config.expandAll || !props.index);
764
761
  const rowConfig = vue.computed(() => ({
765
762
  type: "row",
766
763
  span: props.config.span || 24,
@@ -772,7 +769,11 @@
772
769
  if (props.config.titleKey && props.model[props.config.titleKey]) {
773
770
  return props.model[props.config.titleKey];
774
771
  }
775
- return `组 ${String(props.index)}`;
772
+ if (props.config.title) {
773
+ return filterFunction(mForm, props.config.title, props);
774
+ }
775
+ const titlePrefix = props.config.titlePrefix || "组";
776
+ return `${titlePrefix} ${String(props.index + 1)}`;
776
777
  });
777
778
  const length = vue.computed(() => props.groupModel?.length || 0);
778
779
  const itemExtra = vue.computed(() => filterFunction(mForm, props.config.itemExtra, props));
@@ -788,7 +789,7 @@
788
789
  }
789
790
  return true;
790
791
  };
791
- const changeOrder = (offset = 0) => emit("swap-item", props.index, `${String(props.index)}${offset}`);
792
+ const changeOrder = (offset = 0) => emit("swap-item", props.index, props.index + offset);
792
793
  const movable = () => {
793
794
  const { movable: movable2 } = props.config;
794
795
  if (movable2 === void 0)
@@ -800,16 +801,16 @@
800
801
  };
801
802
  const onAddDiffCount = () => emit("addDiffCount");
802
803
  return (_ctx, _cache) => {
803
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
804
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
804
805
  vue.createElementVNode("div", null, [
805
806
  vue.createVNode(vue.unref(design.TMagicButton), {
806
807
  text: "",
807
- disabled: __props.disabled,
808
+ disabled: _ctx.disabled,
808
809
  icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
809
810
  onClick: expandHandler
810
811
  }, {
811
812
  default: vue.withCtx(() => [
812
- vue.createTextVNode(vue.toDisplayString(vue.unref(title)), 1)
813
+ vue.createTextVNode(vue.toDisplayString(title.value), 1)
813
814
  ]),
814
815
  _: 1
815
816
  }, 8, ["disabled", "icon"]),
@@ -817,20 +818,20 @@
817
818
  style: { "color": "#f56c6c" },
818
819
  text: "",
819
820
  icon: vue.unref(iconsVue.Delete),
820
- disabled: __props.disabled,
821
+ disabled: _ctx.disabled,
821
822
  onClick: removeHandler
822
823
  }, null, 8, ["icon", "disabled"]), [
823
- [vue.vShow, showDelete(parseInt(String(__props.index)))]
824
+ [vue.vShow, showDelete(parseInt(String(_ctx.index)))]
824
825
  ]),
825
826
  movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
826
827
  vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
827
828
  text: "",
828
- disabled: __props.disabled,
829
+ disabled: _ctx.disabled,
829
830
  size: "small",
830
831
  onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
831
832
  }, {
832
833
  default: vue.withCtx(() => [
833
- _hoisted_2$5,
834
+ vue.createTextVNode("上移"),
834
835
  vue.createVNode(vue.unref(design.TMagicIcon), null, {
835
836
  default: vue.withCtx(() => [
836
837
  vue.createVNode(vue.unref(iconsVue.CaretTop))
@@ -840,16 +841,16 @@
840
841
  ]),
841
842
  _: 1
842
843
  }, 8, ["disabled"]), [
843
- [vue.vShow, __props.index !== 0]
844
+ [vue.vShow, _ctx.index !== 0]
844
845
  ]),
845
846
  vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
846
- disabled: __props.disabled,
847
+ disabled: _ctx.disabled,
847
848
  text: "",
848
849
  size: "small",
849
850
  onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
850
851
  }, {
851
852
  default: vue.withCtx(() => [
852
- _hoisted_3$5,
853
+ vue.createTextVNode("下移"),
853
854
  vue.createVNode(vue.unref(design.TMagicIcon), null, {
854
855
  default: vue.withCtx(() => [
855
856
  vue.createVNode(vue.unref(iconsVue.CaretBottom))
@@ -859,25 +860,25 @@
859
860
  ]),
860
861
  _: 1
861
862
  }, 8, ["disabled"]), [
862
- [vue.vShow, __props.index !== vue.unref(length) - 1]
863
+ [vue.vShow, _ctx.index !== length.value - 1]
863
864
  ])
864
865
  ], 64)) : vue.createCommentVNode("", true),
865
- vue.unref(itemExtra) ? (vue.openBlock(), vue.createElementBlock("span", {
866
+ itemExtra.value ? (vue.openBlock(), vue.createElementBlock("span", {
866
867
  key: 1,
867
- innerHTML: vue.unref(itemExtra),
868
+ innerHTML: itemExtra.value,
868
869
  class: "m-form-tip"
869
- }, null, 8, _hoisted_4$4)) : vue.createCommentVNode("", true)
870
+ }, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true)
870
871
  ]),
871
- expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
872
+ expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
872
873
  key: 0,
873
- config: vue.unref(rowConfig),
874
- model: __props.model,
875
- lastValues: __props.lastValues,
876
- "is-compare": __props.isCompare,
877
- labelWidth: __props.labelWidth,
878
- prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
879
- size: __props.size,
880
- disabled: __props.disabled,
874
+ config: rowConfig.value,
875
+ model: _ctx.model,
876
+ lastValues: _ctx.lastValues,
877
+ "is-compare": _ctx.isCompare,
878
+ labelWidth: _ctx.labelWidth,
879
+ prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${String(_ctx.index)}`,
880
+ size: _ctx.size,
881
+ disabled: _ctx.disabled,
881
882
  onChange: changeHandler,
882
883
  onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
883
884
  }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
@@ -886,32 +887,30 @@
886
887
  }
887
888
  });
888
889
 
889
- const _hoisted_1$8 = { class: "m-fields-group-list" };
890
+ const _hoisted_1$a = { class: "m-fields-group-list" };
890
891
  const _hoisted_2$4 = ["innerHTML"];
891
- const _hoisted_3$4 = {
892
+ const _hoisted_3$2 = {
892
893
  key: 1,
893
894
  class: "el-table__empty-block"
894
895
  };
895
- const _hoisted_4$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
896
- const _hoisted_5$2 = [
897
- _hoisted_4$3
896
+ const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
897
+ const _hoisted_5$1 = [
898
+ _hoisted_4$1
898
899
  ];
899
- const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("添加组");
900
- const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("切换为表格");
901
- const __default__$s = vue.defineComponent({
902
- name: "MFormGroupList"
903
- });
904
- const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
905
- ...__default__$s,
900
+ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
901
+ ...{
902
+ name: "MFormGroupList"
903
+ },
904
+ __name: "GroupList",
906
905
  props: {
907
- model: null,
908
- lastValues: null,
906
+ model: {},
907
+ lastValues: {},
909
908
  isCompare: { type: Boolean },
910
- config: null,
911
- name: null,
912
- labelWidth: null,
913
- prop: null,
914
- size: null,
909
+ config: {},
910
+ name: {},
911
+ labelWidth: {},
912
+ prop: {},
913
+ size: {},
915
914
  disabled: { type: Boolean }
916
915
  },
917
916
  emits: ["change", "addDiffCount"],
@@ -981,50 +980,50 @@
981
980
  const onAddDiffCount = () => emit("addDiffCount");
982
981
  const getLastValues = (item, index) => item?.[index] || {};
983
982
  return (_ctx, _cache) => {
984
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
985
- __props.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
983
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
984
+ _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
986
985
  key: 0,
987
- innerHTML: __props.config.extra,
986
+ innerHTML: _ctx.config.extra,
988
987
  style: { "color": "rgba(0, 0, 0, 0.45)" }
989
988
  }, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
990
- !__props.model[__props.name] || !__props.model[__props.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, _hoisted_5$2)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(__props.model[__props.name], (item, index) => {
991
- return vue.openBlock(), vue.createBlock(_sfc_main$t, {
989
+ !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, _hoisted_5$1)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
990
+ return vue.openBlock(), vue.createBlock(_sfc_main$v, {
992
991
  key: index,
993
992
  model: item,
994
- lastValues: getLastValues(__props.lastValues[__props.name], index),
995
- "is-compare": __props.isCompare,
996
- config: __props.config,
997
- prop: __props.prop,
993
+ lastValues: getLastValues(_ctx.lastValues[_ctx.name], index),
994
+ "is-compare": _ctx.isCompare,
995
+ config: _ctx.config,
996
+ prop: _ctx.prop,
998
997
  index,
999
- "label-width": __props.labelWidth,
1000
- size: __props.size,
1001
- disabled: __props.disabled,
1002
- "group-model": __props.model[__props.name],
998
+ "label-width": _ctx.labelWidth,
999
+ size: _ctx.size,
1000
+ disabled: _ctx.disabled,
1001
+ "group-model": _ctx.model[_ctx.name],
1003
1002
  onRemoveItem: removeHandler,
1004
1003
  onSwapItem: swapHandler,
1005
1004
  onChange: changeHandler,
1006
1005
  onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1007
1006
  }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
1008
1007
  }), 128)),
1009
- vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1008
+ addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1010
1009
  key: 3,
1011
1010
  onClick: addHandler,
1012
1011
  size: "small",
1013
- disabled: __props.disabled
1012
+ disabled: _ctx.disabled
1014
1013
  }, {
1015
1014
  default: vue.withCtx(() => [
1016
- _hoisted_6$1
1015
+ vue.createTextVNode("新增")
1017
1016
  ]),
1018
1017
  _: 1
1019
1018
  }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1020
- __props.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1019
+ _ctx.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1021
1020
  key: 4,
1022
1021
  icon: vue.unref(iconsVue.Grid),
1023
1022
  size: "small",
1024
1023
  onClick: toggleMode
1025
1024
  }, {
1026
1025
  default: vue.withCtx(() => [
1027
- _hoisted_7$1
1026
+ vue.createTextVNode("切换为表格")
1028
1027
  ]),
1029
1028
  _: 1
1030
1029
  }, 8, ["icon"])) : vue.createCommentVNode("", true)
@@ -1033,28 +1032,28 @@
1033
1032
  }
1034
1033
  });
1035
1034
 
1036
- const _hoisted_1$7 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
1035
+ const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
1037
1036
  const _hoisted_2$3 = ["innerHTML"];
1038
- const _hoisted_3$3 = {
1037
+ const _hoisted_3$1 = {
1039
1038
  key: 0,
1040
1039
  style: { "display": "flex" }
1041
1040
  };
1042
- const _hoisted_4$2 = { style: { "flex": "1" } };
1043
- const _hoisted_5$1 = ["src"];
1044
- const __default__$r = vue.defineComponent({
1045
- name: "MFormPanel"
1046
- });
1047
- const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
1048
- ...__default__$r,
1041
+ const _hoisted_4 = { style: { "flex": "1" } };
1042
+ const _hoisted_5 = ["src"];
1043
+ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
1044
+ ...{
1045
+ name: "MFormPanel"
1046
+ },
1047
+ __name: "Panel",
1049
1048
  props: {
1050
- model: null,
1051
- lastValues: null,
1049
+ model: {},
1050
+ lastValues: {},
1052
1051
  isCompare: { type: Boolean },
1053
- config: null,
1054
- name: null,
1055
- labelWidth: null,
1056
- prop: null,
1057
- size: null,
1052
+ config: {},
1053
+ name: {},
1054
+ labelWidth: {},
1055
+ prop: {},
1056
+ size: {},
1058
1057
  disabled: { type: Boolean }
1059
1058
  },
1060
1059
  emits: ["change", "addDiffCount"],
@@ -1067,45 +1066,45 @@
1067
1066
  const changeHandler = () => emit("change", props.model);
1068
1067
  const onAddDiffCount = () => emit("addDiffCount");
1069
1068
  return (_ctx, _cache) => {
1070
- return vue.unref(items) && vue.unref(items).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), {
1069
+ return items.value && items.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), {
1071
1070
  key: 0,
1072
1071
  class: "box-card m-form-panel",
1073
1072
  "body-style": { display: expand.value ? "block" : "none" }
1074
1073
  }, {
1075
1074
  header: vue.withCtx(() => [
1076
- vue.createElementVNode("div", _hoisted_1$7, [
1075
+ vue.createElementVNode("div", _hoisted_1$9, [
1077
1076
  vue.createVNode(vue.unref(design.TMagicButton), {
1078
1077
  style: { "padding": "0" },
1079
1078
  text: "",
1080
1079
  icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
1081
1080
  onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
1082
1081
  }, null, 8, ["icon"]),
1083
- __props.config && __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1082
+ _ctx.config && _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1084
1083
  key: 0,
1085
- innerHTML: __props.config.extra,
1084
+ innerHTML: _ctx.config.extra,
1086
1085
  class: "m-form-tip"
1087
1086
  }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true),
1088
1087
  vue.renderSlot(_ctx.$slots, "header", {}, () => [
1089
- vue.createTextVNode(vue.toDisplayString(filter(__props.config.title)), 1)
1088
+ vue.createTextVNode(vue.toDisplayString(filter(_ctx.config.title)), 1)
1090
1089
  ])
1091
1090
  ])
1092
1091
  ]),
1093
1092
  default: vue.withCtx(() => [
1094
1093
  vue.createElementVNode("div", null, [
1095
1094
  vue.renderSlot(_ctx.$slots, "default"),
1096
- __props.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
1097
- vue.createElementVNode("div", _hoisted_4$2, [
1098
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(items), (item, index) => {
1099
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
1095
+ _ctx.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
1096
+ vue.createElementVNode("div", _hoisted_4, [
1097
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item, index) => {
1098
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
1100
1099
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1101
1100
  config: item,
1102
- model: __props.name ? __props.model[__props.name] : __props.model,
1103
- lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1104
- "is-compare": __props.isCompare,
1105
- prop: __props.prop,
1106
- size: __props.size,
1107
- disabled: __props.disabled,
1108
- "label-width": __props.config.labelWidth || __props.labelWidth,
1101
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1102
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1103
+ "is-compare": _ctx.isCompare,
1104
+ prop: _ctx.prop,
1105
+ size: _ctx.size,
1106
+ disabled: _ctx.disabled,
1107
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1109
1108
  onChange: changeHandler,
1110
1109
  onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1111
1110
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
@@ -1113,19 +1112,19 @@
1113
1112
  ]),
1114
1113
  vue.createElementVNode("img", {
1115
1114
  class: "m-form-schematic",
1116
- src: __props.config.schematic
1117
- }, null, 8, _hoisted_5$1)
1118
- ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(items), (item, index) => {
1119
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
1115
+ src: _ctx.config.schematic
1116
+ }, null, 8, _hoisted_5)
1117
+ ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items.value, (item, index) => {
1118
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
1120
1119
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1121
1120
  config: item,
1122
- model: __props.name ? __props.model[__props.name] : __props.model,
1123
- lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1124
- "is-compare": __props.isCompare,
1125
- prop: __props.prop,
1126
- size: __props.size,
1127
- disabled: __props.disabled,
1128
- "label-width": __props.config.labelWidth || __props.labelWidth,
1121
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1122
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1123
+ "is-compare": _ctx.isCompare,
1124
+ prop: _ctx.prop,
1125
+ size: _ctx.size,
1126
+ disabled: _ctx.disabled,
1127
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1129
1128
  onChange: changeHandler,
1130
1129
  onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1131
1130
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
@@ -1138,21 +1137,21 @@
1138
1137
  }
1139
1138
  });
1140
1139
 
1141
- const __default__$q = vue.defineComponent({
1142
- name: "MFormCol"
1143
- });
1144
- const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
1145
- ...__default__$q,
1140
+ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
1141
+ ...{
1142
+ name: "MFormCol"
1143
+ },
1144
+ __name: "Col",
1146
1145
  props: {
1147
- model: null,
1148
- lastValues: null,
1146
+ model: {},
1147
+ lastValues: {},
1149
1148
  isCompare: { type: Boolean },
1150
- config: null,
1151
- labelWidth: null,
1149
+ config: {},
1150
+ labelWidth: {},
1152
1151
  expandMore: { type: Boolean },
1153
- span: null,
1154
- size: null,
1155
- prop: null,
1152
+ span: {},
1153
+ size: {},
1154
+ prop: {},
1156
1155
  disabled: { type: Boolean }
1157
1156
  },
1158
1157
  emits: ["change", "addDiffCount"],
@@ -1163,44 +1162,44 @@
1163
1162
  const changeHandler = () => emit("change", props.model);
1164
1163
  const onAddDiffCount = () => emit("addDiffCount");
1165
1164
  return (_ctx, _cache) => {
1166
- return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: __props.span }, {
1165
+ return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: _ctx.span }, {
1167
1166
  default: vue.withCtx(() => [
1168
- vue.createVNode(_sfc_main$v, {
1169
- model: __props.model,
1170
- lastValues: __props.lastValues,
1171
- "is-compare": __props.isCompare,
1172
- config: __props.config,
1173
- prop: __props.prop,
1174
- "label-width": __props.config.labelWidth || __props.labelWidth,
1175
- "expand-more": __props.expandMore,
1176
- size: __props.size,
1177
- disabled: __props.disabled,
1167
+ vue.createVNode(_sfc_main$x, {
1168
+ model: _ctx.model,
1169
+ lastValues: _ctx.lastValues,
1170
+ "is-compare": _ctx.isCompare,
1171
+ config: _ctx.config,
1172
+ prop: _ctx.prop,
1173
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1174
+ "expand-more": _ctx.expandMore,
1175
+ size: _ctx.size,
1176
+ disabled: _ctx.disabled,
1178
1177
  onChange: changeHandler,
1179
1178
  onAddDiffCount
1180
1179
  }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "label-width", "expand-more", "size", "disabled"])
1181
1180
  ]),
1182
1181
  _: 1
1183
1182
  }, 8, ["span"])), [
1184
- [vue.vShow, vue.unref(display$1) && __props.config.type !== "hidden"]
1183
+ [vue.vShow, display$1.value && _ctx.config.type !== "hidden"]
1185
1184
  ]);
1186
1185
  };
1187
1186
  }
1188
1187
  });
1189
1188
 
1190
- const __default__$p = vue.defineComponent({
1191
- name: "MFormRow"
1192
- });
1193
- const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
1194
- ...__default__$p,
1189
+ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
1190
+ ...{
1191
+ name: "MFormRow"
1192
+ },
1193
+ __name: "Row",
1195
1194
  props: {
1196
- model: null,
1197
- lastValues: null,
1195
+ model: {},
1196
+ lastValues: {},
1198
1197
  isCompare: { type: Boolean },
1199
- config: null,
1200
- name: null,
1201
- labelWidth: null,
1202
- prop: null,
1203
- size: null,
1198
+ config: {},
1199
+ name: {},
1200
+ labelWidth: {},
1201
+ prop: {},
1202
+ size: {},
1204
1203
  expandMore: { type: Boolean },
1205
1204
  disabled: { type: Boolean }
1206
1205
  },
@@ -1213,19 +1212,19 @@
1213
1212
  return (_ctx, _cache) => {
1214
1213
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRow), { gutter: 10 }, {
1215
1214
  default: vue.withCtx(() => [
1216
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.items, (col, index) => {
1217
- return vue.openBlock(), vue.createBlock(_sfc_main$q, {
1215
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
1216
+ return vue.openBlock(), vue.createBlock(_sfc_main$s, {
1218
1217
  key: col[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1219
- span: col.span || __props.config.span || 24 / __props.config.items.length,
1218
+ span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
1220
1219
  config: col,
1221
- labelWidth: __props.config.labelWidth || __props.labelWidth,
1222
- expandMore: __props.expandMore,
1223
- model: __props.name ? __props.model[__props.name] : __props.model,
1224
- lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1225
- "is-compare": __props.isCompare,
1226
- prop: __props.prop,
1227
- size: __props.size,
1228
- disabled: __props.disabled,
1220
+ labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
1221
+ expandMore: _ctx.expandMore,
1222
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1223
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1224
+ "is-compare": _ctx.isCompare,
1225
+ prop: _ctx.prop,
1226
+ size: _ctx.size,
1227
+ disabled: _ctx.disabled,
1229
1228
  onChange: changeHandler,
1230
1229
  onAddDiffCount
1231
1230
  }, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
@@ -1237,19 +1236,19 @@
1237
1236
  }
1238
1237
  });
1239
1238
 
1240
- const __default__$o = vue.defineComponent({
1241
- name: "MFormStep"
1242
- });
1243
- const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
1244
- ...__default__$o,
1239
+ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
1240
+ ...{
1241
+ name: "MFormStep"
1242
+ },
1243
+ __name: "Step",
1245
1244
  props: {
1246
- model: null,
1247
- lastValues: null,
1245
+ model: {},
1246
+ lastValues: {},
1248
1247
  isCompare: { type: Boolean },
1249
- config: null,
1248
+ config: {},
1250
1249
  stepActive: { default: 1 },
1251
- labelWidth: null,
1252
- size: null,
1250
+ labelWidth: {},
1251
+ size: {},
1253
1252
  disabled: { type: Boolean }
1254
1253
  },
1255
1254
  emits: ["change", "addDiffCount"],
@@ -1273,10 +1272,10 @@
1273
1272
  vue.createVNode(vue.unref(design.TMagicSteps), {
1274
1273
  active: active.value,
1275
1274
  "align-center": "",
1276
- space: __props.config.space
1275
+ space: _ctx.config.space
1277
1276
  }, {
1278
1277
  default: vue.withCtx(() => [
1279
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.items, (item, index) => {
1278
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
1280
1279
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicStep), {
1281
1280
  key: item.__key,
1282
1281
  title: item.title,
@@ -1287,20 +1286,20 @@
1287
1286
  ]),
1288
1287
  _: 1
1289
1288
  }, 8, ["active", "space"]),
1290
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.items, (step, index) => {
1289
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (step, index) => {
1291
1290
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1292
1291
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(step.items, (item) => {
1293
1292
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1294
- item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$v, {
1293
+ item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$x, {
1295
1294
  key: item[vue.unref(mForm)?.keyProp || "__key"],
1296
1295
  config: item,
1297
- model: step.name ? __props.model[step.name] : __props.model,
1298
- lastValues: step.name ? __props.lastValues[step.name] : __props.lastValues,
1299
- "is-compare": __props.isCompare,
1296
+ model: step.name ? _ctx.model[step.name] : _ctx.model,
1297
+ lastValues: step.name ? _ctx.lastValues[step.name] : _ctx.lastValues,
1298
+ "is-compare": _ctx.isCompare,
1300
1299
  prop: `${step.name}`,
1301
- size: __props.size,
1302
- disabled: __props.disabled,
1303
- "label-width": __props.config.labelWidth || __props.labelWidth,
1300
+ size: _ctx.size,
1301
+ disabled: _ctx.disabled,
1302
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1304
1303
  onChange: changeHandler,
1305
1304
  onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1306
1305
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
@@ -1315,43 +1314,36 @@
1315
1314
  }
1316
1315
  });
1317
1316
 
1318
- const _hoisted_1$6 = ["innerHTML"];
1319
- const _hoisted_2$2 = { class: "el-form-item__content" };
1320
- const _hoisted_3$2 = ["innerHTML"];
1321
- const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("添加");
1322
- const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode("   ");
1323
- const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("展开配置");
1324
- const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("导入EXCEL");
1325
- const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode("  ");
1326
- const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("清空");
1327
- const _hoisted_10 = {
1328
- key: 1,
1317
+ const _hoisted_1$8 = ["innerHTML"];
1318
+ const _hoisted_2$2 = ["innerHTML"];
1319
+ const _hoisted_3 = {
1320
+ key: 6,
1329
1321
  class: "bottom",
1330
1322
  style: { "text-align": "right" }
1331
1323
  };
1332
- const __default__$n = vue.defineComponent({
1333
- name: "MFormTable"
1334
- });
1335
- const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
1336
- ...__default__$n,
1324
+ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
1325
+ ...{
1326
+ name: "MFormTable"
1327
+ },
1328
+ __name: "Table",
1337
1329
  props: {
1338
- model: null,
1330
+ model: {},
1339
1331
  lastValues: { default: () => ({}) },
1340
1332
  isCompare: { type: Boolean, default: false },
1341
- config: null,
1342
- name: null,
1333
+ config: {},
1334
+ name: {},
1343
1335
  prop: { default: "" },
1344
- labelWidth: null,
1336
+ labelWidth: {},
1345
1337
  sort: { type: Boolean },
1346
1338
  disabled: { type: Boolean },
1347
1339
  sortKey: { default: "" },
1348
- text: null,
1349
- size: null,
1340
+ text: {},
1341
+ size: {},
1350
1342
  enableToggleMode: { type: Boolean, default: true },
1351
1343
  showIndex: { type: Boolean, default: true }
1352
1344
  },
1353
1345
  emits: ["change", "select", "addDiffCount"],
1354
- setup(__props, { expose, emit }) {
1346
+ setup(__props, { expose: __expose, emit }) {
1355
1347
  const props = __props;
1356
1348
  let timer = null;
1357
1349
  const mForm = vue.inject("mForm");
@@ -1671,266 +1663,264 @@
1671
1663
  return `${prop.value}${prop.value ? "." : ""}${index + 1 + pagecontext.value * pagesize.value - 1}`;
1672
1664
  };
1673
1665
  const onAddDiffCount = () => emit("addDiffCount");
1674
- expose({
1666
+ __expose({
1675
1667
  toggleRowSelection
1676
1668
  });
1677
1669
  return (_ctx, _cache) => {
1678
1670
  return vue.openBlock(), vue.createElementBlock("div", {
1679
1671
  ref_key: "mTable",
1680
1672
  ref: mTable,
1681
- class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
1673
+ class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1682
1674
  }, [
1683
- __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1675
+ _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1684
1676
  key: 0,
1685
1677
  style: { "color": "rgba(0, 0, 0, 0.45)" },
1686
- innerHTML: __props.config.extra
1687
- }, null, 8, _hoisted_1$6)) : vue.createCommentVNode("", true),
1688
- vue.createElementVNode("div", _hoisted_2$2, [
1689
- vue.createVNode(vue.unref(design.TMagicTooltip), {
1690
- content: "拖拽可排序",
1691
- placement: "left-start",
1692
- disabled: __props.config.dropSort !== true
1693
- }, {
1694
- default: vue.withCtx(() => [
1695
- __props.model[vue.unref(modelName)] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1696
- ref_key: "tMagicTable",
1697
- ref: tMagicTable,
1698
- style: { "width": "100%" },
1699
- "row-key": __props.config.rowKey || "id",
1700
- data: vue.unref(data),
1701
- lastData: vue.unref(lastData),
1702
- border: __props.config.border,
1703
- "max-height": __props.config.maxHeight,
1704
- "default-expand-all": true,
1705
- key: updateKey.value,
1706
- onSelect: selectHandle,
1707
- onSortChange: sortChange
1708
- }, {
1709
- default: vue.withCtx(() => [
1710
- __props.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1711
- key: 0,
1712
- fixed: "left",
1713
- width: "30",
1714
- type: "expand"
1715
- }, {
1716
- default: vue.withCtx((scope) => [
1717
- vue.createElementVNode("span", {
1718
- innerHTML: itemExtra(__props.config.itemExtra, scope.$index),
1719
- class: "m-form-tip"
1720
- }, null, 8, _hoisted_3$2)
1721
- ]),
1722
- _: 1
1723
- })) : vue.createCommentVNode("", true),
1724
- vue.createVNode(vue.unref(design.TMagicTableColumn), {
1725
- label: "操作",
1726
- width: __props.config.operateColWidth || 55,
1727
- align: "center",
1728
- fixed: __props.config.fixed === false ? void 0 : "left"
1729
- }, {
1730
- default: vue.withCtx((scope) => [
1731
- vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1732
- vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1733
- class: "m-table-delete-icon",
1734
- onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1735
- }, {
1736
- default: vue.withCtx(() => [
1737
- vue.createVNode(vue.unref(iconsVue.Delete))
1738
- ]),
1739
- _: 2
1740
- }, 1032, ["onClick"]), [
1741
- [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1742
- ])
1743
- ]),
1744
- _: 3
1745
- }, 8, ["width", "fixed"]),
1746
- __props.sort && __props.model[vue.unref(modelName)] && __props.model[vue.unref(modelName)].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1747
- key: 1,
1748
- label: "排序",
1749
- width: "60"
1750
- }, {
1751
- default: vue.withCtx((scope) => [
1752
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1753
- key: 0,
1754
- content: "点击上移,双击置顶",
1755
- placement: "top"
1756
- }, {
1757
- default: vue.withCtx(() => [
1758
- vue.createVNode(vue.unref(design.TMagicButton), {
1759
- plain: "",
1760
- size: "small",
1761
- type: "primary",
1762
- icon: vue.unref(iconsVue.ArrowUp),
1763
- disabled: __props.disabled,
1764
- text: "",
1765
- onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1766
- onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1767
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1768
- ]),
1769
- _: 2
1770
- }, 1024)) : vue.createCommentVNode("", true),
1771
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== __props.model[vue.unref(modelName)].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1772
- key: 1,
1773
- content: "点击下移,双击置底",
1774
- placement: "top"
1775
- }, {
1776
- default: vue.withCtx(() => [
1777
- vue.createVNode(vue.unref(design.TMagicButton), {
1778
- plain: "",
1779
- size: "small",
1780
- type: "primary",
1781
- icon: vue.unref(iconsVue.ArrowDown),
1782
- disabled: __props.disabled,
1783
- text: "",
1784
- onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1785
- onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1786
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1787
- ]),
1788
- _: 2
1789
- }, 1024)) : vue.createCommentVNode("", true)
1790
- ]),
1791
- _: 1
1792
- })) : vue.createCommentVNode("", true),
1793
- vue.unref(selection) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1794
- key: 2,
1795
- align: "center",
1796
- "header-align": "center",
1797
- type: "selection",
1798
- width: "45"
1799
- })) : vue.createCommentVNode("", true),
1800
- __props.showIndex && __props.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1801
- key: 3,
1802
- width: "60",
1803
- label: "序号"
1804
- }, {
1805
- default: vue.withCtx((scope) => [
1806
- vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1807
- ]),
1808
- _: 1
1809
- })) : vue.createCommentVNode("", true),
1810
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.items, (column, index) => {
1811
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1812
- column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1813
- prop: column.name,
1814
- width: column.width,
1815
- label: column.label,
1816
- sortable: column.sortable,
1817
- "sort-orders": ["ascending", "descending"],
1818
- key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1819
- "class-name": __props.config.dropSort === true ? "el-table__column--dropable" : ""
1820
- }, {
1821
- default: vue.withCtx((scope) => [
1822
- scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
1823
- key: 0,
1824
- labelWidth: "0",
1825
- disabled: __props.disabled,
1826
- prop: getProp(scope.$index),
1827
- rules: column.rules,
1828
- config: makeConfig(column, scope.row),
1829
- model: scope.row,
1830
- lastValues: vue.unref(lastData)[scope.$index],
1831
- "is-compare": __props.isCompare,
1832
- size: __props.size,
1833
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[vue.unref(modelName)])),
1834
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1835
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1836
- ]),
1837
- _: 2
1838
- }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1839
- ], 64);
1840
- }), 256))
1841
- ]),
1842
- _: 3
1843
- }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1844
- ]),
1845
- _: 3
1846
- }, 8, ["disabled"]),
1847
- vue.renderSlot(_ctx.$slots, "default"),
1848
- vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1849
- key: 0,
1850
- size: "small",
1851
- type: "primary",
1852
- disabled: __props.disabled,
1853
- plain: "",
1854
- onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1855
- }, {
1856
- default: vue.withCtx(() => [
1857
- _hoisted_4$1
1858
- ]),
1859
- _: 1
1860
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1861
- _hoisted_5,
1862
- __props.enableToggleMode && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1863
- key: 1,
1864
- icon: vue.unref(iconsVue.Grid),
1865
- size: "small",
1866
- type: "primary",
1867
- onClick: toggleMode
1868
- }, {
1869
- default: vue.withCtx(() => [
1870
- _hoisted_6
1871
- ]),
1872
- _: 1
1873
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1874
- __props.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1875
- key: 2,
1876
- icon: vue.unref(iconsVue.FullScreen),
1877
- size: "small",
1878
- type: "primary",
1879
- onClick: toggleFullscreen
1880
- }, {
1881
- default: vue.withCtx(() => [
1882
- vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1883
- ]),
1884
- _: 1
1885
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1886
- vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1887
- key: 3,
1888
- style: { "display": "inline-block" },
1889
- ref_key: "excelBtn",
1890
- ref: excelBtn,
1891
- action: "/noop",
1892
- disabled: __props.disabled,
1893
- "on-change": excelHandler,
1894
- "auto-upload": false
1895
- }, {
1896
- default: vue.withCtx(() => [
1897
- vue.createVNode(vue.unref(design.TMagicButton), {
1898
- size: "small",
1899
- type: "success",
1900
- disabled: __props.disabled,
1901
- plain: ""
1902
- }, {
1903
- default: vue.withCtx(() => [
1904
- _hoisted_7
1905
- ]),
1906
- _: 1
1907
- }, 8, ["disabled"])
1908
- ]),
1909
- _: 1
1910
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1911
- _hoisted_8,
1912
- vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1913
- key: 4,
1914
- size: "small",
1915
- type: "warning",
1916
- disabled: __props.disabled,
1917
- plain: "",
1918
- onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1919
- }, {
1920
- default: vue.withCtx(() => [
1921
- _hoisted_9
1922
- ]),
1923
- _: 1
1924
- }, 8, ["disabled"])) : vue.createCommentVNode("", true)
1925
- ]),
1926
- __props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
1678
+ innerHTML: _ctx.config.extra
1679
+ }, null, 8, _hoisted_1$8)) : vue.createCommentVNode("", true),
1680
+ vue.createVNode(vue.unref(design.TMagicTooltip), {
1681
+ content: "拖拽可排序",
1682
+ placement: "left-start",
1683
+ disabled: _ctx.config.dropSort !== true
1684
+ }, {
1685
+ default: vue.withCtx(() => [
1686
+ _ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1687
+ ref_key: "tMagicTable",
1688
+ ref: tMagicTable,
1689
+ style: { "width": "100%" },
1690
+ "row-key": _ctx.config.rowKey || "id",
1691
+ data: data.value,
1692
+ lastData: lastData.value,
1693
+ border: _ctx.config.border,
1694
+ "max-height": _ctx.config.maxHeight,
1695
+ "default-expand-all": true,
1696
+ key: updateKey.value,
1697
+ onSelect: selectHandle,
1698
+ onSortChange: sortChange
1699
+ }, {
1700
+ default: vue.withCtx(() => [
1701
+ _ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1702
+ key: 0,
1703
+ fixed: "left",
1704
+ width: "30",
1705
+ type: "expand"
1706
+ }, {
1707
+ default: vue.withCtx((scope) => [
1708
+ vue.createElementVNode("span", {
1709
+ innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1710
+ class: "m-form-tip"
1711
+ }, null, 8, _hoisted_2$2)
1712
+ ]),
1713
+ _: 1
1714
+ })) : vue.createCommentVNode("", true),
1715
+ vue.createVNode(vue.unref(design.TMagicTableColumn), {
1716
+ label: "操作",
1717
+ width: _ctx.config.operateColWidth || 55,
1718
+ align: "center",
1719
+ fixed: _ctx.config.fixed === false ? void 0 : "left"
1720
+ }, {
1721
+ default: vue.withCtx((scope) => [
1722
+ vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1723
+ vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1724
+ class: "m-table-delete-icon",
1725
+ onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1726
+ }, {
1727
+ default: vue.withCtx(() => [
1728
+ vue.createVNode(vue.unref(iconsVue.Delete))
1729
+ ]),
1730
+ _: 2
1731
+ }, 1032, ["onClick"]), [
1732
+ [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1733
+ ])
1734
+ ]),
1735
+ _: 3
1736
+ }, 8, ["width", "fixed"]),
1737
+ _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1738
+ key: 1,
1739
+ label: "排序",
1740
+ width: "60"
1741
+ }, {
1742
+ default: vue.withCtx((scope) => [
1743
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1744
+ key: 0,
1745
+ content: "点击上移,双击置顶",
1746
+ placement: "top"
1747
+ }, {
1748
+ default: vue.withCtx(() => [
1749
+ vue.createVNode(vue.unref(design.TMagicButton), {
1750
+ plain: "",
1751
+ size: "small",
1752
+ type: "primary",
1753
+ icon: vue.unref(iconsVue.ArrowUp),
1754
+ disabled: _ctx.disabled,
1755
+ text: "",
1756
+ onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1757
+ onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1758
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1759
+ ]),
1760
+ _: 2
1761
+ }, 1024)) : vue.createCommentVNode("", true),
1762
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1763
+ key: 1,
1764
+ content: "点击下移,双击置底",
1765
+ placement: "top"
1766
+ }, {
1767
+ default: vue.withCtx(() => [
1768
+ vue.createVNode(vue.unref(design.TMagicButton), {
1769
+ plain: "",
1770
+ size: "small",
1771
+ type: "primary",
1772
+ icon: vue.unref(iconsVue.ArrowDown),
1773
+ disabled: _ctx.disabled,
1774
+ text: "",
1775
+ onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1776
+ onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1777
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1778
+ ]),
1779
+ _: 2
1780
+ }, 1024)) : vue.createCommentVNode("", true)
1781
+ ]),
1782
+ _: 1
1783
+ })) : vue.createCommentVNode("", true),
1784
+ selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1785
+ key: 2,
1786
+ align: "center",
1787
+ "header-align": "center",
1788
+ type: "selection",
1789
+ width: "45"
1790
+ })) : vue.createCommentVNode("", true),
1791
+ _ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1792
+ key: 3,
1793
+ width: "60",
1794
+ label: "序号"
1795
+ }, {
1796
+ default: vue.withCtx((scope) => [
1797
+ vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1798
+ ]),
1799
+ _: 1
1800
+ })) : vue.createCommentVNode("", true),
1801
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
1802
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1803
+ column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1804
+ prop: column.name,
1805
+ width: column.width,
1806
+ label: column.label,
1807
+ sortable: column.sortable,
1808
+ "sort-orders": ["ascending", "descending"],
1809
+ key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1810
+ "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1811
+ }, {
1812
+ default: vue.withCtx((scope) => [
1813
+ scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
1814
+ key: 0,
1815
+ labelWidth: "0",
1816
+ disabled: _ctx.disabled,
1817
+ prop: getProp(scope.$index),
1818
+ rules: column.rules,
1819
+ config: makeConfig(column, scope.row),
1820
+ model: scope.row,
1821
+ lastValues: lastData.value[scope.$index],
1822
+ "is-compare": _ctx.isCompare,
1823
+ size: _ctx.size,
1824
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1825
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1826
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1827
+ ]),
1828
+ _: 2
1829
+ }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1830
+ ], 64);
1831
+ }), 256))
1832
+ ]),
1833
+ _: 3
1834
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1835
+ ]),
1836
+ _: 3
1837
+ }, 8, ["disabled"]),
1838
+ vue.renderSlot(_ctx.$slots, "default"),
1839
+ addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1840
+ key: 1,
1841
+ size: "small",
1842
+ type: "primary",
1843
+ disabled: _ctx.disabled,
1844
+ plain: "",
1845
+ onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1846
+ }, {
1847
+ default: vue.withCtx(() => [
1848
+ vue.createTextVNode("新增一行")
1849
+ ]),
1850
+ _: 1
1851
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1852
+ vue.createTextVNode("   "),
1853
+ _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1854
+ key: 2,
1855
+ icon: vue.unref(iconsVue.Grid),
1856
+ size: "small",
1857
+ type: "primary",
1858
+ onClick: toggleMode
1859
+ }, {
1860
+ default: vue.withCtx(() => [
1861
+ vue.createTextVNode("展开配置")
1862
+ ]),
1863
+ _: 1
1864
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1865
+ _ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1866
+ key: 3,
1867
+ icon: vue.unref(iconsVue.FullScreen),
1868
+ size: "small",
1869
+ type: "primary",
1870
+ onClick: toggleFullscreen
1871
+ }, {
1872
+ default: vue.withCtx(() => [
1873
+ vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1874
+ ]),
1875
+ _: 1
1876
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1877
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1878
+ key: 4,
1879
+ style: { "display": "inline-block" },
1880
+ ref_key: "excelBtn",
1881
+ ref: excelBtn,
1882
+ action: "/noop",
1883
+ disabled: _ctx.disabled,
1884
+ "on-change": excelHandler,
1885
+ "auto-upload": false
1886
+ }, {
1887
+ default: vue.withCtx(() => [
1888
+ vue.createVNode(vue.unref(design.TMagicButton), {
1889
+ size: "small",
1890
+ type: "success",
1891
+ disabled: _ctx.disabled,
1892
+ plain: ""
1893
+ }, {
1894
+ default: vue.withCtx(() => [
1895
+ vue.createTextVNode("导入EXCEL")
1896
+ ]),
1897
+ _: 1
1898
+ }, 8, ["disabled"])
1899
+ ]),
1900
+ _: 1
1901
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1902
+ vue.createTextVNode("  "),
1903
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1904
+ key: 5,
1905
+ size: "small",
1906
+ type: "warning",
1907
+ disabled: _ctx.disabled,
1908
+ plain: "",
1909
+ onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1910
+ }, {
1911
+ default: vue.withCtx(() => [
1912
+ vue.createTextVNode("清空")
1913
+ ]),
1914
+ _: 1
1915
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1916
+ _ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
1927
1917
  vue.createVNode(vue.unref(design.TMagicPagination), {
1928
1918
  layout: "total, sizes, prev, pager, next, jumper",
1929
- "hide-on-single-page": __props.model[vue.unref(modelName)].length < pagesize.value,
1919
+ "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
1930
1920
  "current-page": pagecontext.value + 1,
1931
1921
  "page-sizes": [pagesize.value, 60, 120, 300],
1932
1922
  "page-size": pagesize.value,
1933
- total: __props.model[vue.unref(modelName)].length,
1923
+ total: _ctx.model[modelName.value].length,
1934
1924
  onSizeChange: handleSizeChange,
1935
1925
  onCurrentChange: handleCurrentChange
1936
1926
  }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
@@ -1940,28 +1930,28 @@
1940
1930
  }
1941
1931
  });
1942
1932
 
1943
- const __default__$m = vue.defineComponent({
1944
- name: "MFormTabs"
1945
- });
1946
- const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
1947
- ...__default__$m,
1933
+ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
1934
+ ...{
1935
+ name: "MFormTabs"
1936
+ },
1937
+ __name: "Tabs",
1948
1938
  props: {
1949
- model: null,
1939
+ model: {},
1950
1940
  lastValues: { default: () => ({}) },
1951
1941
  isCompare: { type: Boolean, default: false },
1952
- config: null,
1953
- name: null,
1954
- size: null,
1955
- labelWidth: null,
1956
- prop: null,
1942
+ config: {},
1943
+ name: {},
1944
+ size: {},
1945
+ labelWidth: {},
1946
+ prop: {},
1957
1947
  expandMore: { type: Boolean },
1958
1948
  disabled: { type: Boolean }
1959
1949
  },
1960
1950
  emits: ["change", "addDiffCount"],
1961
1951
  setup(__props, { emit }) {
1962
1952
  const props = __props;
1963
- const tabPaneComponent = design.getConfig("components").tabPane;
1964
- const tabsComponent = design.getConfig("components").tabs;
1953
+ const tabPaneComponent = design.getConfig("components")?.tabPane;
1954
+ const tabsComponent = design.getConfig("components")?.tabs;
1965
1955
  const getActive = (mForm2, props2, activeTabName2) => {
1966
1956
  const { config, model, prop } = props2;
1967
1957
  const { active } = config;
@@ -2057,28 +2047,31 @@
2057
2047
  emit("addDiffCount");
2058
2048
  };
2059
2049
  return (_ctx, _cache) => {
2060
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent).component), vue.mergeProps(
2050
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)?.component || "el-tabs"), vue.mergeProps(
2061
2051
  {
2062
2052
  modelValue: activeTabName.value,
2063
2053
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
2064
2054
  },
2065
- vue.unref(tabsComponent).props({
2066
- type: __props.config.tabType,
2067
- editable: __props.config.editable || false,
2068
- tabPosition: __props.config.tabPosition || "top"
2069
- }),
2055
+ vue.unref(tabsComponent)?.props({
2056
+ type: _ctx.config.tabType,
2057
+ editable: _ctx.config.editable || false,
2058
+ tabPosition: _ctx.config.tabPosition || "top"
2059
+ }) || {},
2070
2060
  {
2071
- class: `tmagic-design-tabs ${__props.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
2061
+ class: `tmagic-design-tabs ${_ctx.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
2072
2062
  onTabClick: tabClickHandler,
2073
2063
  onTabAdd,
2074
2064
  onTabRemove
2075
2065
  }
2076
2066
  ), {
2077
2067
  default: vue.withCtx(() => [
2078
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab, tabIndex) => {
2079
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent).component), vue.mergeProps({
2080
- key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
2081
- }, vue.unref(tabPaneComponent).props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false })), {
2068
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabs.value, (tab, tabIndex) => {
2069
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent)?.component || "el-tab-pane"), vue.mergeProps(
2070
+ {
2071
+ key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
2072
+ },
2073
+ vue.unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
2074
+ ), {
2082
2075
  label: vue.withCtx(() => [
2083
2076
  vue.createElementVNode("span", null, [
2084
2077
  vue.createTextVNode(vue.toDisplayString(filter(tab.title)), 1),
@@ -2091,17 +2084,17 @@
2091
2084
  ]),
2092
2085
  default: vue.withCtx(() => [
2093
2086
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabItems(tab), (item) => {
2094
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
2087
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
2095
2088
  key: item[vue.unref(mForm)?.keyProp || "__key"],
2096
2089
  config: item,
2097
- disabled: __props.disabled,
2098
- model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
2099
- "last-values": vue.unref(lodashEs.isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
2100
- "is-compare": __props.isCompare,
2101
- prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
2102
- size: __props.size,
2103
- "label-width": tab.labelWidth || __props.labelWidth,
2104
- "expand-more": __props.expandMore,
2090
+ disabled: _ctx.disabled,
2091
+ model: _ctx.config.dynamic ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tabIndex] : tab.name ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tab.name] : _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
2092
+ "last-values": vue.unref(lodashEs.isEmpty)(_ctx.lastValues) ? {} : _ctx.config.dynamic ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tabIndex] : tab.name ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tab.name] : _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
2093
+ "is-compare": _ctx.isCompare,
2094
+ prop: _ctx.config.dynamic ? `${_ctx.prop}${_ctx.prop ? "." : ""}${String(tabIndex)}` : _ctx.prop,
2095
+ size: _ctx.size,
2096
+ "label-width": tab.labelWidth || _ctx.labelWidth,
2097
+ "expand-more": _ctx.expandMore,
2105
2098
  onChange: changeHandler,
2106
2099
  onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
2107
2100
  }, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
@@ -2143,21 +2136,21 @@
2143
2136
  );
2144
2137
  };
2145
2138
 
2146
- const __default__$l = vue.defineComponent({
2147
- name: "MFormCascader"
2148
- });
2149
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2150
- ...__default__$l,
2139
+ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
2140
+ ...{
2141
+ name: "MFormCascader"
2142
+ },
2143
+ __name: "Cascader",
2151
2144
  props: {
2152
- config: null,
2153
- model: null,
2154
- initValues: null,
2155
- values: null,
2156
- name: null,
2157
- prop: null,
2145
+ config: {},
2146
+ model: {},
2147
+ initValues: {},
2148
+ values: {},
2149
+ name: {},
2150
+ prop: {},
2158
2151
  disabled: { type: Boolean },
2159
- size: null,
2160
- lastValues: null
2152
+ size: {},
2153
+ lastValues: {}
2161
2154
  },
2162
2155
  emits: ["change"],
2163
2156
  setup(__props, { emit }) {
@@ -2213,39 +2206,39 @@
2213
2206
  };
2214
2207
  return (_ctx, _cache) => {
2215
2208
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCascader), {
2216
- modelValue: __props.model[__props.name],
2217
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2209
+ modelValue: _ctx.model[_ctx.name],
2210
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2218
2211
  ref_key: "tMagicCascader",
2219
2212
  ref: tMagicCascader,
2220
2213
  style: { "width": "100%" },
2221
2214
  clearable: "",
2222
2215
  filterable: "",
2223
- size: __props.size,
2224
- placeholder: __props.config.placeholder,
2225
- disabled: __props.disabled,
2216
+ size: _ctx.size,
2217
+ placeholder: _ctx.config.placeholder,
2218
+ disabled: _ctx.disabled,
2226
2219
  options: vue.unref(options),
2227
- props: { multiple: __props.config.multiple },
2220
+ props: { multiple: _ctx.config.multiple },
2228
2221
  onChange: changeHandler
2229
2222
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props"]);
2230
2223
  };
2231
2224
  }
2232
2225
  });
2233
2226
 
2234
- const __default__$k = vue.defineComponent({
2235
- name: "MFormCheckbox"
2236
- });
2237
- const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2238
- ...__default__$k,
2227
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2228
+ ...{
2229
+ name: "MFormCheckbox"
2230
+ },
2231
+ __name: "Checkbox",
2239
2232
  props: {
2240
- config: null,
2241
- model: null,
2242
- initValues: null,
2243
- values: null,
2244
- name: null,
2245
- prop: null,
2233
+ config: {},
2234
+ model: {},
2235
+ initValues: {},
2236
+ values: {},
2237
+ name: {},
2238
+ prop: {},
2246
2239
  disabled: { type: Boolean },
2247
- size: null,
2248
- lastValues: null
2240
+ size: {},
2241
+ lastValues: {}
2249
2242
  },
2250
2243
  emits: ["change"],
2251
2244
  setup(__props, { emit }) {
@@ -2276,16 +2269,16 @@
2276
2269
  };
2277
2270
  return (_ctx, _cache) => {
2278
2271
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
2279
- modelValue: __props.model[__props.name],
2280
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2281
- size: __props.size,
2282
- trueLabel: vue.unref(activeValue),
2283
- falseLabel: vue.unref(inactiveValue),
2284
- disabled: __props.disabled,
2272
+ modelValue: _ctx.model[_ctx.name],
2273
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2274
+ size: _ctx.size,
2275
+ trueLabel: activeValue.value,
2276
+ falseLabel: inactiveValue.value,
2277
+ disabled: _ctx.disabled,
2285
2278
  onChange: changeHandler
2286
2279
  }, {
2287
2280
  default: vue.withCtx(() => [
2288
- vue.createTextVNode(vue.toDisplayString(__props.config.text), 1)
2281
+ vue.createTextVNode(vue.toDisplayString(_ctx.config.text), 1)
2289
2282
  ]),
2290
2283
  _: 1
2291
2284
  }, 8, ["modelValue", "size", "trueLabel", "falseLabel", "disabled"]);
@@ -2293,21 +2286,21 @@
2293
2286
  }
2294
2287
  });
2295
2288
 
2296
- const __default__$j = vue.defineComponent({
2297
- name: "MFormCheckGroup"
2298
- });
2299
- const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2300
- ...__default__$j,
2289
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2290
+ ...{
2291
+ name: "MFormCheckGroup"
2292
+ },
2293
+ __name: "CheckboxGroup",
2301
2294
  props: {
2302
- config: null,
2303
- model: null,
2304
- initValues: null,
2305
- values: null,
2306
- name: null,
2307
- prop: null,
2295
+ config: {},
2296
+ model: {},
2297
+ initValues: {},
2298
+ values: {},
2299
+ name: {},
2300
+ prop: {},
2308
2301
  disabled: { type: Boolean },
2309
- size: null,
2310
- lastValues: null
2302
+ size: {},
2303
+ lastValues: {}
2311
2304
  },
2312
2305
  emits: ["change"],
2313
2306
  setup(__props, { emit }) {
@@ -2329,14 +2322,14 @@
2329
2322
  });
2330
2323
  return (_ctx, _cache) => {
2331
2324
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckboxGroup), {
2332
- modelValue: __props.model[__props.name],
2333
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2334
- size: __props.size,
2335
- disabled: __props.disabled,
2325
+ modelValue: _ctx.model[_ctx.name],
2326
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2327
+ size: _ctx.size,
2328
+ disabled: _ctx.disabled,
2336
2329
  onChange: changeHandler
2337
2330
  }, {
2338
2331
  default: vue.withCtx(() => [
2339
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(options), (option) => {
2332
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
2340
2333
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
2341
2334
  label: option.value,
2342
2335
  value: option.value,
@@ -2356,21 +2349,21 @@
2356
2349
  }
2357
2350
  });
2358
2351
 
2359
- const __default__$i = vue.defineComponent({
2360
- name: "MFormColorPicker"
2361
- });
2362
- const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2363
- ...__default__$i,
2352
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2353
+ ...{
2354
+ name: "MFormColorPicker"
2355
+ },
2356
+ __name: "ColorPicker",
2364
2357
  props: {
2365
- config: null,
2366
- model: null,
2367
- initValues: null,
2368
- values: null,
2369
- name: null,
2370
- prop: null,
2358
+ config: {},
2359
+ model: {},
2360
+ initValues: {},
2361
+ values: {},
2362
+ name: {},
2363
+ prop: {},
2371
2364
  disabled: { type: Boolean },
2372
- size: null,
2373
- lastValues: null
2365
+ size: {},
2366
+ lastValues: {}
2374
2367
  },
2375
2368
  emits: ["change"],
2376
2369
  setup(__props, { emit }) {
@@ -2379,10 +2372,10 @@
2379
2372
  const changeHandler = (value) => emit("change", value);
2380
2373
  return (_ctx, _cache) => {
2381
2374
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicColorPicker), {
2382
- modelValue: __props.model[__props.name],
2383
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2384
- size: __props.size,
2385
- disabled: __props.disabled,
2375
+ modelValue: _ctx.model[_ctx.name],
2376
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2377
+ size: _ctx.size,
2378
+ disabled: _ctx.disabled,
2386
2379
  showAlpha: true,
2387
2380
  onChange: changeHandler
2388
2381
  }, null, 8, ["modelValue", "size", "disabled"]);
@@ -2390,21 +2383,21 @@
2390
2383
  }
2391
2384
  });
2392
2385
 
2393
- const __default__$h = vue.defineComponent({
2394
- name: "MFormDate"
2395
- });
2396
- const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
2397
- ...__default__$h,
2386
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2387
+ ...{
2388
+ name: "MFormDate"
2389
+ },
2390
+ __name: "Date",
2398
2391
  props: {
2399
- config: null,
2400
- model: null,
2401
- initValues: null,
2402
- values: null,
2403
- name: null,
2404
- prop: null,
2392
+ config: {},
2393
+ model: {},
2394
+ initValues: {},
2395
+ values: {},
2396
+ name: {},
2397
+ prop: {},
2405
2398
  disabled: { type: Boolean },
2406
- size: null,
2407
- lastValues: null
2399
+ size: {},
2400
+ lastValues: {}
2408
2401
  },
2409
2402
  emits: ["change"],
2410
2403
  setup(__props, { emit }) {
@@ -2416,35 +2409,35 @@
2416
2409
  };
2417
2410
  return (_ctx, _cache) => {
2418
2411
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
2419
- modelValue: __props.model[__props.name],
2420
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2412
+ modelValue: _ctx.model[_ctx.name],
2413
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2421
2414
  type: "date",
2422
- size: __props.size,
2423
- placeholder: __props.config.placeholder,
2424
- disabled: __props.disabled,
2425
- format: __props.config.format,
2426
- "value-format": __props.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
2415
+ size: _ctx.size,
2416
+ placeholder: _ctx.config.placeholder,
2417
+ disabled: _ctx.disabled,
2418
+ format: _ctx.config.format,
2419
+ "value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
2427
2420
  onChange: changeHandler
2428
2421
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format"]);
2429
2422
  };
2430
2423
  }
2431
2424
  });
2432
2425
 
2433
- const __default__$g = vue.defineComponent({
2434
- name: "MFormDateRange"
2435
- });
2436
- const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
2437
- ...__default__$g,
2426
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2427
+ ...{
2428
+ name: "MFormDateRange"
2429
+ },
2430
+ __name: "Daterange",
2438
2431
  props: {
2439
- config: null,
2440
- model: null,
2441
- initValues: null,
2442
- values: null,
2443
- name: null,
2444
- prop: null,
2432
+ config: {},
2433
+ model: {},
2434
+ initValues: {},
2435
+ values: {},
2436
+ name: {},
2437
+ prop: {},
2445
2438
  disabled: { type: Boolean },
2446
- size: null,
2447
- lastValues: null
2439
+ size: {},
2440
+ lastValues: {}
2448
2441
  },
2449
2442
  emits: ["change"],
2450
2443
  setup(__props, { emit }) {
@@ -2522,31 +2515,31 @@
2522
2515
  "range-separator": "-",
2523
2516
  "start-placeholder": "开始日期",
2524
2517
  "end-placeholder": "结束日期",
2525
- size: __props.size,
2518
+ size: _ctx.size,
2526
2519
  "unlink-panels": true,
2527
- disabled: __props.disabled,
2528
- "default-time": __props.config.defaultTime,
2520
+ disabled: _ctx.disabled,
2521
+ "default-time": _ctx.config.defaultTime,
2529
2522
  onChange: changeHandler
2530
2523
  }, null, 8, ["modelValue", "size", "disabled", "default-time"]);
2531
2524
  };
2532
2525
  }
2533
2526
  });
2534
2527
 
2535
- const __default__$f = vue.defineComponent({
2536
- name: "MFormDateTime"
2537
- });
2538
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
2539
- ...__default__$f,
2528
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
2529
+ ...{
2530
+ name: "MFormDateTime"
2531
+ },
2532
+ __name: "DateTime",
2540
2533
  props: {
2541
- config: null,
2542
- model: null,
2543
- initValues: null,
2544
- values: null,
2545
- name: null,
2546
- prop: null,
2534
+ config: {},
2535
+ model: {},
2536
+ initValues: {},
2537
+ values: {},
2538
+ name: {},
2539
+ prop: {},
2547
2540
  disabled: { type: Boolean },
2548
- size: null,
2549
- lastValues: null
2541
+ size: {},
2542
+ lastValues: {}
2550
2543
  },
2551
2544
  emits: ["change"],
2552
2545
  setup(__props, { emit }) {
@@ -2565,36 +2558,38 @@
2565
2558
  };
2566
2559
  return (_ctx, _cache) => {
2567
2560
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
2568
- modelValue: __props.model[__props.name],
2569
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2561
+ modelValue: _ctx.model[_ctx.name],
2562
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2570
2563
  "popper-class": "magic-datetime-picker-popper",
2571
2564
  type: "datetime",
2572
- size: __props.size,
2573
- placeholder: __props.config.placeholder,
2574
- disabled: __props.disabled,
2575
- format: __props.config.format || "YYYY-MM-DD HH:mm:ss",
2576
- "value-format": __props.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
2577
- "default-time": __props.config.defaultTime,
2565
+ size: _ctx.size,
2566
+ placeholder: _ctx.config.placeholder,
2567
+ disabled: _ctx.disabled,
2568
+ format: _ctx.config.format || "YYYY/MM/DD HH:mm:ss",
2569
+ "value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
2570
+ "default-time": _ctx.config.defaultTime,
2578
2571
  onChange: changeHandler
2579
2572
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "default-time"]);
2580
2573
  };
2581
2574
  }
2582
2575
  });
2583
2576
 
2584
- const _hoisted_1$5 = { key: 0 };
2585
- const __default__$e = vue.defineComponent({
2586
- name: "MFormDisplay"
2587
- });
2588
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
2589
- ...__default__$e,
2577
+ const _hoisted_1$7 = { key: 0 };
2578
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
2579
+ ...{
2580
+ name: "MFormDisplay"
2581
+ },
2582
+ __name: "Display",
2590
2583
  props: {
2591
- config: null,
2592
- model: null,
2593
- initValues: null,
2594
- values: null,
2595
- name: null,
2596
- prop: null,
2597
- lastValues: null
2584
+ config: {},
2585
+ model: {},
2586
+ initValues: {},
2587
+ values: {},
2588
+ name: {},
2589
+ prop: {},
2590
+ disabled: { type: Boolean },
2591
+ size: {},
2592
+ lastValues: {}
2598
2593
  },
2599
2594
  setup(__props) {
2600
2595
  const props = __props;
@@ -2603,27 +2598,27 @@
2603
2598
  }
2604
2599
  useAddField(props.prop);
2605
2600
  return (_ctx, _cache) => {
2606
- return __props.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(__props.model[__props.name]), 1)) : vue.createCommentVNode("", true);
2601
+ return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$7, vue.toDisplayString(_ctx.model[_ctx.name]), 1)) : vue.createCommentVNode("", true);
2607
2602
  };
2608
2603
  }
2609
2604
  });
2610
2605
 
2611
- const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
2612
- const __default__$d = vue.defineComponent({
2613
- name: "MFormDynamicField"
2614
- });
2615
- const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
2616
- ...__default__$d,
2606
+ const _hoisted_1$6 = { class: "m-fields-dynamic-field" };
2607
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
2608
+ ...{
2609
+ name: "MFormDynamicField"
2610
+ },
2611
+ __name: "DynamicField",
2617
2612
  props: {
2618
- config: null,
2619
- model: null,
2620
- initValues: null,
2621
- values: null,
2622
- name: null,
2623
- prop: null,
2613
+ config: {},
2614
+ model: {},
2615
+ initValues: {},
2616
+ values: {},
2617
+ name: {},
2618
+ prop: {},
2624
2619
  disabled: { type: Boolean },
2625
- size: null,
2626
- lastValues: null
2620
+ size: {},
2621
+ lastValues: {}
2627
2622
  },
2628
2623
  emits: ["change"],
2629
2624
  setup(__props, { emit }) {
@@ -2674,7 +2669,7 @@
2674
2669
  emit("change", fieldMap.value[key], key);
2675
2670
  };
2676
2671
  return (_ctx, _cache) => {
2677
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
2672
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
2678
2673
  vue.createVNode(vue.unref(design.TMagicForm), { size: "small" }, {
2679
2674
  default: vue.withCtx(() => [
2680
2675
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(fieldMap.value), (key) => {
@@ -2701,40 +2696,42 @@
2701
2696
  }
2702
2697
  });
2703
2698
 
2704
- const __default__$c = vue.defineComponent({
2705
- name: "MFormHidden"
2706
- });
2707
- const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
2708
- ...__default__$c,
2699
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
2700
+ ...{
2701
+ name: "MFormHidden"
2702
+ },
2703
+ __name: "Hidden",
2709
2704
  props: {
2710
- config: null,
2711
- model: null,
2712
- initValues: null,
2713
- values: null,
2714
- name: null,
2715
- prop: null,
2716
- lastValues: null
2705
+ config: {},
2706
+ model: {},
2707
+ initValues: {},
2708
+ values: {},
2709
+ name: {},
2710
+ prop: {},
2711
+ disabled: { type: Boolean },
2712
+ size: {},
2713
+ lastValues: {}
2717
2714
  },
2718
2715
  setup(__props) {
2719
2716
  const props = __props;
2720
2717
  useAddField(props.prop);
2721
2718
  return (_ctx, _cache) => {
2722
- return __props.model ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2719
+ return _ctx.model ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2723
2720
  key: 0,
2724
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
2721
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2725
2722
  type: "hidden"
2726
2723
  }, null, 512)), [
2727
- [vue.vModelText, __props.model[__props.name]]
2724
+ [vue.vModelText, _ctx.model[_ctx.name]]
2728
2725
  ]) : vue.createCommentVNode("", true);
2729
2726
  };
2730
2727
  }
2731
2728
  });
2732
2729
 
2733
- const __default__$b = vue.defineComponent({
2734
- name: "MForm"
2735
- });
2736
- const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
2737
- ...__default__$b,
2730
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
2731
+ ...{
2732
+ name: "MForm"
2733
+ },
2734
+ __name: "Form",
2738
2735
  props: {
2739
2736
  config: { default: () => [] },
2740
2737
  initValues: { default: () => ({}) },
@@ -2745,14 +2742,15 @@
2745
2742
  disabled: { type: Boolean, default: false },
2746
2743
  height: { default: "auto" },
2747
2744
  stepActive: { default: 1 },
2748
- size: null,
2745
+ size: {},
2749
2746
  inline: { type: Boolean, default: false },
2750
2747
  labelPosition: { default: "right" },
2751
2748
  keyProp: { default: "__key" },
2752
- popperClass: null
2749
+ popperClass: {},
2750
+ extendState: {}
2753
2751
  },
2754
2752
  emits: ["change", "field-input", "field-change"],
2755
- setup(__props, { expose, emit }) {
2753
+ setup(__props, { expose: __expose, emit }) {
2756
2754
  const props = __props;
2757
2755
  const tMagicForm = vue.ref();
2758
2756
  const initialized = vue.ref(false);
@@ -2784,7 +2782,7 @@
2784
2782
  }
2785
2783
  }
2786
2784
  });
2787
- vue.watchEffect(() => {
2785
+ vue.watchEffect(async () => {
2788
2786
  formState.initValues = props.initValues;
2789
2787
  formState.lastValues = props.lastValues;
2790
2788
  formState.isCompare = props.isCompare;
@@ -2792,6 +2790,12 @@
2792
2790
  formState.keyProp = props.keyProp;
2793
2791
  formState.popperClass = props.popperClass;
2794
2792
  formState.parentValues = props.parentValues;
2793
+ if (typeof props.extendState === "function") {
2794
+ const state = await props.extendState(formState) || {};
2795
+ Object.entries(state).forEach(([key, value]) => {
2796
+ formState[key] = value;
2797
+ });
2798
+ }
2795
2799
  });
2796
2800
  vue.provide("mForm", formState);
2797
2801
  vue.watch(
@@ -2822,7 +2826,7 @@
2822
2826
  const changeHandler = () => {
2823
2827
  emit("change", values.value);
2824
2828
  };
2825
- expose({
2829
+ __expose({
2826
2830
  values,
2827
2831
  lastValuesProcessed,
2828
2832
  formState,
@@ -2855,23 +2859,23 @@
2855
2859
  ref_key: "tMagicForm",
2856
2860
  ref: tMagicForm,
2857
2861
  model: values.value,
2858
- "label-width": __props.labelWidth,
2859
- style: vue.normalizeStyle(`height: ${__props.height}`),
2860
- inline: __props.inline,
2861
- "label-position": __props.labelPosition
2862
+ "label-width": _ctx.labelWidth,
2863
+ style: vue.normalizeStyle(`height: ${_ctx.height}`),
2864
+ inline: _ctx.inline,
2865
+ "label-position": _ctx.labelPosition
2862
2866
  }, {
2863
2867
  default: vue.withCtx(() => [
2864
- initialized.value && Array.isArray(__props.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(__props.config, (item, index) => {
2865
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
2866
- disabled: __props.disabled,
2867
- key: item[__props.keyProp] ?? index,
2868
+ initialized.value && Array.isArray(_ctx.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.config, (item, index) => {
2869
+ return vue.openBlock(), vue.createBlock(_sfc_main$x, {
2870
+ disabled: _ctx.disabled,
2871
+ key: item[_ctx.keyProp] ?? index,
2868
2872
  config: item,
2869
2873
  model: values.value,
2870
2874
  "last-values": lastValuesProcessed.value,
2871
- "is-compare": __props.isCompare,
2872
- "label-width": item.labelWidth || __props.labelWidth,
2873
- "step-active": __props.stepActive,
2874
- size: __props.size,
2875
+ "is-compare": _ctx.isCompare,
2876
+ "label-width": item.labelWidth || _ctx.labelWidth,
2877
+ "step-active": _ctx.stepActive,
2878
+ size: _ctx.size,
2875
2879
  onChange: changeHandler
2876
2880
  }, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
2877
2881
  }), 128)) : vue.createCommentVNode("", true)
@@ -2882,30 +2886,27 @@
2882
2886
  }
2883
2887
  });
2884
2888
 
2885
- const _hoisted_1$3 = { style: { "min-height": "1px" } };
2886
- const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("取 消");
2887
- const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode("上一步");
2888
- const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("下一步");
2889
- const __default__$a = vue.defineComponent({
2890
- name: "MFormDialog"
2891
- });
2892
- const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
2893
- ...__default__$a,
2889
+ const _hoisted_1$5 = { style: { "min-height": "1px" } };
2890
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
2891
+ ...{
2892
+ name: "MFormDialog"
2893
+ },
2894
+ __name: "FormDialog",
2894
2895
  props: {
2895
2896
  config: { default: () => [] },
2896
2897
  values: { default: () => ({}) },
2897
- parentValues: null,
2898
- width: null,
2899
- labelWidth: null,
2898
+ parentValues: {},
2899
+ width: {},
2900
+ labelWidth: {},
2900
2901
  fullscreen: { type: Boolean },
2901
2902
  disabled: { type: Boolean },
2902
- title: null,
2903
- zIndex: null,
2904
- size: null,
2903
+ title: {},
2904
+ zIndex: {},
2905
+ size: {},
2905
2906
  confirmText: { default: "确定" }
2906
2907
  },
2907
2908
  emits: ["close", "submit", "error", "change"],
2908
- setup(__props, { expose, emit }) {
2909
+ setup(__props, { expose: __expose, emit }) {
2909
2910
  const props = __props;
2910
2911
  const form = vue.ref();
2911
2912
  const dialogVisible = vue.ref(false);
@@ -2930,9 +2931,6 @@
2930
2931
  }
2931
2932
  return false;
2932
2933
  });
2933
- const cancel = () => {
2934
- dialogVisible.value = false;
2935
- };
2936
2934
  const closeHandler = () => {
2937
2935
  stepActive.value = 1;
2938
2936
  emit("close");
@@ -2954,12 +2952,23 @@
2954
2952
  const changeHandler = (value) => {
2955
2953
  emit("change", value);
2956
2954
  };
2957
- expose({
2955
+ const show = () => {
2956
+ dialogVisible.value = true;
2957
+ };
2958
+ const hide = () => {
2959
+ dialogVisible.value = false;
2960
+ };
2961
+ const cancel = () => {
2962
+ hide();
2963
+ };
2964
+ __expose({
2958
2965
  form,
2959
2966
  saveFetch,
2960
2967
  dialogVisible,
2961
2968
  cancel,
2962
- save
2969
+ save,
2970
+ show,
2971
+ hide
2963
2972
  });
2964
2973
  return (_ctx, _cache) => {
2965
2974
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDialog), {
@@ -2968,10 +2977,10 @@
2968
2977
  class: "m-form-dialog",
2969
2978
  top: "20px",
2970
2979
  "append-to-body": "",
2971
- title: __props.title,
2972
- width: __props.width,
2973
- zIndex: __props.zIndex,
2974
- fullscreen: __props.fullscreen,
2980
+ title: _ctx.title,
2981
+ width: _ctx.width,
2982
+ zIndex: _ctx.zIndex,
2983
+ fullscreen: _ctx.fullscreen,
2975
2984
  "close-on-click-modal": false,
2976
2985
  onClose: closeHandler
2977
2986
  }, {
@@ -2983,7 +2992,7 @@
2983
2992
  style: { "text-align": "left" }
2984
2993
  }, {
2985
2994
  default: vue.withCtx(() => [
2986
- vue.createElementVNode("div", _hoisted_1$3, [
2995
+ vue.createElementVNode("div", _hoisted_1$5, [
2987
2996
  vue.renderSlot(_ctx.$slots, "left")
2988
2997
  ])
2989
2998
  ]),
@@ -2997,43 +3006,44 @@
2997
3006
  size: "small"
2998
3007
  }, {
2999
3008
  default: vue.withCtx(() => [
3000
- _hoisted_2$1
3009
+ vue.createTextVNode("取 消")
3001
3010
  ]),
3002
3011
  _: 1
3003
3012
  }),
3004
- vue.unref(hasStep) && stepActive.value > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3013
+ hasStep.value && stepActive.value > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3005
3014
  key: 0,
3006
3015
  type: "info",
3007
3016
  size: "small",
3008
3017
  onClick: preStep
3009
3018
  }, {
3010
3019
  default: vue.withCtx(() => [
3011
- _hoisted_3$1
3020
+ vue.createTextVNode("上一步")
3012
3021
  ]),
3013
3022
  _: 1
3014
3023
  })) : vue.createCommentVNode("", true),
3015
- vue.unref(hasStep) && vue.unref(stepCount) > stepActive.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3024
+ hasStep.value && stepCount.value > stepActive.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3016
3025
  key: 1,
3017
3026
  type: "info",
3018
3027
  size: "small",
3019
3028
  onClick: nextStep
3020
3029
  }, {
3021
3030
  default: vue.withCtx(() => [
3022
- _hoisted_4
3031
+ vue.createTextVNode("下一步")
3023
3032
  ]),
3024
3033
  _: 1
3025
3034
  })) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3026
3035
  key: 2,
3027
3036
  type: "primary",
3028
3037
  size: "small",
3038
+ disabled: _ctx.disabled,
3029
3039
  loading: saveFetch.value,
3030
3040
  onClick: save
3031
3041
  }, {
3032
3042
  default: vue.withCtx(() => [
3033
- vue.createTextVNode(vue.toDisplayString(__props.confirmText), 1)
3043
+ vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
3034
3044
  ]),
3035
3045
  _: 1
3036
- }, 8, ["loading"]))
3046
+ }, 8, ["disabled", "loading"]))
3037
3047
  ])
3038
3048
  ]),
3039
3049
  _: 3
@@ -3048,17 +3058,17 @@
3048
3058
  class: "m-dialog-body",
3049
3059
  style: vue.normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
3050
3060
  }, [
3051
- vue.createVNode(_sfc_main$b, {
3061
+ vue.createVNode(_sfc_main$d, {
3052
3062
  modelValue: stepActive.value,
3053
3063
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
3054
3064
  ref_key: "form",
3055
3065
  ref: form,
3056
- size: __props.size,
3057
- disabled: __props.disabled,
3058
- config: __props.config,
3059
- "init-values": __props.values,
3060
- "parent-values": __props.parentValues,
3061
- "label-width": __props.labelWidth,
3066
+ size: _ctx.size,
3067
+ disabled: _ctx.disabled,
3068
+ config: _ctx.config,
3069
+ "init-values": _ctx.values,
3070
+ "parent-values": _ctx.parentValues,
3071
+ "label-width": _ctx.labelWidth,
3062
3072
  onChange: changeHandler
3063
3073
  }, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width"]),
3064
3074
  vue.renderSlot(_ctx.$slots, "default")
@@ -3070,27 +3080,26 @@
3070
3080
  }
3071
3081
  });
3072
3082
 
3073
- const _hoisted_1$2 = ["href"];
3074
- const _hoisted_2 = {
3083
+ const _hoisted_1$4 = ["href"];
3084
+ const _hoisted_2$1 = {
3075
3085
  key: 2,
3076
3086
  class: "m-fields-link"
3077
3087
  };
3078
- const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("点击编辑");
3079
- const __default__$9 = vue.defineComponent({
3080
- name: "MFormLink"
3081
- });
3082
- const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
3083
- ...__default__$9,
3088
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
3089
+ ...{
3090
+ name: "MFormLink"
3091
+ },
3092
+ __name: "Link",
3084
3093
  props: {
3085
- config: null,
3086
- model: null,
3087
- initValues: null,
3088
- values: null,
3089
- name: null,
3090
- prop: null,
3094
+ config: {},
3095
+ model: {},
3096
+ initValues: {},
3097
+ values: {},
3098
+ name: {},
3099
+ prop: {},
3091
3100
  disabled: { type: Boolean },
3092
- size: null,
3093
- lastValues: null
3101
+ size: {},
3102
+ lastValues: {}
3094
3103
  },
3095
3104
  emits: ["change"],
3096
3105
  setup(__props, { emit }) {
@@ -3139,34 +3148,34 @@
3139
3148
  editor.value && (editor.value.dialogVisible = false);
3140
3149
  };
3141
3150
  return (_ctx, _cache) => {
3142
- return __props.config.href && !__props.disabled ? (vue.openBlock(), vue.createElementBlock("a", {
3151
+ return _ctx.config.href && !_ctx.disabled ? (vue.openBlock(), vue.createElementBlock("a", {
3143
3152
  key: 0,
3144
3153
  target: "_blank",
3145
- href: vue.unref(href),
3146
- style: vue.normalizeStyle(__props.config.css || {})
3147
- }, vue.toDisplayString(vue.unref(displayText)), 13, _hoisted_1$2)) : __props.config.href && __props.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
3154
+ href: href.value,
3155
+ style: vue.normalizeStyle(_ctx.config.css || {})
3156
+ }, vue.toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
3148
3157
  key: 1,
3149
- style: vue.normalizeStyle(__props.config.disabledCss || {})
3150
- }, vue.toDisplayString(vue.unref(displayText)), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
3158
+ style: vue.normalizeStyle(_ctx.config.disabledCss || {})
3159
+ }, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
3151
3160
  vue.createVNode(vue.unref(design.TMagicButton), {
3152
3161
  text: true,
3153
3162
  type: "primary",
3154
3163
  onClick: editHandler
3155
3164
  }, {
3156
3165
  default: vue.withCtx(() => [
3157
- _hoisted_3
3166
+ vue.createTextVNode("点击编辑")
3158
3167
  ]),
3159
3168
  _: 1
3160
3169
  }),
3161
- vue.createVNode(_sfc_main$a, {
3170
+ vue.createVNode(_sfc_main$c, {
3162
3171
  ref_key: "editor",
3163
3172
  ref: editor,
3164
- title: __props.config.formTitle || "编辑扩展配置",
3165
- width: __props.config.formWidth,
3173
+ title: _ctx.config.formTitle || "编辑扩展配置",
3174
+ width: _ctx.config.formWidth,
3166
3175
  values: formValue.value,
3167
- config: vue.unref(formConfig),
3168
- parentValues: __props.values,
3169
- fullscreen: __props.config.fullscreen,
3176
+ config: formConfig.value,
3177
+ parentValues: _ctx.values,
3178
+ fullscreen: _ctx.config.fullscreen,
3170
3179
  onSubmit: action
3171
3180
  }, null, 8, ["title", "width", "values", "config", "parentValues", "fullscreen"])
3172
3181
  ]));
@@ -3174,21 +3183,21 @@
3174
3183
  }
3175
3184
  });
3176
3185
 
3177
- const __default__$8 = vue.defineComponent({
3178
- name: "MFormNumber"
3179
- });
3180
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
3181
- ...__default__$8,
3186
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
3187
+ ...{
3188
+ name: "MFormNumber"
3189
+ },
3190
+ __name: "Number",
3182
3191
  props: {
3183
- config: null,
3184
- model: null,
3185
- initValues: null,
3186
- values: null,
3187
- name: null,
3188
- prop: null,
3192
+ config: {},
3193
+ model: {},
3194
+ initValues: {},
3195
+ values: {},
3196
+ name: {},
3197
+ prop: {},
3189
3198
  disabled: { type: Boolean },
3190
- size: null,
3191
- lastValues: null
3199
+ size: {},
3200
+ lastValues: {}
3192
3201
  },
3193
3202
  emits: ["change", "input"],
3194
3203
  setup(__props, { emit }) {
@@ -3203,18 +3212,18 @@
3203
3212
  mForm?.$emit("field-input", props.prop, v);
3204
3213
  };
3205
3214
  return (_ctx, _cache) => {
3206
- return __props.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInputNumber), {
3215
+ return _ctx.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInputNumber), {
3207
3216
  key: 0,
3208
- modelValue: __props.model[__props.name],
3209
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3217
+ modelValue: _ctx.model[_ctx.name],
3218
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3210
3219
  clearable: "",
3211
3220
  "controls-position": "right",
3212
- size: __props.size,
3213
- max: __props.config.max,
3214
- min: __props.config.min,
3215
- step: __props.config.step,
3216
- placeholder: __props.config.placeholder,
3217
- disabled: __props.disabled,
3221
+ size: _ctx.size,
3222
+ max: _ctx.config.max,
3223
+ min: _ctx.config.min,
3224
+ step: _ctx.config.step,
3225
+ placeholder: _ctx.config.placeholder,
3226
+ disabled: _ctx.disabled,
3218
3227
  onChange: changeHandler,
3219
3228
  onInput: inputHandler
3220
3229
  }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : vue.createCommentVNode("", true);
@@ -3222,21 +3231,76 @@
3222
3231
  }
3223
3232
  });
3224
3233
 
3225
- const __default__$7 = vue.defineComponent({
3226
- name: "MFormRadioGroup"
3234
+ const _hoisted_1$3 = { class: "m-fields-number-range" };
3235
+ const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "split-tag" }, "-", -1);
3236
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
3237
+ ...{
3238
+ name: "MFormNumberRange"
3239
+ },
3240
+ __name: "NumberRange",
3241
+ props: {
3242
+ config: {},
3243
+ model: {},
3244
+ initValues: {},
3245
+ values: {},
3246
+ name: {},
3247
+ prop: {},
3248
+ disabled: { type: Boolean },
3249
+ size: {},
3250
+ lastValues: {}
3251
+ },
3252
+ emits: ["change"],
3253
+ setup(__props, { emit }) {
3254
+ const props = __props;
3255
+ useAddField(props.prop);
3256
+ if (!Array.isArray(props.model[props.name])) {
3257
+ props.model[props.name] = [];
3258
+ }
3259
+ const minChangeHandler = (v) => {
3260
+ emit("change", [Number(v), props.model[props.name][1]]);
3261
+ };
3262
+ const maxChangeHandler = (v) => {
3263
+ emit("change", [props.model[props.name][0], Number(v)]);
3264
+ };
3265
+ return (_ctx, _cache) => {
3266
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
3267
+ vue.createVNode(vue.unref(design.TMagicInput), {
3268
+ modelValue: _ctx.model[_ctx.name][0],
3269
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name][0] = $event),
3270
+ clearable: "",
3271
+ size: _ctx.size,
3272
+ disabled: _ctx.disabled,
3273
+ onChange: minChangeHandler
3274
+ }, null, 8, ["modelValue", "size", "disabled"]),
3275
+ _hoisted_2,
3276
+ vue.createVNode(vue.unref(design.TMagicInput), {
3277
+ modelValue: _ctx.model[_ctx.name][1],
3278
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
3279
+ clearable: "",
3280
+ size: _ctx.size,
3281
+ disabled: _ctx.disabled,
3282
+ onChange: maxChangeHandler
3283
+ }, null, 8, ["modelValue", "size", "disabled"])
3284
+ ]);
3285
+ };
3286
+ }
3227
3287
  });
3228
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
3229
- ...__default__$7,
3288
+
3289
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
3290
+ ...{
3291
+ name: "MFormRadioGroup"
3292
+ },
3293
+ __name: "RadioGroup",
3230
3294
  props: {
3231
- config: null,
3232
- model: null,
3233
- initValues: null,
3234
- values: null,
3235
- name: null,
3236
- prop: null,
3295
+ config: {},
3296
+ model: {},
3297
+ initValues: {},
3298
+ values: {},
3299
+ name: {},
3300
+ prop: {},
3237
3301
  disabled: { type: Boolean },
3238
- size: null,
3239
- lastValues: null
3302
+ size: {},
3303
+ lastValues: {}
3240
3304
  },
3241
3305
  emits: ["change"],
3242
3306
  setup(__props, { emit }) {
@@ -3246,16 +3310,16 @@
3246
3310
  };
3247
3311
  useAddField(props.prop);
3248
3312
  return (_ctx, _cache) => {
3249
- return __props.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadioGroup), {
3313
+ return _ctx.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadioGroup), {
3250
3314
  key: 0,
3251
- modelValue: __props.model[__props.name],
3252
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3253
- size: __props.size,
3254
- disabled: __props.disabled,
3315
+ modelValue: _ctx.model[_ctx.name],
3316
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3317
+ size: _ctx.size,
3318
+ disabled: _ctx.disabled,
3255
3319
  onChange: changeHandler
3256
3320
  }, {
3257
3321
  default: vue.withCtx(() => [
3258
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.options, (option) => {
3322
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.options, (option) => {
3259
3323
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
3260
3324
  label: option.value,
3261
3325
  value: option.value,
@@ -3274,18 +3338,18 @@
3274
3338
  }
3275
3339
  });
3276
3340
 
3277
- const __default__$6 = vue.defineComponent({
3278
- name: "MFormSelectOptionGroups"
3279
- });
3280
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3281
- ...__default__$6,
3341
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
3342
+ ...{
3343
+ name: "MFormSelectOptionGroups"
3344
+ },
3345
+ __name: "SelectOptionGroups",
3282
3346
  props: {
3283
- options: null
3347
+ options: {}
3284
3348
  },
3285
3349
  setup(__props) {
3286
- const uiComponent = design.getConfig("components").option;
3350
+ const uiComponent = design.getConfig("components")?.option.component || "el-option";
3287
3351
  return (_ctx, _cache) => {
3288
- return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (group, index) => {
3352
+ return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (group, index) => {
3289
3353
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicOptionGroup), {
3290
3354
  key: index,
3291
3355
  label: group.label,
@@ -3293,7 +3357,7 @@
3293
3357
  }, {
3294
3358
  default: vue.withCtx(() => [
3295
3359
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group.options, (item, index2) => {
3296
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent).component), {
3360
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent)), {
3297
3361
  key: index2,
3298
3362
  label: item.label || item.text,
3299
3363
  value: item.value,
@@ -3308,22 +3372,22 @@
3308
3372
  }
3309
3373
  });
3310
3374
 
3311
- const __default__$5 = vue.defineComponent({
3312
- name: "MFormSelectOptions"
3313
- });
3314
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3315
- ...__default__$5,
3375
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3376
+ ...{
3377
+ name: "MFormSelectOptions"
3378
+ },
3379
+ __name: "SelectOptions",
3316
3380
  props: {
3317
- options: null,
3318
- valueKey: null
3381
+ options: {},
3382
+ valueKey: {}
3319
3383
  },
3320
3384
  setup(__props) {
3321
3385
  return (_ctx, _cache) => {
3322
- return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (option) => {
3386
+ return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (option) => {
3323
3387
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicOption), {
3324
3388
  label: option.text,
3325
3389
  value: option.value,
3326
- key: __props.valueKey ? option.value[__props.valueKey] : option.value,
3390
+ key: _ctx.valueKey ? option.value[_ctx.valueKey] : option.value,
3327
3391
  disabled: option.disabled
3328
3392
  }, null, 8, ["label", "value", "disabled"]);
3329
3393
  }), 128);
@@ -3331,22 +3395,22 @@
3331
3395
  }
3332
3396
  });
3333
3397
 
3334
- const _hoisted_1$1 = { key: 2 };
3335
- const __default__$4 = vue.defineComponent({
3336
- name: "MFormSelect"
3337
- });
3338
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3339
- ...__default__$4,
3398
+ const _hoisted_1$2 = { key: 2 };
3399
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3400
+ ...{
3401
+ name: "MFormSelect"
3402
+ },
3403
+ __name: "Select",
3340
3404
  props: {
3341
- config: null,
3342
- model: null,
3343
- initValues: null,
3344
- values: null,
3345
- name: null,
3346
- prop: null,
3405
+ config: {},
3406
+ model: {},
3407
+ initValues: {},
3408
+ values: {},
3409
+ name: {},
3410
+ prop: {},
3347
3411
  disabled: { type: Boolean },
3348
- size: null,
3349
- lastValues: null
3412
+ size: {},
3413
+ lastValues: {}
3350
3414
  },
3351
3415
  emits: ["change"],
3352
3416
  setup(__props, { emit }) {
@@ -3374,12 +3438,16 @@
3374
3438
  return value === v;
3375
3439
  };
3376
3440
  const mapOptions = (data) => {
3377
- const { option } = props.config;
3378
- const { text } = option;
3379
- const { value } = option;
3441
+ const {
3442
+ option = {
3443
+ text: "text",
3444
+ value: "value"
3445
+ }
3446
+ } = props.config;
3447
+ const { text = "text", value = "value" } = option;
3380
3448
  return data.map((item) => ({
3381
- text: typeof text === "function" ? text(item) : item[text || "text"],
3382
- value: typeof value === "function" ? value(item) : item[value || "value"]
3449
+ text: typeof text === "function" ? text(item) : item[text],
3450
+ value: typeof value === "function" ? value(item) : item[value]
3383
3451
  }));
3384
3452
  };
3385
3453
  const getOptions = async () => {
@@ -3390,8 +3458,9 @@
3390
3458
  }
3391
3459
  loading.value = true;
3392
3460
  let items = [];
3393
- const { config } = props;
3394
- const { option } = config;
3461
+ const { option } = props.config;
3462
+ if (!option)
3463
+ return [];
3395
3464
  const { root = "", totalKey = "total" } = option;
3396
3465
  let { body = {}, url } = option;
3397
3466
  if (typeof url === "function") {
@@ -3438,11 +3507,8 @@
3438
3507
  postOptions
3439
3508
  });
3440
3509
  }
3441
- const optionsData = root.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
3442
- const resTotal = globalThis.parseInt(
3443
- totalKey.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res),
3444
- 10
3445
- );
3510
+ const optionsData = utils.getValueByKeyPath(root, res);
3511
+ const resTotal = globalThis.parseInt(utils.getValueByKeyPath(totalKey, res), 10);
3446
3512
  if (resTotal > 0) {
3447
3513
  total.value = resTotal;
3448
3514
  }
@@ -3491,8 +3557,9 @@
3491
3557
  const getInitOption = async () => {
3492
3558
  if (!props.model)
3493
3559
  return [];
3494
- const { config } = props;
3495
- const { option } = config;
3560
+ const { option } = props.config;
3561
+ if (!option)
3562
+ return [];
3496
3563
  const { root = "", initRoot = "" } = option;
3497
3564
  let { initBody = {} } = option;
3498
3565
  let options2 = [];
@@ -3542,7 +3609,7 @@
3542
3609
  postOptions
3543
3610
  });
3544
3611
  }
3545
- let initData = (initRoot || root).split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
3612
+ let initData = utils.getValueByKeyPath(initRoot || root, res);
3546
3613
  if (initData) {
3547
3614
  if (!Array.isArray(initData)) {
3548
3615
  initData = [initData];
@@ -3647,36 +3714,36 @@
3647
3714
  const groupOptions = options;
3648
3715
  return (_ctx, _cache) => {
3649
3716
  const _directive_loading = vue.resolveDirective("loading");
3650
- return __props.model ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSelect), {
3717
+ return _ctx.model ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSelect), {
3651
3718
  key: 0,
3652
- modelValue: __props.model[__props.name],
3653
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3719
+ modelValue: _ctx.model[_ctx.name],
3720
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3654
3721
  class: "m-select",
3655
3722
  ref_key: "tMagicSelect",
3656
3723
  ref: tMagicSelect,
3657
- clearable: typeof __props.config.clearable !== "undefined" ? __props.config.clearable : true,
3658
- filterable: typeof __props.config.filterable !== "undefined" ? __props.config.filterable : true,
3724
+ clearable: typeof _ctx.config.clearable !== "undefined" ? _ctx.config.clearable : true,
3725
+ filterable: typeof _ctx.config.filterable !== "undefined" ? _ctx.config.filterable : true,
3659
3726
  "popper-class": `m-select-popper ${vue.unref(popperClass)}`,
3660
- size: __props.size,
3727
+ size: _ctx.size,
3661
3728
  remote: remote.value,
3662
- placeholder: __props.config.placeholder,
3663
- multiple: __props.config.multiple,
3664
- "value-key": __props.config.valueKey || "value",
3665
- "allow-create": __props.config.allowCreate,
3666
- disabled: __props.disabled,
3667
- "remote-method": __props.config.remote && remoteMethod,
3729
+ placeholder: _ctx.config.placeholder,
3730
+ multiple: _ctx.config.multiple,
3731
+ "value-key": _ctx.config.valueKey || "value",
3732
+ "allow-create": _ctx.config.allowCreate,
3733
+ disabled: _ctx.disabled,
3734
+ "remote-method": _ctx.config.remote && remoteMethod,
3668
3735
  onChange: changeHandler,
3669
3736
  onVisibleChange: visibleHandler
3670
3737
  }, {
3671
3738
  default: vue.withCtx(() => [
3672
- __props.config.group ? (vue.openBlock(), vue.createBlock(_sfc_main$6, {
3739
+ _ctx.config.group ? (vue.openBlock(), vue.createBlock(_sfc_main$7, {
3673
3740
  key: 0,
3674
3741
  options: vue.unref(groupOptions)
3675
- }, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$5, {
3742
+ }, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$6, {
3676
3743
  key: 1,
3677
3744
  options: vue.unref(itemOptions)
3678
3745
  }, null, 8, ["options"])),
3679
- moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, null, 512)), [
3746
+ moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
3680
3747
  [_directive_loading, true]
3681
3748
  ]) : vue.createCommentVNode("", true)
3682
3749
  ]),
@@ -3688,21 +3755,21 @@
3688
3755
  }
3689
3756
  });
3690
3757
 
3691
- const __default__$3 = vue.defineComponent({
3692
- name: "MFormSwitch"
3693
- });
3694
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3695
- ...__default__$3,
3758
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3759
+ ...{
3760
+ name: "MFormSwitch"
3761
+ },
3762
+ __name: "Switch",
3696
3763
  props: {
3697
- config: null,
3698
- model: null,
3699
- initValues: null,
3700
- values: null,
3701
- name: null,
3702
- prop: null,
3764
+ config: {},
3765
+ model: {},
3766
+ initValues: {},
3767
+ values: {},
3768
+ name: {},
3769
+ prop: {},
3703
3770
  disabled: { type: Boolean },
3704
- size: null,
3705
- lastValues: null
3771
+ size: {},
3772
+ lastValues: {}
3706
3773
  },
3707
3774
  emits: ["change"],
3708
3775
  setup(__props, { emit }) {
@@ -3733,34 +3800,34 @@
3733
3800
  });
3734
3801
  return (_ctx, _cache) => {
3735
3802
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSwitch), {
3736
- modelValue: __props.model[__props.name],
3737
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3738
- size: __props.size,
3739
- activeValue: vue.unref(activeValue),
3740
- inactiveValue: vue.unref(inactiveValue),
3741
- disabled: __props.disabled,
3803
+ modelValue: _ctx.model[_ctx.name],
3804
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3805
+ size: _ctx.size,
3806
+ activeValue: activeValue.value,
3807
+ inactiveValue: inactiveValue.value,
3808
+ disabled: _ctx.disabled,
3742
3809
  onChange: changeHandler
3743
3810
  }, null, 8, ["modelValue", "size", "activeValue", "inactiveValue", "disabled"]);
3744
3811
  };
3745
3812
  }
3746
3813
  });
3747
3814
 
3748
- const _hoisted_1 = { key: 0 };
3749
- const __default__$2 = vue.defineComponent({
3750
- name: "MFormText"
3751
- });
3752
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3753
- ...__default__$2,
3815
+ const _hoisted_1$1 = { key: 0 };
3816
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3817
+ ...{
3818
+ name: "MFormText"
3819
+ },
3820
+ __name: "Text",
3754
3821
  props: {
3755
- config: null,
3756
- model: null,
3757
- initValues: null,
3758
- values: null,
3759
- name: null,
3760
- prop: null,
3822
+ config: {},
3823
+ model: {},
3824
+ initValues: {},
3825
+ values: {},
3826
+ name: {},
3827
+ prop: {},
3761
3828
  disabled: { type: Boolean },
3762
- size: null,
3763
- lastValues: null
3829
+ size: {},
3830
+ lastValues: {}
3764
3831
  },
3765
3832
  emits: ["change", "input"],
3766
3833
  setup(__props, { emit }) {
@@ -3837,53 +3904,54 @@
3837
3904
  };
3838
3905
  return (_ctx, _cache) => {
3839
3906
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
3840
- modelValue: __props.model[__props.name],
3841
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3907
+ modelValue: _ctx.model[_ctx.name],
3908
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3842
3909
  clearable: "",
3843
- size: __props.size,
3844
- placeholder: __props.config.placeholder,
3845
- disabled: __props.disabled,
3910
+ size: _ctx.size,
3911
+ placeholder: _ctx.config.placeholder,
3912
+ disabled: _ctx.disabled,
3846
3913
  onChange: changeHandler,
3847
3914
  onInput: inputHandler,
3848
3915
  onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
3849
3916
  }, vue.createSlots({ _: 2 }, [
3850
- __props.config.append ? {
3917
+ _ctx.config.append ? {
3851
3918
  name: "append",
3852
3919
  fn: vue.withCtx(() => [
3853
- typeof __props.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(__props.config.append), 1)) : vue.createCommentVNode("", true),
3854
- typeof __props.config.append === "object" && __props.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3920
+ typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
3921
+ typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3855
3922
  key: 1,
3856
3923
  style: { "color": "#409eff" },
3857
- size: __props.size,
3924
+ size: _ctx.size,
3858
3925
  onClick: vue.withModifiers(buttonClickHandler, ["prevent"])
3859
3926
  }, {
3860
3927
  default: vue.withCtx(() => [
3861
- vue.createTextVNode(vue.toDisplayString(__props.config.append.text), 1)
3928
+ vue.createTextVNode(vue.toDisplayString(_ctx.config.append.text), 1)
3862
3929
  ]),
3863
3930
  _: 1
3864
3931
  }, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
3865
- ])
3932
+ ]),
3933
+ key: "0"
3866
3934
  } : void 0
3867
3935
  ]), 1032, ["modelValue", "size", "placeholder", "disabled"]);
3868
3936
  };
3869
3937
  }
3870
3938
  });
3871
3939
 
3872
- const __default__$1 = vue.defineComponent({
3873
- name: "MFormTextarea"
3874
- });
3875
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3876
- ...__default__$1,
3940
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3941
+ ...{
3942
+ name: "MFormTextarea"
3943
+ },
3944
+ __name: "Textarea",
3877
3945
  props: {
3878
- config: null,
3879
- model: null,
3880
- initValues: null,
3881
- values: null,
3882
- name: null,
3883
- prop: null,
3946
+ config: {},
3947
+ model: {},
3948
+ initValues: {},
3949
+ values: {},
3950
+ name: {},
3951
+ prop: {},
3884
3952
  disabled: { type: Boolean },
3885
- size: null,
3886
- lastValues: null
3953
+ size: {},
3954
+ lastValues: {}
3887
3955
  },
3888
3956
  emits: ["change", "input"],
3889
3957
  setup(__props, { emit }) {
@@ -3899,13 +3967,13 @@
3899
3967
  };
3900
3968
  return (_ctx, _cache) => {
3901
3969
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
3902
- modelValue: __props.model[__props.name],
3903
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3970
+ modelValue: _ctx.model[_ctx.name],
3971
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3904
3972
  type: "textarea",
3905
- size: __props.size,
3973
+ size: _ctx.size,
3906
3974
  clearable: "",
3907
- placeholder: __props.config.placeholder,
3908
- disabled: __props.disabled,
3975
+ placeholder: _ctx.config.placeholder,
3976
+ disabled: _ctx.disabled,
3909
3977
  onChange: changeHandler,
3910
3978
  onInput: inputHandler
3911
3979
  }, null, 8, ["modelValue", "size", "placeholder", "disabled"]);
@@ -3913,21 +3981,21 @@
3913
3981
  }
3914
3982
  });
3915
3983
 
3916
- const __default__ = vue.defineComponent({
3917
- name: "MFormTime"
3918
- });
3919
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3920
- ...__default__,
3984
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3985
+ ...{
3986
+ name: "MFormTime"
3987
+ },
3988
+ __name: "Time",
3921
3989
  props: {
3922
- config: null,
3923
- model: null,
3924
- initValues: null,
3925
- values: null,
3926
- name: null,
3927
- prop: null,
3990
+ config: {},
3991
+ model: {},
3992
+ initValues: {},
3993
+ values: {},
3994
+ name: {},
3995
+ prop: {},
3928
3996
  disabled: { type: Boolean },
3929
- size: null,
3930
- lastValues: null
3997
+ size: {},
3998
+ lastValues: {}
3931
3999
  },
3932
4000
  emits: ["change"],
3933
4001
  setup(__props, { emit }) {
@@ -3938,13 +4006,13 @@
3938
4006
  };
3939
4007
  return (_ctx, _cache) => {
3940
4008
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
3941
- modelValue: __props.model[__props.name],
3942
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
3943
- "value-format": __props.config.valueFormat || "HH:mm:ss",
3944
- format: __props.config.format || "HH:mm:ss",
3945
- size: __props.size,
3946
- placeholder: __props.config.placeholder,
3947
- disabled: __props.disabled,
4009
+ modelValue: _ctx.model[_ctx.name],
4010
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
4011
+ "value-format": _ctx.config.valueFormat || "HH:mm:ss",
4012
+ format: _ctx.config.format || "HH:mm:ss",
4013
+ size: _ctx.size,
4014
+ placeholder: _ctx.config.placeholder,
4015
+ disabled: _ctx.disabled,
3948
4016
  onChange: changeHandler
3949
4017
  }, null, 8, ["modelValue", "value-format", "format", "size", "placeholder", "disabled"]);
3950
4018
  };
@@ -3953,71 +4021,218 @@
3953
4021
 
3954
4022
  const index$1 = '';
3955
4023
 
4024
+ const _hoisted_1 = { style: { "min-height": "1px" } };
4025
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4026
+ ...{
4027
+ name: "MFormDialog"
4028
+ },
4029
+ __name: "FormDrawer",
4030
+ props: {
4031
+ config: { default: () => [] },
4032
+ values: { default: () => ({}) },
4033
+ parentValues: {},
4034
+ width: {},
4035
+ labelWidth: {},
4036
+ disabled: { type: Boolean },
4037
+ closeOnPressEscape: { type: Boolean, default: true },
4038
+ title: {},
4039
+ zIndex: {},
4040
+ size: {},
4041
+ confirmText: { default: "确定" }
4042
+ },
4043
+ emits: ["close", "submit", "error", "change", "open", "opened"],
4044
+ setup(__props, { expose: __expose, emit }) {
4045
+ const form = vue.ref();
4046
+ const drawerBody = vue.ref();
4047
+ const visible = vue.ref(false);
4048
+ const saveFetch = vue.ref(false);
4049
+ const bodyHeight = vue.ref(0);
4050
+ vue.watchEffect(() => {
4051
+ if (drawerBody.value) {
4052
+ bodyHeight.value = drawerBody.value.clientHeight;
4053
+ }
4054
+ });
4055
+ const submitHandler = async () => {
4056
+ try {
4057
+ const values = await form.value?.submitForm();
4058
+ emit("submit", values);
4059
+ } catch (e) {
4060
+ emit("error", e);
4061
+ }
4062
+ };
4063
+ const changeHandler = (value) => {
4064
+ emit("change", value);
4065
+ };
4066
+ const openHandler = (value) => {
4067
+ emit("open", value);
4068
+ };
4069
+ const openedHandler = (value) => {
4070
+ emit("opened", value);
4071
+ };
4072
+ const show = () => {
4073
+ visible.value = true;
4074
+ };
4075
+ const hide = () => {
4076
+ visible.value = false;
4077
+ };
4078
+ __expose({
4079
+ form,
4080
+ saveFetch,
4081
+ bodyHeight,
4082
+ show,
4083
+ hide
4084
+ });
4085
+ return (_ctx, _cache) => {
4086
+ return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDrawer), {
4087
+ class: "m-form-drawer",
4088
+ modelValue: visible.value,
4089
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
4090
+ title: _ctx.title,
4091
+ "close-on-press-escape": _ctx.closeOnPressEscape,
4092
+ "append-to-body": true,
4093
+ "show-close": true,
4094
+ "close-on-click-modal": true,
4095
+ size: _ctx.width,
4096
+ zIndex: _ctx.zIndex,
4097
+ onOpen: openHandler,
4098
+ onOpened: openedHandler
4099
+ }, {
4100
+ footer: vue.withCtx(() => [
4101
+ vue.createVNode(vue.unref(design.TMagicRow), { class: "dialog-footer" }, {
4102
+ default: vue.withCtx(() => [
4103
+ vue.createVNode(vue.unref(design.TMagicCol), {
4104
+ span: 12,
4105
+ style: { "text-align": "left" }
4106
+ }, {
4107
+ default: vue.withCtx(() => [
4108
+ vue.createElementVNode("div", _hoisted_1, [
4109
+ vue.renderSlot(_ctx.$slots, "left")
4110
+ ])
4111
+ ]),
4112
+ _: 3
4113
+ }),
4114
+ vue.createVNode(vue.unref(design.TMagicCol), { span: 12 }, {
4115
+ default: vue.withCtx(() => [
4116
+ vue.renderSlot(_ctx.$slots, "footer", {}, () => [
4117
+ vue.createVNode(vue.unref(design.TMagicButton), { onClick: hide }, {
4118
+ default: vue.withCtx(() => [
4119
+ vue.createTextVNode("关闭")
4120
+ ]),
4121
+ _: 1
4122
+ }),
4123
+ vue.createVNode(vue.unref(design.TMagicButton), {
4124
+ type: "primary",
4125
+ disabled: _ctx.disabled,
4126
+ loading: saveFetch.value,
4127
+ onClick: submitHandler
4128
+ }, {
4129
+ default: vue.withCtx(() => [
4130
+ vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
4131
+ ]),
4132
+ _: 1
4133
+ }, 8, ["disabled", "loading"])
4134
+ ])
4135
+ ]),
4136
+ _: 3
4137
+ })
4138
+ ]),
4139
+ _: 3
4140
+ })
4141
+ ]),
4142
+ default: vue.withCtx(() => [
4143
+ visible.value ? (vue.openBlock(), vue.createElementBlock("div", {
4144
+ key: 0,
4145
+ ref_key: "drawerBody",
4146
+ ref: drawerBody,
4147
+ class: "m-drawer-body"
4148
+ }, [
4149
+ vue.createVNode(_sfc_main$d, {
4150
+ ref_key: "form",
4151
+ ref: form,
4152
+ size: _ctx.size,
4153
+ disabled: _ctx.disabled,
4154
+ config: _ctx.config,
4155
+ "init-values": _ctx.values,
4156
+ "parent-values": _ctx.parentValues,
4157
+ "label-width": _ctx.labelWidth,
4158
+ onChange: changeHandler
4159
+ }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width"]),
4160
+ vue.renderSlot(_ctx.$slots, "default")
4161
+ ], 512)) : vue.createCommentVNode("", true)
4162
+ ]),
4163
+ _: 3
4164
+ }, 8, ["modelValue", "title", "close-on-press-escape", "size", "zIndex"]);
4165
+ };
4166
+ }
4167
+ });
4168
+
3956
4169
  const defaultInstallOpt = {};
3957
- const install = (app, opt) => {
3958
- const option = Object.assign(defaultInstallOpt, opt);
3959
- app.config.globalProperties.$MAGIC_FORM = option;
3960
- setConfig(option);
3961
- app.component("m-form", _sfc_main$b);
3962
- app.component("m-form-dialog", _sfc_main$a);
3963
- app.component("m-form-container", _sfc_main$v);
3964
- app.component("m-form-fieldset", _sfc_main$u);
3965
- app.component("m-form-group-list", _sfc_main$s);
3966
- app.component("m-form-panel", _sfc_main$r);
3967
- app.component("m-form-row", _sfc_main$p);
3968
- app.component("m-form-step", _sfc_main$o);
3969
- app.component("m-form-table", _sfc_main$n);
3970
- app.component("m-form-tab", _sfc_main$m);
3971
- app.component("m-fields-text", _sfc_main$2);
3972
- app.component("m-fields-number", _sfc_main$8);
3973
- app.component("m-fields-textarea", _sfc_main$1);
3974
- app.component("m-fields-hidden", _sfc_main$c);
3975
- app.component("m-fields-date", _sfc_main$h);
3976
- app.component("m-fields-datetime", _sfc_main$f);
3977
- app.component("m-fields-daterange", _sfc_main$g);
3978
- app.component("m-fields-time", _sfc_main);
3979
- app.component("m-fields-checkbox", _sfc_main$k);
3980
- app.component("m-fields-switch", _sfc_main$3);
3981
- app.component("m-fields-color-picker", _sfc_main$i);
3982
- app.component("m-fields-checkbox-group", _sfc_main$j);
3983
- app.component("m-fields-radio-group", _sfc_main$7);
3984
- app.component("m-fields-display", _sfc_main$e);
3985
- app.component("m-fields-link", _sfc_main$9);
3986
- app.component("m-fields-select", _sfc_main$4);
3987
- app.component("m-fields-cascader", _sfc_main$l);
3988
- app.component("m-fields-dynamic-field", _sfc_main$d);
3989
- };
3990
4170
  const index = {
3991
- install
4171
+ install(app, opt = {}) {
4172
+ const option = Object.assign(defaultInstallOpt, opt);
4173
+ app.config.globalProperties.$MAGIC_FORM = option;
4174
+ setConfig(option);
4175
+ app.component("m-form", _sfc_main$d);
4176
+ app.component("m-form-dialog", _sfc_main$c);
4177
+ app.component("m-form-container", _sfc_main$x);
4178
+ app.component("m-form-fieldset", _sfc_main$w);
4179
+ app.component("m-form-group-list", _sfc_main$u);
4180
+ app.component("m-form-panel", _sfc_main$t);
4181
+ app.component("m-form-row", _sfc_main$r);
4182
+ app.component("m-form-step", _sfc_main$q);
4183
+ app.component("m-form-table", _sfc_main$p);
4184
+ app.component("m-form-tab", _sfc_main$o);
4185
+ app.component("m-fields-text", _sfc_main$3);
4186
+ app.component("m-fields-number", _sfc_main$a);
4187
+ app.component("m-fields-number-range", _sfc_main$9);
4188
+ app.component("m-fields-textarea", _sfc_main$2);
4189
+ app.component("m-fields-hidden", _sfc_main$e);
4190
+ app.component("m-fields-date", _sfc_main$j);
4191
+ app.component("m-fields-datetime", _sfc_main$h);
4192
+ app.component("m-fields-daterange", _sfc_main$i);
4193
+ app.component("m-fields-time", _sfc_main$1);
4194
+ app.component("m-fields-checkbox", _sfc_main$m);
4195
+ app.component("m-fields-switch", _sfc_main$4);
4196
+ app.component("m-fields-color-picker", _sfc_main$k);
4197
+ app.component("m-fields-checkbox-group", _sfc_main$l);
4198
+ app.component("m-fields-radio-group", _sfc_main$8);
4199
+ app.component("m-fields-display", _sfc_main$g);
4200
+ app.component("m-fields-link", _sfc_main$b);
4201
+ app.component("m-fields-select", _sfc_main$5);
4202
+ app.component("m-fields-cascader", _sfc_main$n);
4203
+ app.component("m-fields-dynamic-field", _sfc_main$f);
4204
+ }
3992
4205
  };
3993
4206
 
3994
- exports.MCascader = _sfc_main$l;
3995
- exports.MCheckbox = _sfc_main$k;
3996
- exports.MCheckboxGroup = _sfc_main$j;
3997
- exports.MColorPicker = _sfc_main$i;
3998
- exports.MContainer = _sfc_main$v;
3999
- exports.MDate = _sfc_main$h;
4000
- exports.MDateTime = _sfc_main$f;
4001
- exports.MDaterange = _sfc_main$g;
4002
- exports.MDisplay = _sfc_main$e;
4003
- exports.MDynamicField = _sfc_main$d;
4004
- exports.MFieldset = _sfc_main$u;
4005
- exports.MForm = _sfc_main$b;
4006
- exports.MFormDialog = _sfc_main$a;
4007
- exports.MGroupList = _sfc_main$s;
4008
- exports.MHidden = _sfc_main$c;
4009
- exports.MLink = _sfc_main$9;
4010
- exports.MNumber = _sfc_main$8;
4011
- exports.MPanel = _sfc_main$r;
4012
- exports.MRadioGroup = _sfc_main$7;
4013
- exports.MRow = _sfc_main$p;
4014
- exports.MSelect = _sfc_main$4;
4015
- exports.MSwitch = _sfc_main$3;
4016
- exports.MTable = _sfc_main$n;
4017
- exports.MTabs = _sfc_main$m;
4018
- exports.MText = _sfc_main$2;
4019
- exports.MTextarea = _sfc_main$1;
4020
- exports.MTime = _sfc_main;
4207
+ exports.MCascader = _sfc_main$n;
4208
+ exports.MCheckbox = _sfc_main$m;
4209
+ exports.MCheckboxGroup = _sfc_main$l;
4210
+ exports.MColorPicker = _sfc_main$k;
4211
+ exports.MContainer = _sfc_main$x;
4212
+ exports.MDate = _sfc_main$j;
4213
+ exports.MDateTime = _sfc_main$h;
4214
+ exports.MDaterange = _sfc_main$i;
4215
+ exports.MDisplay = _sfc_main$g;
4216
+ exports.MDynamicField = _sfc_main$f;
4217
+ exports.MFieldset = _sfc_main$w;
4218
+ exports.MForm = _sfc_main$d;
4219
+ exports.MFormDialog = _sfc_main$c;
4220
+ exports.MFormDrawer = _sfc_main;
4221
+ exports.MGroupList = _sfc_main$u;
4222
+ exports.MHidden = _sfc_main$e;
4223
+ exports.MLink = _sfc_main$b;
4224
+ exports.MNumber = _sfc_main$a;
4225
+ exports.MNumberRange = _sfc_main$9;
4226
+ exports.MPanel = _sfc_main$t;
4227
+ exports.MRadioGroup = _sfc_main$8;
4228
+ exports.MRow = _sfc_main$r;
4229
+ exports.MSelect = _sfc_main$5;
4230
+ exports.MSwitch = _sfc_main$4;
4231
+ exports.MTable = _sfc_main$p;
4232
+ exports.MTabs = _sfc_main$o;
4233
+ exports.MText = _sfc_main$3;
4234
+ exports.MTextarea = _sfc_main$2;
4235
+ exports.MTime = _sfc_main$1;
4021
4236
  exports.createValues = createValues;
4022
4237
  exports.default = index;
4023
4238
  exports.display = display;