@dt-frames/ui 2.0.23 → 2.0.24
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.
|
@@ -1061,7 +1061,7 @@ function useFormValues({
|
|
|
1061
1061
|
if (!isObject(model))
|
|
1062
1062
|
return {};
|
|
1063
1063
|
const vals = {};
|
|
1064
|
-
let comMap = getComMap();
|
|
1064
|
+
let comMap = getComMap(), extraNames = [];
|
|
1065
1065
|
for (let [key, val] of Object.entries(model)) {
|
|
1066
1066
|
let component = comMap.get(key)?.component;
|
|
1067
1067
|
if (!key || Array.isArray(val) && val.length === 0 || isFunction(val)) {
|
|
@@ -1069,11 +1069,12 @@ function useFormValues({
|
|
|
1069
1069
|
}
|
|
1070
1070
|
if (component) {
|
|
1071
1071
|
if (SINGLE_DATA_TYPE.includes(component)) {
|
|
1072
|
-
val = dayjs(val).valueOf();
|
|
1072
|
+
val = val ? dayjs(val).valueOf() : null;
|
|
1073
1073
|
} else if (MULTIFY_DATA_TYPE.includes(component)) {
|
|
1074
1074
|
val = (val || []).map((it) => dayjs(it).valueOf());
|
|
1075
1075
|
if (comMap.get(key).extraName?.length) {
|
|
1076
1076
|
comMap.get(key).extraName.map((it, i) => {
|
|
1077
|
+
extraNames.push(it);
|
|
1077
1078
|
set(vals, it, val.length > 0 ? val[i] : null);
|
|
1078
1079
|
});
|
|
1079
1080
|
}
|
|
@@ -1082,7 +1083,9 @@ function useFormValues({
|
|
|
1082
1083
|
if (isString(val)) {
|
|
1083
1084
|
val = val.trim();
|
|
1084
1085
|
}
|
|
1085
|
-
|
|
1086
|
+
if (!extraNames.includes(key)) {
|
|
1087
|
+
set(vals, key, val);
|
|
1088
|
+
}
|
|
1086
1089
|
}
|
|
1087
1090
|
return vals;
|
|
1088
1091
|
}
|