@dialiq/calendar-component 1.1.0 → 1.1.1
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/dist/BookingDetailsModal.d.ts +11 -0
- package/dist/BookingDetailsModal.d.ts.map +1 -0
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/components/MonthView.d.ts.map +1 -1
- package/dist/components/TimeGrid.d.ts.map +1 -1
- package/dist/index.esm.js +73 -36
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +73 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Booking } from './types';
|
|
3
|
+
import './BookingDetailsModal.css';
|
|
4
|
+
interface BookingDetailsModalProps {
|
|
5
|
+
booking: Booking;
|
|
6
|
+
timezone: string;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const BookingDetailsModal: React.FC<BookingDetailsModalProps>;
|
|
10
|
+
export default BookingDetailsModal;
|
|
11
|
+
//# sourceMappingURL=BookingDetailsModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookingDetailsModal.d.ts","sourceRoot":"","sources":["../src/BookingDetailsModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,2BAA2B,CAAC;AAEnC,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAiH3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/Calendar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAW,MAAM,SAAS,CAAC;AAQjD,OAAO,gBAAgB,CAAC;AAIxB,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiOrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthView.d.ts","sourceRoot":"","sources":["../../src/components/MonthView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,cAAc;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"MonthView.d.ts","sourceRoot":"","sources":["../../src/components/MonthView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,cAAc;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAyFvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeGrid.d.ts","sourceRoot":"","sources":["../../src/components/TimeGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGxD,UAAU,aAAa;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;IAClC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"TimeGrid.d.ts","sourceRoot":"","sources":["../../src/components/TimeGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGxD,UAAU,aAAa;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;IAClC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA6RrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -7416,8 +7416,8 @@ function styleInject(css, ref) {
|
|
|
7416
7416
|
}
|
|
7417
7417
|
}
|
|
7418
7418
|
|
|
7419
|
-
var css_248z$
|
|
7420
|
-
styleInject(css_248z$
|
|
7419
|
+
var css_248z$2 = ".modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 1000;\r\n padding: 20px;\r\n}\r\n\r\n.modal-content {\r\n background: #ffffff;\r\n border-radius: 8px;\r\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);\r\n width: 100%;\r\n max-width: 500px;\r\n max-height: 90vh;\r\n overflow-y: auto;\r\n}\r\n\r\n.modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 20px;\r\n border-bottom: 1px solid #e9ecef;\r\n}\r\n\r\n.modal-header h3 {\r\n margin: 0;\r\n font-size: 20px;\r\n font-weight: 600;\r\n color: #212529;\r\n}\r\n\r\n.modal-close-btn {\r\n background: none;\r\n border: none;\r\n font-size: 32px;\r\n line-height: 1;\r\n color: #6c757d;\r\n cursor: pointer;\r\n padding: 0;\r\n width: 32px;\r\n height: 32px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n border-radius: 4px;\r\n transition: background-color 0.2s;\r\n}\r\n\r\n.modal-close-btn:hover {\r\n background: #e9ecef;\r\n color: #212529;\r\n}\r\n\r\n.modal-body {\r\n padding: 20px;\r\n}\r\n\r\n.modal-footer {\r\n display: flex;\r\n justify-content: flex-end;\r\n gap: 12px;\r\n padding: 20px;\r\n border-top: 1px solid #e9ecef;\r\n}\r\n\r\n.modal-error {\r\n background: #f8d7da;\r\n color: #842029;\r\n padding: 12px;\r\n border-radius: 4px;\r\n margin-bottom: 16px;\r\n font-size: 14px;\r\n}\r\n\r\n.form-group {\r\n margin-bottom: 16px;\r\n}\r\n\r\n.form-group label {\r\n display: block;\r\n font-weight: 500;\r\n font-size: 14px;\r\n color: #212529;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.form-group input,\r\n.form-group textarea {\r\n width: 100%;\r\n padding: 10px 12px;\r\n border: 1px solid #ced4da;\r\n border-radius: 4px;\r\n font-size: 14px;\r\n font-family: inherit;\r\n color: #212529;\r\n transition: border-color 0.2s;\r\n box-sizing: border-box;\r\n}\r\n\r\n.form-group input:focus,\r\n.form-group textarea:focus {\r\n outline: none;\r\n border-color: #0d6efd;\r\n box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);\r\n}\r\n\r\n.form-group textarea {\r\n resize: vertical;\r\n}\r\n\r\n.form-group small {\r\n display: block;\r\n margin-top: 4px;\r\n font-size: 12px;\r\n color: #6c757d;\r\n}\r\n\r\n.form-row {\r\n display: grid;\r\n grid-template-columns: 1fr 1fr;\r\n gap: 12px;\r\n}\r\n\r\n.modal-btn {\r\n padding: 10px 20px;\r\n border: none;\r\n border-radius: 4px;\r\n font-size: 14px;\r\n font-weight: 500;\r\n cursor: pointer;\r\n transition: all 0.2s;\r\n}\r\n\r\n.modal-btn:disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n\r\n.modal-btn-primary {\r\n background: #0d6efd;\r\n color: #ffffff;\r\n}\r\n\r\n.modal-btn-primary:hover:not(:disabled) {\r\n background: #0b5ed7;\r\n}\r\n\r\n.modal-btn-secondary {\r\n background: #6c757d;\r\n color: #ffffff;\r\n}\r\n\r\n.modal-btn-secondary:hover:not(:disabled) {\r\n background: #5c636a;\r\n}\r\n\r\n@media (max-width: 576px) {\r\n .modal-content {\r\n max-width: 100%;\r\n }\r\n\r\n .form-row {\r\n grid-template-columns: 1fr;\r\n }\r\n}\r\n";
|
|
7420
|
+
styleInject(css_248z$2);
|
|
7421
7421
|
|
|
7422
7422
|
const CreateBookingModal = ({ businessId, apiBaseUrl, initialDate, participants: defaultParticipants, onClose, onBookingCreated, timezone = moment$1.tz.guess(), businessHours, }) => {
|
|
7423
7423
|
const [title, setTitle] = useState('');
|
|
@@ -7529,6 +7529,62 @@ const CreateBookingModal = ({ businessId, apiBaseUrl, initialDate, participants:
|
|
|
7529
7529
|
React.createElement("button", { type: "submit", className: "modal-btn modal-btn-primary", disabled: loading }, loading ? 'Creating...' : 'Create Booking'))))));
|
|
7530
7530
|
};
|
|
7531
7531
|
|
|
7532
|
+
var css_248z$1 = "/* BookingDetailsModal - extends base modal styles from CreateBookingModal.css */\r\n\r\n.booking-details-modal {\r\n max-width: 500px;\r\n}\r\n\r\n.detail-section {\r\n padding: 12px 0;\r\n border-bottom: 1px solid #e9ecef;\r\n}\r\n\r\n.detail-section:last-child {\r\n border-bottom: none;\r\n}\r\n\r\n.detail-row {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n margin-bottom: 8px;\r\n}\r\n\r\n.detail-row:last-child {\r\n margin-bottom: 0;\r\n}\r\n\r\n.detail-row.full-width {\r\n flex-direction: column;\r\n}\r\n\r\n.detail-label {\r\n font-weight: 500;\r\n color: #6c757d;\r\n font-size: 14px;\r\n min-width: 100px;\r\n}\r\n\r\n.detail-label-muted {\r\n color: #adb5bd;\r\n font-size: 12px;\r\n}\r\n\r\n.detail-value {\r\n font-weight: 500;\r\n color: #212529;\r\n font-size: 14px;\r\n text-align: right;\r\n}\r\n\r\n.detail-value-muted {\r\n color: #adb5bd;\r\n font-size: 12px;\r\n font-family: monospace;\r\n}\r\n\r\n.detail-description {\r\n margin: 8px 0 0 0;\r\n color: #495057;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n white-space: pre-wrap;\r\n}\r\n\r\n.participants-list {\r\n margin: 8px 0 0 0;\r\n padding-left: 20px;\r\n list-style-type: disc;\r\n}\r\n\r\n.participant-item {\r\n color: #495057;\r\n font-size: 14px;\r\n margin-bottom: 4px;\r\n}\r\n\r\n@media (max-width: 576px) {\r\n .booking-details-modal {\r\n max-width: 100%;\r\n }\r\n\r\n .detail-row {\r\n flex-direction: column;\r\n gap: 4px;\r\n }\r\n\r\n .detail-value {\r\n text-align: left;\r\n }\r\n}\r\n";
|
|
7533
|
+
styleInject(css_248z$1);
|
|
7534
|
+
|
|
7535
|
+
const BookingDetailsModal = ({ booking, timezone, onClose, }) => {
|
|
7536
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7537
|
+
const startMoment = moment$1(booking.start).tz(timezone);
|
|
7538
|
+
const endMoment = moment$1(booking.end).tz(timezone);
|
|
7539
|
+
const durationMinutes = endMoment.diff(startMoment, 'minutes');
|
|
7540
|
+
return (React.createElement("div", { className: "modal-overlay", onClick: onClose },
|
|
7541
|
+
React.createElement("div", { className: "modal-content booking-details-modal", onClick: (e) => e.stopPropagation() },
|
|
7542
|
+
React.createElement("div", { className: "modal-header" },
|
|
7543
|
+
React.createElement("h3", null, ((_a = booking.metadata) === null || _a === void 0 ? void 0 : _a.title) || 'Untitled Booking'),
|
|
7544
|
+
React.createElement("button", { className: "modal-close-btn", onClick: onClose }, "\u00D7")),
|
|
7545
|
+
React.createElement("div", { className: "modal-body" },
|
|
7546
|
+
React.createElement("div", { className: "detail-section" },
|
|
7547
|
+
React.createElement("div", { className: "detail-row" },
|
|
7548
|
+
React.createElement("span", { className: "detail-label" }, "Date:"),
|
|
7549
|
+
React.createElement("span", { className: "detail-value" }, startMoment.format('dddd, MMMM D, YYYY'))),
|
|
7550
|
+
React.createElement("div", { className: "detail-row" },
|
|
7551
|
+
React.createElement("span", { className: "detail-label" }, "Time:"),
|
|
7552
|
+
React.createElement("span", { className: "detail-value" },
|
|
7553
|
+
startMoment.format('h:mm A'),
|
|
7554
|
+
" - ",
|
|
7555
|
+
endMoment.format('h:mm A'))),
|
|
7556
|
+
React.createElement("div", { className: "detail-row" },
|
|
7557
|
+
React.createElement("span", { className: "detail-label" }, "Duration:"),
|
|
7558
|
+
React.createElement("span", { className: "detail-value" }, durationMinutes >= 60
|
|
7559
|
+
? `${Math.floor(durationMinutes / 60)}h ${durationMinutes % 60}m`
|
|
7560
|
+
: `${durationMinutes} minutes`))),
|
|
7561
|
+
((_b = booking.metadata) === null || _b === void 0 ? void 0 : _b.description) && (React.createElement("div", { className: "detail-section" },
|
|
7562
|
+
React.createElement("div", { className: "detail-row full-width" },
|
|
7563
|
+
React.createElement("span", { className: "detail-label" }, "Description:"),
|
|
7564
|
+
React.createElement("p", { className: "detail-description" }, booking.metadata.description)))),
|
|
7565
|
+
((booking.staff || ((_c = booking.metadata) === null || _c === void 0 ? void 0 : _c.staff)) || (booking.room || ((_d = booking.metadata) === null || _d === void 0 ? void 0 : _d.room))) && (React.createElement("div", { className: "detail-section" },
|
|
7566
|
+
(booking.staff || ((_e = booking.metadata) === null || _e === void 0 ? void 0 : _e.staff)) && (React.createElement("div", { className: "detail-row" },
|
|
7567
|
+
React.createElement("span", { className: "detail-label" }, "Staff:"),
|
|
7568
|
+
React.createElement("span", { className: "detail-value" }, booking.staff || ((_f = booking.metadata) === null || _f === void 0 ? void 0 : _f.staff)))),
|
|
7569
|
+
(booking.room || ((_g = booking.metadata) === null || _g === void 0 ? void 0 : _g.room)) && (React.createElement("div", { className: "detail-row" },
|
|
7570
|
+
React.createElement("span", { className: "detail-label" }, "Room:"),
|
|
7571
|
+
React.createElement("span", { className: "detail-value" }, booking.room || ((_h = booking.metadata) === null || _h === void 0 ? void 0 : _h.room)))))),
|
|
7572
|
+
booking.participants && booking.participants.length > 0 && (React.createElement("div", { className: "detail-section" },
|
|
7573
|
+
React.createElement("div", { className: "detail-row full-width" },
|
|
7574
|
+
React.createElement("span", { className: "detail-label" }, "Participants:"),
|
|
7575
|
+
React.createElement("ul", { className: "participants-list" }, booking.participants.map((participant, index) => (React.createElement("li", { key: index, className: "participant-item" }, participant))))))),
|
|
7576
|
+
((_j = booking.metadata) === null || _j === void 0 ? void 0 : _j.organizer) && (React.createElement("div", { className: "detail-section" },
|
|
7577
|
+
React.createElement("div", { className: "detail-row" },
|
|
7578
|
+
React.createElement("span", { className: "detail-label" }, "Organizer:"),
|
|
7579
|
+
React.createElement("span", { className: "detail-value" }, booking.metadata.organizer)))),
|
|
7580
|
+
React.createElement("div", { className: "detail-section" },
|
|
7581
|
+
React.createElement("div", { className: "detail-row" },
|
|
7582
|
+
React.createElement("span", { className: "detail-label detail-label-muted" }, "Meeting ID:"),
|
|
7583
|
+
React.createElement("span", { className: "detail-value detail-value-muted" }, booking.meeting_id)))),
|
|
7584
|
+
React.createElement("div", { className: "modal-footer" },
|
|
7585
|
+
React.createElement("button", { className: "modal-btn modal-btn-secondary", onClick: onClose }, "Close")))));
|
|
7586
|
+
};
|
|
7587
|
+
|
|
7532
7588
|
const getWeekDays = (currentDate, view, businessHours) => {
|
|
7533
7589
|
const startOfWeek = currentDate.clone().startOf('week');
|
|
7534
7590
|
const days = [];
|
|
@@ -7848,7 +7904,7 @@ const TimeGrid = ({ currentDate, view, bookings, timezone, onBookingClick, onTim
|
|
|
7848
7904
|
visibleBookings
|
|
7849
7905
|
.filter(b => moment$1(b.start).tz(timezone).isSame(day, 'day'))
|
|
7850
7906
|
.map(booking => {
|
|
7851
|
-
var _a
|
|
7907
|
+
var _a;
|
|
7852
7908
|
const pos = dayPositions.get(booking.meeting_id);
|
|
7853
7909
|
if (!pos)
|
|
7854
7910
|
return null;
|
|
@@ -7868,21 +7924,7 @@ const TimeGrid = ({ currentDate, view, bookings, timezone, onBookingClick, onTim
|
|
|
7868
7924
|
React.createElement("div", { className: "event-time" },
|
|
7869
7925
|
moment$1(booking.start).tz(timezone).format('h:mm A'),
|
|
7870
7926
|
" - ",
|
|
7871
|
-
moment$1(booking.end).tz(timezone).format('h:mm A')))
|
|
7872
|
-
React.createElement("div", { className: "event-tooltip" },
|
|
7873
|
-
React.createElement("div", { className: "tooltip-title" }, ((_b = booking.metadata) === null || _b === void 0 ? void 0 : _b.title) || 'Untitled'),
|
|
7874
|
-
React.createElement("div", { className: "tooltip-row" },
|
|
7875
|
-
React.createElement("span", { className: "tooltip-label" }, "Time:"),
|
|
7876
|
-
React.createElement("span", { className: "tooltip-value" },
|
|
7877
|
-
moment$1(booking.start).tz(timezone).format('h:mm A'),
|
|
7878
|
-
" - ",
|
|
7879
|
-
moment$1(booking.end).tz(timezone).format('h:mm A'))),
|
|
7880
|
-
(booking.staff || ((_c = booking.metadata) === null || _c === void 0 ? void 0 : _c.staff)) && (React.createElement("div", { className: "tooltip-row" },
|
|
7881
|
-
React.createElement("span", { className: "tooltip-label" }, "Staff:"),
|
|
7882
|
-
React.createElement("span", { className: "tooltip-value" }, booking.staff || ((_d = booking.metadata) === null || _d === void 0 ? void 0 : _d.staff)))),
|
|
7883
|
-
(booking.room || ((_e = booking.metadata) === null || _e === void 0 ? void 0 : _e.room)) && (React.createElement("div", { className: "tooltip-row" },
|
|
7884
|
-
React.createElement("span", { className: "tooltip-label" }, "Room:"),
|
|
7885
|
-
React.createElement("span", { className: "tooltip-value" }, booking.room || ((_f = booking.metadata) === null || _f === void 0 ? void 0 : _f.room)))))));
|
|
7927
|
+
moment$1(booking.end).tz(timezone).format('h:mm A')))));
|
|
7886
7928
|
})));
|
|
7887
7929
|
})))));
|
|
7888
7930
|
};
|
|
@@ -7910,7 +7952,7 @@ const MonthView = ({ currentDate, bookings, timezone, onBookingClick, onDateClic
|
|
|
7910
7952
|
isClosed && React.createElement("span", { className: "calendar-closed-label-small" }, "Closed")),
|
|
7911
7953
|
React.createElement("div", { className: "calendar-cell-bookings" },
|
|
7912
7954
|
dayBookings.slice(0, 3).map((booking) => {
|
|
7913
|
-
var _a
|
|
7955
|
+
var _a;
|
|
7914
7956
|
return (React.createElement("div", { key: booking.meeting_id, className: `calendar-booking ${booking.className || ''}`, onClick: (e) => {
|
|
7915
7957
|
e.stopPropagation();
|
|
7916
7958
|
if (onBookingClick) {
|
|
@@ -7918,21 +7960,7 @@ const MonthView = ({ currentDate, bookings, timezone, onBookingClick, onDateClic
|
|
|
7918
7960
|
}
|
|
7919
7961
|
} },
|
|
7920
7962
|
React.createElement("span", { className: "calendar-booking-time" }, moment$1(booking.start).tz(timezone).format('HH:mm')),
|
|
7921
|
-
React.createElement("span", { className: "calendar-booking-title" }, ((_a = booking.metadata) === null || _a === void 0 ? void 0 : _a.title) || 'Untitled')
|
|
7922
|
-
React.createElement("div", { className: "event-tooltip" },
|
|
7923
|
-
React.createElement("div", { className: "tooltip-title" }, ((_b = booking.metadata) === null || _b === void 0 ? void 0 : _b.title) || 'Untitled'),
|
|
7924
|
-
React.createElement("div", { className: "tooltip-row" },
|
|
7925
|
-
React.createElement("span", { className: "tooltip-label" }, "Time:"),
|
|
7926
|
-
React.createElement("span", { className: "tooltip-value" },
|
|
7927
|
-
moment$1(booking.start).tz(timezone).format('h:mm A'),
|
|
7928
|
-
" - ",
|
|
7929
|
-
moment$1(booking.end).tz(timezone).format('h:mm A'))),
|
|
7930
|
-
(booking.staff || ((_c = booking.metadata) === null || _c === void 0 ? void 0 : _c.staff)) && (React.createElement("div", { className: "tooltip-row" },
|
|
7931
|
-
React.createElement("span", { className: "tooltip-label" }, "Staff:"),
|
|
7932
|
-
React.createElement("span", { className: "tooltip-value" }, booking.staff || ((_d = booking.metadata) === null || _d === void 0 ? void 0 : _d.staff)))),
|
|
7933
|
-
(booking.room || ((_e = booking.metadata) === null || _e === void 0 ? void 0 : _e.room)) && (React.createElement("div", { className: "tooltip-row" },
|
|
7934
|
-
React.createElement("span", { className: "tooltip-label" }, "Room:"),
|
|
7935
|
-
React.createElement("span", { className: "tooltip-value" }, booking.room || ((_f = booking.metadata) === null || _f === void 0 ? void 0 : _f.room)))))));
|
|
7963
|
+
React.createElement("span", { className: "calendar-booking-title" }, ((_a = booking.metadata) === null || _a === void 0 ? void 0 : _a.title) || 'Untitled')));
|
|
7936
7964
|
}),
|
|
7937
7965
|
dayBookings.length > 3 && (React.createElement("div", { className: "calendar-booking-more" },
|
|
7938
7966
|
"+",
|
|
@@ -7959,6 +7987,7 @@ const Calendar = ({ businessId, resourceId, title = 'Calendar', apiBaseUrl, defa
|
|
|
7959
7987
|
const [error, setError] = useState(null);
|
|
7960
7988
|
const [showCreateModal, setShowCreateModal] = useState(false);
|
|
7961
7989
|
const [selectedDate, setSelectedDate] = useState(null);
|
|
7990
|
+
const [selectedBooking, setSelectedBooking] = useState(null);
|
|
7962
7991
|
// Mobile responsiveness logic
|
|
7963
7992
|
useEffect(() => {
|
|
7964
7993
|
const handleResize = () => {
|
|
@@ -8060,6 +8089,13 @@ const Calendar = ({ businessId, resourceId, title = 'Calendar', apiBaseUrl, defa
|
|
|
8060
8089
|
onBookingCreate(booking);
|
|
8061
8090
|
}
|
|
8062
8091
|
});
|
|
8092
|
+
const handleInternalBookingClick = (booking) => {
|
|
8093
|
+
setSelectedBooking(booking);
|
|
8094
|
+
// Also call the external callback if provided
|
|
8095
|
+
if (onBookingClick) {
|
|
8096
|
+
onBookingClick(booking);
|
|
8097
|
+
}
|
|
8098
|
+
};
|
|
8063
8099
|
const getHeaderDateFormat = () => {
|
|
8064
8100
|
const current = moment$1(currentDate).tz(timezone);
|
|
8065
8101
|
if (currentView === 'month') {
|
|
@@ -8081,8 +8117,9 @@ const Calendar = ({ businessId, resourceId, title = 'Calendar', apiBaseUrl, defa
|
|
|
8081
8117
|
}, dateRangeText: getHeaderDateFormat() }),
|
|
8082
8118
|
error && React.createElement("div", { className: "calendar-error" }, error),
|
|
8083
8119
|
loading && React.createElement("div", { className: "calendar-loading" }, "Loading..."),
|
|
8084
|
-
React.createElement("div", { className: "calendar-content" }, currentView === 'month' ? (React.createElement(MonthView, { currentDate: currentDate, bookings: bookings, timezone: timezone, onBookingClick:
|
|
8085
|
-
showCreateModal && selectedDate && (React.createElement(CreateBookingModal, { businessId: businessId, apiBaseUrl: apiBaseUrl, initialDate: selectedDate, participants: participants, onClose: () => setShowCreateModal(false), onBookingCreated: handleBookingCreated, timezone: timezone, businessHours: businessHours }))
|
|
8120
|
+
React.createElement("div", { className: "calendar-content" }, currentView === 'month' ? (React.createElement(MonthView, { currentDate: currentDate, bookings: bookings, timezone: timezone, onBookingClick: handleInternalBookingClick, onDateClick: handleDateClick, businessHours: businessHours })) : (React.createElement(TimeGrid, { currentDate: currentDate, view: currentView, bookings: bookings, timezone: timezone, onBookingClick: handleInternalBookingClick, onTimeSlotClick: handleDateClick, businessHours: businessHours }))),
|
|
8121
|
+
showCreateModal && selectedDate && (React.createElement(CreateBookingModal, { businessId: businessId, apiBaseUrl: apiBaseUrl, initialDate: selectedDate, participants: participants, onClose: () => setShowCreateModal(false), onBookingCreated: handleBookingCreated, timezone: timezone, businessHours: businessHours })),
|
|
8122
|
+
selectedBooking && (React.createElement(BookingDetailsModal, { booking: selectedBooking, timezone: timezone, onClose: () => setSelectedBooking(null) }))));
|
|
8086
8123
|
};
|
|
8087
8124
|
|
|
8088
8125
|
export { Calendar, createBooking, getAllBookings, getMeetingDetails, getResourceSchedule };
|