@dt-frames/ui 2.0.22 → 2.0.23

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.
@@ -906,6 +906,7 @@ function useFormEvents({
906
906
  }
907
907
  function _setValue(data, isReset = false) {
908
908
  data = isArray(data) ? data : [data];
909
+ let oldValues = getFormValues();
909
910
  let obj = {};
910
911
  data.map((it) => {
911
912
  let name = isArray(it.name) ? it.name[0] : it.name;
@@ -917,15 +918,24 @@ function useFormEvents({
917
918
  obj[name] = props.defaultValue;
918
919
  });
919
920
  if (isReset) {
920
- let oldValues = getFormValues();
921
921
  let oldObj = {};
922
922
  Object.keys(oldValues).map((key) => oldObj[key] = null);
923
923
  obj = {
924
924
  ...oldObj,
925
925
  ...obj
926
926
  };
927
+ setFormValues(obj);
928
+ } else {
929
+ Object.keys(obj).forEach((key) => {
930
+ if (obj[key] !== null) {
931
+ obj[key];
932
+ }
933
+ });
934
+ setFormValues({
935
+ ...obj,
936
+ ...oldValues
937
+ });
927
938
  }
928
- setFormValues(obj);
929
939
  }
930
940
  async function clearValidate(name) {
931
941
  await unref(formElRef)?.clearValidate(name);
@@ -16,7 +16,7 @@ export declare const BasicProps: {
16
16
  default: () => {};
17
17
  };
18
18
  layout: {
19
- type: PropType<"vertical" | "inline" | "horizontal">;
19
+ type: PropType<"inline" | "horizontal" | "vertical">;
20
20
  default: string;
21
21
  };
22
22
  labelWidth: {
@@ -41,8 +41,8 @@ export declare const BasicProps: {
41
41
  };
42
42
  rowProps: {
43
43
  type: PropType<Partial<import("vue").ExtractPropTypes<{
44
- align: PropType<"middle" | "top" | "bottom" | "stretch">;
45
- justify: PropType<"center" | "space-around" | "space-between" | "end" | "start">;
44
+ align: PropType<"stretch" | "bottom" | "top" | "middle">;
45
+ justify: PropType<"space-around" | "space-between" | "center" | "end" | "start">;
46
46
  prefixCls: StringConstructor;
47
47
  gutter: {
48
48
  type: PropType<import("ant-design-vue/lib/grid/Row").Gutter | [import("ant-design-vue/lib/grid/Row").Gutter, import("ant-design-vue/lib/grid/Row").Gutter]>;
@@ -62,7 +62,7 @@ export declare const BasicProps: {
62
62
  type: NumberConstructor;
63
63
  };
64
64
  size: {
65
- type: PropType<"small" | "large" | "middle">;
65
+ type: PropType<"large" | "small" | "middle">;
66
66
  };
67
67
  disabled: {
68
68
  type: BooleanConstructor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./src/index.ts",