@qite/tide-booking-component 1.4.50 → 1.4.52

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.
@@ -28752,7 +28752,8 @@ var LanguageSwitcher = function (_a) {
28752
28752
  };
28753
28753
 
28754
28754
  var Navbar = function (_a) {
28755
- var logo = _a.logo,
28755
+ var currentPath = _a.currentPath,
28756
+ logo = _a.logo,
28756
28757
  topLinks = _a.topLinks,
28757
28758
  items = _a.items,
28758
28759
  language = _a.language,
@@ -28768,7 +28769,6 @@ var Navbar = function (_a) {
28768
28769
  var _d = React.useState(),
28769
28770
  activeMobileGroup = _d[0],
28770
28771
  setActiveMobileGroup = _d[1];
28771
- var location = reactRouter.useLocation();
28772
28772
  var normalizePath = function (path) {
28773
28773
  return path.replace(/\/+$/, '');
28774
28774
  };
@@ -28807,7 +28807,7 @@ var Navbar = function (_a) {
28807
28807
  };
28808
28808
  var isActive = function (item) {
28809
28809
  var _a;
28810
- return location && normalizePath(location.pathname) === normalizePath('/' + ((_a = item.href) !== null && _a !== void 0 ? _a : ''));
28810
+ return currentPath && normalizePath(currentPath) === normalizePath('/' + ((_a = item.href) !== null && _a !== void 0 ? _a : ''));
28811
28811
  };
28812
28812
  var renderNavItem = function (item) {
28813
28813
  var _a, _b;
@@ -31972,7 +31972,8 @@ var QSMContainer = function () {
31972
31972
  };
31973
31973
  var handleSubmit = function () {
31974
31974
  if (!onSubmit) return;
31975
- var fromDate = qsmState.fromDate,
31975
+ var qsmType = qsmState.qsmType,
31976
+ fromDate = qsmState.fromDate,
31976
31977
  toDate = qsmState.toDate,
31977
31978
  selectedTravelClass = qsmState.selectedTravelClass,
31978
31979
  selectedTravelType = qsmState.selectedTravelType,
@@ -31989,6 +31990,7 @@ var QSMContainer = function () {
31989
31990
  return t.label === selectedTravelType;
31990
31991
  });
31991
31992
  var payload = {
31993
+ qsmType: qsmType,
31992
31994
  fromDate: fromDate,
31993
31995
  toDate: toDate,
31994
31996
  travelClass: selectedTravelClass,
@@ -16,6 +16,7 @@ export interface NavItem {
16
16
  items?: NavLink[];
17
17
  }
18
18
  export interface NavbarProps {
19
+ currentPath?: string;
19
20
  logo: React.ReactNode;
20
21
  topLinks: NavLink[];
21
22
  items: NavItem[];
@@ -28655,7 +28655,8 @@ var LanguageSwitcher = function (_a) {
28655
28655
  };
28656
28656
 
28657
28657
  var Navbar = function (_a) {
28658
- var logo = _a.logo,
28658
+ var currentPath = _a.currentPath,
28659
+ logo = _a.logo,
28659
28660
  topLinks = _a.topLinks,
28660
28661
  items = _a.items,
28661
28662
  language = _a.language,
@@ -28671,7 +28672,6 @@ var Navbar = function (_a) {
28671
28672
  var _d = useState(),
28672
28673
  activeMobileGroup = _d[0],
28673
28674
  setActiveMobileGroup = _d[1];
28674
- var location = useLocation();
28675
28675
  var normalizePath = function (path) {
28676
28676
  return path.replace(/\/+$/, '');
28677
28677
  };
@@ -28710,7 +28710,7 @@ var Navbar = function (_a) {
28710
28710
  };
28711
28711
  var isActive = function (item) {
28712
28712
  var _a;
28713
- return location && normalizePath(location.pathname) === normalizePath('/' + ((_a = item.href) !== null && _a !== void 0 ? _a : ''));
28713
+ return currentPath && normalizePath(currentPath) === normalizePath('/' + ((_a = item.href) !== null && _a !== void 0 ? _a : ''));
28714
28714
  };
28715
28715
  var renderNavItem = function (item) {
28716
28716
  var _a, _b;
@@ -31857,7 +31857,8 @@ var QSMContainer = function () {
31857
31857
  };
31858
31858
  var handleSubmit = function () {
31859
31859
  if (!onSubmit) return;
31860
- var fromDate = qsmState.fromDate,
31860
+ var qsmType = qsmState.qsmType,
31861
+ fromDate = qsmState.fromDate,
31861
31862
  toDate = qsmState.toDate,
31862
31863
  selectedTravelClass = qsmState.selectedTravelClass,
31863
31864
  selectedTravelType = qsmState.selectedTravelType,
@@ -31874,6 +31875,7 @@ var QSMContainer = function () {
31874
31875
  return t.label === selectedTravelType;
31875
31876
  });
31876
31877
  var payload = {
31878
+ qsmType: qsmType,
31877
31879
  fromDate: fromDate,
31878
31880
  toDate: toDate,
31879
31881
  travelClass: selectedTravelClass,
@@ -16,6 +16,7 @@ export interface NavItem {
16
16
  items?: NavLink[];
17
17
  }
18
18
  export interface NavbarProps {
19
+ currentPath?: string;
19
20
  logo: React.ReactNode;
20
21
  topLinks: NavLink[];
21
22
  items: NavItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.4.50",
3
+ "version": "1.4.52",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",
@@ -2,14 +2,12 @@ import React, { useEffect, useState } from 'react';
2
2
  import LanguageSwitcher from '../components/LanguageSwitcher';
3
3
  import Icon from '../components/icon';
4
4
  import { NavbarProps, NavItem } from '../navbar/types';
5
- import { useLocation } from 'react-router-dom';
6
5
 
7
- const Navbar: React.FC<NavbarProps> = ({ logo, topLinks, items, language, languages, onLanguageChange, onSearch }) => {
6
+ const Navbar: React.FC<NavbarProps> = ({ currentPath, logo, topLinks, items, language, languages, onLanguageChange, onSearch }) => {
8
7
  const [menuOpen, setMenuOpen] = useState(false);
9
8
  const [query, setQuery] = useState('');
10
9
  const [activeMobileGroup, setActiveMobileGroup] = useState<string>();
11
10
 
12
- const location = useLocation();
13
11
  const normalizePath = (path: string) => path.replace(/\/+$/, '');
14
12
 
15
13
  useEffect(() => {
@@ -45,7 +43,7 @@ const Navbar: React.FC<NavbarProps> = ({ logo, topLinks, items, language, langua
45
43
  };
46
44
 
47
45
  const isActive = (item: NavItem) => {
48
- return location && normalizePath(location.pathname) === normalizePath('/' + (item.href ?? ''));
46
+ return currentPath && normalizePath(currentPath) === normalizePath('/' + (item.href ?? ''));
49
47
  };
50
48
 
51
49
  const renderNavItem = (item: NavItem) => {
@@ -21,6 +21,8 @@ export interface NavItem {
21
21
  }
22
22
 
23
23
  export interface NavbarProps {
24
+ currentPath?: string;
25
+
24
26
  logo: React.ReactNode;
25
27
 
26
28
  topLinks: NavLink[];
@@ -78,10 +78,11 @@ const QSMContainer: React.FC = () => {
78
78
  const handleSubmit = () => {
79
79
  if (!onSubmit) return;
80
80
 
81
- const { fromDate, toDate, selectedTravelClass, selectedTravelType, selectedNationality, rooms, tripType, adults, kids, babies } = qsmState;
81
+ const { qsmType, fromDate, toDate, selectedTravelClass, selectedTravelType, selectedNationality, rooms, tripType, adults, kids, babies } = qsmState;
82
82
 
83
83
  const selectedTravelTypeValue = travelTypes?.find((t) => t.label === selectedTravelType);
84
84
  const payload = {
85
+ qsmType,
85
86
  fromDate,
86
87
  toDate,
87
88
  travelClass: selectedTravelClass,