mozrest-sdk-react-dev 0.2.54 → 0.2.55

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/mozrest-sdk.es.js CHANGED
@@ -6455,6 +6455,7 @@ const OPTIN = "Opt-in";
6455
6455
  const BOOKINGCHANNEL = "Booking channel";
6456
6456
  const CONFIRMATIONTEXT = "Are you sure you want to do this action?";
6457
6457
  const pleaseCheckFormsErrors = "Please check the form for errors";
6458
+ const NO_RESERVATIONS = "No reservations";
6458
6459
  var en = {
6459
6460
  errors,
6460
6461
  SPECIALCLOSINGDATES,
@@ -6796,7 +6797,8 @@ var en = {
6796
6797
  OPTIN,
6797
6798
  BOOKINGCHANNEL,
6798
6799
  CONFIRMATIONTEXT,
6799
- pleaseCheckFormsErrors
6800
+ pleaseCheckFormsErrors,
6801
+ NO_RESERVATIONS
6800
6802
  };
6801
6803
  instance.use(initReactI18next).init({
6802
6804
  resources: {
@@ -35856,7 +35858,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
35856
35858
  }
35857
35859
  }, {
35858
35860
  key: "injectStyles",
35859
- value: function injectStyles() {
35861
+ value: function injectStyles2() {
35860
35862
  var tooltipRef = this.tooltipRef;
35861
35863
  if (!tooltipRef) {
35862
35864
  return;
@@ -91932,7 +91934,7 @@ const SelectedDateDisplay = ({ initialDate, selectedDate, onSelectDate, datesSum
91932
91934
  style: { marginLeft: 10, marginRight: 10 }
91933
91935
  }, "No date selected"));
91934
91936
  };
91935
- const CustomDatePicker = ({
91937
+ const CustomDatePicker$1 = ({
91936
91938
  onSelectDate,
91937
91939
  onOpenHoursAvailability,
91938
91940
  bookingSumary,
@@ -92508,6 +92510,8 @@ const GetCreateBookingSelectsData = async ({
92508
92510
  includeAreaInTables = false,
92509
92511
  includeCoversInTables = false
92510
92512
  }) => {
92513
+ if (!venue_id)
92514
+ return;
92511
92515
  const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
92512
92516
  const responseAreas = await instance$1.get(`/v1/rms/venues/${venue_id}/areas`);
92513
92517
  const responseHours = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours`);
@@ -94950,7 +94954,7 @@ const ReservationDashboard = ({
94950
94954
  className: styles$q.header
94951
94955
  }, /* @__PURE__ */ React__default.createElement("h1", null, "RESERVATION DASHBOARD"), /* @__PURE__ */ React__default.createElement("h1", null, /* @__PURE__ */ React__default.createElement(CurrentTime, null))), /* @__PURE__ */ React__default.createElement("div", {
94952
94956
  className: styles$q.datesSectionContainer
94953
- }, /* @__PURE__ */ React__default.createElement(CustomDatePicker, {
94957
+ }, /* @__PURE__ */ React__default.createElement(CustomDatePicker$1, {
94954
94958
  onSelectDate: (d2) => handleOnSelectDate(d2),
94955
94959
  onOpenHoursAvailability,
94956
94960
  bookingSumary,
@@ -102407,33 +102411,34 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
102407
102411
  totalDays
102408
102412
  }));
102409
102413
  };
102410
- const mainConatiner = "_mainConatiner_ncjgq_42";
102411
- const mainTableContainer = "_mainTableContainer_ncjgq_52";
102412
- const mainSidebarContainer = "_mainSidebarContainer_ncjgq_59";
102413
- const headerContainer = "_headerContainer_ncjgq_68";
102414
- const buttonList = "_buttonList_ncjgq_73";
102415
- const tableTopHeader = "_tableTopHeader_ncjgq_79";
102416
- const tableTopHeaderContent = "_tableTopHeaderContent_ncjgq_87";
102417
- const tableRowContainer = "_tableRowContainer_ncjgq_95";
102418
- const tableRowCard = "_tableRowCard_ncjgq_101";
102419
- const tableRowHour = "_tableRowHour_ncjgq_105";
102420
- const hours = "_hours_ncjgq_116";
102421
- const tableRowContent = "_tableRowContent_ncjgq_122";
102422
- const rowImage = "_rowImage_ncjgq_129";
102423
- const rowContactContainer = "_rowContactContainer_ncjgq_135";
102424
- const rowContactText = "_rowContactText_ncjgq_141";
102425
- const rowContactPhone = "_rowContactPhone_ncjgq_147";
102426
- const rowSectionContainer = "_rowSectionContainer_ncjgq_154";
102427
- const rowSectionText = "_rowSectionText_ncjgq_160";
102428
- const rowSectionSecText = "_rowSectionSecText_ncjgq_166";
102429
- const rowActionButton = "_rowActionButton_ncjgq_173";
102430
- const bookingInfoContainer = "_bookingInfoContainer_ncjgq_179";
102431
- const bookingInfoCardRow = "_bookingInfoCardRow_ncjgq_183";
102432
- const bookingInfoCardContainer = "_bookingInfoCardContainer_ncjgq_191";
102433
- const bookingInfoCard = "_bookingInfoCard_ncjgq_183";
102434
- const bookingInfoCardContent = "_bookingInfoCardContent_ncjgq_203";
102435
- const bookingInfoCardTitle = "_bookingInfoCardTitle_ncjgq_209";
102436
- const bookingInfoCardText = "_bookingInfoCardText_ncjgq_212";
102414
+ const mainConatiner = "_mainConatiner_oexkd_48";
102415
+ const mainTableContainer = "_mainTableContainer_oexkd_58";
102416
+ const mainSidebarContainer = "_mainSidebarContainer_oexkd_65";
102417
+ const headerContainer = "_headerContainer_oexkd_74";
102418
+ const buttonList = "_buttonList_oexkd_79";
102419
+ const tableTopHeader = "_tableTopHeader_oexkd_85";
102420
+ const tableTopHeaderContent = "_tableTopHeaderContent_oexkd_93";
102421
+ const tableRowContainer = "_tableRowContainer_oexkd_101";
102422
+ const tableRowCard = "_tableRowCard_oexkd_107";
102423
+ const noData = "_noData_oexkd_112";
102424
+ const tableRowHour = "_tableRowHour_oexkd_119";
102425
+ const hours = "_hours_oexkd_130";
102426
+ const tableRowContent = "_tableRowContent_oexkd_136";
102427
+ const rowImage = "_rowImage_oexkd_143";
102428
+ const rowContactContainer = "_rowContactContainer_oexkd_149";
102429
+ const rowContactText = "_rowContactText_oexkd_155";
102430
+ const rowContactPhone = "_rowContactPhone_oexkd_161";
102431
+ const rowSectionContainer = "_rowSectionContainer_oexkd_168";
102432
+ const rowSectionText = "_rowSectionText_oexkd_174";
102433
+ const rowSectionSecText = "_rowSectionSecText_oexkd_180";
102434
+ const rowActionButton = "_rowActionButton_oexkd_187";
102435
+ const bookingInfoContainer = "_bookingInfoContainer_oexkd_193";
102436
+ const bookingInfoCardRow = "_bookingInfoCardRow_oexkd_197";
102437
+ const bookingInfoCardContainer = "_bookingInfoCardContainer_oexkd_205";
102438
+ const bookingInfoCard = "_bookingInfoCard_oexkd_197";
102439
+ const bookingInfoCardContent = "_bookingInfoCardContent_oexkd_217";
102440
+ const bookingInfoCardTitle = "_bookingInfoCardTitle_oexkd_223";
102441
+ const bookingInfoCardText = "_bookingInfoCardText_oexkd_226";
102437
102442
  var styles$c = {
102438
102443
  mainConatiner,
102439
102444
  mainTableContainer,
@@ -102444,6 +102449,7 @@ var styles$c = {
102444
102449
  tableTopHeaderContent,
102445
102450
  tableRowContainer,
102446
102451
  tableRowCard,
102452
+ noData,
102447
102453
  tableRowHour,
102448
102454
  hours,
102449
102455
  tableRowContent,
@@ -102475,9 +102481,9 @@ const TrashX = () => /* @__PURE__ */ React.createElement("svg", {
102475
102481
  }), /* @__PURE__ */ React.createElement("path", {
102476
102482
  fill: "none",
102477
102483
  stroke: "currentColor",
102478
- "stroke-linecap": "round",
102479
- "stroke-linejoin": "round",
102480
- "stroke-width": "2",
102484
+ strokeLinecap: "round",
102485
+ strokeLinejoin: "round",
102486
+ strokeWidth: "2",
102481
102487
  d: "M4 7h16M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3m-5 5l4 4m0-4l-4 4"
102482
102488
  }));
102483
102489
  const EyeOff = () => /* @__PURE__ */ React.createElement("svg", {
@@ -102492,9 +102498,9 @@ const EyeOff = () => /* @__PURE__ */ React.createElement("svg", {
102492
102498
  }), /* @__PURE__ */ React.createElement("g", {
102493
102499
  fill: "none",
102494
102500
  stroke: "currentColor",
102495
- "stroke-linecap": "round",
102496
- "stroke-linejoin": "round",
102497
- "stroke-width": "2"
102501
+ strokeLinecap: "round",
102502
+ strokeLinejoin: "round",
102503
+ strokeWidth: "2"
102498
102504
  }, /* @__PURE__ */ React.createElement("path", {
102499
102505
  d: "M10.585 10.587a2 2 0 0 0 2.829 2.828"
102500
102506
  }), /* @__PURE__ */ React.createElement("path", {
@@ -102508,9 +102514,9 @@ const CalendarTime = () => /* @__PURE__ */ React.createElement("svg", {
102508
102514
  }, /* @__PURE__ */ React.createElement("g", {
102509
102515
  fill: "none",
102510
102516
  stroke: "currentColor",
102511
- "stroke-linecap": "round",
102512
- "stroke-linejoin": "round",
102513
- "stroke-width": "2"
102517
+ strokeLinecap: "round",
102518
+ strokeLinejoin: "round",
102519
+ strokeWidth: "2"
102514
102520
  }, /* @__PURE__ */ React.createElement("path", {
102515
102521
  d: "M11.795 21H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4"
102516
102522
  }), /* @__PURE__ */ React.createElement("path", {
@@ -102526,9 +102532,9 @@ const CheckBox = () => /* @__PURE__ */ React.createElement("svg", {
102526
102532
  }, /* @__PURE__ */ React.createElement("g", {
102527
102533
  fill: "none",
102528
102534
  stroke: "currentColor",
102529
- "stroke-linecap": "round",
102530
- "stroke-linejoin": "round",
102531
- "stroke-width": "2"
102535
+ strokeLinecap: "round",
102536
+ strokeLinejoin: "round",
102537
+ strokeWidth: "2"
102532
102538
  }, /* @__PURE__ */ React.createElement("path", {
102533
102539
  d: "m9 11l3 3l8-8"
102534
102540
  }), /* @__PURE__ */ React.createElement("path", {
@@ -102542,9 +102548,9 @@ const FidgetSpinner = () => /* @__PURE__ */ React.createElement("svg", {
102542
102548
  }, /* @__PURE__ */ React.createElement("path", {
102543
102549
  fill: "none",
102544
102550
  stroke: "currentColor",
102545
- "stroke-linecap": "round",
102546
- "stroke-linejoin": "round",
102547
- "stroke-width": "2",
102551
+ strokeLinecap: "round",
102552
+ strokeLinejoin: "round",
102553
+ strokeWidth: "2",
102548
102554
  d: "M18 16v.01M6 16v.01M12 5v.01M12 12v.01M12 1a4 4 0 0 1 2.001 7.464l.001.072a4 4 0 0 1 1.987 3.758l.22.128a4 4 0 0 1 1.591-.417L18 12a4 4 0 1 1-3.994 3.77l-.28-.16c-.522.25-1.108.39-1.726.39c-.619 0-1.205-.14-1.728-.391l-.279.16L10 16a4 4 0 1 1-2.212-3.579l.222-.129a4 4 0 0 1 1.988-3.756L10 8.465A4 4 0 0 1 8.005 5.2L8 5a4 4 0 0 1 4-4"
102549
102555
  }));
102550
102556
  const Scale = () => /* @__PURE__ */ React.createElement("svg", {
@@ -102555,9 +102561,9 @@ const Scale = () => /* @__PURE__ */ React.createElement("svg", {
102555
102561
  }, /* @__PURE__ */ React.createElement("path", {
102556
102562
  fill: "none",
102557
102563
  stroke: "currentColor",
102558
- "stroke-linecap": "round",
102559
- "stroke-linejoin": "round",
102560
- "stroke-width": "2",
102564
+ strokeLinecap: "round",
102565
+ strokeLinejoin: "round",
102566
+ strokeWidth: "2",
102561
102567
  d: "M7 20h10M6 6l6-1l6 1m-6-3v17m-3-8L6 6l-3 6a3 3 0 0 0 6 0m12 0l-3-6l-3 6a3 3 0 0 0 6 0"
102562
102568
  }));
102563
102569
  const armChair = () => /* @__PURE__ */ React.createElement("svg", {
@@ -102568,9 +102574,9 @@ const armChair = () => /* @__PURE__ */ React.createElement("svg", {
102568
102574
  }, /* @__PURE__ */ React.createElement("g", {
102569
102575
  fill: "none",
102570
102576
  stroke: "currentColor",
102571
- "stroke-linecap": "round",
102572
- "stroke-linejoin": "round",
102573
- "stroke-width": "2"
102577
+ strokeLinecap: "round",
102578
+ strokeLinejoin: "round",
102579
+ strokeWidth: "2"
102574
102580
  }, /* @__PURE__ */ React.createElement("path", {
102575
102581
  d: "M5 11a2 2 0 0 1 2 2v2h10v-2a2 2 0 1 1 4 0v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2"
102576
102582
  }), /* @__PURE__ */ React.createElement("path", {
@@ -102584,9 +102590,9 @@ const Login = () => /* @__PURE__ */ React.createElement("svg", {
102584
102590
  }, /* @__PURE__ */ React.createElement("g", {
102585
102591
  fill: "none",
102586
102592
  stroke: "currentColor",
102587
- "stroke-linecap": "round",
102588
- "stroke-linejoin": "round",
102589
- "stroke-width": "2"
102593
+ strokeLinecap: "round",
102594
+ strokeLinejoin: "round",
102595
+ strokeWidth: "2"
102590
102596
  }, /* @__PURE__ */ React.createElement("path", {
102591
102597
  d: "M15 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2"
102592
102598
  }), /* @__PURE__ */ React.createElement("path", {
@@ -102600,9 +102606,9 @@ const Logout2 = () => /* @__PURE__ */ React.createElement("svg", {
102600
102606
  }, /* @__PURE__ */ React.createElement("g", {
102601
102607
  fill: "none",
102602
102608
  stroke: "currentColor",
102603
- "stroke-linecap": "round",
102604
- "stroke-linejoin": "round",
102605
- "stroke-width": "2"
102609
+ strokeLinecap: "round",
102610
+ strokeLinejoin: "round",
102611
+ strokeWidth: "2"
102606
102612
  }, /* @__PURE__ */ React.createElement("path", {
102607
102613
  d: "M14 8V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2"
102608
102614
  }), /* @__PURE__ */ React.createElement("path", {
@@ -105874,18 +105880,21 @@ const SelectedBookingProvider = ({ children }) => {
105874
105880
  const index$2 = ({ filters: filters2, setFilters }) => {
105875
105881
  const { t: t2 } = useTranslation();
105876
105882
  const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
105883
+ const [datePickerOpen, setDatePickerOpen] = useState(false);
105884
+ const datePickerRef = useRef(null);
105877
105885
  const defaultValue = {
105878
105886
  criteria: "",
105879
- date: ""
105887
+ commingUp: false,
105888
+ fromDate: hooks().format("YYYY-MM-DD")
105880
105889
  };
105881
105890
  const searchSchema = () => create$1().shape({
105882
105891
  criteria: create$2(),
105883
- date: create$2()
105892
+ fromDate: create$2(),
105893
+ commingUp: create$3()
105884
105894
  });
105885
105895
  const {
105886
105896
  control,
105887
- setValue: setValue2,
105888
- getValues
105897
+ setValue: setValue2
105889
105898
  } = useForm({
105890
105899
  mode: "onChange",
105891
105900
  resolver: o(searchSchema()),
@@ -105895,17 +105904,56 @@ const index$2 = ({ filters: filters2, setFilters }) => {
105895
105904
  control,
105896
105905
  name: "criteria"
105897
105906
  });
105898
- const date4 = useWatch({
105907
+ const fromDate = useWatch({
105899
105908
  control,
105900
- name: "date"
105909
+ name: "fromDate"
105910
+ });
105911
+ const commingUp = useWatch({
105912
+ control,
105913
+ name: "commingUp"
105901
105914
  });
105915
+ const selectDate = (type4) => {
105916
+ switch (type4) {
105917
+ case "today":
105918
+ setValue2("fromDate", hooks().format("YYYY-MM-DD"));
105919
+ setValue2("commingUp", false);
105920
+ break;
105921
+ case "tomorrow":
105922
+ setValue2("fromDate", hooks().add(1, "days").format("YYYY-MM-DD"));
105923
+ setValue2("commingUp", false);
105924
+ break;
105925
+ case "commingUp":
105926
+ setValue2("commingUp", true);
105927
+ break;
105928
+ default:
105929
+ setValue2("commingUp", false);
105930
+ break;
105931
+ }
105932
+ };
105933
+ const onChange3 = (date4, dateString) => {
105934
+ setValue2("fromDate", dateString);
105935
+ setDatePickerOpen(false);
105936
+ };
105902
105937
  useEffect(() => {
105903
105938
  setFilters({
105904
105939
  ...filters2,
105905
105940
  criteria,
105906
- date: date4
105941
+ commingUp,
105942
+ fromDate
105907
105943
  });
105908
- }, [criteria, date4]);
105944
+ }, [criteria, fromDate, commingUp]);
105945
+ useEffect(() => {
105946
+ function handleDocumentClick(event) {
105947
+ var _a2, _b;
105948
+ if (datePickerRef.current && typeof ((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.className) === "string" && !((_b = event == null ? void 0 : event.target) == null ? void 0 : _b.className.includes("ant"))) {
105949
+ setDatePickerOpen(false);
105950
+ }
105951
+ }
105952
+ document.addEventListener("mousedown", handleDocumentClick);
105953
+ return () => {
105954
+ document.removeEventListener("mousedown", handleDocumentClick);
105955
+ };
105956
+ }, []);
105909
105957
  return /* @__PURE__ */ React__default.createElement("div", {
105910
105958
  className: styles$c.headerContainer
105911
105959
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
@@ -105926,18 +105974,101 @@ const index$2 = ({ filters: filters2, setFilters }) => {
105926
105974
  }), /* @__PURE__ */ React__default.createElement("div", {
105927
105975
  className: styles$c.buttonList
105928
105976
  }, /* @__PURE__ */ React__default.createElement(Button, {
105929
- mode: "tertiary"
105977
+ mode: "tertiary",
105978
+ onClick: () => selectDate("commingUp")
105930
105979
  }, t2("COMMINGUP")), /* @__PURE__ */ React__default.createElement(Button, {
105931
- mode: "tertiary"
105980
+ mode: "tertiary",
105981
+ onClick: () => selectDate("today")
105932
105982
  }, t2("TODAY")), /* @__PURE__ */ React__default.createElement(Button, {
105933
- mode: "tertiary"
105934
- }, t2("TOMORROW")), /* @__PURE__ */ React__default.createElement(Button, {
105935
- mode: "primary"
105936
- }, t2("SELECTADAY")), /* @__PURE__ */ React__default.createElement(Button, {
105983
+ mode: "tertiary",
105984
+ onClick: () => selectDate("tomorrow")
105985
+ }, t2("TOMORROW")), /* @__PURE__ */ React__default.createElement("div", {
105986
+ style: { display: "flex", flexDirection: "column", justifyContent: "center" }
105987
+ }, /* @__PURE__ */ React__default.createElement(Button, {
105988
+ mode: "primary",
105989
+ onClick: () => setDatePickerOpen(true)
105990
+ }, t2("SELECTADAY")), /* @__PURE__ */ React__default.createElement(CustomDatePicker, {
105991
+ ref: datePickerRef,
105992
+ onChange: onChange3,
105993
+ open: datePickerOpen,
105994
+ style: {
105995
+ marginTop: "30px",
105996
+ width: 0,
105997
+ height: 0,
105998
+ opacity: 0,
105999
+ position: "absolute",
106000
+ pointerEvents: "none"
106001
+ }
106002
+ })), /* @__PURE__ */ React__default.createElement(Button, {
105937
106003
  mode: "success",
105938
106004
  onClick: () => setSelectedBooking(null)
105939
106005
  }, t2("ADDRESERVATION"))));
105940
106006
  };
106007
+ const injectStyles = () => {
106008
+ const styleElement = document.createElement("style");
106009
+ styleElement.innerHTML = `
106010
+ .ant-picker-panel {
106011
+ background-color: #2F3349 !important;
106012
+ border-radius: 6px !important;
106013
+ color: white !important;
106014
+ }
106015
+
106016
+ .ant-picker-content {
106017
+ background-color: #2F3349 !important;
106018
+ color: white !important;
106019
+ }
106020
+
106021
+ .ant-picker-content thead th {
106022
+ background-color: #2F3349 !important;
106023
+ color: white !important;
106024
+ text-transform: uppercase;
106025
+ }
106026
+
106027
+ .ant-picker-cell {
106028
+ color: #D0CEE5 !important;
106029
+ background-color: #2F3349 !important;
106030
+ }
106031
+
106032
+ .ant-picker-cell-in-view.ant-picker-cell-today {
106033
+ border: 1px solid #ACABC1 !important;
106034
+ }
106035
+
106036
+ .ant-picker-cell-in-view.ant-picker-cell-selected {
106037
+ background-color: #4C4F64 !important;
106038
+ color: white !important;
106039
+ }
106040
+
106041
+ .ant-picker-cell-in-view.ant-picker-cell:hover {
106042
+ background-color: #3A3D54 !important;
106043
+ color: white !important;
106044
+ }
106045
+
106046
+ .ant-picker-footer {
106047
+ background-color: #2F3349 !important;
106048
+ }
106049
+
106050
+ .ant-picker-today-btn {
106051
+ color: white !important;
106052
+ background-color: #3A3D54 !important;
106053
+ border-radius: 6px;
106054
+ padding: 4px 8px;
106055
+ }
106056
+
106057
+ .ant-picker-today-btn:hover {
106058
+ background-color: #4C4F64 !important;
106059
+ }
106060
+ `;
106061
+ document.head.appendChild(styleElement);
106062
+ };
106063
+ const CustomDatePicker = React__default.forwardRef((props, ref) => {
106064
+ useEffect(() => {
106065
+ injectStyles();
106066
+ }, []);
106067
+ return /* @__PURE__ */ React__default.createElement(DatePicker$2, {
106068
+ ...props,
106069
+ ref
106070
+ });
106071
+ });
105941
106072
  const TableTopHeader = ({ date: date4, total }) => {
105942
106073
  const { t: t2 } = useTranslation();
105943
106074
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -106082,8 +106213,9 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
106082
106213
  const { t: t2 } = useTranslation();
106083
106214
  const [formattedData, setFormattedData] = useState({});
106084
106215
  useEffect(() => {
106085
- if (data2) {
106216
+ if (data2 && filtersData) {
106086
106217
  const groupedByHour = _23.groupBy(data2, (item2) => {
106218
+ console.log(filtersData == null ? void 0 : filtersData.timeZone, "LOL");
106087
106219
  const formattedTime = new Date(item2.date).toLocaleTimeString([], {
106088
106220
  ...(filtersData == null ? void 0 : filtersData.timeZone) ? {
106089
106221
  timeZone: filtersData == null ? void 0 : filtersData.timeZone
@@ -106099,9 +106231,16 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
106099
106231
  ["asc"]
106100
106232
  ).fromPairs().value();
106101
106233
  setFormattedData(sortedGroupedByHour);
106234
+ console.log(sortedGroupedByHour, "SORTED");
106102
106235
  }
106103
- }, [data2]);
106104
- return /* @__PURE__ */ React__default.createElement("div", null, _23.map(formattedData, (group, key2) => {
106236
+ }, [data2, filtersData]);
106237
+ return /* @__PURE__ */ React__default.createElement("div", null, _23.isEmpty(formattedData) ? /* @__PURE__ */ React__default.createElement("div", {
106238
+ className: styles$c.tableRowContainer
106239
+ }, /* @__PURE__ */ React__default.createElement(Card, {
106240
+ className: styles$c.tableRowCard
106241
+ }, /* @__PURE__ */ React__default.createElement("h2", {
106242
+ className: styles$c.noData
106243
+ }, t2("NO_RESERVATIONS")))) : _23.map(formattedData, (group, key2) => {
106105
106244
  return /* @__PURE__ */ React__default.createElement("div", {
106106
106245
  key: key2
106107
106246
  }, /* @__PURE__ */ React__default.createElement("div", {
@@ -106120,7 +106259,7 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
106120
106259
  };
106121
106260
  const index$1 = ({ data: data2, filters: filters2, filtersData, venueId }) => {
106122
106261
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TableTopHeader, {
106123
- date: filters2.date,
106262
+ date: filters2.fromDate,
106124
106263
  total: data2 == null ? void 0 : data2.length
106125
106264
  }), /* @__PURE__ */ React__default.createElement("div", {
106126
106265
  style: { overflowY: "auto" }
@@ -106290,7 +106429,7 @@ const TextAreaField = ({ control, name, ...props }) => {
106290
106429
  }))
106291
106430
  });
106292
106431
  };
106293
- var styles$2 = /* @__PURE__ */ (() => ".ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.ant-modal-content{background-color:transparent;border-radius:6px}.ant-modal-header,.ant-modal-body{background-color:#2f3349!important;color:#fff}.ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.ant-modal-header h1,.ant-modal-header p,.ant-modal-body h1,.ant-modal-body h2,.ant-modal-body h3,.ant-modal-body h4,.ant-modal-body p{font-family:Public Sans,sans-serif}.ant-modal-header p,.ant-modal-body p{font-size:15px;color:#acabc1}.ant-modal-header p{margin-bottom:0;margin-top:0}.ant-modal-header h1,.ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.ant-modal-body label{font-size:15px;color:#acabc1}.ant-modal-body h2{color:#fff}.ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.mz-header input,.ant-modal-body input,.ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.mz-header .css-spersy-control,.ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.ant-modal-title,.ant-modal-body span{color:#fff}.ant-modal-close-x line{stroke:#fff}\n")();
106432
+ var styles$2 = /* @__PURE__ */ (() => ".resbook-modal .ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.resbook-modal .ant-modal-content{background-color:transparent;border-radius:6px}.resbook-modal .ant-modal-header,.resbook-modal .ant-modal-body{background-color:#2f3349!important;color:#fff}.resbook-modal .ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.resbook-modal .ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body h1,.resbook-modal .ant-modal-body h2,.resbook-modal .ant-modal-body h3,.resbook-modal .ant-modal-body h4,.resbook-modal .ant-modal-body p{font-family:Public Sans,sans-serif}.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body p{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-header p{margin-bottom:0;margin-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.resbook-modal .ant-modal-body label{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-body h2{color:#fff}.resbook-modal .ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.resbook-modal .ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.resbook-modal .mz-header input,.resbook-modal .ant-modal-body input,.resbook-modal .ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.resbook-modal .mz-header .css-spersy-control,.resbook-modal .ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.resbook-modal .css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.resbook-modal .ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.resbook-modal .ant-modal-title,.resbook-modal .ant-modal-body span{color:#fff}.resbook-modal .ant-modal-close-x line{stroke:#fff}\n")();
106294
106433
  const Modal2 = ({
106295
106434
  open,
106296
106435
  children,
@@ -106299,6 +106438,7 @@ const Modal2 = ({
106299
106438
  width
106300
106439
  }) => {
106301
106440
  return /* @__PURE__ */ React__default.createElement(ModalAntd, {
106441
+ className: "resbook-modal",
106302
106442
  title: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof title2 === "string" && /* @__PURE__ */ React__default.createElement(Heading, null, title2), typeof title2 !== "string" && !!title2 ? title2 : /* @__PURE__ */ React__default.createElement("div", null)),
106303
106443
  open,
106304
106444
  onCancel: onClose2,
@@ -106318,7 +106458,9 @@ const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "
106318
106458
  ...props,
106319
106459
  title: title2,
106320
106460
  width: 500
106321
- }, /* @__PURE__ */ React__default.createElement("h3", null, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
106461
+ }, /* @__PURE__ */ React__default.createElement("h3", {
106462
+ style: { marginTop: 0, paddingTop: 20 }
106463
+ }, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
106322
106464
  style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
106323
106465
  }, /* @__PURE__ */ React__default.createElement(Button, {
106324
106466
  size: "small",
@@ -106770,7 +106912,10 @@ const index = ({ filtersData, venueId }) => {
106770
106912
  })));
106771
106913
  };
106772
106914
  function MainComponent({ venueId }) {
106773
- const [filters2, setFilters] = useState({});
106915
+ const [currentVenue, setCurrentVenue] = useState(null);
106916
+ const [filters2, setFilters] = useState({
106917
+ fromDate: hooks().format("YYYY-MM-DD")
106918
+ });
106774
106919
  const [params, setParams] = useState(
106775
106920
  () => {
106776
106921
  const date4 = new Date();
@@ -106786,23 +106931,34 @@ function MainComponent({ venueId }) {
106786
106931
  );
106787
106932
  const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
106788
106933
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetBookings, { cacheId: "reservation0dashboard", venue_id: venueId, params });
106934
+ console.log(venueId, "VENUE ID");
106789
106935
  const { data: filtersData, isLoading: filtersLoading, error: filtersError, reload: reloadSelectsData } = useFetch(GetCreateBookingSelectsData, {
106790
106936
  cacheId: "venueCapacity",
106791
- venue_id: venueId,
106937
+ venue_id: currentVenue,
106792
106938
  includeAreaInTables: true,
106793
106939
  includeCoversInTables: false
106794
106940
  });
106795
106941
  useEffect(() => {
106796
- console.log(filters2, "FILTERS");
106942
+ setCurrentVenue(venueId);
106943
+ }, [venueId]);
106944
+ useEffect(() => {
106945
+ const paramsToSend = { ...params };
106946
+ if (filters2.criteria) {
106947
+ paramsToSend["filters[criteria]"] = filters2.criteria;
106948
+ } else {
106949
+ delete paramsToSend["filters[criteria]"];
106950
+ }
106951
+ if (filters2.fromDate) {
106952
+ paramsToSend["filters[fromZ]"] = `${filters2.fromDate}${filters2.commingUp ? hooks().format("Tkk:mm:ss") : "T00:00:00"}`;
106953
+ paramsToSend["filters[tillZ]"] = `${filters2.fromDate}T23:59:59.999`;
106954
+ }
106955
+ setParams(paramsToSend);
106797
106956
  }, [filters2]);
106798
106957
  useEffect(() => {
106799
106958
  if (!selectedBooking) {
106800
106959
  reloadSelectsData();
106801
106960
  }
106802
106961
  }, [selectedBooking]);
106803
- useEffect(() => {
106804
- console.log(filtersData, "FILTERS DATA");
106805
- }, [filtersData]);
106806
106962
  return /* @__PURE__ */ React__default.createElement(ReloadProvider, {
106807
106963
  reload
106808
106964
  }, /* @__PURE__ */ React__default.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": ["mozrest"],
6
6
  "author": {