@firecms/core 3.0.0-canary.200 → 3.0.0-canary.202
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.
- package/dist/index.es.js +11 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +6 -0
- package/package.json +5 -5
- package/src/form/EntityForm.tsx +9 -2
- package/src/types/collections.ts +7 -0
- package/src/util/objects.ts +4 -1
package/dist/index.umd.js
CHANGED
|
@@ -214,7 +214,11 @@
|
|
|
214
214
|
if (targetIsObject && isObject(source)) {
|
|
215
215
|
Object.keys(source).forEach((key) => {
|
|
216
216
|
const sourceElement = source[key];
|
|
217
|
-
if (
|
|
217
|
+
if (sourceElement instanceof Date) {
|
|
218
|
+
Object.assign(output, {
|
|
219
|
+
[key]: new Date(sourceElement.getTime())
|
|
220
|
+
});
|
|
221
|
+
} else if (isObject(sourceElement)) {
|
|
218
222
|
if (!(key in target)) Object.assign(output, {
|
|
219
223
|
[key]: sourceElement
|
|
220
224
|
});
|
|
@@ -16677,7 +16681,12 @@
|
|
|
16677
16681
|
});
|
|
16678
16682
|
const properties = resolvedCollection.properties;
|
|
16679
16683
|
if ((status === "existing" || status === "copy") && entity) {
|
|
16680
|
-
|
|
16684
|
+
if (!collection.alwaysApplyDefaultValues) {
|
|
16685
|
+
return entity.values ?? getDefaultValuesFor(properties);
|
|
16686
|
+
} else {
|
|
16687
|
+
const defaultValues = getDefaultValuesFor(properties);
|
|
16688
|
+
return mergeDeep(defaultValues, entity.values ?? {});
|
|
16689
|
+
}
|
|
16681
16690
|
} else if (status === "new") {
|
|
16682
16691
|
return getDefaultValuesFor(properties);
|
|
16683
16692
|
} else {
|