@tmagic/form 1.0.2 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, watch, unref, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
1
+ import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
2
2
  import { WarningFilled, CaretRight, CaretBottom, Delete, ArrowDown, ArrowUp, FullScreen, Grid } from '@element-plus/icons';
3
3
  import { cloneDeep, isEqual } from 'lodash-es';
4
4
  import { ElMessage } from 'element-plus';
@@ -12,16 +12,7 @@ const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
12
12
  value.asyncLoad = typeof initValue2.asyncLoad === "object" ? initValue2.asyncLoad : asyncLoad;
13
13
  }
14
14
  };
15
- const isMultipleValue = (type) => typeof type === "string" && [
16
- "checkbox-group",
17
- "checkboxGroup",
18
- "table",
19
- "cascader",
20
- "group-list",
21
- "groupList",
22
- "dynamic-tab",
23
- "dynamicTab"
24
- ].includes(type);
15
+ const isMultipleValue = (type) => typeof type === "string" && ["checkbox-group", "checkboxGroup", "table", "cascader", "group-list", "groupList"].includes(type);
25
16
  const initItemsValue = (mForm, value, initValue2, { items, name, extensible }) => {
26
17
  if (Array.isArray(initValue2[name])) {
27
18
  value[name] = initValue2[name].map((v, index) => init(mForm, items, v, value[name]?.[index]));
@@ -34,7 +25,7 @@ const initItemsValue = (mForm, value, initValue2, { items, name, extensible }) =
34
25
  };
35
26
  const setValue = (mForm, value, initValue2, item) => {
36
27
  const { items, name, type, checkbox } = item;
37
- if (isMultipleValue(type)) {
28
+ if (isMultipleValue(type) || type === "tab" && item.dynamic) {
38
29
  value[name] = initValue2[name] || [];
39
30
  }
40
31
  if (items) {
@@ -137,7 +128,7 @@ const getRules = function(mForm, rules = [], props) {
137
128
  const fnc = item.validator;
138
129
  item.validator = (rule, value, callback, source, options) => fnc({
139
130
  rule,
140
- value,
131
+ value: props.config.names ? props.model : value,
141
132
  callback,
142
133
  source,
143
134
  options
@@ -175,7 +166,7 @@ var _export_sfc = (sfc, props) => {
175
166
  return target;
176
167
  };
177
168
 
178
- const _sfc_main$t = defineComponent({
169
+ const _sfc_main$v = defineComponent({
179
170
  name: "m-form-container",
180
171
  components: { WarningFilled },
181
172
  props: {
@@ -320,7 +311,7 @@ const _sfc_main$t = defineComponent({
320
311
  };
321
312
  }
322
313
  });
323
- const _hoisted_1$e = ["innerHTML"];
314
+ const _hoisted_1$d = ["innerHTML"];
324
315
  const _hoisted_2$7 = ["innerHTML"];
325
316
  const _hoisted_3$7 = ["innerHTML"];
326
317
  const _hoisted_4$6 = ["innerHTML"];
@@ -328,7 +319,7 @@ const _hoisted_5$4 = {
328
319
  key: 4,
329
320
  style: { "text-align": "center" }
330
321
  };
331
- function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
322
+ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
332
323
  const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
333
324
  const _component_el_tooltip = resolveComponent("el-tooltip");
334
325
  const _component_el_form_item = resolveComponent("el-form-item");
@@ -370,7 +361,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
370
361
  label: withCtx(() => [
371
362
  createElementVNode("span", {
372
363
  innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
373
- }, null, 8, _hoisted_1$e)
364
+ }, null, 8, _hoisted_1$d)
374
365
  ]),
375
366
  default: withCtx(() => [
376
367
  _ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
@@ -455,32 +446,32 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
455
446
  ])) : createCommentVNode("", true)
456
447
  ], 6)) : createCommentVNode("", true);
457
448
  }
458
- var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
449
+ var Container = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$p]]);
459
450
 
460
- const _sfc_main$s = defineComponent({
461
- name: "m-form-fieldset",
451
+ const _hoisted_1$c = ["innerHTML"];
452
+ const _hoisted_2$6 = ["innerHTML"];
453
+ const _hoisted_3$6 = { key: 1 };
454
+ const _hoisted_4$5 = ["innerHTML"];
455
+ const _hoisted_5$3 = ["innerHTML"];
456
+ const _hoisted_6$2 = {
457
+ key: 2,
458
+ style: { "display": "flex" }
459
+ };
460
+ const _hoisted_7$2 = { style: { "flex": "1" } };
461
+ const _hoisted_8$1 = ["src"];
462
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
463
+ __name: "Fieldset",
462
464
  props: {
463
- labelWidth: String,
464
- model: {
465
- type: Object,
466
- default: () => ({})
467
- },
468
- config: {
469
- type: Object,
470
- default: () => ({})
471
- },
472
- rules: {
473
- type: Object,
474
- default: () => ({})
475
- },
476
- prop: {
477
- type: String,
478
- default: () => ""
479
- },
480
- size: String
465
+ labelWidth: null,
466
+ prop: { default: "" },
467
+ size: null,
468
+ model: null,
469
+ config: null,
470
+ rules: { default: {} }
481
471
  },
482
472
  emits: ["change"],
483
- setup(props, { emit }) {
473
+ setup(__props, { emit }) {
474
+ const props = __props;
484
475
  const mForm = inject("mForm");
485
476
  const name = computed(() => props.config.name || "");
486
477
  const show = computed(() => {
@@ -499,125 +490,89 @@ const _sfc_main$s = defineComponent({
499
490
  emit("change", props.model);
500
491
  };
501
492
  const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
502
- return {
503
- show,
504
- name,
505
- mForm,
506
- lWidth,
507
- key,
508
- change
509
- };
510
- }
511
- });
512
- const _hoisted_1$d = ["innerHTML"];
513
- const _hoisted_2$6 = ["innerHTML"];
514
- const _hoisted_3$6 = { key: 1 };
515
- const _hoisted_4$5 = ["innerHTML"];
516
- const _hoisted_5$3 = ["innerHTML"];
517
- const _hoisted_6$2 = { key: 2 };
518
- const _hoisted_7$2 = ["innerHTML"];
519
- const _hoisted_8$1 = ["innerHTML"];
520
- const _hoisted_9$1 = {
521
- key: 3,
522
- style: { "display": "flex" }
523
- };
524
- const _hoisted_10$1 = { style: { "flex": "1" } };
525
- const _hoisted_11 = ["src"];
526
- function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
527
- const _component_el_checkbox = resolveComponent("el-checkbox");
528
- const _component_m_form_container = resolveComponent("m-form-container");
529
- return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
530
- key: 0,
531
- class: "m-fieldset",
532
- style: normalizeStyle(_ctx.show ? "padding: 15px 15px 0 5px;" : "border: 0")
533
- }, [
534
- !_ctx.show && _ctx.name ? (openBlock(), createBlock(_component_el_checkbox, {
535
- key: 0,
536
- modelValue: _ctx.model[_ctx.name].value,
537
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name].value = $event),
538
- prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
539
- "true-label": 1,
540
- "false-label": 0,
541
- onChange: _ctx.change
542
- }, {
543
- default: withCtx(() => [
544
- createElementVNode("span", {
545
- innerHTML: _ctx.config.legend
546
- }, null, 8, _hoisted_1$d),
547
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
548
- key: 0,
549
- innerHTML: _ctx.config.extra,
550
- class: "m-form-tip"
551
- }, null, 8, _hoisted_2$6)) : createCommentVNode("", true)
552
- ]),
553
- _: 1
554
- }, 8, ["modelValue", "prop", "onChange"])) : _ctx.config.checkbox && _ctx.name ? (openBlock(), createElementBlock("legend", _hoisted_3$6, [
555
- createVNode(_component_el_checkbox, {
556
- modelValue: _ctx.model[_ctx.name].value,
557
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name].value = $event),
558
- prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
559
- "true-label": 1,
560
- "false-label": 0,
561
- onChange: _ctx.change
562
- }, {
563
- default: withCtx(() => [
493
+ if (props.config.checkbox && name.value) {
494
+ watch(() => props.model[name.value]?.value, () => {
495
+ emit("change", props.model);
496
+ });
497
+ }
498
+ return (_ctx, _cache) => {
499
+ const _component_el_checkbox = resolveComponent("el-checkbox");
500
+ const _component_m_form_container = resolveComponent("m-form-container");
501
+ return (unref(name) ? __props.model[unref(name)] : __props.model) ? (openBlock(), createElementBlock("fieldset", {
502
+ key: 0,
503
+ class: "m-fieldset",
504
+ style: normalizeStyle(unref(show) ? "padding: 15px 15px 0 5px;" : "border: 0")
505
+ }, [
506
+ unref(name) && __props.config.checkbox ? (openBlock(), createBlock(resolveDynamicComponent(!unref(show) ? "div" : "legend"), { key: 0 }, {
507
+ default: withCtx(() => [
508
+ createVNode(_component_el_checkbox, {
509
+ modelValue: __props.model[unref(name)].value,
510
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[unref(name)].value = $event),
511
+ prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.value`,
512
+ "true-label": 1,
513
+ "false-label": 0
514
+ }, {
515
+ default: withCtx(() => [
516
+ createElementVNode("span", {
517
+ innerHTML: __props.config.legend
518
+ }, null, 8, _hoisted_1$c),
519
+ __props.config.extra ? (openBlock(), createElementBlock("span", {
520
+ key: 0,
521
+ innerHTML: __props.config.extra,
522
+ class: "m-form-tip"
523
+ }, null, 8, _hoisted_2$6)) : createCommentVNode("", true)
524
+ ]),
525
+ _: 1
526
+ }, 8, ["modelValue", "prop"])
527
+ ]),
528
+ _: 1
529
+ })) : (openBlock(), createElementBlock("legend", _hoisted_3$6, [
564
530
  createElementVNode("span", {
565
- innerHTML: _ctx.config.legend
531
+ innerHTML: __props.config.legend
566
532
  }, null, 8, _hoisted_4$5),
567
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
533
+ __props.config.extra ? (openBlock(), createElementBlock("span", {
568
534
  key: 0,
569
- innerHTML: _ctx.config.extra,
535
+ innerHTML: __props.config.extra,
570
536
  class: "m-form-tip"
571
537
  }, null, 8, _hoisted_5$3)) : createCommentVNode("", true)
572
- ]),
573
- _: 1
574
- }, 8, ["modelValue", "prop", "onChange"])
575
- ])) : (openBlock(), createElementBlock("legend", _hoisted_6$2, [
576
- createElementVNode("span", {
577
- innerHTML: _ctx.config.legend
578
- }, null, 8, _hoisted_7$2),
579
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
580
- key: 0,
581
- innerHTML: _ctx.config.extra,
582
- class: "m-form-tip"
583
- }, null, 8, _hoisted_8$1)) : createCommentVNode("", true)
584
- ])),
585
- _ctx.config.schematic && _ctx.show ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
586
- createElementVNode("div", _hoisted_10$1, [
587
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (item, index) => {
538
+ ])),
539
+ __props.config.schematic && unref(show) ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
540
+ createElementVNode("div", _hoisted_7$2, [
541
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.config.items, (item, index) => {
542
+ return openBlock(), createBlock(_component_m_form_container, {
543
+ key: key(item, index),
544
+ model: unref(name) ? __props.model[unref(name)] : __props.model,
545
+ rules: unref(name) ? __props.rules[unref(name)] : [],
546
+ config: item,
547
+ prop: __props.prop,
548
+ labelWidth: unref(lWidth),
549
+ size: __props.size,
550
+ onChange: change
551
+ }, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
552
+ }), 128))
553
+ ]),
554
+ createElementVNode("img", {
555
+ class: "m-form-schematic",
556
+ src: __props.config.schematic
557
+ }, null, 8, _hoisted_8$1)
558
+ ])) : unref(show) ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(__props.config.items, (item, index) => {
588
559
  return openBlock(), createBlock(_component_m_form_container, {
589
- key: _ctx.key(item, index),
590
- model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
591
- rules: _ctx.name ? _ctx.rules[_ctx.name] : [],
560
+ key: key(item, index),
561
+ model: unref(name) ? __props.model[unref(name)] : __props.model,
562
+ rules: unref(name) ? __props.rules[unref(name)] : [],
592
563
  config: item,
593
- prop: _ctx.prop,
594
- labelWidth: _ctx.lWidth,
595
- size: _ctx.size,
596
- onChange: _ctx.change
597
- }, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size", "onChange"]);
598
- }), 128))
599
- ]),
600
- createElementVNode("img", {
601
- class: "m-form-schematic",
602
- src: _ctx.config.schematic
603
- }, null, 8, _hoisted_11)
604
- ])) : _ctx.show ? (openBlock(true), createElementBlock(Fragment, { key: 4 }, renderList(_ctx.config.items, (item, index) => {
605
- return openBlock(), createBlock(_component_m_form_container, {
606
- key: _ctx.key(item, index),
607
- model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
608
- rules: _ctx.name ? _ctx.rules[_ctx.name] : [],
609
- config: item,
610
- prop: _ctx.prop,
611
- labelWidth: _ctx.lWidth,
612
- size: _ctx.size,
613
- onChange: _ctx.change
614
- }, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size", "onChange"]);
615
- }), 128)) : createCommentVNode("", true)
616
- ], 4)) : createCommentVNode("", true);
617
- }
618
- var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
564
+ prop: __props.prop,
565
+ labelWidth: unref(lWidth),
566
+ size: __props.size,
567
+ onChange: change
568
+ }, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
569
+ }), 128)) : createCommentVNode("", true)
570
+ ], 4)) : createCommentVNode("", true);
571
+ };
572
+ }
573
+ });
619
574
 
620
- const _sfc_main$r = defineComponent({
575
+ const _sfc_main$t = defineComponent({
621
576
  name: "m-form-group-list-item",
622
577
  components: { CaretRight, CaretBottom },
623
578
  props: {
@@ -701,7 +656,7 @@ const _sfc_main$r = defineComponent({
701
656
  };
702
657
  }
703
658
  });
704
- const _hoisted_1$c = { class: "m-fields-group-list-item" };
659
+ const _hoisted_1$b = { class: "m-fields-group-list-item" };
705
660
  const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
706
661
  const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
707
662
  const _hoisted_4$4 = ["innerHTML"];
@@ -713,7 +668,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
713
668
  const _component_CaretRight = resolveComponent("CaretRight");
714
669
  const _component_CaretBottom = resolveComponent("CaretBottom");
715
670
  const _component_m_form_container = resolveComponent("m-form-container");
716
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
671
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
717
672
  createElementVNode("div", null, [
718
673
  createVNode(_component_el_icon, {
719
674
  style: { "margin-right": "7px" },
@@ -796,9 +751,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
796
751
  }, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
797
752
  ]);
798
753
  }
799
- var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
754
+ var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$o]]);
800
755
 
801
- const _sfc_main$q = defineComponent({
756
+ const _sfc_main$s = defineComponent({
802
757
  name: "m-form-group-list",
803
758
  components: { MFieldsGroupListItem },
804
759
  props: {
@@ -894,7 +849,7 @@ const _sfc_main$q = defineComponent({
894
849
  };
895
850
  }
896
851
  });
897
- const _hoisted_1$b = { class: "m-fields-group-list" };
852
+ const _hoisted_1$a = { class: "m-fields-group-list" };
898
853
  const _hoisted_2$4 = ["innerHTML"];
899
854
  const _hoisted_3$4 = {
900
855
  key: 1,
@@ -909,7 +864,7 @@ const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u
909
864
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
910
865
  const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
911
866
  const _component_el_button = resolveComponent("el-button");
912
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
867
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
913
868
  _ctx.config.extra ? (openBlock(), createElementBlock("div", {
914
869
  key: 0,
915
870
  innerHTML: _ctx.config.extra,
@@ -953,9 +908,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
953
908
  }, 8, ["onClick"])) : createCommentVNode("", true)
954
909
  ]);
955
910
  }
956
- var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
911
+ var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$n]]);
957
912
 
958
- const _sfc_main$p = defineComponent({
913
+ const _sfc_main$r = defineComponent({
959
914
  name: "m-form-panel",
960
915
  components: { CaretBottom, CaretRight },
961
916
  props: {
@@ -988,7 +943,7 @@ const _sfc_main$p = defineComponent({
988
943
  };
989
944
  }
990
945
  });
991
- const _hoisted_1$a = { class: "clearfix" };
946
+ const _hoisted_1$9 = { class: "clearfix" };
992
947
  const _hoisted_2$3 = ["innerHTML"];
993
948
  const _hoisted_3$3 = {
994
949
  key: 0,
@@ -1008,7 +963,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
1008
963
  "body-style": { display: _ctx.expand ? "block" : "none" }
1009
964
  }, {
1010
965
  header: withCtx(() => [
1011
- createElementVNode("div", _hoisted_1$a, [
966
+ createElementVNode("div", _hoisted_1$9, [
1012
967
  createElementVNode("a", {
1013
968
  href: "javascript:",
1014
969
  style: { "width": "100%", "display": "block" },
@@ -1066,9 +1021,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
1066
1021
  _: 3
1067
1022
  }, 8, ["body-style"])) : createCommentVNode("", true);
1068
1023
  }
1069
- var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
1024
+ var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$m]]);
1070
1025
 
1071
- const _sfc_main$o = defineComponent({
1026
+ const _sfc_main$q = defineComponent({
1072
1027
  props: {
1073
1028
  labelWidth: String,
1074
1029
  expandMore: Boolean,
@@ -1115,9 +1070,9 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
1115
1070
  [vShow, _ctx.display && _ctx.config.type !== "hidden"]
1116
1071
  ]);
1117
1072
  }
1118
- var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
1073
+ var Col = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$l]]);
1119
1074
 
1120
- const _sfc_main$n = defineComponent({
1075
+ const _sfc_main$p = defineComponent({
1121
1076
  name: "m-form-row",
1122
1077
  components: { Col },
1123
1078
  props: {
@@ -1167,9 +1122,9 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
1167
1122
  _: 1
1168
1123
  });
1169
1124
  }
1170
- var Row = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$k]]);
1125
+ var Row = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$k]]);
1171
1126
 
1172
- const _sfc_main$m = defineComponent({
1127
+ const _sfc_main$o = defineComponent({
1173
1128
  name: "m-form-step",
1174
1129
  props: {
1175
1130
  model: {
@@ -1247,11 +1202,11 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
1247
1202
  }), 256))
1248
1203
  ]);
1249
1204
  }
1250
- var MStep = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$j]]);
1205
+ var MStep = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$j]]);
1251
1206
 
1252
1207
  let loadedAMapJS = false;
1253
1208
  let firstLoadingAMapJS = true;
1254
- const _sfc_main$l = defineComponent({
1209
+ const _sfc_main$n = defineComponent({
1255
1210
  name: "m-form-table",
1256
1211
  props: {
1257
1212
  name: {
@@ -1620,7 +1575,7 @@ const _sfc_main$l = defineComponent({
1620
1575
  };
1621
1576
  }
1622
1577
  });
1623
- const _hoisted_1$9 = ["innerHTML"];
1578
+ const _hoisted_1$8 = ["innerHTML"];
1624
1579
  const _hoisted_2$2 = { class: "el-form-item__content" };
1625
1580
  const _hoisted_3$2 = ["innerHTML"];
1626
1581
  const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
@@ -1649,7 +1604,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
1649
1604
  key: 0,
1650
1605
  style: { "color": "rgba(0, 0, 0, 0.45)" },
1651
1606
  innerHTML: _ctx.config.extra
1652
- }, null, 8, _hoisted_1$9)) : createCommentVNode("", true),
1607
+ }, null, 8, _hoisted_1$8)) : createCommentVNode("", true),
1653
1608
  createElementVNode("div", _hoisted_2$2, [
1654
1609
  createVNode(_component_el_tooltip, {
1655
1610
  content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
@@ -1882,7 +1837,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
1882
1837
  ])
1883
1838
  ], 2);
1884
1839
  }
1885
- var Table = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$i]]);
1840
+ var Table = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$i]]);
1886
1841
 
1887
1842
  const getActive = (mForm, props, activeTabName) => {
1888
1843
  const { config, model, prop } = props;
@@ -1920,6 +1875,7 @@ const Tab = defineComponent({
1920
1875
  default: () => ({})
1921
1876
  },
1922
1877
  prop: String,
1878
+ name: String,
1923
1879
  size: String
1924
1880
  },
1925
1881
  emits: {
@@ -2000,7 +1956,7 @@ const Tab = defineComponent({
2000
1956
  };
2001
1957
  }
2002
1958
  });
2003
- const _sfc_main$k = Tab;
1959
+ const _sfc_main$m = Tab;
2004
1960
  function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
2005
1961
  const _component_m_form_container = resolveComponent("m-form-container");
2006
1962
  const _component_el_tab_pane = resolveComponent("el-tab-pane");
@@ -2030,7 +1986,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
2030
1986
  return openBlock(), createBlock(_component_m_form_container, {
2031
1987
  key: item[_ctx.mForm?.keyProp || "__key"],
2032
1988
  config: item,
2033
- model: _ctx.config.dynamic ? _ctx.model[_ctx.config.name || ""][tabIndex] : tab.name ? _ctx.model[tab.name] : _ctx.model,
1989
+ 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,
2034
1990
  prop: _ctx.config.dynamic ? `${_ctx.prop}${_ctx.prop ? "." : ""}${String(tabIndex)}` : _ctx.prop,
2035
1991
  size: _ctx.size,
2036
1992
  "label-width": tab.labelWidth || _ctx.labelWidth,
@@ -2047,7 +2003,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
2047
2003
  _: 1
2048
2004
  }, 8, ["modelValue", "class", "type", "editable", "tab-position", "onTabClick", "onTabAdd", "onTabRemove"]);
2049
2005
  }
2050
- var Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$h]]);
2006
+ var Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$h]]);
2051
2007
 
2052
2008
  let $MAGIC_FORM = {};
2053
2009
  const setConfig = (option) => {
@@ -2091,7 +2047,7 @@ const useAddField = (prop) => {
2091
2047
  });
2092
2048
  };
2093
2049
 
2094
- const _sfc_main$j = defineComponent({
2050
+ const _sfc_main$l = defineComponent({
2095
2051
  name: "m-fields-cascader",
2096
2052
  props: {
2097
2053
  ...fieldProps,
@@ -2126,8 +2082,9 @@ const _sfc_main$j = defineComponent({
2126
2082
  if (typeof body === "function" && props.model && mForm) {
2127
2083
  body = body(mForm, {
2128
2084
  model: props.model,
2129
- formValue: null,
2130
- formValues: mForm.values
2085
+ formValue: mForm.values,
2086
+ formValues: mForm.values,
2087
+ config: props.config
2131
2088
  });
2132
2089
  }
2133
2090
  postOptions.data = body;
@@ -2183,13 +2140,13 @@ const _sfc_main$j = defineComponent({
2183
2140
  };
2184
2141
  }
2185
2142
  });
2186
- const _hoisted_1$8 = {
2143
+ const _hoisted_1$7 = {
2187
2144
  class: "m-cascader",
2188
2145
  style: { "width": "100%" }
2189
2146
  };
2190
2147
  function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
2191
2148
  const _component_el_cascader = resolveComponent("el-cascader");
2192
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
2149
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
2193
2150
  createVNode(_component_el_cascader, {
2194
2151
  modelValue: _ctx.model[_ctx.name],
2195
2152
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
@@ -2206,9 +2163,9 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
2206
2163
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props", "onChange"])
2207
2164
  ]);
2208
2165
  }
2209
- var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$g]]);
2166
+ var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$g]]);
2210
2167
 
2211
- const _sfc_main$i = defineComponent({
2168
+ const _sfc_main$k = defineComponent({
2212
2169
  name: "m-fields-checkbox",
2213
2170
  props: {
2214
2171
  ...fieldProps,
@@ -2260,9 +2217,9 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
2260
2217
  onChange: _ctx.changeHandler
2261
2218
  }, null, 8, ["modelValue", "size", "trueLabel", "falseLabel", "disabled", "label", "onChange"]);
2262
2219
  }
2263
- var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$f]]);
2220
+ var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$f]]);
2264
2221
 
2265
- const _sfc_main$h = defineComponent({
2222
+ const _sfc_main$j = defineComponent({
2266
2223
  name: "m-fields-checkbox-group",
2267
2224
  props: {
2268
2225
  ...fieldProps,
@@ -2310,13 +2267,13 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
2310
2267
  _: 1
2311
2268
  }, 8, ["modelValue", "size", "disabled", "onChange"]);
2312
2269
  }
2313
- var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
2270
+ var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$e]]);
2314
2271
 
2315
- const _hoisted_1$7 = { key: 0 };
2272
+ const _hoisted_1$6 = { key: 0 };
2316
2273
  const __default__$2 = defineComponent({
2317
2274
  name: "m-fields-color-picker"
2318
2275
  });
2319
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
2276
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2320
2277
  ...__default__$2,
2321
2278
  props: {
2322
2279
  ...fieldProps,
@@ -2332,7 +2289,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2332
2289
  const changeHandler = (value) => emit("change", value);
2333
2290
  return (_ctx, _cache) => {
2334
2291
  const _component_el_color_picker = resolveComponent("el-color-picker");
2335
- return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
2292
+ return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
2336
2293
  createVNode(_component_el_color_picker, {
2337
2294
  modelValue: _ctx.model[_ctx.name],
2338
2295
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
@@ -2346,7 +2303,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2346
2303
  }
2347
2304
  });
2348
2305
 
2349
- const _sfc_main$f = defineComponent({
2306
+ const _sfc_main$h = defineComponent({
2350
2307
  name: "m-fields-date",
2351
2308
  props: {
2352
2309
  ...fieldProps,
@@ -2358,36 +2315,31 @@ const _sfc_main$f = defineComponent({
2358
2315
  emits: ["change", "input"],
2359
2316
  setup(props, { emit }) {
2360
2317
  useAddField(props.prop);
2361
- const modelName = computed(() => props.prop || props.config.name || "");
2362
- props.model[modelName.value] = datetimeFormatter(props.model[modelName.value], "");
2318
+ props.model[props.name] = datetimeFormatter(props.model[props.name], "");
2363
2319
  return {
2364
- modelName,
2365
2320
  changeHandler(v) {
2366
2321
  emit("change", v);
2367
2322
  }
2368
2323
  };
2369
2324
  }
2370
2325
  });
2371
- const _hoisted_1$6 = { key: 0 };
2372
2326
  function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
2373
2327
  const _component_el_date_picker = resolveComponent("el-date-picker");
2374
- return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
2375
- createVNode(_component_el_date_picker, {
2376
- modelValue: _ctx.model[_ctx.modelName],
2377
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
2378
- type: "date",
2379
- size: _ctx.size,
2380
- placeholder: _ctx.config.placeholder,
2381
- disabled: _ctx.disabled,
2382
- format: _ctx.config.format,
2383
- "value-format": _ctx.config.format || "YYYY-MM-DD HH:mm:ss",
2384
- onChange: _ctx.changeHandler
2385
- }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "onChange"])
2386
- ])) : createCommentVNode("", true);
2328
+ return openBlock(), createBlock(_component_el_date_picker, {
2329
+ modelValue: _ctx.model[_ctx.name],
2330
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2331
+ type: "date",
2332
+ size: _ctx.size,
2333
+ placeholder: _ctx.config.placeholder,
2334
+ disabled: _ctx.disabled,
2335
+ format: _ctx.config.format,
2336
+ "value-format": _ctx.config.format || "YYYY-MM-DD HH:mm:ss",
2337
+ onChange: _ctx.changeHandler
2338
+ }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "onChange"]);
2387
2339
  }
2388
- var Date$1 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$d]]);
2340
+ var Date$1 = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$d]]);
2389
2341
 
2390
- const _sfc_main$e = defineComponent({
2342
+ const _sfc_main$g = defineComponent({
2391
2343
  name: "m-fields-daterange",
2392
2344
  props: {
2393
2345
  ...fieldProps,
@@ -2448,13 +2400,13 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
2448
2400
  size: _ctx.size,
2449
2401
  "unlink-panels": true,
2450
2402
  disabled: _ctx.disabled,
2451
- "default-time": _ctx.config.defaultTime || [new Date(2e3, 1, 1, 23, 59, 59)],
2403
+ "default-time": _ctx.config.defaultTime,
2452
2404
  onChange: _ctx.changeHandler
2453
2405
  }, null, 8, ["modelValue", "size", "disabled", "default-time", "onChange"]);
2454
2406
  }
2455
- var Daterange = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$c]]);
2407
+ var Daterange = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$c]]);
2456
2408
 
2457
- const _sfc_main$d = defineComponent({
2409
+ const _sfc_main$f = defineComponent({
2458
2410
  name: "m-fields-datetime",
2459
2411
  props: {
2460
2412
  ...fieldProps,
@@ -2494,17 +2446,17 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
2494
2446
  disabled: _ctx.disabled,
2495
2447
  format: _ctx.config.format || "YYYY-MM-DD HH:mm:ss",
2496
2448
  "value-format": _ctx.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
2497
- "default-time": _ctx.config.defaultTime || [new Date(2e3, 1, 1, 23, 59, 59)],
2449
+ "default-time": _ctx.config.defaultTime,
2498
2450
  onChange: _ctx.changeHandler
2499
2451
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "default-time", "onChange"]);
2500
2452
  }
2501
- var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
2453
+ var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$b]]);
2502
2454
 
2503
2455
  const _hoisted_1$5 = { key: 0 };
2504
2456
  const __default__$1 = defineComponent({
2505
2457
  name: "m-fields-display"
2506
2458
  });
2507
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
2459
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2508
2460
  ...__default__$1,
2509
2461
  props: {
2510
2462
  ...fieldProps,
@@ -2526,7 +2478,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2526
2478
  }
2527
2479
  });
2528
2480
 
2529
- const _sfc_main$b = defineComponent({
2481
+ const _sfc_main$d = defineComponent({
2530
2482
  name: "m-fields-dynamic-field",
2531
2483
  props: {
2532
2484
  ...fieldProps,
@@ -2620,12 +2572,12 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
2620
2572
  })
2621
2573
  ]);
2622
2574
  }
2623
- var DynamicField = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a]]);
2575
+ var DynamicField = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$a]]);
2624
2576
 
2625
2577
  const __default__ = defineComponent({
2626
2578
  name: "m-fields-hidden"
2627
2579
  });
2628
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
2580
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2629
2581
  ...__default__,
2630
2582
  props: {
2631
2583
  ...fieldProps,
@@ -2650,7 +2602,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2650
2602
  }
2651
2603
  });
2652
2604
 
2653
- const _sfc_main$9 = defineComponent({
2605
+ const _sfc_main$b = defineComponent({
2654
2606
  name: "m-fields-link",
2655
2607
  props: {
2656
2608
  ...fieldProps,
@@ -2758,9 +2710,9 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
2758
2710
  }, null, 8, ["title", "width", "values", "config", "parentValues", "fullscreen", "onSubmit"])
2759
2711
  ]));
2760
2712
  }
2761
- var Link = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
2713
+ var Link = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$9]]);
2762
2714
 
2763
- const _sfc_main$8 = defineComponent({
2715
+ const _sfc_main$a = defineComponent({
2764
2716
  name: "m-fields-number",
2765
2717
  props: {
2766
2718
  ...fieldProps,
@@ -2803,9 +2755,9 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2803
2755
  onInput: _ctx.inputHandler
2804
2756
  }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled", "onChange", "onInput"])) : createCommentVNode("", true);
2805
2757
  }
2806
- var Number$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
2758
+ var Number$1 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$8]]);
2807
2759
 
2808
- const _sfc_main$7 = defineComponent({
2760
+ const _sfc_main$9 = defineComponent({
2809
2761
  name: "m-fields-radio-group",
2810
2762
  props: {
2811
2763
  ...fieldProps,
@@ -2849,10 +2801,64 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2849
2801
  _: 1
2850
2802
  }, 8, ["modelValue", "size", "disabled", "onChange"])) : createCommentVNode("", true);
2851
2803
  }
2852
- var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
2804
+ var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$7]]);
2805
+
2806
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2807
+ __name: "SelectOptionGroups",
2808
+ props: {
2809
+ options: null
2810
+ },
2811
+ setup(__props) {
2812
+ return (_ctx, _cache) => {
2813
+ const _component_el_option = resolveComponent("el-option");
2814
+ const _component_el_option_group = resolveComponent("el-option-group");
2815
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (group, index) => {
2816
+ return openBlock(), createBlock(_component_el_option_group, {
2817
+ key: index,
2818
+ label: group.label,
2819
+ disabled: group.disabled
2820
+ }, {
2821
+ default: withCtx(() => [
2822
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
2823
+ return openBlock(), createBlock(_component_el_option, {
2824
+ key: index2,
2825
+ label: item.label,
2826
+ value: item.value,
2827
+ disabled: item.disabled
2828
+ }, null, 8, ["label", "value", "disabled"]);
2829
+ }), 128))
2830
+ ]),
2831
+ _: 2
2832
+ }, 1032, ["label", "disabled"]);
2833
+ }), 128);
2834
+ };
2835
+ }
2836
+ });
2837
+
2838
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2839
+ __name: "SelectOptions",
2840
+ props: {
2841
+ options: null,
2842
+ valueKey: null
2843
+ },
2844
+ setup(__props) {
2845
+ return (_ctx, _cache) => {
2846
+ const _component_el_option = resolveComponent("el-option");
2847
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
2848
+ return openBlock(), createBlock(_component_el_option, {
2849
+ label: option.text,
2850
+ value: option.value,
2851
+ key: __props.valueKey ? option.value[__props.valueKey] : option.value,
2852
+ disabled: option.disabled
2853
+ }, null, 8, ["label", "value", "disabled"]);
2854
+ }), 128);
2855
+ };
2856
+ }
2857
+ });
2853
2858
 
2854
2859
  const _sfc_main$6 = defineComponent({
2855
2860
  name: "m-fields-select",
2861
+ components: { SelectOptions: _sfc_main$7, SelectOptionGroups: _sfc_main$8 },
2856
2862
  props: {
2857
2863
  ...fieldProps,
2858
2864
  config: {
@@ -3083,6 +3089,7 @@ const _sfc_main$6 = defineComponent({
3083
3089
  loading,
3084
3090
  remote,
3085
3091
  options,
3092
+ groupOptions: options,
3086
3093
  moreLoadingVisible,
3087
3094
  popperClass: mForm?.popperClass,
3088
3095
  getOptions,
@@ -3121,8 +3128,8 @@ const _sfc_main$6 = defineComponent({
3121
3128
  });
3122
3129
  const _hoisted_1$2 = { key: 2 };
3123
3130
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
3124
- const _component_el_option = resolveComponent("el-option");
3125
- const _component_el_option_group = resolveComponent("el-option-group");
3131
+ const _component_select_option_groups = resolveComponent("select-option-groups");
3132
+ const _component_select_options = resolveComponent("select-options");
3126
3133
  const _component_el_select = resolveComponent("el-select");
3127
3134
  const _directive_loading = resolveDirective("loading");
3128
3135
  return _ctx.model ? withDirectives((openBlock(), createBlock(_component_el_select, {
@@ -3146,32 +3153,13 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
3146
3153
  onVisibleChange: _ctx.visibleHandler
3147
3154
  }, {
3148
3155
  default: withCtx(() => [
3149
- _ctx.config.group ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (group, index) => {
3150
- return openBlock(), createBlock(_component_el_option_group, {
3151
- key: index,
3152
- label: group.label,
3153
- disabled: group.disabled
3154
- }, {
3155
- default: withCtx(() => [
3156
- (openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
3157
- return openBlock(), createBlock(_component_el_option, {
3158
- key: index2,
3159
- label: item.label,
3160
- value: item.value,
3161
- disabled: item.disabled
3162
- }, null, 8, ["label", "value", "disabled"]);
3163
- }), 128))
3164
- ]),
3165
- _: 2
3166
- }, 1032, ["label", "disabled"]);
3167
- }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.options, (option) => {
3168
- return openBlock(), createBlock(_component_el_option, {
3169
- label: option.text,
3170
- value: option.value,
3171
- key: _ctx.config.valueKey ? option.value[_ctx.config.valueKey] : option.value,
3172
- disabled: option.disabled
3173
- }, null, 8, ["label", "value", "disabled"]);
3174
- }), 128)),
3156
+ _ctx.config.group ? (openBlock(), createBlock(_component_select_option_groups, {
3157
+ key: 0,
3158
+ options: _ctx.groupOptions
3159
+ }, null, 8, ["options"])) : (openBlock(), createBlock(_component_select_options, {
3160
+ key: 1,
3161
+ options: _ctx.options
3162
+ }, null, 8, ["options"])),
3175
3163
  _ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
3176
3164
  [_directive_loading, true]
3177
3165
  ]) : createCommentVNode("", true)
@@ -3434,17 +3422,15 @@ const _sfc_main$2 = defineComponent({
3434
3422
  });
3435
3423
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
3436
3424
  const _component_el_time_picker = resolveComponent("el-time-picker");
3437
- return openBlock(), createElementBlock("div", null, [
3438
- createVNode(_component_el_time_picker, {
3439
- modelValue: _ctx.model[_ctx.name],
3440
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3441
- size: _ctx.size,
3442
- "value-format": "HH:mm:ss",
3443
- placeholder: _ctx.config.placeholder,
3444
- disabled: _ctx.disabled,
3445
- onChange: _ctx.changeHandler
3446
- }, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange"])
3447
- ]);
3425
+ return openBlock(), createBlock(_component_el_time_picker, {
3426
+ modelValue: _ctx.model[_ctx.name],
3427
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3428
+ size: _ctx.size,
3429
+ "value-format": "HH:mm:ss",
3430
+ placeholder: _ctx.config.placeholder,
3431
+ disabled: _ctx.disabled,
3432
+ onChange: _ctx.changeHandler
3433
+ }, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange"]);
3448
3434
  }
3449
3435
  var Time = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
3450
3436
 
@@ -3805,7 +3791,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3805
3791
  }
3806
3792
  var FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
3807
3793
 
3808
- var index$1 = /* #__PURE__ */ (() => ".m-form-dialog .el-dialog__body {\n padding: 0 !important;\n}\n.m-form-dialog .m-dialog-body {\n padding: 0 20px;\n}\n.m-form-dialog .el-table .m-form-item .el-form-item {\n margin-bottom: 0;\n}\n\n.fade-enter-active,\n.fade-leave-active {\n transition: opacity 0.5s;\n}\n\n.fade-enter, .fade-leave-to {\n opacity: 0;\n}\n\n.m-form .m-form-tip {\n color: rgba(0, 0, 0, 0.45);\n font-size: 12px;\n transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n.m-form .m-form-schematic {\n max-width: 50%;\n height: 100%;\n}\n.m-form .el-table .cell > div.m-form-container {\n display: block;\n}\n.m-form .el-tabs {\n margin-bottom: 10px;\n}\n.m-form .el-form-item.hidden .el-form-item__label {\n display: none;\n}\n\n.magic-datetime-picker-popper .el-picker-panel__footer button:first-child {\n display: none;\n}\n\ndiv.m-fields-link {\n width: fit-content;\n}\n\nfieldset.m-fieldset {\n position: relative;\n border: 1px solid rgb(229, 229, 229);\n margin-top: 10px;\n margin-bottom: 10px;\n min-inline-size: auto;\n}\nfieldset.m-fieldset legend {\n font-size: 14px;\n position: absolute;\n border: 0;\n top: -10px;\n left: 20px;\n background: rgb(255, 255, 255);\n width: auto;\n padding: 0px 3px;\n font-weight: bold;\n line-height: 20px;\n}\nfieldset.m-fieldset .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-group-list .el-button--text {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon.expand {\n transform: rotate(90deg);\n}\n.m-fields-group-list .m-fields-group-list-item {\n border-bottom: 1px solid #ebeef5;\n margin-bottom: 7px;\n}\n.m-fields-group-list .m-fields-group-list-item:last-of-type {\n border-bottom: 0;\n}\n\n.m-form-panel .el-card__header:hover {\n background: #f2f6fc;\n}\n.m-form-panel .el-card__header a {\n color: #409eff;\n}\n.m-form-panel .el-card__body {\n padding: 10px;\n}\n.m-form-panel .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-table {\n width: 100%;\n}\n.m-fields-table.fixed {\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed::before {\n content: \" \";\n display: block;\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed > .el-form-item__content {\n z-index: 101;\n position: relative;\n margin: 10vh auto;\n max-width: fit-content;\n}\n.m-fields-table.fixed table {\n width: 95vw !important;\n}\n.m-fields-table th {\n background-color: #f2f2f2 !important;\n color: #333 !important;\n}\n.m-fields-table .el-table th {\n padding: 0 !important;\n}\n.m-fields-table .el-table__column--dropable {\n cursor: move;\n}\n.m-fields-table .el-form-item__content .el-input-group {\n vertical-align: middle;\n}\n.m-fields-table.m-fields-table-item-extra tr.expanded td {\n border-bottom: 0;\n}\n.m-fields-table .el-table__expanded-cell .m-form-tip {\n margin-left: 80px;\n}\n.m-fields-table .el-form-item {\n margin-bottom: 0;\n}\n\n.m-select {\n width: 100%;\n}")();
3794
+ var index$1 = /* #__PURE__ */ (() => ".m-form-dialog .el-dialog__body {\n padding: 0 !important;\n}\n.m-form-dialog .m-dialog-body {\n padding: 0 20px;\n}\n.m-form-dialog .el-table .m-form-item .el-form-item {\n margin-bottom: 0;\n}\n\n.fade-enter-active,\n.fade-leave-active {\n transition: opacity 0.5s;\n}\n\n.fade-enter, .fade-leave-to {\n opacity: 0;\n}\n\n.m-form .m-form-tip {\n color: rgba(0, 0, 0, 0.45);\n font-size: 12px;\n transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n.m-form .m-form-schematic {\n max-width: 50%;\n height: 100%;\n}\n.m-form .el-table .cell > div.m-form-container {\n display: block;\n}\n.m-form .el-tabs {\n margin-bottom: 10px;\n}\n.m-form .el-form-item.hidden .el-form-item__label {\n display: none;\n}\n\n.magic-datetime-picker-popper .el-picker-panel__footer button:first-child {\n display: none;\n}\n\ndiv.m-fields-link {\n width: fit-content;\n}\n\nfieldset.m-fieldset {\n position: relative;\n border: 1px solid rgb(229, 229, 229);\n margin-top: 10px;\n margin-bottom: 10px;\n min-inline-size: auto;\n}\nfieldset.m-fieldset .el-checkbox {\n height: 22px;\n}\nfieldset.m-fieldset legend {\n font-size: 14px;\n position: absolute;\n border: 0;\n top: -10px;\n left: 20px;\n background: rgb(255, 255, 255);\n width: auto;\n padding: 0px 3px;\n font-weight: bold;\n line-height: 20px;\n}\nfieldset.m-fieldset .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-group-list .el-button--text {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon {\n padding: 0;\n margin-bottom: 7px;\n}\n.m-fields-group-list .el-tree-node__expand-icon.expand {\n transform: rotate(90deg);\n}\n.m-fields-group-list .m-fields-group-list-item {\n border-bottom: 1px solid #ebeef5;\n margin-bottom: 7px;\n}\n.m-fields-group-list .m-fields-group-list-item:last-of-type {\n border-bottom: 0;\n}\n\n.m-form-panel .el-card__header:hover {\n background: #f2f6fc;\n}\n.m-form-panel .el-card__header a {\n color: #409eff;\n}\n.m-form-panel .el-card__body {\n padding: 10px;\n}\n.m-form-panel .m-form-tip {\n margin-left: 5px;\n}\n\n.m-fields-table {\n width: 100%;\n}\n.m-fields-table.fixed {\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed::before {\n content: \" \";\n display: block;\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n z-index: 100;\n}\n.m-fields-table.fixed > .el-form-item__content {\n z-index: 101;\n position: relative;\n margin: 10vh auto;\n max-width: fit-content;\n}\n.m-fields-table.fixed table {\n width: 95vw !important;\n}\n.m-fields-table th {\n background-color: #f2f2f2 !important;\n color: #333 !important;\n}\n.m-fields-table .el-table th {\n padding: 0 !important;\n}\n.m-fields-table .el-table__column--dropable {\n cursor: move;\n}\n.m-fields-table .el-form-item__content .el-input-group {\n vertical-align: middle;\n}\n.m-fields-table.m-fields-table-item-extra tr.expanded td {\n border-bottom: 0;\n}\n.m-fields-table .el-table__expanded-cell .m-form-tip {\n margin-left: 80px;\n}\n.m-fields-table .el-form-item {\n margin-bottom: 0;\n}\n\n.m-select {\n width: 100%;\n}")();
3809
3795
 
3810
3796
  const defaultInstallOpt = {};
3811
3797
  const install = (app, opt) => {
@@ -3815,7 +3801,7 @@ const install = (app, opt) => {
3815
3801
  app.component(Form.name, Form);
3816
3802
  app.component(FormDialog.name, FormDialog);
3817
3803
  app.component(Container.name, Container);
3818
- app.component(Fieldset.name, Fieldset);
3804
+ app.component("m-form-fieldset", _sfc_main$u);
3819
3805
  app.component(GroupList.name, GroupList);
3820
3806
  app.component(Panel.name, Panel);
3821
3807
  app.component(Row.name, Row);
@@ -3825,17 +3811,17 @@ const install = (app, opt) => {
3825
3811
  app.component(Text.name, Text);
3826
3812
  app.component(Number$1.name, Number$1);
3827
3813
  app.component(Textarea.name, Textarea);
3828
- app.component(_sfc_main$a.name, _sfc_main$a);
3814
+ app.component(_sfc_main$c.name, _sfc_main$c);
3829
3815
  app.component(Date$1.name, Date$1);
3830
3816
  app.component(DateTime.name, DateTime);
3831
3817
  app.component(Time.name, Time);
3832
3818
  app.component(Checkbox.name, Checkbox);
3833
3819
  app.component(Switch.name, Switch);
3834
3820
  app.component(Daterange.name, Daterange);
3835
- app.component(_sfc_main$g.name, _sfc_main$g);
3821
+ app.component(_sfc_main$i.name, _sfc_main$i);
3836
3822
  app.component(CheckboxGroup.name, CheckboxGroup);
3837
3823
  app.component(RadioGroup.name, RadioGroup);
3838
- app.component(_sfc_main$c.name, _sfc_main$c);
3824
+ app.component(_sfc_main$e.name, _sfc_main$e);
3839
3825
  app.component(Link.name, Link);
3840
3826
  app.component(Select.name, Select);
3841
3827
  app.component(Cascader.name, Cascader);
@@ -3845,5 +3831,5 @@ var index = {
3845
3831
  install
3846
3832
  };
3847
3833
 
3848
- export { Cascader as MCascader, Checkbox as MCheckbox, CheckboxGroup as MCheckboxGroup, _sfc_main$g as MColorPicker, Container as MContainer, Date$1 as MDate, DateTime as MDateTime, Daterange as MDaterange, _sfc_main$c as MDisplay, DynamicField as MDynamicField, Fieldset as MFieldset, Form as MForm, FormDialog as MFormDialog, GroupList as MGroupList, _sfc_main$a as MHidden, Link as MLink, Number$1 as MNumber, Panel as MPanel, RadioGroup as MRadioGroup, Row as MRow, Select as MSelect, Switch as MSwitch, Table as MTable, Tabs as MTabs, Text as MText, Textarea as MTextarea, Time as MTime, index as default, display, fieldProps, filterFunction, getRules, initValue, useAddField };
3834
+ export { Cascader as MCascader, Checkbox as MCheckbox, CheckboxGroup as MCheckboxGroup, _sfc_main$i as MColorPicker, Container as MContainer, Date$1 as MDate, DateTime as MDateTime, Daterange as MDaterange, _sfc_main$e as MDisplay, DynamicField as MDynamicField, _sfc_main$u as MFieldset, Form as MForm, FormDialog as MFormDialog, GroupList as MGroupList, _sfc_main$c as MHidden, Link as MLink, Number$1 as MNumber, Panel as MPanel, RadioGroup as MRadioGroup, Row as MRow, Select as MSelect, Switch as MSwitch, Table as MTable, Tabs as MTabs, Text as MText, Textarea as MTextarea, Time as MTime, index as default, display, fieldProps, filterFunction, getRules, initValue, useAddField };
3849
3835
  //# sourceMappingURL=tmagic-form.es.js.map