@headless-adminapp/app 1.4.14 → 1.4.15
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.
|
@@ -13,6 +13,9 @@ function getFormDefaultParameters(schema, formExperience, router) {
|
|
|
13
13
|
if (defaultValue instanceof Date) {
|
|
14
14
|
defaultValue = defaultValue.toISOString();
|
|
15
15
|
}
|
|
16
|
+
else if (attribute.type === 'date' && defaultValue === '@now') {
|
|
17
|
+
defaultValue = new Date().toISOString();
|
|
18
|
+
}
|
|
16
19
|
return {
|
|
17
20
|
...acc,
|
|
18
21
|
[key]: defaultValue,
|
package/hooks/useIsMobile.js
CHANGED
|
@@ -7,11 +7,17 @@ exports.useIsMobile = useIsMobile;
|
|
|
7
7
|
exports.useIsTablet = useIsTablet;
|
|
8
8
|
const debounce_1 = __importDefault(require("lodash/debounce"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
+
function getInnerWidth() {
|
|
11
|
+
if (typeof window !== 'undefined') {
|
|
12
|
+
return window.innerWidth;
|
|
13
|
+
}
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
10
16
|
function useIsMobile() {
|
|
11
|
-
const [isMobile, setIsMobile] = (0, react_1.useState)(
|
|
17
|
+
const [isMobile, setIsMobile] = (0, react_1.useState)(getInnerWidth() < 768);
|
|
12
18
|
(0, react_1.useLayoutEffect)(() => {
|
|
13
19
|
const updateSize = () => {
|
|
14
|
-
setIsMobile(
|
|
20
|
+
setIsMobile(getInnerWidth() < 768);
|
|
15
21
|
};
|
|
16
22
|
window.addEventListener('resize', (0, debounce_1.default)(updateSize, 250));
|
|
17
23
|
updateSize();
|
|
@@ -23,7 +29,7 @@ function useIsTablet() {
|
|
|
23
29
|
const [isTablet, setIsTablet] = (0, react_1.useState)(false);
|
|
24
30
|
(0, react_1.useLayoutEffect)(() => {
|
|
25
31
|
const updateSize = () => {
|
|
26
|
-
setIsTablet(
|
|
32
|
+
setIsTablet(getInnerWidth() < 1024);
|
|
27
33
|
};
|
|
28
34
|
window.addEventListener('resize', (0, debounce_1.default)(updateSize, 250));
|
|
29
35
|
updateSize();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"uuid": "11.0.3",
|
|
39
39
|
"yup": "^1.4.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a95b4f3c11bcb78f672fb7299bb461368d70bd48"
|
|
42
42
|
}
|