ublo-lib 1.19.34 → 1.19.36
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.
|
@@ -6,8 +6,7 @@ import * as Ripple from "dt-design-system/es/ripple";
|
|
|
6
6
|
import * as Utils from "./utils";
|
|
7
7
|
import css from "./calendar-date.module.css";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export default
|
|
10
|
-
function CalendarDate({
|
|
9
|
+
export default function CalendarDate({
|
|
11
10
|
date,
|
|
12
11
|
month,
|
|
13
12
|
year,
|
|
@@ -9,12 +9,11 @@ import * as Utils from "./utils";
|
|
|
9
9
|
import css from "./calendar.module.css";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
export default
|
|
13
|
-
function Calendar({
|
|
12
|
+
export default function Calendar({
|
|
14
13
|
lang = "fr",
|
|
15
14
|
format,
|
|
16
15
|
className
|
|
17
|
-
}
|
|
16
|
+
}) {
|
|
18
17
|
const locale = lang || (typeof navigator !== "undefined" && navigator.language) === "fr" ? "fr" : "en";
|
|
19
18
|
const [presets, setPresets] = React.useState(format.presets);
|
|
20
19
|
React.useEffect(() => {
|
|
@@ -65,7 +64,6 @@ function Calendar({
|
|
|
65
64
|
};
|
|
66
65
|
const classes = classnames(css.root, className);
|
|
67
66
|
return _jsx("div", {
|
|
68
|
-
ref: ref,
|
|
69
67
|
className: classes,
|
|
70
68
|
"data-cms-remove": "",
|
|
71
69
|
children: _jsxs("div", {
|
|
@@ -24,6 +24,15 @@
|
|
|
24
24
|
flex-direction: row-reverse;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
@media (max-width: 565px) {
|
|
28
|
+
:global(body:not(.cms--editing) [data-caption-position="gauche"]) .outer {
|
|
29
|
+
flex-direction: column-reverse;
|
|
30
|
+
}
|
|
31
|
+
:global(body:not(.cms--editing) [data-caption-position="droite"]) .outer {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
.calendar {
|
|
28
37
|
width: min-content;
|
|
29
38
|
padding: 6px;
|
|
@@ -9,27 +9,30 @@ const Calendar = dynamic(() => import("./calendar"), {
|
|
|
9
9
|
export default function EditableCalendar() {
|
|
10
10
|
const {
|
|
11
11
|
lang,
|
|
12
|
-
path
|
|
12
|
+
path,
|
|
13
|
+
cmsMode
|
|
13
14
|
} = useUbloContext();
|
|
14
15
|
const [formats, setFormats] = React.useState([]);
|
|
15
16
|
const refreshFormats = React.useCallback(() => {
|
|
16
17
|
setFormats([]);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
window.requestAnimationFrame(() => setTimeout(() => {
|
|
19
|
+
const elements = document.querySelectorAll("section.editable-calendar");
|
|
20
|
+
if (elements.length) {
|
|
21
|
+
const formats = Array.from(elements).map(element => {
|
|
22
|
+
const storedPresets = element.dataset.presets;
|
|
23
|
+
const presets = storedPresets ? JSON.parse(storedPresets) : {};
|
|
24
|
+
return {
|
|
25
|
+
element,
|
|
26
|
+
presets
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
setFormats(formats);
|
|
30
|
+
}
|
|
31
|
+
}, 1000));
|
|
29
32
|
}, []);
|
|
30
33
|
React.useEffect(() => {
|
|
31
34
|
refreshFormats();
|
|
32
|
-
}, [lang, path, refreshFormats]);
|
|
35
|
+
}, [lang, path, cmsMode, refreshFormats]);
|
|
33
36
|
React.useEffect(() => {
|
|
34
37
|
const zones = Array.from(document.querySelectorAll(".cms"));
|
|
35
38
|
zones.forEach(zone => {
|