@tripian/react 9.1.43 → 9.1.45

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/index.js CHANGED
@@ -33050,49 +33050,7 @@ __webpack_require__(890);
33050
33050
  const GPlacesAutocomplete2 = ({ onSelectedChanged, initialText, boundry, placeholder, disabled, onFocus, onBlur }) => {
33051
33051
  const [text, setText] = (0, react_1.useState)(initialText);
33052
33052
  const [initialized, setInitialized] = (0, react_1.useState)(false);
33053
- const [hasSelection, setHasSelection] = (0, react_1.useState)(false);
33054
33053
  const placesAutocomplete = (0, react_1.useRef)();
33055
- const isPacItemClick = (0, react_1.useRef)(false);
33056
- (0, react_1.useEffect)(() => {
33057
- const handleMouseDown = (e) => {
33058
- const target = e.target;
33059
- if (target && target.classList && target.classList.contains('pac-item')) {
33060
- isPacItemClick.current = true;
33061
- }
33062
- };
33063
- window.addEventListener('mousedown', handleMouseDown);
33064
- return () => {
33065
- window.removeEventListener('mousedown', handleMouseDown);
33066
- };
33067
- }, []);
33068
- const handleEnterKey = (event) => {
33069
- if (event.key === 'Enter') {
33070
- event.preventDefault();
33071
- const firstPrediction = document.querySelector('.pac-item');
33072
- if (firstPrediction) {
33073
- const input = document.getElementById('google-autocompelete');
33074
- const simulatedDownArrow = new KeyboardEvent('keydown', { keyCode: 40 });
33075
- input.dispatchEvent(simulatedDownArrow);
33076
- const simulatedEnter = new KeyboardEvent('keydown', { keyCode: 13 });
33077
- input.dispatchEvent(simulatedEnter);
33078
- }
33079
- }
33080
- };
33081
- const handleBlur = () => {
33082
- setTimeout(() => {
33083
- if (isPacItemClick.current) {
33084
- isPacItemClick.current = false;
33085
- return;
33086
- }
33087
- if (!hasSelection) {
33088
- setText('');
33089
- onSelectedChanged({ name: '' });
33090
- }
33091
- if (onBlur) {
33092
- onBlur();
33093
- }
33094
- }, 200);
33095
- };
33096
33054
  /**
33097
33055
  * initialize
33098
33056
  */
@@ -33108,15 +33066,20 @@ const GPlacesAutocomplete2 = ({ onSelectedChanged, initialText, boundry, placeho
33108
33066
  strictBounds: true,
33109
33067
  };
33110
33068
  placesAutocomplete.current = new google.maps.places.Autocomplete(document.getElementById('google-autocompelete'), autocompleteOptions);
33069
+ // console.log('setTimeout set 1');
33111
33070
  setTimeout(() => {
33071
+ // if (!unmounted) {
33112
33072
  const pacContainerParent = document.getElementById('pac-container-parent');
33113
33073
  const pacContainer = document.getElementsByClassName('pac-container')[0];
33114
33074
  if (pacContainer)
33115
33075
  pacContainerParent === null || pacContainerParent === void 0 ? void 0 : pacContainerParent.appendChild(pacContainer);
33076
+ // console.log('setTimeout set 2');
33077
+ // }
33116
33078
  }, 1000);
33117
33079
  setInitialized(true);
33118
33080
  };
33119
33081
  init();
33082
+ // console.log('useEffect init');
33120
33083
  return () => {
33121
33084
  const pacContainers = document.getElementsByClassName('pac-container');
33122
33085
  for (let i = 0; i < pacContainers.length; i += 1) {
@@ -33137,7 +33100,6 @@ const GPlacesAutocomplete2 = ({ onSelectedChanged, initialText, boundry, placeho
33137
33100
  const displayText = [place.name, place.formatted_address].filter(Boolean).join(' ');
33138
33101
  setText(displayText || '');
33139
33102
  onSelectedChanged(place);
33140
- setHasSelection(true);
33141
33103
  }
33142
33104
  });
33143
33105
  return () => {
@@ -33150,11 +33112,15 @@ const GPlacesAutocomplete2 = ({ onSelectedChanged, initialText, boundry, placeho
33150
33112
  * setBounds
33151
33113
  */
33152
33114
  (0, react_1.useEffect)(() => {
33115
+ // console.log(boundry);
33153
33116
  if (placesAutocomplete.current && boundry) {
33154
33117
  placesAutocomplete.current.setBounds(boundry);
33155
33118
  }
33119
+ // console.log('initialized, boundry');
33120
+ // console.log('setBounds');
33156
33121
  }, [initialized, boundry]);
33157
33122
  (0, react_1.useEffect)(() => {
33123
+ // console.log('useEffect initialText');
33158
33124
  setText(initialText);
33159
33125
  }, [initialText]);
33160
33126
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -33162,9 +33128,9 @@ const GPlacesAutocomplete2 = ({ onSelectedChanged, initialText, boundry, placeho
33162
33128
  if (!newText.target.value) {
33163
33129
  onSelectedChanged({ name: '' });
33164
33130
  }
33131
+ // console.log(newText.target.value);
33165
33132
  setText(newText.target.value);
33166
- setHasSelection(false);
33167
- }, className: "gplaces-autocomplete", disabled: disabled, onFocus: onFocus, onBlur: handleBlur, onKeyDown: handleEnterKey }),
33133
+ }, disabled: disabled, onFocus: onFocus, onBlur: onBlur }),
33168
33134
  react_1.default.createElement("div", { id: "pac-container-parent" })));
33169
33135
  };
33170
33136
  exports.default = GPlacesAutocomplete2;
@@ -58640,13 +58606,14 @@ const PoiInfoText = ({ poi, hideFeatures, hideCuisine, reservationUrl, hideBooki
58640
58606
  react_1.default.createElement("span", { className: PoiInfoText_scss_1.default.bookableTabSubtext }, "Covering this POI")))),
58641
58607
  !hideTours && activeBookableTab === 'tickets' && ticketProducts.length > 0 && (react_1.default.createElement("div", { className: "col col12 pb4" }, ticketProducts.map((bookingProduct) => (react_1.default.createElement("div", { key: bookingProduct.id, className: "pt4" },
58642
58608
  react_1.default.createElement(TourCard_1.default, { key: bookingProduct.id, title: bookingProduct.title, tags: bookingProduct.info, images: [bookingProduct.image || ''], provider: bookingProduct.provider, onBook: () => {
58643
- if (bookingProduct.provider === 'Victory' && getTourInfo) {
58609
+ if (getTourInfo)
58644
58610
  getTourInfo(bookingProduct.id.toString(), poi);
58645
- }
58646
- window.open(bookingProduct.url || '', '_blank');
58647
58611
  } })))))),
58648
58612
  !hideTours && activeBookableTab === 'tours' && tourProducts.length > 0 && (react_1.default.createElement("div", { className: `col col12 pb4 ${tourTicketProductsLoading ? 'pointer-events-none' : ''}` }, tourProducts.map((bookingProduct) => (react_1.default.createElement("div", { key: bookingProduct.id, className: "pt4" },
58649
- react_1.default.createElement(TourCard_1.default, { key: bookingProduct.id, title: bookingProduct.title, tags: bookingProduct.info, images: [bookingProduct.image || ''], provider: bookingProduct.provider, onBook: () => window.open(bookingProduct.url || '', '_blank') }))))))))))))));
58613
+ react_1.default.createElement(TourCard_1.default, { key: bookingProduct.id, title: bookingProduct.title, tags: bookingProduct.info, images: [bookingProduct.image || ''], provider: bookingProduct.provider, onBook: () => {
58614
+ if (getTourInfo)
58615
+ getTourInfo(bookingProduct.id.toString(), poi);
58616
+ } }))))))))))))));
58650
58617
  };
58651
58618
  exports.default = PoiInfoText;
58652
58619
 
@@ -88357,7 +88324,7 @@ gygTourIds, bbTourIds, viatorTourIds, toristyTourIds, alternativeReplace, timesC
88357
88324
  react_1.default.createElement(Price_1.default, { price: step.poi.price }))) : null)));
88358
88325
  }
88359
88326
  return (react_1.default.createElement("div", { style: { marginLeft: isWidget ? '1.5rem' : '0' }, className: `${StepCard_scss_1.default.stepCardMain} ${step.warningMessage.length > 0 ? StepCard_scss_1.default.redBorder : ''}` },
88360
- react_1.default.createElement("div", { className: `${StepCard_scss_1.default.stepCard} ${tourTicketProductsLoading && step.poi.category.some((c) => c.id === 1) ? 'pointer-events-none' : ''}`, onKeyDown: () => { }, role: "button", tabIndex: 0, onClick: () => {
88327
+ react_1.default.createElement("div", { className: StepCard_scss_1.default.stepCard, onKeyDown: () => { }, role: "button", tabIndex: 0, onClick: () => {
88361
88328
  clicked(step);
88362
88329
  } },
88363
88330
  step.warningMessage.length > 0 && (react_1.default.createElement("div", { className: StepCard_scss_1.default.tooltip, "data-tooltip": step.warningMessage.join(' '), "data-tooltip-position": "bottom" },
@@ -88383,11 +88350,7 @@ gygTourIds, bbTourIds, viatorTourIds, toristyTourIds, alternativeReplace, timesC
88383
88350
  } },
88384
88351
  react_1.default.createElement(Icons_1.X, { fill: "var(--primary-color)" }))),
88385
88352
  react_1.default.createElement("div", { className: StepCard_scss_1.default.iconButtonsMobile }, replaceRemoveButtons),
88386
- tourTicketProductsLoading && step.poi.category.some((c) => c.id === 1) && (react_1.default.createElement("div", { className: StepCard_scss_1.default.loadingIndicator, onClick: (e) => {
88387
- e.stopPropagation();
88388
- }, onKeyDown: (e) => {
88389
- e.stopPropagation();
88390
- }, role: "presentation" },
88353
+ tourTicketProductsLoading && step.poi.category.some((c) => c.id === 1) && (react_1.default.createElement("div", { className: StepCard_scss_1.default.loadingIndicator },
88391
88354
  react_1.default.createElement(TourTicketLazyLoading_1.default, null))),
88392
88355
  !tourTicketProductsLoading && (react_1.default.createElement(react_1.default.Fragment, null, ((!hideTourTicketIcons &&
88393
88356
  (model_1.helper.tourAvailable(step.poi.bookings, TOUR_PROVIDER_IDS, gygTourIds, bbTourIds, viatorTourIds, toristyTourIds) ||