ublo-lib 1.35.4 → 1.35.6

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,4 +1,4 @@
1
- export default function Calendar({ date, display, stayDates, min, max, onSubmit, availabilities, close, singleDate, submitOnSelectionEnd, disableConfirmModal, }: {
1
+ export default function Calendar({ date, display, stayDates, min, max, onSubmit, availabilities, close, singleDate, submitOnSelectionEnd, disableConfirmModal, resetToBound, }: {
2
2
  date: any;
3
3
  display: any;
4
4
  stayDates?: any[];
@@ -10,5 +10,6 @@ export default function Calendar({ date, display, stayDates, min, max, onSubmit,
10
10
  singleDate: any;
11
11
  submitOnSelectionEnd: any;
12
12
  disableConfirmModal: any;
13
+ resetToBound: any;
13
14
  }): import("react/jsx-runtime").JSX.Element;
14
15
  //# sourceMappingURL=calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/calendar.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;4CAoPC"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/calendar.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;4CAqPC"}
@@ -12,7 +12,7 @@ import * as Data from "./data";
12
12
  import * as Utils from "./utils";
13
13
  import datePickerStyles from "./date-picker.module.css";
14
14
  import styles from "./calendar.module.css";
15
- export default function Calendar({ date, display, stayDates = [], min, max, onSubmit, availabilities, close, singleDate, submitOnSelectionEnd, disableConfirmModal, }) {
15
+ export default function Calendar({ date, display, stayDates = [], min, max, onSubmit, availabilities, close, singleDate, submitOnSelectionEnd, disableConfirmModal, resetToBound, }) {
16
16
  const isDateObject = Utils.isDate(date);
17
17
  const _date = isDateObject ? date : new Date();
18
18
  const { lang } = useUbloContext();
@@ -28,7 +28,7 @@ export default function Calendar({ date, display, stayDates = [], min, max, onSu
28
28
  const [year, setYear] = React.useState(selectedYear);
29
29
  const [monthAlt, setMonthAlt] = React.useState(month);
30
30
  const [yearAlt, setYearAlt] = React.useState(year);
31
- const [selecting, setSelecting] = React.useState(false);
31
+ const [selecting, setSelecting] = React.useState(resetToBound || false);
32
32
  const [firstSelectedDate, setFirstSelectedDate] = React.useState();
33
33
  const [lastSelectedDate, setLastSelectedDate] = React.useState();
34
34
  const [showPopup, setShowPopup] = React.useState(false);
@@ -1,4 +1,4 @@
1
- export default function DatePicker({ stayDates, onSubmit, close, min, max, availabilities, popup, singleDate, submitOnSelectionEnd, disableConfirmModal, }: {
1
+ export default function DatePicker({ stayDates, onSubmit, close, min, max, availabilities, popup, singleDate, submitOnSelectionEnd, disableConfirmModal, resetToBound, }: {
2
2
  stayDates?: any[];
3
3
  onSubmit: any;
4
4
  close: any;
@@ -9,6 +9,7 @@ export default function DatePicker({ stayDates, onSubmit, close, min, max, avail
9
9
  singleDate: any;
10
10
  submitOnSelectionEnd: any;
11
11
  disableConfirmModal: any;
12
+ resetToBound: any;
12
13
  }): import("react/jsx-runtime").JSX.Element;
13
14
  import * as Data from "./data";
14
15
  import * as Utils from "./utils";
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/date-picker.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;4CAmDC;sBAzDqB,QAAQ;uBACP,SAAS"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/date-picker.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;4CAuDC;sBA7DqB,QAAQ;uBACP,SAAS"}
@@ -7,8 +7,8 @@ import * as Data from "./data";
7
7
  import * as Utils from "./utils";
8
8
  import styles from "./date-picker.module.css";
9
9
  export { Data, Utils };
10
- export default function DatePicker({ stayDates = [], onSubmit, close, min, max, availabilities, popup = true, singleDate, submitOnSelectionEnd, disableConfirmModal, }) {
11
- const [display, setDisplay] = React.useState(Data.DISPLAYS.DESKTOP);
10
+ export default function DatePicker({ stayDates = [], onSubmit, close, min, max, availabilities, popup = true, singleDate, submitOnSelectionEnd, disableConfirmModal, resetToBound, }) {
11
+ const [display, setDisplay] = React.useState();
12
12
  const { width: windowWidth } = useWindowSizes();
13
13
  React.useEffect(() => {
14
14
  if (windowWidth <= Data.BREAKPOINTS.PHONE) {
@@ -23,8 +23,10 @@ export default function DatePicker({ stayDates = [], onSubmit, close, min, max,
23
23
  setDisplay(Data.DISPLAYS.DESKTOP);
24
24
  }
25
25
  }, [windowWidth]);
26
+ if (display === undefined)
27
+ return null;
26
28
  const classes = classNames(styles.datePicker, {
27
29
  [styles.datePickerPopup]: popup,
28
30
  });
29
- return (_jsxs(_Fragment, { children: [popup && _jsx("div", { className: styles.backdrop, onClick: close }), _jsx("div", { className: classes, children: _jsx(Calendar, { display: display, stayDates: stayDates, min: min, max: max, onSubmit: onSubmit, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, availabilities: availabilities, disableConfirmModal: disableConfirmModal, close: close }) })] }));
31
+ return (_jsxs(_Fragment, { children: [popup && _jsx("div", { className: styles.backdrop, onClick: close }), _jsx("div", { className: classes, children: _jsx(Calendar, { display: display, stayDates: stayDates, min: min, max: max, onSubmit: onSubmit, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, availabilities: availabilities, disableConfirmModal: disableConfirmModal, close: close, resetToBound: resetToBound }) })] }));
30
32
  }
@@ -9,8 +9,7 @@ div.popup {
9
9
  display: grid;
10
10
  grid-template-columns: repeat(3, 1fr);
11
11
  background-color: var(--ds-grey-000, #fff);
12
- border-radius: var(--ds-radius-400, 20px);
13
- box-shadow: var(--ds-shadow-300, 0 8px 30px rgba(0, 0, 0, 0.12));
12
+ border-radius: inherit;
14
13
  }
15
14
 
16
15
  .datePickerPopup {
@@ -19,6 +18,8 @@ div.popup {
19
18
  left: 50%;
20
19
  transform: translate(-50%, -50%);
21
20
  z-index: 4;
21
+ border-radius: var(--ds-radius-400, 20px);
22
+ box-shadow: var(--ds-shadow-300, 0 8px 30px rgba(0, 0, 0, 0.12));
22
23
  animation: date-picker-appearance 160ms
23
24
  var(--ds-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
24
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.35.4",
3
+ "version": "1.35.6",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.5",
6
6
  "leaflet": "^1.9.1",