@dxos/react-ui-form 0.8.2-main.12df754 → 0.8.2-main.36232bc
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/lib/browser/index.mjs +17 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +17 -5
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +17 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Form/ArrayField.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +2 -2
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormContext.d.ts +2 -2
- package/dist/types/src/components/Form/FormContext.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +1 -1
- package/dist/types/src/util/formatting.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/components/Form/ArrayField.tsx +3 -1
- package/src/components/Form/Form.stories.tsx +4 -4
- package/src/components/Form/FormContext.tsx +10 -2
- package/src/components/Form/custom/GeoPointInput.tsx +2 -2
- package/src/components/Form/custom/SelectOptionsInput.tsx +2 -2
- package/src/util/formatting.ts +15 -3
|
@@ -944,10 +944,10 @@ var padding = "px-2";
|
|
|
944
944
|
var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponent }) => {
|
|
945
945
|
const { t } = useTranslation5(translationKey);
|
|
946
946
|
const { ast, name, type, title } = property;
|
|
947
|
-
const values = useFormValues(path ?? []);
|
|
947
|
+
const values = useFormValues(path ?? []) ?? [];
|
|
948
948
|
invariant2(Array.isArray(values), `Values at path ${path?.join(".")} must be an array.`, {
|
|
949
949
|
F: __dxlog_file2,
|
|
950
|
-
L:
|
|
950
|
+
L: 39,
|
|
951
951
|
S: void 0,
|
|
952
952
|
A: [
|
|
953
953
|
"Array.isArray(values)",
|
|
@@ -1780,13 +1780,25 @@ var formatForDisplay = ({ type, format, value, locale = void 0 }) => {
|
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
1782
1782
|
case FormatEnum4.Date: {
|
|
1783
|
-
|
|
1783
|
+
try {
|
|
1784
|
+
return formatDate(new Date(value), "yyyy-MM-dd");
|
|
1785
|
+
} catch (error) {
|
|
1786
|
+
return "Invalid Date";
|
|
1787
|
+
}
|
|
1784
1788
|
}
|
|
1785
1789
|
case FormatEnum4.Time: {
|
|
1786
|
-
|
|
1790
|
+
try {
|
|
1791
|
+
return formatDate(new Date(value), "HH:mm:ss");
|
|
1792
|
+
} catch (error) {
|
|
1793
|
+
return "Invalid Time";
|
|
1794
|
+
}
|
|
1787
1795
|
}
|
|
1788
1796
|
case FormatEnum4.DateTime: {
|
|
1789
|
-
|
|
1797
|
+
try {
|
|
1798
|
+
return formatDate(new Date(value), "yyyy-MM-dd HH:mm:ss");
|
|
1799
|
+
} catch (error) {
|
|
1800
|
+
return "Invalid DateTime";
|
|
1801
|
+
}
|
|
1790
1802
|
}
|
|
1791
1803
|
case FormatEnum4.GeoPoint: {
|
|
1792
1804
|
if (value === null || value === void 0) {
|