@tmagic/form 1.2.0-beta.7 → 1.2.0-beta.9

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 (39) hide show
  1. package/dist/tmagic-form.mjs +18 -3
  2. package/dist/tmagic-form.mjs.map +1 -1
  3. package/dist/tmagic-form.umd.js +18 -3
  4. package/dist/tmagic-form.umd.js.map +1 -1
  5. package/package.json +4 -4
  6. package/src/Form.vue +9 -1
  7. package/src/FormDialog.vue +2 -0
  8. package/src/containers/Container.vue +7 -4
  9. package/src/utils/form.ts +4 -0
  10. package/types/Form.vue.d.ts +1 -3
  11. package/types/FormDialog.vue.d.ts +7 -9
  12. package/types/containers/Col.vue.d.ts +1 -3
  13. package/types/containers/Container.vue.d.ts +1 -3
  14. package/types/containers/Fieldset.vue.d.ts +1 -3
  15. package/types/containers/GroupList.vue.d.ts +1 -3
  16. package/types/containers/GroupListItem.vue.d.ts +1 -3
  17. package/types/containers/Row.vue.d.ts +1 -3
  18. package/types/containers/Step.vue.d.ts +1 -3
  19. package/types/containers/Tabs.vue.d.ts +1 -3
  20. package/types/fields/Cascader.vue.d.ts +1 -3
  21. package/types/fields/Checkbox.vue.d.ts +1 -3
  22. package/types/fields/CheckboxGroup.vue.d.ts +1 -3
  23. package/types/fields/ColorPicker.vue.d.ts +1 -3
  24. package/types/fields/Date.vue.d.ts +1 -3
  25. package/types/fields/DateTime.vue.d.ts +1 -3
  26. package/types/fields/Daterange.vue.d.ts +1 -3
  27. package/types/fields/Display.vue.d.ts +1 -3
  28. package/types/fields/DynamicField.vue.d.ts +1 -3
  29. package/types/fields/Hidden.vue.d.ts +1 -3
  30. package/types/fields/Link.vue.d.ts +1 -3
  31. package/types/fields/Number.vue.d.ts +1 -3
  32. package/types/fields/RadioGroup.vue.d.ts +1 -3
  33. package/types/fields/Select.vue.d.ts +1 -3
  34. package/types/fields/SelectOptionGroups.vue.d.ts +1 -3
  35. package/types/fields/SelectOptions.vue.d.ts +1 -3
  36. package/types/fields/Switch.vue.d.ts +1 -3
  37. package/types/fields/Text.vue.d.ts +1 -3
  38. package/types/fields/Textarea.vue.d.ts +1 -3
  39. package/types/fields/Time.vue.d.ts +1 -3
@@ -112,6 +112,9 @@ const filterFunction = (mForm, config, props) => {
112
112
  });
113
113
  };
114
114
  const display = function(mForm, config, props) {
115
+ if (config === "expand") {
116
+ return config;
117
+ }
115
118
  if (typeof config === "function") {
116
119
  return filterFunction(mForm, config, props);
117
120
  }
@@ -224,10 +227,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
224
227
  return type2?.replace(/([A-Z])/g, "-$1").toLowerCase() || (items.value ? "" : "text");
225
228
  });
226
229
  const display$1 = computed(() => {
227
- if (props.config.display === "expand") {
230
+ const value = display(mForm, props.config.display, props);
231
+ if (value === "expand") {
228
232
  return expand.value;
229
233
  }
230
- return display(mForm, props.config.display, props);
234
+ return value;
231
235
  });
232
236
  const itemLabelWidth = computed(() => props.config.labelWidth || props.labelWidth);
233
237
  watchEffect(() => {
@@ -395,6 +399,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
395
399
  ], 64)) : createCommentVNode("", true),
396
400
  __props.config.expand && unref(type) !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
397
401
  createVNode(unref(TMagicButton), {
402
+ type: "primary",
403
+ size: "small",
398
404
  text: "",
399
405
  onClick: expandHandler
400
406
  }, {
@@ -2407,6 +2413,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2407
2413
  }
2408
2414
  }
2409
2415
  });
2416
+ watchEffect(() => {
2417
+ formState.initValues = props.initValues;
2418
+ formState.config = props.config;
2419
+ formState.keyProp = props.keyProp;
2420
+ formState.popperClass = props.popperClass;
2421
+ formState.parentValues = props.parentValues;
2422
+ });
2410
2423
  provide("mForm", formState);
2411
2424
  watch(
2412
2425
  [() => props.config, () => props.initValues],
@@ -2498,6 +2511,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2498
2511
  labelWidth: null,
2499
2512
  fullscreen: { type: Boolean },
2500
2513
  title: null,
2514
+ zIndex: null,
2501
2515
  size: null,
2502
2516
  confirmText: { default: "\u786E\u5B9A" }
2503
2517
  },
@@ -2567,6 +2581,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2567
2581
  "append-to-body": "",
2568
2582
  title: __props.title,
2569
2583
  width: __props.width,
2584
+ zIndex: __props.zIndex,
2570
2585
  fullscreen: __props.fullscreen,
2571
2586
  "close-on-click-modal": false,
2572
2587
  onClose: closeHandler
@@ -2660,7 +2675,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2660
2675
  ], 4)) : createCommentVNode("", true)
2661
2676
  ]),
2662
2677
  _: 3
2663
- }, 8, ["modelValue", "title", "width", "fullscreen"]);
2678
+ }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen"]);
2664
2679
  };
2665
2680
  }
2666
2681
  });