ublo-lib 1.35.18 → 1.35.19
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/calendar.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/calendar.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;4CAuQC"}
|
|
@@ -2,15 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { useUbloContext } from "ublo/with-ublo";
|
|
5
|
-
import
|
|
6
|
-
import Popup from "ublo-lib/es/common/components/popup";
|
|
7
|
-
import Helper from "./helper";
|
|
5
|
+
import Dialog from "dt-design-system/es/dialog";
|
|
8
6
|
import Button from "dt-design-system/es/button";
|
|
9
7
|
import * as Icons from "dt-design-system/es/icons";
|
|
8
|
+
import Month from "./month";
|
|
9
|
+
import Helper from "./helper";
|
|
10
10
|
import * as Messages from "./messages";
|
|
11
11
|
import * as Data from "./data";
|
|
12
12
|
import * as Utils from "./utils";
|
|
13
|
-
import datePickerStyles from "./date-picker.module.css";
|
|
14
13
|
import styles from "./calendar.module.css";
|
|
15
14
|
export default function Calendar({ date, display, stayDates = [], min, max, onSubmit, availabilities, close, singleDate, submitOnSelectionEnd, disableConfirmModal, defaultSelecting, }) {
|
|
16
15
|
const isDateObject = Utils.isDate(date);
|
|
@@ -116,12 +115,9 @@ export default function Calendar({ date, display, stayDates = [], min, max, onSu
|
|
|
116
115
|
[styles.calendarTouch]: hide2ndMonth,
|
|
117
116
|
[styles.calendarLoading]: isLoading,
|
|
118
117
|
});
|
|
119
|
-
return (_jsxs("div", { className: classes, children: [!singleDate && (_jsx(Helper, { lang: lang, selecting: selecting, selectedDates: selectedDates, availabilities: availabilities, isLoading: isLoading, error: error })), _jsxs("div", { className: styles.months, children: [_jsxs("div", { className: styles.controls, children: [_jsx(Button, { variant: "transparent", className: styles.control, onClick: gotoPreviousMonth, disabled: isPast, children: _jsx(Icons.ChevronLeft, {}) }), _jsx(Button, { variant: "transparent", className: styles.control, onClick: gotoNextMonth, children: _jsx(Icons.ChevronRight, {}) })] }), _jsx(Month, { display: display, month: month, year: year, min: min, max: max, selecting: selecting, setSelecting: setSelecting, selectedDates: selectedDates, setSelectedDates: setSelectedDates, firstSelectedDate: firstSelectedDate, setFirstSelectedDate: setFirstSelectedDate, lastSelectedDate: lastSelectedDate, setLastSelectedDate: setLastSelectedDate, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, onSubmit: submit, stays: stays, matchingStays: matchingStays, allMatchingStaysEnd: allMatchingStaysEnd }), !hide2ndMonth && (_jsx(Month, { display: display, month: monthAlt, year: yearAlt, min: min, max: max, selecting: selecting, setSelecting: setSelecting, selectedDates: selectedDates, setSelectedDates: setSelectedDates, firstSelectedDate: firstSelectedDate, setFirstSelectedDate: setFirstSelectedDate, lastSelectedDate: lastSelectedDate, setLastSelectedDate: setLastSelectedDate, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, onSubmit: submit, stays: stays, matchingStays: matchingStays, allMatchingStaysEnd: allMatchingStaysEnd }))] }), _jsxs("div", { className: styles.buttons, children: [_jsx(Button, { variant: "transparent", className: styles.close, onClick: close, children: Messages.get(lang, "close") }), showReset && (_jsx(Button, { variant: "link", className: styles.reset, onClick: reset, children: Messages.get(lang, "reset") })), _jsxs(Button, { className: styles.submit, onClick: () => submit(selectedDates), disabled: !submitEnabled, children: [_jsx(Icons.Check, {}), Messages.get(lang, "submit")] })] }), showPopup
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
function ConfirmDateChangeForm({ lang, cancel, confirm }) {
|
|
126
|
-
return (_jsxs("div", { className: styles.confirmDateChange, children: [_jsx("div", { className: styles.confirmDateChangeMessage, children: Messages.get(lang, "warning-date-change-text") }), _jsxs("div", { className: styles.confirmDateChangeButtons, children: [_jsx("button", { className: classNames(styles.confirmDateChangeButton, styles.confirmDateChangeButtonCancel), onClick: cancel, children: Messages.get(lang, "warning-date-change-cancel") }), _jsx("button", { className: classNames(styles.confirmDateChangeButton, styles.confirmDateChangeButtonConfirm), onClick: confirm, children: Messages.get(lang, "warning-date-change-confirm") })] })] }));
|
|
118
|
+
return (_jsxs("div", { className: classes, children: [!singleDate && (_jsx(Helper, { lang: lang, selecting: selecting, selectedDates: selectedDates, availabilities: availabilities, isLoading: isLoading, error: error })), _jsxs("div", { className: styles.months, children: [_jsxs("div", { className: styles.controls, children: [_jsx(Button, { variant: "transparent", className: styles.control, onClick: gotoPreviousMonth, disabled: isPast, children: _jsx(Icons.ChevronLeft, {}) }), _jsx(Button, { variant: "transparent", className: styles.control, onClick: gotoNextMonth, children: _jsx(Icons.ChevronRight, {}) })] }), _jsx(Month, { display: display, month: month, year: year, min: min, max: max, selecting: selecting, setSelecting: setSelecting, selectedDates: selectedDates, setSelectedDates: setSelectedDates, firstSelectedDate: firstSelectedDate, setFirstSelectedDate: setFirstSelectedDate, lastSelectedDate: lastSelectedDate, setLastSelectedDate: setLastSelectedDate, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, onSubmit: submit, stays: stays, matchingStays: matchingStays, allMatchingStaysEnd: allMatchingStaysEnd }), !hide2ndMonth && (_jsx(Month, { display: display, month: monthAlt, year: yearAlt, min: min, max: max, selecting: selecting, setSelecting: setSelecting, selectedDates: selectedDates, setSelectedDates: setSelectedDates, firstSelectedDate: firstSelectedDate, setFirstSelectedDate: setFirstSelectedDate, lastSelectedDate: lastSelectedDate, setLastSelectedDate: setLastSelectedDate, singleDate: singleDate, submitOnSelectionEnd: submitOnSelectionEnd, onSubmit: submit, stays: stays, matchingStays: matchingStays, allMatchingStaysEnd: allMatchingStaysEnd }))] }), _jsxs("div", { className: styles.buttons, children: [_jsx(Button, { variant: "transparent", className: styles.close, onClick: close, children: Messages.get(lang, "close") }), showReset && (_jsx(Button, { variant: "link", className: styles.reset, onClick: reset, children: Messages.get(lang, "reset") })), _jsxs(Button, { className: styles.submit, onClick: () => submit(selectedDates), disabled: !submitEnabled, children: [_jsx(Icons.Check, {}), Messages.get(lang, "submit")] })] }), _jsxs(Dialog, { isOpened: showPopup, className: styles.confirmDateChange, close: () => setShowPopup(false), children: [_jsx("div", { className: styles.confirmDateChangeTitle, children: Messages.get(lang, "warning-date-change-title") }), _jsx("div", { className: styles.confirmDateChangeMessage, children: Messages.get(lang, "warning-date-change-text") }), _jsxs("div", { className: styles.confirmDateChangeButtons, children: [_jsx("button", { className: classNames(styles.confirmDateChangeButton, styles.confirmDateChangeButtonCancel), onClick: () => setShowPopup(false), children: Messages.get(lang, "warning-date-change-cancel") }), _jsx("button", { className: classNames(styles.confirmDateChangeButton, styles.confirmDateChangeButtonConfirm), onClick: () => {
|
|
119
|
+
window.sessionStorage.removeItem("cartId");
|
|
120
|
+
submit(selectedDates);
|
|
121
|
+
setShowPopup(false);
|
|
122
|
+
}, children: Messages.get(lang, "warning-date-change-confirm") })] })] })] }));
|
|
127
123
|
}
|
|
@@ -81,9 +81,17 @@ button.close {
|
|
|
81
81
|
.confirmDateChange {
|
|
82
82
|
display: flex;
|
|
83
83
|
flex-direction: column;
|
|
84
|
+
padding: 14px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.confirmDateChangeTitle {
|
|
88
|
+
color: var(--ds-grey-900, #1d1d1d);
|
|
89
|
+
font-size: 22px;
|
|
90
|
+
font-weight: 700;
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
.confirmDateChangeMessage {
|
|
94
|
+
padding-top: 20px;
|
|
87
95
|
color: var(--ds-grey-700, #232324);
|
|
88
96
|
font-size: 13px;
|
|
89
97
|
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
div.popup {
|
|
2
|
-
z-index: 5;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.datePicker {
|
|
6
|
-
position: relative;
|
|
7
|
-
width: min-content;
|
|
8
|
-
max-width: 100%;
|
|
9
|
-
display: grid;
|
|
10
|
-
grid-template-columns: repeat(3, 1fr);
|
|
11
|
-
background-color: var(--ds-grey-000, #fff);
|
|
12
|
-
border-radius: inherit;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.datePickerPopup {
|
|
16
|
-
position: fixed;
|
|
17
|
-
top: 50%;
|
|
18
|
-
left: 50%;
|
|
19
|
-
transform: translate(-50%, -50%);
|
|
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));
|
|
23
|
-
animation: date-picker-appearance 160ms
|
|
24
|
-
var(--ds-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.backdrop {
|
|
28
|
-
position: fixed;
|
|
29
|
-
top: 0;
|
|
30
|
-
left: 0;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
34
|
-
backdrop-filter: blur(var(--ds-blur, 8px));
|
|
35
|
-
z-index: 3;
|
|
36
|
-
animation: date-picker-appearance 160ms
|
|
37
|
-
var(--ds-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@keyframes date-picker-appearance {
|
|
41
|
-
0% {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
}
|
|
44
|
-
}
|