ublo-lib 1.24.3 → 1.25.0
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/common/components/admin-links/admin-links.js +95 -52
- package/es/common/components/admin-links/index.js +1 -1
- package/es/common/components/breadcrumb.js +78 -21
- package/es/common/components/cross-selling-editor/cross-selling-editor.js +52 -0
- package/es/common/components/cross-selling-editor/cross-selling-editor.module.css +6 -0
- package/es/common/components/cross-selling-editor/editor.js +98 -0
- package/es/common/components/cross-selling-editor/editor.module.css +23 -0
- package/es/common/components/cross-selling-editor/hooks/use-custom-offers.js +52 -0
- package/es/common/components/cross-selling-editor/hooks/use-tunnel-offers.js +35 -0
- package/es/common/components/cross-selling-editor/index.js +2 -0
- package/es/common/components/cross-selling-editor/override-trigger-form.js +156 -0
- package/es/common/components/cross-selling-editor/override-trigger-form.module.css +58 -0
- package/es/common/components/cross-selling-editor/override.js +124 -0
- package/es/common/components/cross-selling-editor/override.module.css +65 -0
- package/es/common/components/cross-selling-editor/overrides-list.js +111 -0
- package/es/common/components/cross-selling-editor/overrides-list.module.css +56 -0
- package/es/common/components/cross-selling-editor/rule.js +105 -0
- package/es/common/components/cross-selling-editor/rule.module.css +37 -0
- package/es/common/components/cross-selling-editor/rules.js +84 -0
- package/es/common/components/cross-selling-editor/rules.module.css +39 -0
- package/es/common/components/cross-selling-editor/services/api.js +36 -0
- package/es/common/components/cross-selling-editor/services/utils.js +199 -0
- package/es/common/components/cross-selling-editor/tester-tunnel-offer.js +53 -0
- package/es/common/components/cross-selling-editor/tester-tunnel-offer.module.css +18 -0
- package/es/common/components/cross-selling-editor/tester.js +188 -0
- package/es/common/components/cross-selling-editor/tester.module.css +106 -0
- package/es/common/components/cross-selling-editor/types.js +1 -0
- package/es/common/components/custom-contact-form/custom-contact-form.js +147 -75
- package/es/common/components/date-picker/calendar.js +1 -1
- package/es/common/components/gesco-contact-form/gesco-contact-form.js +243 -95
- package/es/common/components/gesco-contact-form/hooks/use-params.js +35 -20
- package/es/common/components/gesco-contact-form/index.js +1 -1
- package/es/common/components/gesco-contact-form/phone-code-select.js +76 -56
- package/es/common/components/gesco-contact-form/services/api.js +7 -8
- package/es/common/components/gesco-contact-form/services/form.js +39 -25
- package/es/common/components/gesco-contact-form/services/messages.js +68 -65
- package/es/common/components/gesco-contact-form/services/plausible.js +8 -10
- package/es/common/components/gesco-contact-form/types.js +1 -1
- package/es/common/components/instant-search/hooks/use-constant.js +8 -6
- package/es/common/components/instant-search/hooks/use-debounced-search.js +14 -5
- package/es/common/components/instant-search/hooks/use-search.js +10 -6
- package/es/common/components/instant-search/index.js +1 -1
- package/es/common/components/instant-search/input.js +75 -45
- package/es/common/components/instant-search/instant-search.js +124 -73
- package/es/common/components/instant-search/links.js +74 -23
- package/es/common/components/instant-search/no-product.js +81 -4
- package/es/common/components/instant-search/products.js +118 -31
- package/es/common/components/instant-search/results.js +121 -32
- package/es/common/components/instant-search/services/api.js +12 -10
- package/es/common/components/instant-search/services/messages.js +3 -3
- package/es/common/components/instant-search/services/utils.js +34 -34
- package/es/common/components/msem-preset-editor/components/facet-selector.js +39 -22
- package/es/common/components/msem-preset-editor/components/form.js +54 -5
- package/es/common/components/msem-preset-editor/components/stay-picker.js +72 -33
- package/es/common/components/msem-preset-editor/components/widget-list-item.js +130 -42
- package/es/common/components/msem-preset-editor/components/widget-list.js +54 -29
- package/es/common/components/msem-preset-editor/editor-dialog.js +68 -21
- package/es/common/components/msem-preset-editor/editors/elloha.js +102 -69
- package/es/common/components/msem-preset-editor/editors/index.js +6 -6
- package/es/common/components/msem-preset-editor/editors/lodgings.js +316 -184
- package/es/common/components/msem-preset-editor/editors/ski-passes.js +267 -180
- package/es/common/components/msem-preset-editor/editors/standard-products.js +84 -56
- package/es/common/components/msem-preset-editor/editors/vakario.js +239 -171
- package/es/common/components/msem-preset-editor/msem-preset-editor.js +215 -129
- package/es/common/components/msem-preset-editor/services/api.js +69 -42
- package/es/common/components/msem-preset-editor/services/offers.js +61 -35
- package/es/common/components/msem-preset-editor/services/preset.js +22 -14
- package/es/common/components/msem-preset-editor/services/url-params.js +24 -24
- package/es/common/components/msem-preset-linker/components/actions.js +52 -40
- package/es/common/components/msem-preset-linker/components/overlays.js +57 -41
- package/es/common/components/msem-preset-linker/components/resort-selector.js +21 -11
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.js +43 -31
- package/es/common/components/msem-preset-linker/index.js +1 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.js +71 -42
- package/es/common/components/msem-preset-linker/services/url-params.js +10 -13
- package/es/common/components/plausible/hooks/use-plausible.js +22 -18
- package/es/common/components/plausible/index.js +1 -1
- package/es/common/components/plausible/plausible.js +23 -14
- package/es/common/components/plausible/services/callback.js +164 -115
- package/es/common/components/plausible/services/load.js +4 -6
- package/es/common/components/plausible/services/send-goal.js +6 -3
- package/es/common/components/scroll-spy.js +56 -43
- package/es/common/components/scrolling-carousel/index.js +1 -1
- package/es/common/components/scrolling-carousel/scrolling-carousel.js +94 -55
- package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +1 -0
- package/es/common/components/tabbed-zones.js +100 -47
- package/es/common/hooks/use-faq.js +37 -36
- package/es/common/hooks/use-in-view.js +74 -74
- package/es/common/hooks/use-scroll-direction.js +37 -32
- package/es/common/hooks/use-stay.js +16 -13
- package/es/common/hooks/use-sticky.js +35 -35
- package/es/common/hooks/use-tunnel.js +42 -30
- package/es/common/hooks/use-update-effect.js +9 -9
- package/es/common/hooks/use-window-sizes.js +27 -28
- package/es/common/utils/cms.js +15 -17
- package/es/common/utils/cookies.js +10 -11
- package/es/common/utils/copy.js +11 -11
- package/es/common/utils/dates.js +8 -10
- package/es/common/utils/elements.js +14 -15
- package/es/common/utils/events.js +4 -19
- package/es/common/utils/file-manager.js +12 -10
- package/es/common/utils/load-js.js +10 -11
- package/es/common/utils/msem-widget.js +30 -23
- package/es/common/utils/url-parameters.js +11 -7
- package/es/esf/components/magic-box/index.js +1 -1
- package/es/esf/components/magic-box/magic-box.js +164 -102
- package/es/esf/components/parcours-esf/index.js +1 -1
- package/es/esf/components/parcours-esf/parcours-esf.js +45 -30
- package/es/esf/components/period-picker/period-picker.js +5 -5
- package/es/lbm/components/lumiplan/api.js +35 -18
- package/es/lbm/components/lumiplan/domain.js +96 -20
- package/es/lbm/components/lumiplan/i18n/translations.js +24 -15
- package/es/lbm/components/lumiplan/index.js +1 -1
- package/es/lbm/components/lumiplan/lumiplan.js +130 -102
- package/es/lbm/components/lumiplan/opening.js +116 -38
- package/es/lbm/components/lumiplan/pois.js +270 -161
- package/es/lbm/components/lumiplan/resort-selector.js +58 -36
- package/es/lbm/components/lumiplan/road-condition.js +100 -19
- package/es/lbm/components/lumiplan/todays-tips.js +45 -16
- package/es/lbm/components/lumiplan/types.js +1 -1
- package/es/lbm/components/lumiplan/weather/avalanche-risk.js +33 -8
- package/es/lbm/components/lumiplan/weather/index.js +1 -1
- package/es/lbm/components/lumiplan/weather/snow-data.js +71 -5
- package/es/lbm/components/lumiplan/weather/weather-data.js +126 -7
- package/es/lbm/components/lumiplan/weather/weather-days.js +76 -48
- package/es/lbm/components/lumiplan/weather/weather-icon.js +23 -20
- package/es/lbm/components/lumiplan/weather/weather-zones.js +71 -42
- package/es/lbm/components/lumiplan/weather/weather.js +90 -28
- package/package.json +4 -10
- package/es/common/components/admin-links/admin-links.d.ts +0 -11
- package/es/common/components/admin-links/admin-links.d.ts.map +0 -1
- package/es/common/components/admin-links/index.d.ts +0 -3
- package/es/common/components/admin-links/index.d.ts.map +0 -1
- package/es/common/components/breadcrumb.d.ts +0 -16
- package/es/common/components/breadcrumb.d.ts.map +0 -1
- package/es/common/components/custom-contact-form/custom-contact-form.d.ts +0 -25
- package/es/common/components/custom-contact-form/custom-contact-form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts +0 -17
- package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/hooks/use-params.d.ts +0 -15
- package/es/common/components/gesco-contact-form/hooks/use-params.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/index.d.ts +0 -3
- package/es/common/components/gesco-contact-form/index.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/phone-code-select.d.ts +0 -7
- package/es/common/components/gesco-contact-form/phone-code-select.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/api.d.ts +0 -30
- package/es/common/components/gesco-contact-form/services/api.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/form.d.ts +0 -31
- package/es/common/components/gesco-contact-form/services/form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/messages.d.ts +0 -34
- package/es/common/components/gesco-contact-form/services/messages.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/plausible.d.ts +0 -3
- package/es/common/components/gesco-contact-form/services/plausible.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/types.d.ts +0 -34
- package/es/common/components/gesco-contact-form/types.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-constant.d.ts +0 -2
- package/es/common/components/instant-search/hooks/use-constant.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-debounced-search.d.ts +0 -7
- package/es/common/components/instant-search/hooks/use-debounced-search.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-search.d.ts +0 -16
- package/es/common/components/instant-search/hooks/use-search.d.ts.map +0 -1
- package/es/common/components/instant-search/index.d.ts +0 -3
- package/es/common/components/instant-search/index.d.ts.map +0 -1
- package/es/common/components/instant-search/input.d.ts +0 -15
- package/es/common/components/instant-search/input.d.ts.map +0 -1
- package/es/common/components/instant-search/instant-search.d.ts +0 -14
- package/es/common/components/instant-search/instant-search.d.ts.map +0 -1
- package/es/common/components/instant-search/links.d.ts +0 -12
- package/es/common/components/instant-search/links.d.ts.map +0 -1
- package/es/common/components/instant-search/no-product.d.ts +0 -6
- package/es/common/components/instant-search/no-product.d.ts.map +0 -1
- package/es/common/components/instant-search/products.d.ts +0 -14
- package/es/common/components/instant-search/products.d.ts.map +0 -1
- package/es/common/components/instant-search/results.d.ts +0 -76
- package/es/common/components/instant-search/results.d.ts.map +0 -1
- package/es/common/components/instant-search/services/api.d.ts +0 -2
- package/es/common/components/instant-search/services/api.d.ts.map +0 -1
- package/es/common/components/instant-search/services/messages.d.ts +0 -2
- package/es/common/components/instant-search/services/messages.d.ts.map +0 -1
- package/es/common/components/instant-search/services/utils.d.ts +0 -4
- package/es/common/components/instant-search/services/utils.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/facet-selector.d.ts +0 -6
- package/es/common/components/msem-preset-editor/components/facet-selector.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/form.d.ts +0 -8
- package/es/common/components/msem-preset-editor/components/form.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/stay-picker.d.ts +0 -14
- package/es/common/components/msem-preset-editor/components/stay-picker.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts +0 -12
- package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/widget-list.d.ts +0 -17
- package/es/common/components/msem-preset-editor/components/widget-list.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editor-dialog.d.ts +0 -30
- package/es/common/components/msem-preset-editor/editor-dialog.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/elloha.d.ts +0 -15
- package/es/common/components/msem-preset-editor/editors/elloha.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/index.d.ts +0 -14
- package/es/common/components/msem-preset-editor/editors/index.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts +0 -17
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts +0 -16
- package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/standard-products.d.ts +0 -16
- package/es/common/components/msem-preset-editor/editors/standard-products.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/vakario.d.ts +0 -15
- package/es/common/components/msem-preset-editor/editors/vakario.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts +0 -28
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/api.d.ts +0 -15
- package/es/common/components/msem-preset-editor/services/api.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/offers.d.ts +0 -47
- package/es/common/components/msem-preset-editor/services/offers.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/preset.d.ts +0 -40
- package/es/common/components/msem-preset-editor/services/preset.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/url-params.d.ts +0 -3
- package/es/common/components/msem-preset-editor/services/url-params.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/actions.d.ts +0 -11
- package/es/common/components/msem-preset-linker/components/actions.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/overlays.d.ts +0 -8
- package/es/common/components/msem-preset-linker/components/overlays.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/resort-selector.d.ts +0 -6
- package/es/common/components/msem-preset-linker/components/resort-selector.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts +0 -4
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/index.d.ts +0 -3
- package/es/common/components/msem-preset-linker/index.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts +0 -30
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/services/url-params.d.ts +0 -2
- package/es/common/components/msem-preset-linker/services/url-params.d.ts.map +0 -1
- package/es/common/components/plausible/hooks/use-plausible.d.ts +0 -12
- package/es/common/components/plausible/hooks/use-plausible.d.ts.map +0 -1
- package/es/common/components/plausible/index.d.ts +0 -8
- package/es/common/components/plausible/index.d.ts.map +0 -1
- package/es/common/components/plausible/plausible.d.ts +0 -7
- package/es/common/components/plausible/plausible.d.ts.map +0 -1
- package/es/common/components/plausible/services/callback.d.ts +0 -24
- package/es/common/components/plausible/services/callback.d.ts.map +0 -1
- package/es/common/components/plausible/services/load.d.ts +0 -2
- package/es/common/components/plausible/services/load.d.ts.map +0 -1
- package/es/common/components/plausible/services/send-goal.d.ts +0 -7
- package/es/common/components/plausible/services/send-goal.d.ts.map +0 -1
- package/es/common/components/scroll-spy.d.ts +0 -14
- package/es/common/components/scroll-spy.d.ts.map +0 -1
- package/es/common/components/scrolling-carousel/index.d.ts +0 -3
- package/es/common/components/scrolling-carousel/index.d.ts.map +0 -1
- package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts +0 -8
- package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts.map +0 -1
- package/es/common/components/tabbed-zones.d.ts +0 -12
- package/es/common/components/tabbed-zones.d.ts.map +0 -1
- package/es/common/hooks/use-faq.d.ts +0 -3
- package/es/common/hooks/use-faq.d.ts.map +0 -1
- package/es/common/hooks/use-in-view.d.ts +0 -5
- package/es/common/hooks/use-in-view.d.ts.map +0 -1
- package/es/common/hooks/use-scroll-direction.d.ts +0 -11
- package/es/common/hooks/use-scroll-direction.d.ts.map +0 -1
- package/es/common/hooks/use-stay.d.ts +0 -4
- package/es/common/hooks/use-stay.d.ts.map +0 -1
- package/es/common/hooks/use-sticky.d.ts +0 -4
- package/es/common/hooks/use-sticky.d.ts.map +0 -1
- package/es/common/hooks/use-tunnel.d.ts +0 -8
- package/es/common/hooks/use-tunnel.d.ts.map +0 -1
- package/es/common/hooks/use-update-effect.d.ts +0 -2
- package/es/common/hooks/use-update-effect.d.ts.map +0 -1
- package/es/common/hooks/use-window-sizes.d.ts +0 -7
- package/es/common/hooks/use-window-sizes.d.ts.map +0 -1
- package/es/common/utils/cms.d.ts +0 -4
- package/es/common/utils/cms.d.ts.map +0 -1
- package/es/common/utils/cookies.d.ts +0 -2
- package/es/common/utils/cookies.d.ts.map +0 -1
- package/es/common/utils/copy.d.ts +0 -2
- package/es/common/utils/copy.d.ts.map +0 -1
- package/es/common/utils/dates.d.ts +0 -2
- package/es/common/utils/dates.d.ts.map +0 -1
- package/es/common/utils/elements.d.ts +0 -5
- package/es/common/utils/elements.d.ts.map +0 -1
- package/es/common/utils/events.d.ts +0 -4
- package/es/common/utils/events.d.ts.map +0 -1
- package/es/common/utils/file-manager.d.ts +0 -13
- package/es/common/utils/file-manager.d.ts.map +0 -1
- package/es/common/utils/load-js.d.ts +0 -3
- package/es/common/utils/load-js.d.ts.map +0 -1
- package/es/common/utils/msem-widget.d.ts +0 -16
- package/es/common/utils/msem-widget.d.ts.map +0 -1
- package/es/common/utils/url-parameters.d.ts +0 -2
- package/es/common/utils/url-parameters.d.ts.map +0 -1
- package/es/esf/components/magic-box/index.d.ts +0 -3
- package/es/esf/components/magic-box/index.d.ts.map +0 -1
- package/es/esf/components/magic-box/magic-box.d.ts +0 -22
- package/es/esf/components/magic-box/magic-box.d.ts.map +0 -1
- package/es/esf/components/parcours-esf/index.d.ts +0 -3
- package/es/esf/components/parcours-esf/index.d.ts.map +0 -1
- package/es/esf/components/parcours-esf/parcours-esf.d.ts +0 -14
- package/es/esf/components/parcours-esf/parcours-esf.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/api.d.ts +0 -8
- package/es/lbm/components/lumiplan/api.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/domain.d.ts +0 -8
- package/es/lbm/components/lumiplan/domain.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/i18n/translations.d.ts +0 -7
- package/es/lbm/components/lumiplan/i18n/translations.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/index.d.ts +0 -3
- package/es/lbm/components/lumiplan/index.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/lumiplan.d.ts +0 -2
- package/es/lbm/components/lumiplan/lumiplan.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/opening.d.ts +0 -9
- package/es/lbm/components/lumiplan/opening.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/pois.d.ts +0 -8
- package/es/lbm/components/lumiplan/pois.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/resort-selector.d.ts +0 -12
- package/es/lbm/components/lumiplan/resort-selector.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/road-condition.d.ts +0 -8
- package/es/lbm/components/lumiplan/road-condition.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/todays-tips.d.ts +0 -8
- package/es/lbm/components/lumiplan/todays-tips.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/types.d.ts +0 -285
- package/es/lbm/components/lumiplan/types.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts +0 -4
- package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/index.d.ts +0 -3
- package/es/lbm/components/lumiplan/weather/index.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/snow-data.d.ts +0 -8
- package/es/lbm/components/lumiplan/weather/snow-data.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts +0 -9
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-days.d.ts +0 -7
- package/es/lbm/components/lumiplan/weather/weather-days.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-icon.d.ts +0 -23
- package/es/lbm/components/lumiplan/weather/weather-icon.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-zones.d.ts +0 -6
- package/es/lbm/components/lumiplan/weather/weather-zones.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather.d.ts +0 -8
- package/es/lbm/components/lumiplan/weather/weather.d.ts.map +0 -1
|
@@ -1,27 +1,108 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
3
|
import Loader from "dt-design-system/es/loader";
|
|
5
4
|
import T, { t } from "./i18n/translations";
|
|
6
5
|
import RoadConditionIcon from "./icons/road-condition";
|
|
7
6
|
import css from "./road-condition.module.css";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
const RoadCondition = React.forwardRef(({
|
|
11
|
+
resortAccess
|
|
12
|
+
}, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
lang
|
|
15
|
+
} = useUbloContext();
|
|
16
|
+
if (resortAccess === undefined) {
|
|
17
|
+
return _jsx("div", {
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: css.loader,
|
|
20
|
+
"data-tags": t(lang, "road-conditions.navigation-title"),
|
|
21
|
+
children: _jsx(Loader, {
|
|
22
|
+
variant: "overlay"
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!resortAccess?.roadConditions?.length) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const {
|
|
30
|
+
roadConditions
|
|
31
|
+
} = resortAccess;
|
|
32
|
+
return _jsxs("div", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
className: css.conditions,
|
|
35
|
+
"data-tags": t(lang, "road-conditions.navigation-title"),
|
|
36
|
+
children: [_jsx("div", {
|
|
37
|
+
className: css.title,
|
|
38
|
+
dangerouslySetInnerHTML: {
|
|
39
|
+
__html: t(lang, "road-conditions.title")
|
|
40
|
+
}
|
|
41
|
+
}), roadConditions.map(({
|
|
42
|
+
id,
|
|
43
|
+
name,
|
|
44
|
+
status,
|
|
45
|
+
roadInfo,
|
|
46
|
+
equipment,
|
|
47
|
+
surface,
|
|
48
|
+
number
|
|
49
|
+
}) => {
|
|
50
|
+
const roadInfoData = roadInfo?.data?.find(({
|
|
51
|
+
language
|
|
52
|
+
}) => {
|
|
53
|
+
const _lang = lang === "fr" ? "fr_FR" : "en_US";
|
|
54
|
+
return language === _lang;
|
|
55
|
+
});
|
|
56
|
+
const hasValidNumber = !isNaN(parseInt(number, 10)) && number !== "0";
|
|
57
|
+
return _jsxs("div", {
|
|
58
|
+
className: css.condition,
|
|
59
|
+
children: [_jsx(RoadConditionIcon, {
|
|
60
|
+
className: css.icon
|
|
61
|
+
}), _jsxs("div", {
|
|
62
|
+
className: css.right,
|
|
63
|
+
children: [_jsxs("div", {
|
|
64
|
+
className: css.status,
|
|
65
|
+
children: [_jsx(T, {
|
|
66
|
+
id: "road-conditions.road"
|
|
67
|
+
}), " ", _jsx(T, {
|
|
68
|
+
id: `road-conditions.status.${status ? "OPENED" : "CLOSED"}`
|
|
69
|
+
})]
|
|
70
|
+
}), _jsxs("div", {
|
|
71
|
+
className: css.top,
|
|
72
|
+
children: [name?.trim() && _jsxs("div", {
|
|
73
|
+
className: css.name,
|
|
74
|
+
children: [name, " ", hasValidNumber && _jsxs(_Fragment, {
|
|
75
|
+
children: ["n\xB0", number]
|
|
76
|
+
})]
|
|
77
|
+
}), surface?.trim() && surface !== "UNDEF" && _jsxs("div", {
|
|
78
|
+
className: css.surface,
|
|
79
|
+
children: [_jsx("b", {
|
|
80
|
+
children: _jsx(T, {
|
|
81
|
+
id: "road-conditions.surface.title"
|
|
82
|
+
})
|
|
83
|
+
}), _jsx(T, {
|
|
84
|
+
id: `road-conditions.surface.states.${surface}`
|
|
85
|
+
}), "."]
|
|
86
|
+
}), equipment?.trim() && equipment !== "UNDEF" && _jsxs("div", {
|
|
87
|
+
className: css.equipment,
|
|
88
|
+
children: [_jsx("b", {
|
|
89
|
+
children: _jsx(T, {
|
|
90
|
+
id: "road-conditions.equipment.title"
|
|
91
|
+
})
|
|
92
|
+
}), _jsx(T, {
|
|
93
|
+
id: `road-conditions.equipment.states.${equipment}`
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
}), roadInfoData && _jsx("div", {
|
|
97
|
+
className: css.bottom,
|
|
98
|
+
dangerouslySetInnerHTML: {
|
|
99
|
+
__html: roadInfoData.data
|
|
100
|
+
}
|
|
101
|
+
})]
|
|
102
|
+
})]
|
|
103
|
+
}, id);
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
25
106
|
});
|
|
26
107
|
RoadCondition.displayName = "RoadCondition";
|
|
27
|
-
export default RoadCondition;
|
|
108
|
+
export default RoadCondition;
|
|
@@ -1,23 +1,52 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
3
|
import Loader from "dt-design-system/es/loader";
|
|
5
4
|
import { t } from "./i18n/translations";
|
|
6
5
|
import css from "./todays-tips.module.css";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const TodaysTips = React.forwardRef(({
|
|
9
|
+
resortOpening
|
|
10
|
+
}, ref) => {
|
|
11
|
+
const {
|
|
12
|
+
lang
|
|
13
|
+
} = useUbloContext();
|
|
14
|
+
const todaysTips = resortOpening?.resortInfos?.find(({
|
|
15
|
+
type
|
|
16
|
+
}) => type === "RESORT_TIP_OF_THE_DAY");
|
|
17
|
+
if (todaysTips === undefined) {
|
|
18
|
+
return _jsx("div", {
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: css.loader,
|
|
21
|
+
children: _jsx(Loader, {
|
|
22
|
+
variant: "overlay"
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!todaysTips) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const text = todaysTips.data.find(({
|
|
30
|
+
language
|
|
31
|
+
}) => language === "fr_FR");
|
|
32
|
+
if (!text?.data) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return _jsxs("div", {
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: css.tips,
|
|
38
|
+
children: [_jsx("div", {
|
|
39
|
+
className: css.title,
|
|
40
|
+
dangerouslySetInnerHTML: {
|
|
41
|
+
__html: t(lang, "todays-tips.title")
|
|
42
|
+
}
|
|
43
|
+
}), _jsx("div", {
|
|
44
|
+
className: css.text,
|
|
45
|
+
dangerouslySetInnerHTML: {
|
|
46
|
+
__html: text.data
|
|
47
|
+
}
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
21
50
|
});
|
|
22
51
|
TodaysTips.displayName = "TodaysTips";
|
|
23
|
-
export default TodaysTips;
|
|
52
|
+
export default TodaysTips;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Image from "next/image";
|
|
3
3
|
import getConfig from "next/config";
|
|
4
4
|
import T from "../i18n/translations";
|
|
5
5
|
import css from "./avalanche-risk.module.css";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const {
|
|
9
|
+
publicRuntimeConfig
|
|
10
|
+
} = getConfig();
|
|
11
|
+
const {
|
|
12
|
+
lumiplanApi
|
|
13
|
+
} = publicRuntimeConfig;
|
|
14
|
+
export default function AvalancheRisk({
|
|
15
|
+
avalancheRisk
|
|
16
|
+
}) {
|
|
17
|
+
if (!avalancheRisk || avalancheRisk === "UNDEF") return null;
|
|
18
|
+
return _jsxs("div", {
|
|
19
|
+
className: css.avalancheRisk,
|
|
20
|
+
children: [_jsx("b", {
|
|
21
|
+
children: _jsx(T, {
|
|
22
|
+
id: "weather.avalanche-risk.title"
|
|
23
|
+
})
|
|
24
|
+
}), _jsxs("span", {
|
|
25
|
+
children: [_jsx(Image, {
|
|
26
|
+
src: `${lumiplanApi}/avalanche/${avalancheRisk}.svg`,
|
|
27
|
+
width: 20,
|
|
28
|
+
height: 20,
|
|
29
|
+
alt: ""
|
|
30
|
+
}), _jsx("span", {
|
|
31
|
+
children: _jsx(T, {
|
|
32
|
+
id: `weather.avalanche-risk.states.${avalancheRisk}`
|
|
33
|
+
})
|
|
34
|
+
})]
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import Weather from "./weather";
|
|
2
|
-
export default Weather;
|
|
2
|
+
export default Weather;
|
|
@@ -1,8 +1,74 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import T from "../i18n/translations";
|
|
3
3
|
import SnowCover from "../icons/snow-cover";
|
|
4
4
|
import css from "./snow-data.module.css";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export default function SnowData({
|
|
9
|
+
data,
|
|
10
|
+
expanded
|
|
11
|
+
}) {
|
|
12
|
+
const {
|
|
13
|
+
snowQuality,
|
|
14
|
+
snowTotalDepth,
|
|
15
|
+
freshSnowFallDepth12H,
|
|
16
|
+
freshSnowFallDepth24H,
|
|
17
|
+
freshSnowFallDepth48H,
|
|
18
|
+
freshSnowFallDepth72H
|
|
19
|
+
} = data;
|
|
20
|
+
return _jsxs("div", {
|
|
21
|
+
className: css.snow,
|
|
22
|
+
children: [_jsx(SnowCover, {
|
|
23
|
+
className: css.snowIcon
|
|
24
|
+
}), _jsxs("div", {
|
|
25
|
+
className: css.snowInfo,
|
|
26
|
+
children: [_jsxs("div", {
|
|
27
|
+
className: css.snowState,
|
|
28
|
+
children: [_jsx(T, {
|
|
29
|
+
id: "snow.snow-quality.title"
|
|
30
|
+
}), " ", snowQuality && snowQuality !== "UNDEF" && _jsxs(_Fragment, {
|
|
31
|
+
children: [": ", _jsx(T, {
|
|
32
|
+
id: `snow.snow-quality.states.${snowQuality}`
|
|
33
|
+
})]
|
|
34
|
+
})]
|
|
35
|
+
}), _jsxs("div", {
|
|
36
|
+
className: css.snowDepth,
|
|
37
|
+
children: [snowTotalDepth?.value || 0, _jsx(T, {
|
|
38
|
+
id: snowTotalDepth?.unit || "CENTIMETER"
|
|
39
|
+
})]
|
|
40
|
+
}), expanded && _jsxs("div", {
|
|
41
|
+
className: css.expanded,
|
|
42
|
+
children: [freshSnowFallDepth12H && freshSnowFallDepth12H.value !== 0 && _jsxs("div", {
|
|
43
|
+
className: css.snowFall,
|
|
44
|
+
children: [_jsx(T, {
|
|
45
|
+
id: "snow.fresh-snow-fall"
|
|
46
|
+
}), " 12h :", " ", freshSnowFallDepth12H.value, _jsx(T, {
|
|
47
|
+
id: freshSnowFallDepth12H.unit
|
|
48
|
+
})]
|
|
49
|
+
}), freshSnowFallDepth24H && freshSnowFallDepth24H.value !== 0 && _jsxs("div", {
|
|
50
|
+
className: css.snowFall,
|
|
51
|
+
children: [_jsx(T, {
|
|
52
|
+
id: "snow.fresh-snow-fall"
|
|
53
|
+
}), " 24h :", " ", freshSnowFallDepth24H.value, _jsx(T, {
|
|
54
|
+
id: freshSnowFallDepth24H.unit
|
|
55
|
+
})]
|
|
56
|
+
}), freshSnowFallDepth48H && freshSnowFallDepth48H.value !== 0 && _jsxs("div", {
|
|
57
|
+
className: css.snowFall,
|
|
58
|
+
children: [_jsx(T, {
|
|
59
|
+
id: "snow.fresh-snow-fall"
|
|
60
|
+
}), " 48h :", " ", freshSnowFallDepth48H.value, _jsx(T, {
|
|
61
|
+
id: freshSnowFallDepth48H.unit
|
|
62
|
+
})]
|
|
63
|
+
}), freshSnowFallDepth72H && freshSnowFallDepth72H.value !== 0 && _jsxs("div", {
|
|
64
|
+
className: css.snowFall,
|
|
65
|
+
children: [_jsx(T, {
|
|
66
|
+
id: "snow.fresh-snow-fall"
|
|
67
|
+
}), " 72h :", " ", freshSnowFallDepth72H.value, _jsx(T, {
|
|
68
|
+
id: freshSnowFallDepth72H.unit
|
|
69
|
+
})]
|
|
70
|
+
})]
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -1,10 +1,129 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import T from "../i18n/translations";
|
|
3
3
|
import WeatherIcon from "./weather-icon";
|
|
4
4
|
import css from "./weather-data.module.css";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
export default function WeatherData({
|
|
9
|
+
kind,
|
|
10
|
+
data,
|
|
11
|
+
expanded
|
|
12
|
+
}) {
|
|
13
|
+
if (!data) return null;
|
|
14
|
+
const {
|
|
15
|
+
skyStatus,
|
|
16
|
+
temperature,
|
|
17
|
+
windchill,
|
|
18
|
+
indexUv,
|
|
19
|
+
limitIsothermic0,
|
|
20
|
+
limitIsothermicMinus10,
|
|
21
|
+
limitRainSnowFall,
|
|
22
|
+
visibility,
|
|
23
|
+
wind
|
|
24
|
+
} = data;
|
|
25
|
+
return _jsxs("div", {
|
|
26
|
+
className: css.weatherData,
|
|
27
|
+
children: [_jsx(WeatherIcon, {
|
|
28
|
+
sky: skyStatus
|
|
29
|
+
}), _jsxs("div", {
|
|
30
|
+
className: css.weatherInfo,
|
|
31
|
+
children: [_jsx("div", {
|
|
32
|
+
className: css.weatherInfoTitle,
|
|
33
|
+
children: _jsx(T, {
|
|
34
|
+
id: `weather.${kind}`
|
|
35
|
+
})
|
|
36
|
+
}), _jsxs("div", {
|
|
37
|
+
className: css.weatherInfoTemperatures,
|
|
38
|
+
children: [_jsxs("span", {
|
|
39
|
+
children: [temperature.value, _jsx(T, {
|
|
40
|
+
id: temperature.unit
|
|
41
|
+
})]
|
|
42
|
+
}), "|", _jsxs("span", {
|
|
43
|
+
children: [windchill.value, _jsx(T, {
|
|
44
|
+
id: windchill.unit
|
|
45
|
+
}), _jsx("em", {
|
|
46
|
+
children: _jsx(T, {
|
|
47
|
+
id: "weather.feels-like"
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
})]
|
|
51
|
+
}), expanded && _jsxs("div", {
|
|
52
|
+
className: css.expanded,
|
|
53
|
+
children: [skyStatus && _jsxs("div", {
|
|
54
|
+
className: css.data,
|
|
55
|
+
children: [_jsx(T, {
|
|
56
|
+
id: "weather.sky-status.title"
|
|
57
|
+
}), " :", " ", _jsx(T, {
|
|
58
|
+
id: `weather.sky-status.states.${skyStatus}`
|
|
59
|
+
})]
|
|
60
|
+
}), temperature && _jsxs("div", {
|
|
61
|
+
className: css.data,
|
|
62
|
+
children: [_jsx(T, {
|
|
63
|
+
id: "weather.temperature"
|
|
64
|
+
}), " : ", temperature.value, _jsx(T, {
|
|
65
|
+
id: temperature.unit
|
|
66
|
+
})]
|
|
67
|
+
}), wind && _jsxs(_Fragment, {
|
|
68
|
+
children: [wind.value && _jsxs("div", {
|
|
69
|
+
className: css.data,
|
|
70
|
+
children: [_jsx(T, {
|
|
71
|
+
id: "weather.wind"
|
|
72
|
+
}), " : ", wind.value.value, _jsx(T, {
|
|
73
|
+
id: wind.value.unit
|
|
74
|
+
})]
|
|
75
|
+
}), wind.valueMax && _jsxs("div", {
|
|
76
|
+
className: css.data,
|
|
77
|
+
children: [_jsx(T, {
|
|
78
|
+
id: "weather.wind-max"
|
|
79
|
+
}), " : ", wind.valueMax.value, _jsx(T, {
|
|
80
|
+
id: wind.valueMax.unit
|
|
81
|
+
})]
|
|
82
|
+
}), wind.direction && _jsxs("div", {
|
|
83
|
+
className: css.data,
|
|
84
|
+
children: [_jsx(T, {
|
|
85
|
+
id: "weather.wind-direction.title"
|
|
86
|
+
}), " :", " ", _jsx(T, {
|
|
87
|
+
id: `weather.wind-direction.states.${wind.direction}`
|
|
88
|
+
})]
|
|
89
|
+
})]
|
|
90
|
+
}), limitRainSnowFall && _jsxs("div", {
|
|
91
|
+
className: css.data,
|
|
92
|
+
children: [_jsx(T, {
|
|
93
|
+
id: "weather.limit-rain-snow-fall"
|
|
94
|
+
}), " :", " ", limitRainSnowFall.value, _jsx(T, {
|
|
95
|
+
id: limitRainSnowFall.unit
|
|
96
|
+
})]
|
|
97
|
+
}), limitIsothermic0 && _jsxs("div", {
|
|
98
|
+
className: css.data,
|
|
99
|
+
children: [_jsx(T, {
|
|
100
|
+
id: "weather.limit-isothermic-0"
|
|
101
|
+
}), " : ", limitIsothermic0.value, _jsx(T, {
|
|
102
|
+
id: limitIsothermic0.unit
|
|
103
|
+
})]
|
|
104
|
+
}), limitIsothermicMinus10 && _jsxs("div", {
|
|
105
|
+
className: css.data,
|
|
106
|
+
children: [_jsx(T, {
|
|
107
|
+
id: "weather.limit-isothermic-minus-10"
|
|
108
|
+
}), " :", " ", limitIsothermicMinus10.value, _jsx(T, {
|
|
109
|
+
id: limitIsothermicMinus10.unit
|
|
110
|
+
})]
|
|
111
|
+
}), visibility && _jsxs("div", {
|
|
112
|
+
className: css.data,
|
|
113
|
+
children: [_jsx(T, {
|
|
114
|
+
id: "weather.visibility.title"
|
|
115
|
+
}), " :", " ", _jsx(T, {
|
|
116
|
+
id: `weather.visibility.states.${visibility}`
|
|
117
|
+
})]
|
|
118
|
+
}), indexUv && _jsxs("div", {
|
|
119
|
+
className: css.data,
|
|
120
|
+
children: [_jsx(T, {
|
|
121
|
+
id: "weather.index-uv"
|
|
122
|
+
}), " : ", indexUv.value, _jsx(T, {
|
|
123
|
+
id: indexUv.unit
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
@@ -1,54 +1,82 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import classNames from "classnames";
|
|
4
3
|
import Button from "dt-design-system/es/button";
|
|
5
4
|
import T from "../i18n/translations";
|
|
6
|
-
// import useWindowSizes from "ublo-lib/es/common/hooks/use-window-sizes";
|
|
7
5
|
import useWindowSizes from "../../../../common/hooks/use-window-sizes";
|
|
8
6
|
import css from "./weather-days.module.css";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function Days({
|
|
10
|
+
days,
|
|
11
|
+
currentDayIndex,
|
|
12
|
+
setCurrentDayIndex,
|
|
13
|
+
lang
|
|
14
|
+
}) {
|
|
15
|
+
const [showLeftShadow, setShowLeftShadow] = React.useState(false);
|
|
16
|
+
const [showRightShadow, setShowRightShadow] = React.useState(false);
|
|
17
|
+
const containerRef = React.useRef(null);
|
|
18
|
+
const scrollerRef = React.useRef(null);
|
|
19
|
+
const {
|
|
20
|
+
width,
|
|
21
|
+
height
|
|
22
|
+
} = useWindowSizes();
|
|
23
|
+
const refreshShadows = React.useCallback(() => {
|
|
24
|
+
const container = containerRef.current;
|
|
25
|
+
const scroller = scrollerRef.current;
|
|
26
|
+
if (container && scroller) {
|
|
27
|
+
setShowLeftShadow(scroller.scrollLeft > 50);
|
|
28
|
+
const maxScroll = Math.round(scroller.scrollWidth) - Math.round(scroller.clientWidth);
|
|
29
|
+
setShowRightShadow(scroller.scrollLeft < maxScroll - 50);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
refreshShadows();
|
|
34
|
+
}, [refreshShadows, width, height]);
|
|
35
|
+
const daysClasses = classNames(css.days, {
|
|
36
|
+
[css.leftShadow]: showLeftShadow,
|
|
37
|
+
[css.rightShadow]: showRightShadow
|
|
38
|
+
});
|
|
39
|
+
return _jsx("div", {
|
|
40
|
+
ref: containerRef,
|
|
41
|
+
className: daysClasses,
|
|
42
|
+
children: _jsx("div", {
|
|
43
|
+
ref: scrollerRef,
|
|
44
|
+
onScroll: refreshShadows,
|
|
45
|
+
className: css.content,
|
|
46
|
+
children: days.map((day, i) => {
|
|
47
|
+
const {
|
|
48
|
+
date,
|
|
49
|
+
am,
|
|
50
|
+
pm
|
|
51
|
+
} = day;
|
|
52
|
+
if (!pm || !am) return null;
|
|
53
|
+
const isSelected = i === currentDayIndex;
|
|
54
|
+
const updateCurrentDay = () => {
|
|
55
|
+
setCurrentDayIndex(i);
|
|
56
|
+
};
|
|
57
|
+
const isToday = new Date(date).getDate() === new Date().getDate();
|
|
58
|
+
const locale = lang === "fr" ? "fr-FR" : "en-UK";
|
|
59
|
+
const today = new Date(date).toLocaleDateString(locale, {
|
|
60
|
+
weekday: "long"
|
|
61
|
+
});
|
|
62
|
+
const formatedDate = new Date(date).toLocaleDateString(locale, {
|
|
63
|
+
day: "2-digit",
|
|
64
|
+
month: "2-digit",
|
|
65
|
+
year: "numeric"
|
|
66
|
+
});
|
|
67
|
+
const classes = classNames(css.day, {
|
|
68
|
+
[css.daySelected]: isSelected
|
|
69
|
+
});
|
|
70
|
+
return _jsxs(Button, {
|
|
71
|
+
className: classes,
|
|
72
|
+
onClick: updateCurrentDay,
|
|
73
|
+
children: [_jsx("b", {
|
|
74
|
+
children: isToday ? _jsx(T, {
|
|
75
|
+
id: "weather.today"
|
|
76
|
+
}) : today
|
|
77
|
+
}), formatedDate]
|
|
78
|
+
}, date);
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|