ublo-lib 1.21.2 → 1.21.4
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/es/lbm/components/lumiplan/lumiplan.module.css +7 -1
- package/es/lbm/components/lumiplan/opening.js +1 -1
- package/es/lbm/components/lumiplan/pois.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/pois.js +3 -19
- package/es/lbm/components/lumiplan/road-condition.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/road-condition.js +4 -3
- package/es/lbm/components/lumiplan/todays-tips.module.css +1 -1
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts +1 -1
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/weather/weather-data.js +2 -0
- package/es/lbm/components/lumiplan/weather/weather.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/weather/weather.js +12 -6
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ const Opening = React.forwardRef(({ resortOpening }, ref) => {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
const { dawnSkiingDays, nightSkiingDays } = resortOpening.availability;
|
|
20
|
-
return (
|
|
20
|
+
return (_jsx("div", { ref: ref, className: css.opening, "data-tags": t(lang, "opening.navigation-title"), children: _jsx("div", { className: css.tableOuter, children: _jsxs("table", { className: css.table, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", {}), dawnSkiingDays.map((day) => (_jsx("th", { className: css.heading, children: _jsx("div", { className: css.headingInner, children: _jsx(T, { id: `opening.days.${day.dayType}` }) }) }, day.dayType)))] }) }), _jsxs("tbody", { children: [_jsx("tr", { children: _jsx(Rows, { kind: "dawn", rows: dawnSkiingDays }) }), _jsx("tr", { children: _jsx(Rows, { kind: "night", rows: nightSkiingDays }) })] })] }) }) }));
|
|
21
21
|
});
|
|
22
22
|
function Rows({ kind, rows }) {
|
|
23
23
|
const Icon = kind === "dawn" ? DawnIcon : NightIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,8EA+KR,CAAC;AAIH,eAAe,IAAI,CAAC"}
|
|
@@ -96,8 +96,8 @@ const Pois = React.forwardRef(({ pois }, ref) => {
|
|
|
96
96
|
const toggleExpanded = () => {
|
|
97
97
|
setExpanded(!expanded);
|
|
98
98
|
};
|
|
99
|
-
const displayedPois = expanded ? flattenedPois : flattenedPois.slice(0,
|
|
100
|
-
return (_jsx("div", { className: css.pois, children: _jsxs("div", { className: css.inner, children: [_jsx("div", { className: css.list, children: displayedPois.map(({ id, name, type, liftType, trailType, trailLevel, sectorName, messagePoi, openingStatus, snowQuality, groomingStatus,
|
|
99
|
+
const displayedPois = expanded ? flattenedPois : flattenedPois.slice(0, 16);
|
|
100
|
+
return (_jsx("div", { className: css.pois, children: _jsxs("div", { className: css.inner, children: [_jsx("div", { className: css.list, children: displayedPois.map(({ id, name, type, liftType, trailType, trailLevel, sectorName, messagePoi, openingStatus, snowQuality, groomingStatus, }) => {
|
|
101
101
|
const isLift = type === "SKI_LIFT";
|
|
102
102
|
const translationCode = isLift
|
|
103
103
|
? `pois.lifts.${liftType}`
|
|
@@ -107,26 +107,10 @@ const Pois = React.forwardRef(({ pois }, ref) => {
|
|
|
107
107
|
? `(${t(lang, `pois.trailLevels.${trailLevel}`)})`
|
|
108
108
|
: null;
|
|
109
109
|
const specialTrail = Object.keys(SPECIAL_TRAILS).find((key) => name.includes(key));
|
|
110
|
-
// TMP
|
|
111
|
-
const isEven = Number(id) % 2 === 0;
|
|
112
|
-
const mockMessage = {
|
|
113
|
-
id: "mock",
|
|
114
|
-
type: "TEXT",
|
|
115
|
-
title: "messagePoi",
|
|
116
|
-
data: [
|
|
117
|
-
{
|
|
118
|
-
language: "fr_FR",
|
|
119
|
-
data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
};
|
|
123
|
-
// TMP
|
|
124
110
|
const message = messagePoi?.data?.find(({ language }) => {
|
|
125
111
|
const _lang = lang === "fr" ? "fr_FR" : "en_US";
|
|
126
112
|
return language === _lang;
|
|
127
|
-
})
|
|
128
|
-
? mockMessage.data[0]
|
|
129
|
-
: undefined;
|
|
113
|
+
});
|
|
130
114
|
const hasGroomingStatus = groomingStatus !== undefined && groomingStatus !== "UNDEF";
|
|
131
115
|
const hasSnowQuality = snowQuality !== undefined && snowQuality !== "UNDEF";
|
|
132
116
|
const classes = classNames(css.poi, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"road-condition.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/road-condition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,KAAK,GAAG;IACX,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"road-condition.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/road-condition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,KAAK,GAAG;IACX,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,aAAa,8EAmFlB,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
4
|
import Loader from "dt-design-system/es/loader";
|
|
@@ -14,12 +14,13 @@ const RoadCondition = React.forwardRef(({ resortAccess }, ref) => {
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
const { roadConditions } = resortAccess;
|
|
17
|
-
return (_jsxs("div", { ref: ref, className: css.conditions, "data-tags": t(lang, "road-conditions.navigation-title"), children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "road-conditions.title") } }), roadConditions.map(({ id, name, status, roadInfo, equipment, surface }) => {
|
|
17
|
+
return (_jsxs("div", { ref: ref, className: css.conditions, "data-tags": t(lang, "road-conditions.navigation-title"), children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "road-conditions.title") } }), roadConditions.map(({ id, name, status, roadInfo, equipment, surface, number }) => {
|
|
18
18
|
const roadInfoData = roadInfo?.data?.find(({ language }) => {
|
|
19
19
|
const _lang = lang === "fr" ? "fr_FR" : "en_US";
|
|
20
20
|
return language === _lang;
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
const hasValidNumber = !isNaN(parseInt(number, 10));
|
|
23
|
+
return (_jsxs("div", { className: css.condition, children: [_jsx(RoadConditionIcon, { className: css.icon }), _jsxs("div", { className: css.right, children: [_jsxs("div", { className: css.top, children: [_jsxs("div", { className: css.name, children: [name, " ", hasValidNumber && _jsxs(_Fragment, { children: ["n\u00B0", number] })] }), _jsxs("div", { className: css.surface, children: [_jsx("b", { children: _jsx(T, { id: "road-conditions.surface.title" }) }), _jsx(T, { id: `road-conditions.surface.states.${surface}` }), "."] }), _jsxs("div", { className: css.equipment, children: [_jsx("b", { children: _jsx(T, { id: "road-conditions.equipment.title" }) }), _jsx(T, { id: `road-conditions.equipment.states.${equipment}` })] })] }), roadInfoData && (_jsx("div", { className: css.bottom, dangerouslySetInnerHTML: { __html: roadInfoData.data } }))] }), _jsx("div", { className: css.status, children: _jsx(T, { id: `road-conditions.status.${status ? "OPENED" : "CLOSED"}` }) })] }, id));
|
|
23
24
|
})] }));
|
|
24
25
|
});
|
|
25
26
|
RoadCondition.displayName = "RoadCondition";
|
|
@@ -4,6 +4,6 @@ type Props = {
|
|
|
4
4
|
data: WeatherInfo;
|
|
5
5
|
expanded: boolean;
|
|
6
6
|
};
|
|
7
|
-
export default function WeatherData({ kind, data, expanded }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default function WeatherData({ kind, data, expanded }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=weather-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather-data.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/lumiplan/weather/weather-data.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"weather-data.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/lumiplan/weather/weather-data.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,kDA6GlE"}
|
|
@@ -3,6 +3,8 @@ import T from "../i18n/translations";
|
|
|
3
3
|
import WeatherIcon from "./weather-icon";
|
|
4
4
|
import css from "./weather-data.module.css";
|
|
5
5
|
export default function WeatherData({ kind, data, expanded }) {
|
|
6
|
+
if (!data)
|
|
7
|
+
return null;
|
|
6
8
|
const { skyStatus, temperature, windchill, indexUv, limitIsothermic0, limitIsothermicMinus10, limitRainSnowFall, visibility, wind, } = data;
|
|
7
9
|
return (_jsxs("div", { className: css.weatherData, children: [_jsx(WeatherIcon, { sky: skyStatus }), _jsxs("div", { className: css.weatherInfo, children: [_jsx("div", { className: css.weatherInfoTitle, children: _jsx(T, { id: `weather.${kind}` }) }), _jsxs("div", { className: css.weatherInfoTemperatures, children: [_jsxs("span", { children: [temperature.value, _jsx(T, { id: temperature.unit })] }), "|", _jsxs("span", { children: [windchill.value, _jsx(T, { id: windchill.unit }), _jsx("em", { children: _jsx(T, { id: "weather.feels-like" }) })] })] }), expanded && (_jsxs("div", { className: css.expanded, children: [skyStatus && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.sky-status.title" }), " :", " ", _jsx(T, { id: `weather.sky-status.states.${skyStatus}` })] })), temperature && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.temperature" }), " : ", temperature.value, _jsx(T, { id: temperature.unit })] })), wind && (_jsxs(_Fragment, { children: [wind.value && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind" }), " : ", wind.value.value, _jsx(T, { id: wind.value.unit })] })), wind.valueMax && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind-max" }), " : ", wind.valueMax.value, _jsx(T, { id: wind.valueMax.unit })] })), wind.direction && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind-direction.title" }), " :", " ", _jsx(T, { id: `weather.wind-direction.states.${wind.direction}` })] }))] })), limitRainSnowFall && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-rain-snow-fall" }), " :", " ", limitRainSnowFall.value, _jsx(T, { id: limitRainSnowFall.unit })] })), limitIsothermic0 && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-isothermic-0" }), " : ", limitIsothermic0.value, _jsx(T, { id: limitIsothermic0.unit })] })), limitIsothermicMinus10 && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-isothermic-minus-10" }), " :", " ", limitIsothermicMinus10.value, _jsx(T, { id: limitIsothermicMinus10.unit })] })), visibility && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.visibility.title" }), " :", " ", _jsx(T, { id: `weather.visibility.states.${visibility}` })] })), indexUv && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.index-uv" }), " : ", indexUv.value, _jsx(T, { id: indexUv.unit })] }))] }))] })] }));
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/lumiplan/weather/weather.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/lumiplan/weather/weather.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,OAAO,8EA+IZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -15,7 +15,7 @@ const Weather = React.forwardRef(({ weather }, ref) => {
|
|
|
15
15
|
const { lang } = useUbloContext();
|
|
16
16
|
const [currentZoneIndex, setCurrentZoneIndex] = React.useState(0);
|
|
17
17
|
const [currentDayIndex, setCurrentDayIndex] = React.useState(0);
|
|
18
|
-
const [expanded, setExpanded] = React.useState(
|
|
18
|
+
const [expanded, setExpanded] = React.useState(true);
|
|
19
19
|
React.useEffect(() => {
|
|
20
20
|
setCurrentZoneIndex(0);
|
|
21
21
|
setCurrentDayIndex(0);
|
|
@@ -29,14 +29,15 @@ const Weather = React.forwardRef(({ weather }, ref) => {
|
|
|
29
29
|
const { weatherZones } = weather.weather;
|
|
30
30
|
const { snowZones } = weather.snow;
|
|
31
31
|
const { weatherInfos } = weatherZones[currentZoneIndex] || {};
|
|
32
|
-
const
|
|
32
|
+
const days = weatherInfos.slice(0, 4);
|
|
33
|
+
const { am, pm } = days[currentDayIndex] || {};
|
|
33
34
|
const snowData = snowZones[currentZoneIndex] || {};
|
|
34
35
|
const ExpandIcon = expanded ? Icons.MinusCircle : Icons.PlusCircle;
|
|
35
36
|
const toggleExpanded = () => {
|
|
36
37
|
setExpanded(!expanded);
|
|
37
38
|
};
|
|
38
|
-
return (_jsxs("div", { ref: ref, className: css.weather, "data-tags": t(lang, "weather.title"), children: [_jsxs("div", { className: css.header, children: [_jsx("div", { className: css.days, children:
|
|
39
|
-
const { date, am, pm } =
|
|
39
|
+
return (_jsxs("div", { ref: ref, className: css.weather, "data-tags": t(lang, "weather.title"), children: [_jsxs("div", { className: css.header, children: [_jsx("div", { className: css.days, children: days.map((day, i) => {
|
|
40
|
+
const { date, am, pm } = day;
|
|
40
41
|
if (!pm || !am)
|
|
41
42
|
return null;
|
|
42
43
|
const isSelected = i === currentDayIndex;
|
|
@@ -45,7 +46,7 @@ const Weather = React.forwardRef(({ weather }, ref) => {
|
|
|
45
46
|
};
|
|
46
47
|
const isToday = new Date(date).getDate() === new Date().getDate();
|
|
47
48
|
const locale = lang === "fr" ? "fr-FR" : "en-UK";
|
|
48
|
-
const
|
|
49
|
+
const today = new Date(date).toLocaleDateString(locale, {
|
|
49
50
|
weekday: "long",
|
|
50
51
|
});
|
|
51
52
|
const formatedDate = new Date(date).toLocaleDateString(locale, {
|
|
@@ -56,8 +57,13 @@ const Weather = React.forwardRef(({ weather }, ref) => {
|
|
|
56
57
|
const classes = classNames(css.day, {
|
|
57
58
|
[css.daySelected]: isSelected,
|
|
58
59
|
});
|
|
59
|
-
return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) :
|
|
60
|
+
return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) : today }), formatedDate] }, date));
|
|
60
61
|
}) }), _jsx("div", { className: css.zones, children: weatherZones.map((zone, i) => {
|
|
62
|
+
const hasData = Boolean(zone.weatherInfos.length > 0 &&
|
|
63
|
+
zone.weatherInfos[0].am &&
|
|
64
|
+
zone.weatherInfos[0].pm);
|
|
65
|
+
if (!hasData)
|
|
66
|
+
return null;
|
|
61
67
|
const { name, altitude } = zone;
|
|
62
68
|
const { value, unit } = altitude;
|
|
63
69
|
const isSelected = i === currentZoneIndex;
|