ublo-lib 1.12.14 → 1.12.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.
@@ -1,21 +1,18 @@
1
1
  import * as React from "react";
2
2
  import classNames from "classnames";
3
- import { useUbloContext } from "ublo/with-ublo";
4
3
  import * as Stay from "./services/stay";
5
4
  import * as Dates from "./services/dates";
6
5
  import css from "./days.module.css";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
8
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
8
  const Day = ({
9
+ lang,
10
10
  index,
11
11
  day,
12
12
  fullStay,
13
13
  firstSelected,
14
14
  updateSelection
15
15
  }) => {
16
- const {
17
- lang
18
- } = useUbloContext();
19
16
  const locale = Dates.locales[lang] || Dates.locales.en;
20
17
  const isFirstDayOfStay = day.getTime() === fullStay[0]?.getTime();
21
18
  const isLastDayOfStay = day.getTime() === fullStay[fullStay.length - 1].getTime();
@@ -1,6 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { AnimatePresence, motion } from "framer-motion";
3
- import { useUbloContext } from "ublo/with-ublo";
4
3
  import Button from "dt-design-system/es/button";
5
4
  import Days from "./days";
6
5
  import * as Dates from "./services/dates";
@@ -10,6 +9,7 @@ import css from "./extended-stay-picker.module.css";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
11
  const ExtendedStayPicker = ({
12
+ lang,
13
13
  stay,
14
14
  extend,
15
15
  week,
@@ -20,9 +20,6 @@ const ExtendedStayPicker = ({
20
20
  onChange
21
21
  }) => {
22
22
  const barRef = React.useRef();
23
- const {
24
- lang
25
- } = useUbloContext();
26
23
  const startDate = Dates.weekToDate(week, endWeek, forceSeasonSwitch);
27
24
  const endDate = Dates.weekToDate(week + 1, endWeek, forceSeasonSwitch);
28
25
  const fullStay = stay ? Dates.getInterval(new Date(stay.from), new Date(stay.to)) : [];
@@ -49,6 +46,7 @@ const ExtendedStayPicker = ({
49
46
  })]
50
47
  }), _jsx(Days, {
51
48
  ref: barRef,
49
+ lang: lang,
52
50
  fullStay: fullStay,
53
51
  interval: interval,
54
52
  onChange: onChange
@@ -157,6 +157,7 @@ const PeriodPicker = ({
157
157
  className: css.icon
158
158
  })
159
159
  }), _jsx(Title, {
160
+ lang: lang,
160
161
  stay: stay
161
162
  }), _jsx(Controls, {
162
163
  barRef: ref,
@@ -164,6 +165,7 @@ const PeriodPicker = ({
164
165
  })]
165
166
  }), _jsx(Weeks, {
166
167
  ref: ref,
168
+ lang: lang,
167
169
  weeks: weeks,
168
170
  beginWeek: beginWeek,
169
171
  endWeek: endWeek,
@@ -173,11 +175,13 @@ const PeriodPicker = ({
173
175
  openExtendedPicker: openExtendedPicker,
174
176
  isPopup: isPopup
175
177
  }), _jsx(Warning, {
178
+ lang: lang,
176
179
  warn: warn,
177
180
  setWarn: setWarn,
178
181
  selectWeek: selectWeek,
179
182
  chosenWeek: chosenWeek
180
183
  }), _jsx(ExtendedStayPicker, {
184
+ lang: lang,
181
185
  stay: stay,
182
186
  extend: extend,
183
187
  week: selected,
@@ -1,16 +1,13 @@
1
1
  import * as React from "react";
2
- import { useUbloContext } from "ublo/with-ublo";
3
2
  import * as Messages from "./messages";
4
3
  import * as Stay from "./services/stay";
5
4
  import css from "./title.module.css";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
7
  const Title = ({
8
+ lang,
9
9
  stay
10
10
  }) => {
11
- const {
12
- lang
13
- } = useUbloContext();
14
11
  if (!stay) {
15
12
  return _jsx("div", {
16
13
  className: css.title,
@@ -1,6 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { AnimatePresence, motion } from "framer-motion";
3
- import { useUbloContext } from "ublo/with-ublo";
4
3
  import Button from "dt-design-system/es/button";
5
4
  import * as Icons from "dt-design-system/es/icons";
6
5
  import * as Messages from "./messages";
@@ -9,14 +8,12 @@ import css from "./warning.module.css";
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
10
  const Warning = ({
11
+ lang,
12
12
  warn,
13
13
  setWarn,
14
14
  selectWeek,
15
15
  chosenWeek
16
16
  }) => {
17
- const {
18
- lang
19
- } = useUbloContext();
20
17
  const cancel = () => {
21
18
  setWarn(false);
22
19
  };
@@ -1,13 +1,13 @@
1
1
  import * as React from "react";
2
2
  import classNames from "classnames";
3
3
  import { LayoutGroup, motion } from "framer-motion";
4
- import { useUbloContext } from "ublo/with-ublo";
5
4
  import * as Icons from "dt-design-system/es/icons";
6
5
  import css from "./weeks.module.css";
7
6
  import * as Dates from "./services/dates";
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const Week = ({
10
+ lang,
11
11
  week,
12
12
  beginWeek,
13
13
  endWeek,
@@ -17,9 +17,6 @@ const Week = ({
17
17
  openExtendedPicker,
18
18
  isPopup
19
19
  }) => {
20
- const {
21
- lang
22
- } = useUbloContext();
23
20
  const [checkVisible, setCheckVisible] = React.useState(false);
24
21
  const [checkTimeout, setCheckTimeout] = React.useState();
25
22
  const now = new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.12.14",
3
+ "version": "1.12.15",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "leaflet": "^1.9.1",