@digitransit-component/digitransit-component-autosuggest 9.1.0 → 10.0.0
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/lib/index.cjs +2 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.development.cjs +303 -325
- package/lib/index.js +277 -298
- package/lib/index.js.map +1 -1
- package/package.json +10 -7
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import
|
|
2
|
+
import require$$0, { memo, useState, useEffect, useCallback, useReducer, useRef, useMemo } from 'react';
|
|
3
3
|
import { useTranslation, I18nextProvider } from 'react-i18next';
|
|
4
4
|
import cx from 'classnames';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
@@ -20,6 +20,7 @@ import { DateTime } from 'luxon';
|
|
|
20
20
|
import ReactModal from 'react-modal';
|
|
21
21
|
import DialogModal from '@digitransit-component/digitransit-component-dialog-modal';
|
|
22
22
|
import SuggestionItem from '@digitransit-component/digitransit-component-suggestion-item';
|
|
23
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
24
|
|
|
24
25
|
function _typeof(o) {
|
|
25
26
|
"@babel/helpers - typeof";
|
|
@@ -5315,8 +5316,8 @@ function getJson(url, params) {
|
|
|
5315
5316
|
});
|
|
5316
5317
|
}
|
|
5317
5318
|
|
|
5318
|
-
function ownKeys$
|
|
5319
|
-
function _objectSpread$
|
|
5319
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5320
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5320
5321
|
const DEFAULT_PELIAS_URL = 'https://api.digitransit.fi/geocoding/v1/search';
|
|
5321
5322
|
/**
|
|
5322
5323
|
* <DESCRIPTION>
|
|
@@ -5340,19 +5341,19 @@ function getGeocodingResults(searchString, searchParams, lang, focusPoint, sourc
|
|
|
5340
5341
|
return Promise.resolve([]);
|
|
5341
5342
|
}
|
|
5342
5343
|
const PELIAS_URL = peliasUrl || DEFAULT_PELIAS_URL;
|
|
5343
|
-
let opts = _objectSpread$
|
|
5344
|
+
let opts = _objectSpread$6(_objectSpread$6(_objectSpread$6({
|
|
5344
5345
|
text
|
|
5345
5346
|
}, searchParams), focusPoint), {}, {
|
|
5346
5347
|
lang
|
|
5347
5348
|
});
|
|
5348
5349
|
if (sources) {
|
|
5349
|
-
opts = _objectSpread$
|
|
5350
|
+
opts = _objectSpread$6(_objectSpread$6({}, opts), {}, {
|
|
5350
5351
|
sources
|
|
5351
5352
|
});
|
|
5352
5353
|
}
|
|
5353
5354
|
if (geocodingLayers) {
|
|
5354
5355
|
const layers = geocodingLayers.toString();
|
|
5355
|
-
opts = _objectSpread$
|
|
5356
|
+
opts = _objectSpread$6(_objectSpread$6({}, opts), {}, {
|
|
5356
5357
|
layers
|
|
5357
5358
|
});
|
|
5358
5359
|
}
|
|
@@ -5361,8 +5362,8 @@ function getGeocodingResults(searchString, searchParams, lang, focusPoint, sourc
|
|
|
5361
5362
|
});
|
|
5362
5363
|
}
|
|
5363
5364
|
|
|
5364
|
-
function ownKeys$
|
|
5365
|
-
function _objectSpread$
|
|
5365
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5366
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5366
5367
|
function getStopsFromGeocoding(stops, URL_PELIAS_PLACE) {
|
|
5367
5368
|
if (!stops || stops.length < 1) {
|
|
5368
5369
|
return Promise.resolve([]);
|
|
@@ -5375,7 +5376,7 @@ function getStopsFromGeocoding(stops, URL_PELIAS_PLACE) {
|
|
|
5375
5376
|
gid += `#${stop.code}`;
|
|
5376
5377
|
}
|
|
5377
5378
|
gids += `${gid},`;
|
|
5378
|
-
return _objectSpread$
|
|
5379
|
+
return _objectSpread$5(_objectSpread$5({}, stop), {}, {
|
|
5379
5380
|
gid
|
|
5380
5381
|
});
|
|
5381
5382
|
});
|
|
@@ -5410,7 +5411,7 @@ function getStopsFromGeocoding(stops, URL_PELIAS_PLACE) {
|
|
|
5410
5411
|
function filterFavouriteLocations(favourites, input) {
|
|
5411
5412
|
return Promise.resolve(filterMatchingToInput(favourites, input, ['address', 'name']).map(item => ({
|
|
5412
5413
|
type: 'FavouritePlace',
|
|
5413
|
-
properties: _objectSpread$
|
|
5414
|
+
properties: _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
5414
5415
|
label: item.name,
|
|
5415
5416
|
layer: 'favouritePlace'
|
|
5416
5417
|
}),
|
|
@@ -5518,7 +5519,7 @@ function filterOldSearches(oldSearches, input, dropLayers) {
|
|
|
5518
5519
|
matchingOldSearches = matchingOldSearches.filter(item => !dropLayers.includes(item.properties.layer));
|
|
5519
5520
|
}
|
|
5520
5521
|
return Promise.resolve(take(matchingOldSearches, 10).map(item => {
|
|
5521
|
-
const newItem = _objectSpread$
|
|
5522
|
+
const newItem = _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
5522
5523
|
type: 'OldSearch',
|
|
5523
5524
|
timetableClicked: false,
|
|
5524
5525
|
// reset latest selection action
|
|
@@ -5791,7 +5792,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
|
|
|
5791
5792
|
searches.error = err;
|
|
5792
5793
|
});
|
|
5793
5794
|
searchResultsPromise.then(() => {
|
|
5794
|
-
callback(_objectSpread$
|
|
5795
|
+
callback(_objectSpread$5(_objectSpread$5({}, searches), {}, {
|
|
5795
5796
|
results: sortSearchResults(lineRegexp, searches.results, input)
|
|
5796
5797
|
}));
|
|
5797
5798
|
});
|
|
@@ -6529,7 +6530,7 @@ function requireLib () {
|
|
|
6529
6530
|
if (hasRequiredLib) return lib.exports;
|
|
6530
6531
|
hasRequiredLib = 1;
|
|
6531
6532
|
(function (module, exports) {
|
|
6532
|
-
!function(e,t){module.exports=t(React);}("undefined"!=typeof self?self:this,(function(e){return function(){var t={888:function(e,t,n){var o,r;r=void 0!==n.g?n.g:"undefined"!=typeof window?window:this,o=function(){return function(e){var t={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:true,speed:500,speedAsDuration:false,durationMax:null,durationMin:null,clip:true,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:true,popstate:true,emitEvents:true},n=function(){var e={};return Array.prototype.forEach.call(arguments,(function(t){for(var n in t){if(!t.hasOwnProperty(n))return;e[n]=t[n];}})),e},o=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,r=-1,u="",i=n.charCodeAt(0);++r<o;){if(0===(t=n.charCodeAt(r)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");u+=t>=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===i?"\\"+t.toString(16)+" ":t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(r):"\\"+n.charAt(r);}return "#"+u},r=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},u=function(t){return t?(n=t,parseInt(e.getComputedStyle(n).height,10)+t.offsetTop):0;var n;},i=function(t,n,o){0===t&&document.body.focus(),o||(t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n));},s=function(t,n,o,r){if(n.emitEvents&&"function"==typeof e.CustomEvent){var u=new CustomEvent(t,{bubbles:true,detail:{anchor:o,toggle:r}});document.dispatchEvent(u);}};return function(c,a){var l,f,d,v,p={cancelScroll:function(e){cancelAnimationFrame(v),v=null,e||s("scrollCancel",l);},animateScroll:function(o,c,a){p.cancelScroll();var f=n(l||t,a||{}),h="[object Number]"===Object.prototype.toString.call(o),m=h||!o.tagName?null:o;if(h||m){var y=e.pageYOffset;f.header&&!d&&(d=document.querySelector(f.header));var b,g,w,E=u(d),O=h?o:function(t,n,o,u){var i=0;if(t.offsetParent)do{i+=t.offsetTop,t=t.offsetParent;}while(t);return i=Math.max(i-n-o,0),u&&(i=Math.min(i,r()-e.innerHeight)),i}(m,E,parseInt("function"==typeof f.offset?f.offset(o,c):f.offset,10),f.clip),S=O-y,_=r(),I=0,M=function(e,t){var n=t.speedAsDuration?t.speed:Math.abs(e/1e3*t.speed);return t.durationMax&&n>t.durationMax?t.durationMax:t.durationMin&&n<t.durationMin?t.durationMin:parseInt(n,10)}(S,f),L=function(t){b||(b=t),I+=t-b,w=y+S*function(e,t){var n;return "easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t}(f,g=(g=0===M?0:I/M)>1?1:g),e.scrollTo(0,Math.floor(w)),function(t,n){var r=e.pageYOffset;if(t==n||r==n||(y<n&&e.innerHeight+r)>=_)return p.cancelScroll(true),i(o,n,h),s("scrollStop",f,o,c),b=null,v=null,true}(w,O)||(v=e.requestAnimationFrame(L),b=t);};0===e.pageYOffset&&e.scrollTo(0,0),function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id);}(o,h,f),"matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches?i(o,Math.floor(O),false):(s("scrollStart",f,o,c),p.cancelScroll(true),e.requestAnimationFrame(L));}}},h=function(t){if(!t.defaultPrevented&&!(0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)&&"closest"in t.target&&(f=t.target.closest(c))&&"a"===f.tagName.toLowerCase()&&!t.target.closest(l.ignore)&&f.hostname===e.location.hostname&&f.pathname===e.location.pathname&&/#/.test(f.href)){var n,r;try{n=o(decodeURIComponent(f.hash));}catch(e){n=o(f.hash);}if("#"===n){if(!l.topOnEmptyHash)return;r=document.documentElement;}else r=document.querySelector(n);(r=r||"#top"!==n?r:document.documentElement)&&(t.preventDefault(),function(t){if(history.replaceState&&t.updateURL&&!history.state){var n=e.location.hash;n=n||"",history.replaceState({smoothScroll:JSON.stringify(t),anchor:n||e.pageYOffset},document.title,n||e.location.href);}}(l),p.animateScroll(r,f));}},m=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(l)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(o(history.state.anchor)))||p.animateScroll(t,null,{updateURL:false});}};return p.destroy=function(){l&&(document.removeEventListener("click",h,false),e.removeEventListener("popstate",m,false),p.cancelScroll(),l=null,f=null,d=null,v=null);},function(){if(!("querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype))throw "Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";p.destroy(),l=n(t,a||{}),d=l.header?document.querySelector(l.header):null,document.addEventListener("click",h,false),l.updateURL&&l.popstate&&e.addEventListener("popstate",m,false);}(),p}}(r)}.apply(t,[]),void 0===o||(e.exports=o);},432:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){ void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:true,get:function(){return t[n]}});}:function(e,t,n,o){ void 0===o&&(o=n),e[o]=t[n];}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n);};Object.defineProperty(t,"__esModule",{value:true}),r(n(47),t),r(n(926),t),r(n(349),t),r(n(137),t),r(n(729),t),r(n(383),t),r(n(450),t),r(n(358),t),r(n(753),t),r(n(869),t),r(n(352),t),r(n(446),t),r(n(164),t),r(n(305),t),r(n(502),t);},349:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useArrowNavigation=void 0;var o=n(156);t.useArrowNavigation=function(e){var t=e.listItems,n=e.onArrowUpOrDown,r=(0, o.useState)(0),u=r[0],i=r[1],s=(0, o.useCallback)((function(e){i(e);}),[t]),c=function(e){var o=e.key;if(null==t?void 0:t.length)if("ArrowUp"===o)n&&n(),e.preventDefault(),s(u>0?u-1:t.length-1);else {if("ArrowDown"!==o)return;n&&n(),e.preventDefault(),u<t.length-1?s(u+1):s(0);}};return (0, o.useEffect)((function(){return window.addEventListener("keydown",c),function(){return window.removeEventListener("keydown",c)}})),(0, o.useEffect)((function(){s(0);}),[t]),{selectedIndex:u}};},446:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useDebounce=void 0;var o=n(156);t.useDebounce=function(e,t){ void 0===t&&(t=300);var n=(0, o.useState)(e),r=n[0],u=n[1];return (0, o.useEffect)((function(){var n=setTimeout((function(){u(e);}),t);return function(){clearTimeout(n);}}),[e,t]),r};},164:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useElementSize=void 0;var o=n(156);t.useElementSize=function(){var e,t,n=(0, o.useRef)(null);return [n,{width:null===(e=null==n?void 0:n.current)||void 0===e?void 0:e.clientWidth,height:null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.clientHeight}]},t.default=t.useElementSize;},137:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIntersectionObserver=void 0;var o=n(156);t.useIntersectionObserver=function(e){var t=(0, o.useRef)(null),n=(0, o.useState)(false),r=n[0],u=n[1],i=function(e){var t=e[0];u(t.isIntersecting);};return (0, o.useEffect)((function(){if(window&&window.IntersectionObserver){var n=new IntersectionObserver(i,e),o=t.current;return t.current&&n.observe(t.current),function(){o&&n.unobserve(o);}}u(false);}),[t,e]),{containerRef:t,isVisible:r}},t.default=t.useIntersectionObserver;},729:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsBreakpoint=void 0;var o=n(156),r=n(432),u={xs:1,mobileSmall:320,mobile:375,tablet:768,tabletLarge:920,desktopSmall:1024,desktop:1260,desktopLarge:1440};t.useIsBreakpoint=function(e){var t="string"==typeof e?u[e]:e,n=(0, o.useState)(null),i=n[0],s=n[1],c=(0, o.useCallback)((function(){s(window.innerWidth);}),[]);return (0, o.useEffect)((function(){c();}),[]),(0, r.useOnResize)(c),i>=t},t.default=t.useIsBreakpoint;},450:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsLoadingAfterError=void 0;var o=n(156);t.useIsLoadingAfterError=function(e,t){var n=(0, o.useState)(t),r=n[0],u=n[1];return (0, o.useEffect)((function(){e||u(t);}),[e,t]),e&&r};},305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsMobile=void 0;var o=n(729);t.useIsMobile=function(){return !(0, o.useIsBreakpoint)("tablet")},t.default=t.useIsMobile;},383:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsomorphicLayoutEffect=void 0;var o=n(156);t.useIsomorphicLayoutEffect="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,t.default=t.useIsomorphicLayoutEffect;},753:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnLoseFocusWithin=void 0;var o=n(156);t.useOnLoseFocusWithin=function(e){var t=e.ref,n=e.callback,r=e.watch;(0, o.useEffect)((function(){var e=function(){var e;if(r)return (null===(e=t.current)||void 0===e?void 0:e.matches(":focus-within"))?void 0:n()};return document.addEventListener("keyup",e),function(){return document.removeEventListener("keyup",e)}}),[n,t,r]);},t.default=t.useOnLoseFocusWithin;},502:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnResize=void 0;var o=n(156);t.useOnResize=function(e){(0, o.useEffect)((function(){var t=function(){e(window.innerWidth);};return window.addEventListener("resize",t,{passive:true}),function(){return window.removeEventListener("resize",t)}}),[]);},t.default=t.useOnResize;},352:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnWindowFocus=void 0;var o=n(156);t.useOnWindowFocus=function(e){(0, o.useEffect)((function(){var t=function(){e&&"visible"===document.visibilityState&&e();};return window.addEventListener("visibilitychange",t,false),function(){return window.removeEventListener("visibilitychange",t)}}),[e]);};},47:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOutsideReacter=void 0;var o=n(156);t.useOutsideReacter=function(e,t){function n(n){e.current&&!e.current.contains(n.target)&&t();}(0, o.useEffect)((function(){return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n);}}));};},869:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useRunAfterUpdate=void 0;var o=n(156);t.useRunAfterUpdate=function(){var e=(0, o.useRef)(null);return (0, o.useEffect)((function(){e.current&&(e.current(),e.current=null);})),function(t){e.current=t;}},t.default=t.useRunAfterUpdate;},926:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useScrollLock=void 0;var o=n(156);t.useScrollLock=function(){return {lock:(0, o.useCallback)((function(){var e=window.scrollY+"px",t=document.body;t.style.position="fixed",t.style.top="-"+e;}),[]),unlock:(0, o.useCallback)((function(){var e=document.body,t=e.style.top,n=-1*parseInt(t||"0");e.style.position="",e.style.top="",n&&window.scrollTo(0,-1*parseInt(t||"0"));}),[])}};},358:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true}),t.useSmoothScroll=void 0;var r=n(156),u=o(n(888));t.useSmoothScroll=function(e){var t=(0, r.useRef)(null),n=e.ref,o=e.offset,i=void 0===o?0:o,s=e.speed,c=void 0===s?500:s;return (0, r.useEffect)((function(){t.current=new u.default(null,{speed:c,speedAsDuration:true});}),[]),(0, r.useCallback)((function(){n&&t.current&&t.current.animateScroll(n.current,null,{offset:function(){return i},updateURL:false});}),[i,n])};},156:function(t){t.exports=e;}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var u=n[e]={exports:{}};return t[e].call(u.exports,u,u.exports,o),u.exports}return o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o(432)}()}));
|
|
6533
|
+
!function(e,t){module.exports=t(require$$0);}("undefined"!=typeof self?self:this,(function(e){return function(){var t={888:function(e,t,n){var o,r;r=void 0!==n.g?n.g:"undefined"!=typeof window?window:this,o=function(){return function(e){var t={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:true,speed:500,speedAsDuration:false,durationMax:null,durationMin:null,clip:true,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:true,popstate:true,emitEvents:true},n=function(){var e={};return Array.prototype.forEach.call(arguments,(function(t){for(var n in t){if(!t.hasOwnProperty(n))return;e[n]=t[n];}})),e},o=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,r=-1,u="",i=n.charCodeAt(0);++r<o;){if(0===(t=n.charCodeAt(r)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");u+=t>=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===i?"\\"+t.toString(16)+" ":t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(r):"\\"+n.charAt(r);}return "#"+u},r=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},u=function(t){return t?(n=t,parseInt(e.getComputedStyle(n).height,10)+t.offsetTop):0;var n;},i=function(t,n,o){0===t&&document.body.focus(),o||(t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n));},s=function(t,n,o,r){if(n.emitEvents&&"function"==typeof e.CustomEvent){var u=new CustomEvent(t,{bubbles:true,detail:{anchor:o,toggle:r}});document.dispatchEvent(u);}};return function(c,a){var l,f,d,v,p={cancelScroll:function(e){cancelAnimationFrame(v),v=null,e||s("scrollCancel",l);},animateScroll:function(o,c,a){p.cancelScroll();var f=n(l||t,a||{}),h="[object Number]"===Object.prototype.toString.call(o),m=h||!o.tagName?null:o;if(h||m){var y=e.pageYOffset;f.header&&!d&&(d=document.querySelector(f.header));var b,g,w,E=u(d),O=h?o:function(t,n,o,u){var i=0;if(t.offsetParent)do{i+=t.offsetTop,t=t.offsetParent;}while(t);return i=Math.max(i-n-o,0),u&&(i=Math.min(i,r()-e.innerHeight)),i}(m,E,parseInt("function"==typeof f.offset?f.offset(o,c):f.offset,10),f.clip),S=O-y,_=r(),I=0,M=function(e,t){var n=t.speedAsDuration?t.speed:Math.abs(e/1e3*t.speed);return t.durationMax&&n>t.durationMax?t.durationMax:t.durationMin&&n<t.durationMin?t.durationMin:parseInt(n,10)}(S,f),L=function(t){b||(b=t),I+=t-b,w=y+S*function(e,t){var n;return "easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t}(f,g=(g=0===M?0:I/M)>1?1:g),e.scrollTo(0,Math.floor(w)),function(t,n){var r=e.pageYOffset;if(t==n||r==n||(y<n&&e.innerHeight+r)>=_)return p.cancelScroll(true),i(o,n,h),s("scrollStop",f,o,c),b=null,v=null,true}(w,O)||(v=e.requestAnimationFrame(L),b=t);};0===e.pageYOffset&&e.scrollTo(0,0),function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id);}(o,h,f),"matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches?i(o,Math.floor(O),false):(s("scrollStart",f,o,c),p.cancelScroll(true),e.requestAnimationFrame(L));}}},h=function(t){if(!t.defaultPrevented&&!(0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)&&"closest"in t.target&&(f=t.target.closest(c))&&"a"===f.tagName.toLowerCase()&&!t.target.closest(l.ignore)&&f.hostname===e.location.hostname&&f.pathname===e.location.pathname&&/#/.test(f.href)){var n,r;try{n=o(decodeURIComponent(f.hash));}catch(e){n=o(f.hash);}if("#"===n){if(!l.topOnEmptyHash)return;r=document.documentElement;}else r=document.querySelector(n);(r=r||"#top"!==n?r:document.documentElement)&&(t.preventDefault(),function(t){if(history.replaceState&&t.updateURL&&!history.state){var n=e.location.hash;n=n||"",history.replaceState({smoothScroll:JSON.stringify(t),anchor:n||e.pageYOffset},document.title,n||e.location.href);}}(l),p.animateScroll(r,f));}},m=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(l)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(o(history.state.anchor)))||p.animateScroll(t,null,{updateURL:false});}};return p.destroy=function(){l&&(document.removeEventListener("click",h,false),e.removeEventListener("popstate",m,false),p.cancelScroll(),l=null,f=null,d=null,v=null);},function(){if(!("querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype))throw "Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";p.destroy(),l=n(t,a||{}),d=l.header?document.querySelector(l.header):null,document.addEventListener("click",h,false),l.updateURL&&l.popstate&&e.addEventListener("popstate",m,false);}(),p}}(r)}.apply(t,[]),void 0===o||(e.exports=o);},432:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){ void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:true,get:function(){return t[n]}});}:function(e,t,n,o){ void 0===o&&(o=n),e[o]=t[n];}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n);};Object.defineProperty(t,"__esModule",{value:true}),r(n(47),t),r(n(926),t),r(n(349),t),r(n(137),t),r(n(729),t),r(n(383),t),r(n(450),t),r(n(358),t),r(n(753),t),r(n(869),t),r(n(352),t),r(n(446),t),r(n(164),t),r(n(305),t),r(n(502),t);},349:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useArrowNavigation=void 0;var o=n(156);t.useArrowNavigation=function(e){var t=e.listItems,n=e.onArrowUpOrDown,r=(0, o.useState)(0),u=r[0],i=r[1],s=(0, o.useCallback)((function(e){i(e);}),[t]),c=function(e){var o=e.key;if(null==t?void 0:t.length)if("ArrowUp"===o)n&&n(),e.preventDefault(),s(u>0?u-1:t.length-1);else {if("ArrowDown"!==o)return;n&&n(),e.preventDefault(),u<t.length-1?s(u+1):s(0);}};return (0, o.useEffect)((function(){return window.addEventListener("keydown",c),function(){return window.removeEventListener("keydown",c)}})),(0, o.useEffect)((function(){s(0);}),[t]),{selectedIndex:u}};},446:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useDebounce=void 0;var o=n(156);t.useDebounce=function(e,t){ void 0===t&&(t=300);var n=(0, o.useState)(e),r=n[0],u=n[1];return (0, o.useEffect)((function(){var n=setTimeout((function(){u(e);}),t);return function(){clearTimeout(n);}}),[e,t]),r};},164:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useElementSize=void 0;var o=n(156);t.useElementSize=function(){var e,t,n=(0, o.useRef)(null);return [n,{width:null===(e=null==n?void 0:n.current)||void 0===e?void 0:e.clientWidth,height:null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.clientHeight}]},t.default=t.useElementSize;},137:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIntersectionObserver=void 0;var o=n(156);t.useIntersectionObserver=function(e){var t=(0, o.useRef)(null),n=(0, o.useState)(false),r=n[0],u=n[1],i=function(e){var t=e[0];u(t.isIntersecting);};return (0, o.useEffect)((function(){if(window&&window.IntersectionObserver){var n=new IntersectionObserver(i,e),o=t.current;return t.current&&n.observe(t.current),function(){o&&n.unobserve(o);}}u(false);}),[t,e]),{containerRef:t,isVisible:r}},t.default=t.useIntersectionObserver;},729:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsBreakpoint=void 0;var o=n(156),r=n(432),u={xs:1,mobileSmall:320,mobile:375,tablet:768,tabletLarge:920,desktopSmall:1024,desktop:1260,desktopLarge:1440};t.useIsBreakpoint=function(e){var t="string"==typeof e?u[e]:e,n=(0, o.useState)(null),i=n[0],s=n[1],c=(0, o.useCallback)((function(){s(window.innerWidth);}),[]);return (0, o.useEffect)((function(){c();}),[]),(0, r.useOnResize)(c),i>=t},t.default=t.useIsBreakpoint;},450:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsLoadingAfterError=void 0;var o=n(156);t.useIsLoadingAfterError=function(e,t){var n=(0, o.useState)(t),r=n[0],u=n[1];return (0, o.useEffect)((function(){e||u(t);}),[e,t]),e&&r};},305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsMobile=void 0;var o=n(729);t.useIsMobile=function(){return !(0, o.useIsBreakpoint)("tablet")},t.default=t.useIsMobile;},383:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useIsomorphicLayoutEffect=void 0;var o=n(156);t.useIsomorphicLayoutEffect="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,t.default=t.useIsomorphicLayoutEffect;},753:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnLoseFocusWithin=void 0;var o=n(156);t.useOnLoseFocusWithin=function(e){var t=e.ref,n=e.callback,r=e.watch;(0, o.useEffect)((function(){var e=function(){var e;if(r)return (null===(e=t.current)||void 0===e?void 0:e.matches(":focus-within"))?void 0:n()};return document.addEventListener("keyup",e),function(){return document.removeEventListener("keyup",e)}}),[n,t,r]);},t.default=t.useOnLoseFocusWithin;},502:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnResize=void 0;var o=n(156);t.useOnResize=function(e){(0, o.useEffect)((function(){var t=function(){e(window.innerWidth);};return window.addEventListener("resize",t,{passive:true}),function(){return window.removeEventListener("resize",t)}}),[]);},t.default=t.useOnResize;},352:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOnWindowFocus=void 0;var o=n(156);t.useOnWindowFocus=function(e){(0, o.useEffect)((function(){var t=function(){e&&"visible"===document.visibilityState&&e();};return window.addEventListener("visibilitychange",t,false),function(){return window.removeEventListener("visibilitychange",t)}}),[e]);};},47:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useOutsideReacter=void 0;var o=n(156);t.useOutsideReacter=function(e,t){function n(n){e.current&&!e.current.contains(n.target)&&t();}(0, o.useEffect)((function(){return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n);}}));};},869:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useRunAfterUpdate=void 0;var o=n(156);t.useRunAfterUpdate=function(){var e=(0, o.useRef)(null);return (0, o.useEffect)((function(){e.current&&(e.current(),e.current=null);})),function(t){e.current=t;}},t.default=t.useRunAfterUpdate;},926:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true}),t.useScrollLock=void 0;var o=n(156);t.useScrollLock=function(){return {lock:(0, o.useCallback)((function(){var e=window.scrollY+"px",t=document.body;t.style.position="fixed",t.style.top="-"+e;}),[]),unlock:(0, o.useCallback)((function(){var e=document.body,t=e.style.top,n=-1*parseInt(t||"0");e.style.position="",e.style.top="",n&&window.scrollTo(0,-1*parseInt(t||"0"));}),[])}};},358:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true}),t.useSmoothScroll=void 0;var r=n(156),u=o(n(888));t.useSmoothScroll=function(e){var t=(0, r.useRef)(null),n=e.ref,o=e.offset,i=void 0===o?0:o,s=e.speed,c=void 0===s?500:s;return (0, r.useEffect)((function(){t.current=new u.default(null,{speed:c,speedAsDuration:true});}),[]),(0, r.useCallback)((function(){n&&t.current&&t.current.animateScroll(n.current,null,{offset:function(){return i},updateURL:false});}),[i,n])};},156:function(t){t.exports=e;}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var u=n[e]={exports:{}};return t[e].call(u.exports,u,u.exports,o),u.exports}return o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o(432)}()}));
|
|
6533
6534
|
|
|
6534
6535
|
} (lib));
|
|
6535
6536
|
return lib.exports;
|
|
@@ -6570,8 +6571,8 @@ function _objectWithoutProperties(e, t) {
|
|
|
6570
6571
|
|
|
6571
6572
|
const _excluded = ["item", "lng", "getItemProps", "highlightedIndex", "itemIndex", "styles"],
|
|
6572
6573
|
_excluded2 = ["suggestions", "getMenuProps", "getItemProps", "lng", "styles", "hidden", "renderClearHistoryButton", "handleClearHistory"];
|
|
6573
|
-
function ownKeys$
|
|
6574
|
-
function _objectSpread$
|
|
6574
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6575
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6575
6576
|
const Suggestion = /*#__PURE__*/memo(function Suggestion(_ref) {
|
|
6576
6577
|
let {
|
|
6577
6578
|
item,
|
|
@@ -6583,19 +6584,21 @@ const Suggestion = /*#__PURE__*/memo(function Suggestion(_ref) {
|
|
|
6583
6584
|
} = _ref,
|
|
6584
6585
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
6585
6586
|
const [t] = useTranslation();
|
|
6586
|
-
const newItem = item.type === 'FutureRoute' ? _objectSpread$
|
|
6587
|
+
const newItem = item.type === 'FutureRoute' ? _objectSpread$4(_objectSpread$4({}, item), {}, {
|
|
6587
6588
|
translatedText: translateFutureRouteSuggestionTime(item, lng, t)
|
|
6588
6589
|
}) : item;
|
|
6589
6590
|
const content = getSuggestionContent(item, lng, t);
|
|
6590
|
-
return /*#__PURE__*/
|
|
6591
|
+
return /*#__PURE__*/jsx("li", _objectSpread$4(_objectSpread$4({
|
|
6591
6592
|
className: cx(styles.suggestion, highlightedIndex === itemIndex && styles.suggestionHighlighted)
|
|
6592
6593
|
}, getItemProps({
|
|
6593
6594
|
index: itemIndex
|
|
6594
|
-
})),
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6595
|
+
})), {}, {
|
|
6596
|
+
children: /*#__PURE__*/jsx(SuggestionItem, _objectSpread$4({
|
|
6597
|
+
item: newItem,
|
|
6598
|
+
content: content,
|
|
6599
|
+
lng: lng
|
|
6600
|
+
}, rest))
|
|
6601
|
+
}));
|
|
6599
6602
|
});
|
|
6600
6603
|
const itemShape = process.env.NODE_ENV !== "production" ? PropTypes.shape({
|
|
6601
6604
|
name: PropTypes.string,
|
|
@@ -6643,30 +6646,35 @@ const Suggestions = /*#__PURE__*/memo(function Suggestions(_ref2) {
|
|
|
6643
6646
|
} = _ref2,
|
|
6644
6647
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
6645
6648
|
const [t] = useTranslation();
|
|
6646
|
-
return /*#__PURE__*/
|
|
6647
|
-
className: cx(styles.suggestionsContainerOpen, styles.suggestionsContainer, hidden && styles.hidden)
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6649
|
+
return /*#__PURE__*/jsx("div", {
|
|
6650
|
+
className: cx(styles.suggestionsContainerOpen, styles.suggestionsContainer, hidden && styles.hidden),
|
|
6651
|
+
children: /*#__PURE__*/jsxs("ul", _objectSpread$4(_objectSpread$4({
|
|
6652
|
+
className: styles.suggestionsList
|
|
6653
|
+
}, getMenuProps()), {}, {
|
|
6654
|
+
children: [suggestions.map((suggestion, i) => {
|
|
6655
|
+
return /*#__PURE__*/jsx(Suggestion, _objectSpread$4({
|
|
6656
|
+
getItemProps: getItemProps,
|
|
6657
|
+
itemIndex: i,
|
|
6658
|
+
item: suggestion,
|
|
6659
|
+
lng: lng,
|
|
6660
|
+
styles: styles
|
|
6661
|
+
}, rest), `${suggestion.type}-${suggestion.properties.gid || suggestion.properties.gtfsId || JSON.stringify(suggestion.properties)}`);
|
|
6662
|
+
}), renderClearHistoryButton &&
|
|
6663
|
+
/*#__PURE__*/
|
|
6664
|
+
// Not a selectable downshift item, so getItemProps is intentionally
|
|
6665
|
+
// not used here (its index would always be out of the items bounds).
|
|
6666
|
+
jsx("li", {
|
|
6667
|
+
children: /*#__PURE__*/jsx("button", {
|
|
6668
|
+
onClick: handleClearHistory,
|
|
6669
|
+
type: "button",
|
|
6670
|
+
className: styles['clear-search-history'],
|
|
6671
|
+
children: t('clear-search-history', {
|
|
6672
|
+
lng
|
|
6673
|
+
})
|
|
6674
|
+
})
|
|
6675
|
+
})]
|
|
6676
|
+
}))
|
|
6677
|
+
});
|
|
6670
6678
|
});
|
|
6671
6679
|
process.env.NODE_ENV !== "production" ? Suggestions.propTypes = {
|
|
6672
6680
|
suggestions: PropTypes.arrayOf(itemShape).isRequired,
|
|
@@ -6679,16 +6687,6 @@ process.env.NODE_ENV !== "production" ? Suggestions.propTypes = {
|
|
|
6679
6687
|
handleClearHistory: PropTypes.func
|
|
6680
6688
|
} : void 0;
|
|
6681
6689
|
|
|
6682
|
-
/**
|
|
6683
|
-
* Input clear button element
|
|
6684
|
-
* @typedef {object} ClearButtonProps
|
|
6685
|
-
* @property {string} color // hex color string
|
|
6686
|
-
* @property {string} lng // language, eg. 'fi'
|
|
6687
|
-
* @property {() => void} clearInput
|
|
6688
|
-
* @property {() => void} [onKeyDown]
|
|
6689
|
-
* @param {ClearButtonProps} props
|
|
6690
|
-
* @returns {JSX.Element}
|
|
6691
|
-
*/
|
|
6692
6690
|
const ClearButton = ({
|
|
6693
6691
|
color,
|
|
6694
6692
|
lng,
|
|
@@ -6697,18 +6695,19 @@ const ClearButton = ({
|
|
|
6697
6695
|
styles
|
|
6698
6696
|
}) => {
|
|
6699
6697
|
const [t] = useTranslation();
|
|
6700
|
-
return /*#__PURE__*/
|
|
6698
|
+
return /*#__PURE__*/jsx("button", {
|
|
6701
6699
|
type: "button",
|
|
6702
6700
|
className: styles['clear-input'],
|
|
6703
6701
|
onClick: clearInput,
|
|
6704
6702
|
"aria-label": t('clear-button-label', {
|
|
6705
6703
|
lng
|
|
6706
6704
|
}),
|
|
6707
|
-
onKeyDown: onKeyDown
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6705
|
+
onKeyDown: onKeyDown,
|
|
6706
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
6707
|
+
img: "close",
|
|
6708
|
+
color: color
|
|
6709
|
+
})
|
|
6710
|
+
});
|
|
6712
6711
|
};
|
|
6713
6712
|
process.env.NODE_ENV !== "production" ? ClearButton.propTypes = {
|
|
6714
6713
|
color: PropTypes.string.isRequired,
|
|
@@ -6718,6 +6717,8 @@ process.env.NODE_ENV !== "production" ? ClearButton.propTypes = {
|
|
|
6718
6717
|
styles: PropTypes.objectOf(PropTypes.string).isRequired
|
|
6719
6718
|
} : void 0;
|
|
6720
6719
|
|
|
6720
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6721
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6721
6722
|
function Input({
|
|
6722
6723
|
id,
|
|
6723
6724
|
lng,
|
|
@@ -6745,32 +6746,35 @@ function Input({
|
|
|
6745
6746
|
// wipes the keystroke and desyncs Android keyboards' composing range.
|
|
6746
6747
|
onValueChange(e.target.value);
|
|
6747
6748
|
};
|
|
6748
|
-
return /*#__PURE__*/
|
|
6749
|
-
className: styles.container
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6749
|
+
return /*#__PURE__*/jsxs("div", {
|
|
6750
|
+
className: styles.container,
|
|
6751
|
+
children: [renderLabel && /*#__PURE__*/jsx("label", _objectSpread$3(_objectSpread$3({}, getLabelProps({
|
|
6752
|
+
className: styles['sr-only'],
|
|
6753
|
+
htmlFor: id
|
|
6754
|
+
})), {}, {
|
|
6755
|
+
children: ariaLabel
|
|
6756
|
+
})), /*#__PURE__*/jsx("input", _objectSpread$3({
|
|
6757
|
+
"aria-label": ariaLabel
|
|
6758
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
6759
|
+
,
|
|
6760
|
+
autoFocus: autoFocus,
|
|
6761
|
+
placeholder: placeholder,
|
|
6762
|
+
required: required,
|
|
6763
|
+
type: "text",
|
|
6764
|
+
className: cx(styles.input, styles[id], inputClassName, isMobile && transportMode && styles.thin, value && styles.hasValue),
|
|
6765
|
+
id: id
|
|
6766
|
+
}, getInputProps({
|
|
6767
|
+
ref: inputRef,
|
|
6768
|
+
onBlur: inputOnBlur,
|
|
6769
|
+
onChange: handleChange
|
|
6770
|
+
}))), value && /*#__PURE__*/jsx(ClearButton, {
|
|
6771
|
+
lng: lng,
|
|
6772
|
+
clearInput: () => clearInput(inputRef),
|
|
6773
|
+
styles: styles,
|
|
6774
|
+
color: clearButtonColor,
|
|
6775
|
+
onKeyDown: e => isKeyboardSelectionEvent(e) && clearInput(inputRef)
|
|
6776
|
+
})]
|
|
6777
|
+
});
|
|
6774
6778
|
}
|
|
6775
6779
|
process.env.NODE_ENV !== "production" ? Input.propTypes = {
|
|
6776
6780
|
id: PropTypes.string.isRequired,
|
|
@@ -6798,37 +6802,6 @@ process.env.NODE_ENV !== "production" ? Input.propTypes = {
|
|
|
6798
6802
|
|
|
6799
6803
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6800
6804
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6801
|
-
|
|
6802
|
-
/**
|
|
6803
|
-
* @typedef AutosuggestState
|
|
6804
|
-
* @property {array} suggestions
|
|
6805
|
-
* @property {boolean} renderMobile
|
|
6806
|
-
*
|
|
6807
|
-
* @typedef MobileViewProps
|
|
6808
|
-
* @property {string} appElement
|
|
6809
|
-
* @property {string} id
|
|
6810
|
-
* @property {string} placeholder
|
|
6811
|
-
* @property {function} clearInput
|
|
6812
|
-
* @property {function} onSelectedItemChange
|
|
6813
|
-
* @property {function} clearOldSearches
|
|
6814
|
-
* @property {object} suggestionProps
|
|
6815
|
-
* @property {object} colors
|
|
6816
|
-
* @property {string} lng
|
|
6817
|
-
* @property {object} ariaProps
|
|
6818
|
-
* @property {string} value
|
|
6819
|
-
* @property {string} inputClassName
|
|
6820
|
-
* @property {boolean} required
|
|
6821
|
-
* @property {string} [mobileLabel]
|
|
6822
|
-
* @property {boolean} [showScroll]
|
|
6823
|
-
* @property {AutosuggestState} state
|
|
6824
|
-
* @property {function} dispatch
|
|
6825
|
-
* @property {Object} pendingEnterRef ref tracking whether a selection was
|
|
6826
|
-
* requested (click/enter) while suggestions were still loading; shared
|
|
6827
|
-
* with the parent DTAutosuggest component
|
|
6828
|
-
*
|
|
6829
|
-
* @param {MobileViewProps} props
|
|
6830
|
-
* @returns {JSX.Element}
|
|
6831
|
-
*/
|
|
6832
6805
|
const MobileView = ({
|
|
6833
6806
|
appElement,
|
|
6834
6807
|
id,
|
|
@@ -6858,7 +6831,7 @@ const MobileView = ({
|
|
|
6858
6831
|
const inputId = `${id}-input`;
|
|
6859
6832
|
const labelId = `${id}-label`;
|
|
6860
6833
|
const [isDialogOpen, setDialogOpen] = useState(false);
|
|
6861
|
-
const inputRef =
|
|
6834
|
+
const inputRef = require$$0.useRef();
|
|
6862
6835
|
useEffect(() => {
|
|
6863
6836
|
ReactModal.setAppElement(appElement);
|
|
6864
6837
|
}, []);
|
|
@@ -6968,104 +6941,111 @@ const MobileView = ({
|
|
|
6968
6941
|
ariaCurrentSuggestion
|
|
6969
6942
|
} = ariaProps;
|
|
6970
6943
|
const ariaLabel = ariaRequiredText.concat(' ').concat(SearchBarId).concat(' ').concat(ariaCurrentSuggestion);
|
|
6971
|
-
return /*#__PURE__*/
|
|
6944
|
+
return /*#__PURE__*/jsx(ReactModal, {
|
|
6972
6945
|
isOpen: state.renderMobile,
|
|
6973
6946
|
className: styles['mobile-modal'],
|
|
6974
6947
|
overlayClassName: styles['mobile-modal-overlay'],
|
|
6975
6948
|
shouldReturnFocusAfterClose: false,
|
|
6976
|
-
shouldCloseOnEsc: true
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
6949
|
+
shouldCloseOnEsc: true,
|
|
6950
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
6951
|
+
className: styles['mobile-modal-content'],
|
|
6952
|
+
style: {
|
|
6953
|
+
'--color': colors.primary,
|
|
6954
|
+
'--accessible-primary-color': colors.accessiblePrimary,
|
|
6955
|
+
'--hover-color': colors.hover
|
|
6956
|
+
},
|
|
6957
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
6958
|
+
className: styles['combobox-container'],
|
|
6959
|
+
htmlFor: inputId,
|
|
6960
|
+
children: [/*#__PURE__*/jsx("button", {
|
|
6961
|
+
type: "button",
|
|
6962
|
+
className: styles['combobox-icon'],
|
|
6963
|
+
onClick: () => {
|
|
6964
|
+
setHighlightedIndex(-1);
|
|
6965
|
+
dispatch({
|
|
6966
|
+
type: 'TOGGLE_MENU',
|
|
6967
|
+
isMobile: true
|
|
6968
|
+
});
|
|
6969
|
+
},
|
|
6970
|
+
onKeyDown: e => {
|
|
6971
|
+
if (isKeyboardSelectionEvent(e)) {
|
|
6972
|
+
setHighlightedIndex(-1);
|
|
6973
|
+
dispatch({
|
|
6974
|
+
type: 'TOGGLE_MENU',
|
|
6975
|
+
isMobile: true
|
|
6976
|
+
});
|
|
6977
|
+
}
|
|
6978
|
+
},
|
|
6979
|
+
"aria-label": t('cancel', {
|
|
6980
|
+
lng
|
|
6981
|
+
}),
|
|
6982
|
+
tabIndex: 0,
|
|
6983
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
6984
|
+
img: "arrow",
|
|
6985
|
+
color: colors.primary
|
|
6986
|
+
})
|
|
6987
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
6988
|
+
className: styles['right-column'],
|
|
6989
|
+
children: [/*#__PURE__*/jsx("span", _objectSpread$2(_objectSpread$2({
|
|
6990
|
+
className: styles['combobox-label'],
|
|
6991
|
+
id: labelId
|
|
6992
|
+
}, getLabelProps()), {}, {
|
|
6993
|
+
children: mobileLabel
|
|
6994
|
+
})), /*#__PURE__*/jsx(Input, {
|
|
6995
|
+
placeholder: isPOISearch(id) ? t('address-place-or-business', {
|
|
6996
|
+
lng
|
|
6997
|
+
}) : placeholder,
|
|
6998
|
+
id: id,
|
|
6999
|
+
lng: lng,
|
|
7000
|
+
value: value,
|
|
7001
|
+
getInputProps: getInputProps,
|
|
7002
|
+
getLabelProps: getLabelProps,
|
|
7003
|
+
clearInput: () => clearInput(inputRef),
|
|
7004
|
+
ariaLabel: ariaLabel,
|
|
7005
|
+
inputRef: inputRef,
|
|
7006
|
+
styles: styles,
|
|
7007
|
+
renderLabel: false,
|
|
7008
|
+
clearButtonColor: colors.primary,
|
|
7009
|
+
autoFocus: true,
|
|
7010
|
+
inputClassName: inputClassName,
|
|
7011
|
+
required: required,
|
|
7012
|
+
isMobile: true,
|
|
7013
|
+
onValueChange: handleValueChange
|
|
7014
|
+
}), /*#__PURE__*/jsx(Suggestions, _objectSpread$2({
|
|
7015
|
+
suggestions: state.suggestions,
|
|
7016
|
+
getMenuProps: getMenuProps,
|
|
7017
|
+
getItemProps: getItemProps,
|
|
7018
|
+
highlightedIndex: highlightedIndex,
|
|
7019
|
+
isOpen: true // when mobile view is open we always want to show suggestions
|
|
7020
|
+
,
|
|
7021
|
+
hidden: false,
|
|
7022
|
+
lng: lng,
|
|
7023
|
+
styles: styles,
|
|
7024
|
+
renderClearHistoryButton: true,
|
|
7025
|
+
handleClearHistory: handleClearHistory
|
|
7026
|
+
}, suggestionProps))]
|
|
7027
|
+
})]
|
|
7028
|
+
}), /*#__PURE__*/jsx(DialogModal, {
|
|
7029
|
+
isModalOpen: isDialogOpen,
|
|
7030
|
+
handleClose: () => setDialogOpen(false),
|
|
7031
|
+
headerText: t('delete-old-searches-header', {
|
|
7032
|
+
lng
|
|
7033
|
+
}),
|
|
7034
|
+
primaryButtonText: t('delete', {
|
|
7035
|
+
lng
|
|
7036
|
+
}),
|
|
7037
|
+
secondaryButtonText: t('cancel', {
|
|
7038
|
+
lng
|
|
7039
|
+
}),
|
|
7040
|
+
primaryButtonOnClick: () => {
|
|
7041
|
+
clearOldSearches();
|
|
7042
|
+
setDialogOpen(false);
|
|
7043
|
+
},
|
|
7044
|
+
secondaryButtonOnClick: () => setDialogOpen(false),
|
|
7045
|
+
lang: lng
|
|
7046
|
+
})]
|
|
7047
|
+
})
|
|
7048
|
+
});
|
|
7069
7049
|
};
|
|
7070
7050
|
process.env.NODE_ENV !== "production" ? MobileView.propTypes = {
|
|
7071
7051
|
appElement: PropTypes.string.isRequired,
|
|
@@ -7170,14 +7150,6 @@ const searchReducer = (state, action) => {
|
|
|
7170
7150
|
|
|
7171
7151
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7172
7152
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7173
|
-
|
|
7174
|
-
// Hoisted so these defaults are referentially stable across renders. Using
|
|
7175
|
-
// inline object/array literals as parameter defaults (e.g. `sources = []`)
|
|
7176
|
-
// creates a brand-new reference on every render in which the caller omits
|
|
7177
|
-
// the prop, which in turn invalidates every hook (useEffect/useCallback/
|
|
7178
|
-
// useMemo) that depends on them - e.g. causing `fetchSuggestions` to be
|
|
7179
|
-
// recreated and refetch on every render, and the `RESET_SOURCES` effect to
|
|
7180
|
-
// fire in a loop.
|
|
7181
7153
|
const DEFAULT_SOURCES = [];
|
|
7182
7154
|
const DEFAULT_PATH_OPTS = {
|
|
7183
7155
|
routesPrefix: 'linjat',
|
|
@@ -7714,8 +7686,9 @@ function DTAutosuggest({
|
|
|
7714
7686
|
}),
|
|
7715
7687
|
getAutoSuggestIcons,
|
|
7716
7688
|
colors,
|
|
7717
|
-
modeSet
|
|
7718
|
-
|
|
7689
|
+
modeSet,
|
|
7690
|
+
showStopStatusMarkers: !!searchContext.showStopStatusMarkers
|
|
7691
|
+
}), [state.loading, isMobile, t, lng, getAutoSuggestIcons, colors, modeSet, searchContext.showStopStatusMarkers]);
|
|
7719
7692
|
const {
|
|
7720
7693
|
ariaCurrentSuggestion,
|
|
7721
7694
|
ariaRequiredText,
|
|
@@ -7752,76 +7725,80 @@ function DTAutosuggest({
|
|
|
7752
7725
|
});
|
|
7753
7726
|
}
|
|
7754
7727
|
}, [state.renderMobile, isOpen]);
|
|
7755
|
-
return /*#__PURE__*/
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7728
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
7729
|
+
children: [isMobile && /*#__PURE__*/jsx(MobileView, {
|
|
7730
|
+
placeholder: t(placeholder, {
|
|
7731
|
+
lng
|
|
7732
|
+
}),
|
|
7733
|
+
clearOldSearches: mobileClearOldSearches,
|
|
7734
|
+
appElement: appElement,
|
|
7735
|
+
mobileLabel: mobileLabel || t(id, {
|
|
7736
|
+
lng
|
|
7737
|
+
}),
|
|
7738
|
+
ariaProps: {
|
|
7739
|
+
ariaCurrentSuggestion,
|
|
7740
|
+
SearchBarId,
|
|
7741
|
+
ariaRequiredText
|
|
7742
|
+
},
|
|
7743
|
+
id: id,
|
|
7744
|
+
lng: lng,
|
|
7745
|
+
onSelectedItemChange: onSelectedItemChange,
|
|
7746
|
+
value: state.value,
|
|
7747
|
+
clearInput: clearInput,
|
|
7748
|
+
suggestionProps: baseItemProps,
|
|
7749
|
+
showScroll: !!showScroll,
|
|
7750
|
+
colors: colors,
|
|
7751
|
+
inputClassName: inputClassName,
|
|
7752
|
+
required: required,
|
|
7753
|
+
state: state,
|
|
7754
|
+
dispatch: dispatch,
|
|
7755
|
+
pendingEnterRef: pendingEnterRef
|
|
7756
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7757
|
+
className: cx(styles['autosuggest-input-container'], styles[id], state.renderMobile && 'hidden'),
|
|
7758
|
+
style: {
|
|
7759
|
+
'--color': colors.primary,
|
|
7760
|
+
'--hover-color': colors.hover
|
|
7761
|
+
},
|
|
7762
|
+
children: [icon && /*#__PURE__*/jsx("div", {
|
|
7763
|
+
className: cx(styles['autosuggest-input-icon'], styles[id], inputClassName && styles[`${inputClassName}-input-icon`]),
|
|
7764
|
+
"aria-label": ariaRequiredText.concat(' ').concat(SearchBarId).concat(' ').concat(t('search-autosuggest-label', {
|
|
7765
|
+
lng
|
|
7766
|
+
})),
|
|
7767
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
7768
|
+
img: `${icon}`
|
|
7769
|
+
})
|
|
7770
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
7771
|
+
inputClassName: inputClassName,
|
|
7772
|
+
ariaLabel: ariaCurrentSuggestion.concat(' ').concat(ariaRequiredText).concat(' ').concat(SearchBarId).concat(' ').concat(ariaLabelText),
|
|
7773
|
+
id: id,
|
|
7774
|
+
lng: lng,
|
|
7775
|
+
getInputProps: getInputProps,
|
|
7776
|
+
getLabelProps: getLabelProps,
|
|
7777
|
+
selectItem: selectItem,
|
|
7778
|
+
value: state.value,
|
|
7779
|
+
clearInput: clearInput,
|
|
7780
|
+
inputRef: inputRef,
|
|
7781
|
+
styles: styles,
|
|
7782
|
+
clearButtonColor: colors.primary,
|
|
7783
|
+
placeholder: translatedPlaceholder || t(placeholder, {
|
|
7784
|
+
lng
|
|
7785
|
+
}),
|
|
7786
|
+
required: required,
|
|
7787
|
+
transportMode: transportMode,
|
|
7788
|
+
isMobile: isMobile,
|
|
7789
|
+
inputOnBlur: inputOnBlur,
|
|
7790
|
+
onValueChange: handleValueChange
|
|
7791
|
+
}), /*#__PURE__*/jsx(Suggestions, _objectSpread({
|
|
7792
|
+
hidden: !isOpen || !state.suggestions.length || isMobile,
|
|
7793
|
+
highlightedIndex: highlightedIndex,
|
|
7794
|
+
getItemProps: getItemProps,
|
|
7795
|
+
getMenuProps: getMenuProps,
|
|
7796
|
+
suggestions: state.suggestions,
|
|
7797
|
+
lng: lng,
|
|
7798
|
+
styles: styles
|
|
7799
|
+
}, baseItemProps))]
|
|
7800
|
+
})]
|
|
7801
|
+
});
|
|
7825
7802
|
}
|
|
7826
7803
|
process.env.NODE_ENV !== "production" ? DTAutosuggest.propTypes = {
|
|
7827
7804
|
appElement: PropTypes.string.isRequired,
|
|
@@ -7838,7 +7815,8 @@ process.env.NODE_ENV !== "production" ? DTAutosuggest.propTypes = {
|
|
|
7838
7815
|
// eslint-disable-next-line
|
|
7839
7816
|
context: PropTypes.object,
|
|
7840
7817
|
clearOldSearches: PropTypes.func,
|
|
7841
|
-
clearFutureRoutes: PropTypes.func
|
|
7818
|
+
clearFutureRoutes: PropTypes.func,
|
|
7819
|
+
showStopStatusMarkers: PropTypes.bool
|
|
7842
7820
|
}).isRequired,
|
|
7843
7821
|
sources: PropTypes.arrayOf(PropTypes.string),
|
|
7844
7822
|
targets: PropTypes.arrayOf(PropTypes.string),
|
|
@@ -7869,9 +7847,10 @@ process.env.NODE_ENV !== "production" ? DTAutosuggest.propTypes = {
|
|
|
7869
7847
|
isEmbedded: PropTypes.bool
|
|
7870
7848
|
} : void 0;
|
|
7871
7849
|
var index = props => {
|
|
7872
|
-
return /*#__PURE__*/
|
|
7873
|
-
i18n: i18n
|
|
7874
|
-
|
|
7850
|
+
return /*#__PURE__*/jsx(I18nextProvider, {
|
|
7851
|
+
i18n: i18n,
|
|
7852
|
+
children: /*#__PURE__*/jsx(DTAutosuggest, _objectSpread({}, props))
|
|
7853
|
+
});
|
|
7875
7854
|
};
|
|
7876
7855
|
|
|
7877
7856
|
export { index as default };
|