@digitransit-component/digitransit-component-autosuggest 1.7.21 → 1.7.22
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.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var c,n;c=this,n=function(e){void 0===e.version&&e.default&&(e=e.default);var c,
|
|
|
10
10
|
//! moment.js locale configuration
|
|
11
11
|
var c="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",c[7],c[8],c[9]];function o(e,o,a,t){var i="";switch(a){case"s":return t?"muutaman sekunnin":"muutama sekunti";case"ss":i=t?"sekunnin":"sekuntia";break;case"m":return t?"minuutin":"minuutti";case"mm":i=t?"minuutin":"minuuttia";break;case"h":return t?"tunnin":"tunti";case"hh":i=t?"tunnin":"tuntia";break;case"d":return t?"päivän":"päivä";case"dd":i=t?"päivän":"päivää";break;case"M":return t?"kuukauden":"kuukausi";case"MM":i=t?"kuukauden":"kuukautta";break;case"y":return t?"vuoden":"vuosi";case"yy":i=t?"vuoden":"vuotta"}return i=function(e,o){return e<10?o?n[e]:c[e]:e}(e,t)+" "+i,i}return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},n(Be)})),Te((function(e,c){var n;n=function(e){return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var c=e%10;return e+(1==~~(e%100/10)?":e":1===c||2===c?":a":":e")},week:{dow:1,doy:4}})},n(Be)})),Te((function(e,c){var n;n=function(e){
|
|
12
12
|
//! moment.js locale configuration
|
|
13
|
-
function c(e,c,n,o){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return c?a[n][0]:a[n][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:c,mm:"%d Minuten",h:c,hh:"%d Stunden",d:c,dd:c,w:c,ww:"%d Wochen",M:c,MM:c,y:c,yy:c},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},n(Be)})),{de:{address:"Adresse","address-place-or-business":"Adress, Ort or Geschäft","add-via-button-label":"Füge Zwischenziel hinzu","add-via-duration-button-label":"Set stop duration at via point {{index}}","add-via-duration-button-label-close":"Close stop duration selector at via point {{index}}","add-via-duration-button-label-open":"Open stop duration selector at via point {{index}}",airplane:"Flug",arrival:"Ankunft",back:"Zurück",bikerentalstation:"Leihrad-Station",bus:"Bus",cancel:"Abbrechen","clear-button-label":"Löschen","clear-search-history":"Suchhistorie löschen",currentposition:"Aktuelle Position",delete:"Löschen","delete-old-searches-header":"Wollen Sie die Such-Historie löschen?",departure:"Abfahrt",destination:"Ziel","give-origin":"Start eingeben.","give-destination":"Ziel eingeben.",favourite:"Favoriten",ferry:"Fähre","future-route":"Zukünftige Verbindung",origin:"Start","origin-stop-near-you":"Start",ownlocations:"Eigene Favoriten",loading:"Laden...","minute-short":"min",rail:"Zug",search:"Suche","search-address-or-place":"Suche anhand von Adresse oder Ortsangabe","search-button-label":"Suche","search-destination":"Suche Zielort, Linie or Haltestelle","search-destination-index":"Zielort eingeben","search-destination-results-but-no-search":"Ergebnisse in “Zielort”-Reiter anzeigen","search-no-results":"Kein Ort gefunden.","search-origin":"Suche Startort, Linie oder Haltestelle","search-origin-index":"Startort eingeben","search-position":"Standort ermitteln","search-autosuggest-label":"Venue, place and stopsearch. Navigate list with arrow keys and select with enter key","search-autosuggest-len":"There is {{count}} suggestion available","search-autosuggest-len_plural":"There are {{count}} suggestions available","search-current-suggestion":"Aktuelle Auswahl: {{selection}}",subway:"U-Bahn",station:"Station",stop:"Haltestelle","stop-near-you":"Suche Haltestellen und Linien in der Nähe","stop-near-you-bus":"Suche Buslinien or Haltestellen","stop-near-you-citybike":"Suche Leihrad-Stationen","stop-near-you-rail":"Suche Zugverbindungen oder Bahnhöfe","stop-near-you-subway":"Suche U-Bahn-Linien oder Haltestellen","stop-near-you-tram":"Suche Stadtbahn-Haltestellen-Suche","today-at":"Heute um","tomorrow-at":"Morgen um",tram:"Straßenbahn","use-own-position":"Benutze aktuellen Standort","select-from-map":"Wähle Position anhand Karte","select-from-own-locations":"Aus eigenen Favoriten auswählen",venue:"Venue","via-point":"Zwischenziel",where:"Wohin?",place:"Ort"},en:{address:"Address","address-place-or-business":"Address, place or business","add-via-button-label":"Add via point","add-via-duration-button-label":"Set stop duration at via point {{index}}","add-via-duration-button-label-close":"Close stop duration selector at via point {{index}}","add-via-duration-button-label-open":"Open stop duration selector at via point {{index}}",airplane:"Flight",arrival:"Arrival",back:"Back",bikerentalstation:"Bike station",bus:"bus",cancel:"Cancel","clear-button-label":"Clear","clear-search-history":"Clear search history",currentposition:"Current position",delete:"Delete","delete-old-searches-header":"Do you want to clear the search history?",departure:"Departure",destination:"Destination","give-origin":"Enter your origin.","give-destination":"Enter your destination",favourite:"Favourite",ferry:"Ferry","future-route":"Future route",origin:"Start","origin-stop-near-you":"Start",ownlocations:"Own locations",loading:"Loading...","minute-short":"m",rail:"Train",required:"required field",search:"Search","search-address-or-place":"Search by address or place name","search-button-label":"Search","search-destination":"Search destination, route or stop","search-destination-index":"Enter destination","search-destination-results-but-no-search":"View results in the adjacent “Destination” tab","search-no-results":"No location","search-origin":"Search origin, route or stop","search-origin-index":"Enter origin","search-position":"Detect location","search-autosuggest-label":"Venue, place and stopsearch. Navigate list with arrow keys and select with enter key","search-autosuggest-len":"There is {{count}} suggestion available","search-autosuggest-len_plural":"There are {{count}} suggestions available","search-current-suggestion":"Current selection: {{selection}}",subway:"Metro",station:"Station",stop:"Stop","stop-near-you":"Search stops and routes","stop-near-you-airplane":"Search flights or airports","stop-near-you-bus":"Search bus routes or stops","stop-near-you-citybike":"Search city bike stations","stop-near-you-rail":"Search train routes or stations","stop-near-you-subway":"Search metro routes or stations ","stop-near-you-tram":"Search tram routes or stops","stop-route-station":"Bus and stop search","today-at":"today at","tomorrow-at":"tomorrow at",tram:"Tram","use-own-position":"Use current location","select-from-map":"Select position from map","select-from-own-locations":"Select from own locations",venue:"Venue","via-point":"Via point",where:"Where to?",place:"Location"},fi:{address:"Osoite","address-place-or-business":"Osoite, paikka tai yritys","add-via-button-label":"Lisää välipiste","add-via-duration-button-label":"Aseta välipisteelle {{index}} pysähdyksen kesto","add-via-duration-button-label-close":"Avaa välipisteen {{index}} pysähdyksen kesto valitsin","add-via-duration-button-label-open":"Sulje välipisteen {{index}} pysähdyksen kesto valitsin",airplane:"Lentokone",arrival:"Perillä",back:"Takaisin",bikerentalstation:"Pyöräasema",bus:"bussi",cancel:"Peruuta","clear-button-label":"Tyhjennä","clear-search-history":"Tyhjennä hakuhistoria",currentposition:"Tämänhetkinen sijainti",delete:"Poista","delete-old-searches-header":"Haluatko tyhjentää hakuhistorian?",departure:"Lähtöaika",destination:"Määränpää",favourite:"Suosikki",ferry:"Lautta","future-route":"Tuleva reitti","give-origin":"Lähtöpaikka","give-destination":"Määränpää",origin:"Lähtöpaikka","origin-stop-near-you":"Lähtöpaikka",ownlocations:"Omat paikat",loading:"Ladataan...","minute-short":"min",rail:"Juna",required:"pakollinen kenttä",search:"Etsi","search-address-or-place":"Hae osoitteella tai paikan nimellä","search-button-label":"Hae","search-destination":"Hae määränpäätä, linjaa tai pysäkkiä","search-destination-index":"Syötä määränpää","search-destination-results-but-no-search":"Katso tulokset viereiseltä Määränpää-välilehdeltä","search-no-results":"Ei tuloksia","search-origin":"Hae lähtöpaikkaa, linjaa tai pysäkkiä","search-origin-index":"Syötä lähtöpaikka","search-autosuggest-label":"Paikka, linja ja pysäkkihaku. Navigoi listassa nuolinäppäimillä ja valitse enterillä","search-autosuggest-len":" Löydettiin {{count}} ehdotus","search-autosuggest-len_plural":" Löydettiin {{count}} ehdotusta","search-current-suggestion":"Tämänhetkinen valinta: {{selection}}","search-position":"Paikanna",subway:"Metro",station:"Asema",stop:"Pysäkki","stop-near-you":"Linja, pysäkki tai asema","stop-near-you-airplane":"Hae lentoja tai lentoasemaa","stop-near-you-bus":"Hae bussilinjaa tai pysäkkiä","stop-near-you-citybike":"Hae kaupunkipyöräasemaa","stop-near-you-rail":"Hae lähijunaa tai asemaa","stop-near-you-subway":"Hae metrolinjaa tai asemaa","stop-near-you-tram":"Hae raitiolinjaa tai pysäkkiä","stop-route-station":"Linja- ja pysäkkihaku","today-at":"tänään klo","tomorrow-at":"huomenna klo",tram:"Raitiovaunu","use-own-position":"Käytä nykyistä sijaintia","select-from-map":"Valitse sijainti kartalta","select-from-own-locations":"Valitse omista paikoista",venue:"Paikka","via-point":"Välipiste",where:"Minne mennään?",place:"Paikka"},sv:{address:"Adress","address-place-or-business":"Adress, plats eller företag","add-via-button-label":"Lägg till viapunkt","add-via-duration-button-label":"Ställ in varaktighet för viapunkten {{index}}","add-via-duration-button-label-close":"Stäng väljaren för varaktighet vid via-punkten {{index}}","add-via-duration-button-label-open":"Öppna väljaren för varaktighet vid via-punkten {{index}}",airplane:"Flyg",arrival:"Anländer",back:"Tillbaka",bikerentalstation:"Stadscykelstation",bus:"Bussi",cancel:"Avbryt","clear-button-label":"Töm","clear-search-history":"Töm sökhistoriken",currentposition:"Nuvarande position",delete:"Ta bort","delete-old-searches-header":"Vill du tömma sökhistoriken?",departure:"Avgångstid",destination:"Destination",favourite:"Favorit",ferry:"Färja","future-route":"Framtida rutt","give-destination":"Skriv in din destination","give-origin":"Skriv in din avfärdsplats",origin:"Avfärdsplats","origin-stop-near-you":"Avfärdsplats",ownlocations:"Egna platser",loading:"Laddar...","minute-short":"min",rail:"Tåg",required:"obligatoriskt fält",search:"Sök","search-address-or-place":"Sök med adressen eller platsens namn","search-button-label":"Sök","search-destination":"Sök destination, linje eller hållplats","search-destination-index":"Skriv destination","search-destination-results-but-no-search":"Se resultaten under fliken Destination","search-no-results":"Inga sökresultat","search-origin":"Sök avfärdsplats, linje eller hållplats","search-origin-index":"Skriv avfärdsplats","search-position":"Sök position","search-autosuggest-label":"Plats, linje och hållplatssökning. Navigera listan med piltangenterna och välj med Enter-tangeten","search-autosuggest-len":"Hittade {{count}} förslag","search-current-suggestion":"Nuvarande val: {{selection}}",subway:"Metro",station:"Station",stop:"Hållplats","stop-near-you":"Sök hållplatser eller linjer","stop-near-you-airplane":"Sök flyg eller flygplatser","stop-near-you-bus":"Sök busslinjer eller hållplatser","stop-near-you-citybike":"Sök stadscykelstationer","stop-near-you-rail":"Sök närtåger eller stationer","stop-near-you-subway":"Sök metrolinjer eller stationer","stop-near-you-tram":"Sök spårvagnlinjer eller hållplatser","stop-route-station":"Buss och stopp sökningen","today-at":"i dag kl","tomorrow-at":"i morgon",tram:"Spårvagn","use-own-position":"Använd min position","select-from-map":"Välj position från kartan","select-from-own-locations":"Välj från egna platser",venue:"Mötesplats","via-point":"Via punkt",where:"Vart vill du åka?",place:"Plats"}});function De(e,c){void 0===c&&(c={});var n=c.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var Pe={container:"styles_container__1NKX8",input:"styles_input__J8Q0h",favourite:"styles_favourite__384ME",thin:"styles_thin__31pf2",hasValue:"styles_hasValue__3IDIO",suggestionsContainerOpen:"styles_suggestionsContainerOpen__1uEOH",suggestionsContainer:"styles_suggestionsContainer__3P1xL",suggestionsList:"styles_suggestionsList__3DnHc",suggestion:"styles_suggestion__1YRxV",suggestionHighlighted:"styles_suggestionHighlighted__28ZnP","autosuggest-input-container":"styles_autosuggest-input-container__IxbT_",origin:"styles_origin__1qX8p",destination:"styles_destination__3DZBi","stop-route-station":"styles_stop-route-station__2PwTH","autosuggest-input-icon":"styles_autosuggest-input-icon__2PARI","origin-stop-near-you":"styles_origin-stop-near-you__1-J6m","clear-input":"styles_clear-input__1_PXf","sr-only":"styles_sr-only__B2xmy"};De("/* stylelint-disable */\ninput[type='text'] {\n margin: 0; }\n\n.styles_container__1NKX8 {\n display: -ms-flexbox;\n display: flex;\n width: 100%; }\n .styles_container__1NKX8 .styles_input__J8Q0h {\n font-size: 16px;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 44px;\n border-radius: 5px;\n border: solid 1px #888888;\n background-color: #ffffff;\n padding-left: 50px;\n padding-right: 44px;\n line-height: 1.2;\n letter-spacing: -0.5px;\n color: #333;\n box-sizing: border-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none; }\n .styles_container__1NKX8 .styles_input__J8Q0h.styles_favourite__384ME {\n padding-left: 47px; }\n .styles_container__1NKX8 .styles_input__J8Q0h.styles_thin__31pf2 {\n height: 34px; }\n .styles_container__1NKX8 .styles_input__J8Q0h:focus {\n background: #fff;\n outline: none;\n border: solid 1px var(--color);\n box-shadow: none;\n box-shadow: 0px 0px 2px 1px var(--hover-color); }\n @media screen and (min-width: 768px) {\n .styles_container__1NKX8 .styles_input__J8Q0h {\n font-size: 15px;\n height: 44px;\n padding-left: 49px; } }\n .styles_container__1NKX8 .styles_input__J8Q0h:-ms-input-placeholder {\n color: #666666;\n font-size: 15px; }\n .styles_container__1NKX8 .styles_input__J8Q0h::placeholder {\n color: #666666;\n font-size: 15px; }\n\n.styles_hasValue__3IDIO {\n color: #333333; }\n\n.styles_suggestionsContainerOpen__1uEOH {\n width: 100%;\n max-height: 44vh;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: solid 1px rgba(0, 0, 0, 0.1);\n overflow-x: hidden;\n overflow-y: scroll;\n position: absolute;\n background-color: white;\n top: calc(3 * 0.875rem + 9px);\n z-index: 20; }\n\n.styles_suggestionsContainer__3P1xL {\n background-color: white;\n z-index: 20; }\n .styles_suggestionsContainer__3P1xL .styles_suggestionsList__3DnHc {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n background: white; }\n .styles_suggestionsContainer__3P1xL .styles_suggestionsList__3DnHc li:hover {\n background: #F4F4F5; }\n\n.styles_suggestion__1YRxV {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n cursor: pointer;\n list-style: none;\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n white-space: nowrap; }\n\n.styles_suggestionHighlighted__28ZnP {\n background-color: #F4F4F5; }\n\n.styles_autosuggest-input-container__IxbT_ {\n position: relative;\n width: 100%; }\n .styles_autosuggest-input-container__IxbT_.styles_origin__1qX8p {\n z-index: 16; }\n .styles_autosuggest-input-container__IxbT_.styles_destination__3DZBi {\n z-index: 10; }\n .styles_autosuggest-input-container__IxbT_.styles_stop-route-station__2PwTH {\n z-index: 9; }\n\n.styles_autosuggest-input-icon__2PARI {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n -ms-flex-align: center;\n align-items: center;\n width: 16px;\n height: 100%;\n margin-top: 0;\n margin-left: 19px; }\n .styles_autosuggest-input-icon__2PARI svg {\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_origin__1qX8p svg {\n fill: #4ea700;\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_destination__3DZBi svg {\n fill: #ec5188;\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_stop-route-station__2PwTH svg, .styles_autosuggest-input-icon__2PARI.styles_favourite__384ME svg {\n fill: #888888;\n width: 16px;\n height: 16px; }\n .styles_autosuggest-input-icon__2PARI.styles_origin-stop-near-you__1-J6m svg {\n fill: #888888;\n width: 16px;\n height: 16px; }\n\nbutton.styles_clear-input__1_PXf {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n padding: 14px 0;\n right: 0px;\n width: 44px;\n height: 100%;\n color: var(--color);\n outline: none;\n border: 0px;\n margin: 0px;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: left;\n background: none;\n border-style: none;\n border-width: 0px;\n cursor: pointer;\n font-family: inherit;\n background-color: transparent;\n transition: none; }\n button.styles_clear-input__1_PXf svg {\n fill: var(--color);\n width: 16px;\n height: 16px; }\n button.styles_clear-input__1_PXf:focus {\n background-color: transparent;\n color: inherit;\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color; }\n button.styles_clear-input__1_PXf:active {\n background-color: transparent;\n color: inherit; }\n button.styles_clear-input__1_PXf:hover {\n background-color: transparent;\n color: inherit; }\n\n.styles_sr-only__B2xmy:not(:focus):not(:active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n");var xe={"fullscreen-root":"MobileSearch_fullscreen-root__3mzJu","combobox-container":"MobileSearch_combobox-container__2dXKy","right-column":"MobileSearch_right-column__KzsqW","combobox-icon":"MobileSearch_combobox-icon__2y89R","combobox-label":"MobileSearch_combobox-label__20dJF",container:"MobileSearch_container__33kZY",input:"MobileSearch_input__1-Zl9","clear-input":"MobileSearch_clear-input__1x_WA",hasValue:"MobileSearch_hasValue__1ByEp",suggestion:"MobileSearch_suggestion__2AjCH",suggestionHighlighted:"MobileSearch_suggestionHighlighted__14vbR",suggestionsContainerOpen:"MobileSearch_suggestionsContainerOpen__2hg77",suggestionsList:"MobileSearch_suggestionsList__cWAt3","clear-search-history":"MobileSearch_clear-search-history__3A-ea","mobile-modal-overlay":"MobileSearch_mobile-modal-overlay__1SB12","mobile-modal":"MobileSearch_mobile-modal__H2JRE","mobile-modal-content":"MobileSearch_mobile-modal-content__vH5o7"};function Ie(e){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=ce(e);if(c){var a=ce(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return ee(this,n)}}De("input[type='text'] {\n margin: 0;\n padding: 0; }\n\n.MobileSearch_fullscreen-root__3mzJu {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n background: #fff;\n z-index: 1000; }\n\n.MobileSearch_combobox-container__2dXKy {\n margin: 15px 10px 0;\n border: solid #888888 1px;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n border-radius: 5px;\n height: 60px;\n -ms-flex-pack: justify;\n justify-content: space-between; }\n .MobileSearch_combobox-container__2dXKy .MobileSearch_right-column__KzsqW {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: 9px; }\n\n.MobileSearch_combobox-icon__2y89R {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n height: 100%;\n width: 52px; }\n .MobileSearch_combobox-icon__2y89R svg {\n fill: #007ac9;\n width: 14px;\n height: 21px;\n transform: rotate(-180deg); }\n\n.MobileSearch_combobox-label__20dJF {\n position: relative;\n top: -2px;\n font-size: 12px;\n font-weight: var(--font-weight-medium);\n letter-spacing: -0.2px;\n color: #333333; }\n\n.MobileSearch_container__33kZY {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n width: 100%; }\n .MobileSearch_container__33kZY .MobileSearch_input__1-Zl9 {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n width: 100%;\n position: relative;\n padding-bottom: 7px;\n top: 2px;\n border: none;\n height: 26px;\n font-weight: normal;\n box-shadow: none;\n font-size: 16px;\n letter-spacing: -0.5px;\n color: #666666;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none; }\n .MobileSearch_container__33kZY .MobileSearch_input__1-Zl9:focus {\n outline: none;\n border: none;\n box-shadow: none;\n background: #fff; }\n\nbutton.MobileSearch_clear-input__1x_WA {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n right: 0px;\n padding: 0 15px 7px 0;\n height: 26px;\n color: var(--color);\n outline: none;\n border: 0px;\n margin: 0px;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: left;\n background: none;\n border-style: none;\n border-width: 0px;\n cursor: pointer;\n font-family: inherit;\n background-color: transparent;\n transition: none; }\n button.MobileSearch_clear-input__1x_WA svg {\n fill: var(--color);\n width: 16px;\n height: 16px; }\n button.MobileSearch_clear-input__1x_WA:focus {\n background-color: transparent;\n color: inherit; }\n button.MobileSearch_clear-input__1x_WA:active {\n background-color: transparent;\n color: inherit; }\n button.MobileSearch_clear-input__1x_WA:hover {\n background-color: transparent;\n color: inherit; }\n\n.MobileSearch_hasValue__1ByEp {\n color: #333333; }\n\n.MobileSearch_suggestion__2AjCH {\n font-size: 15px;\n min-height: 50px;\n letter-spacing: -0.6px;\n color: #333333;\n font-weight: 500;\n background: #fff;\n margin: 0;\n padding: 0; }\n\n.MobileSearch_suggestionHighlighted__14vbR {\n background-color: #F4F4F5; }\n\n.MobileSearch_suggestionsContainerOpen__2hg77 {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n margin-bottom: auto;\n z-index: 20;\n width: 100vw;\n max-height: calc(100% - 75px);\n height: 100%;\n top: 75px;\n left: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n -ms-overflow-style: none;\n /* Internet Explorer 10+ */\n scrollbar-width: none;\n /* Firefox */ }\n .MobileSearch_suggestionsContainerOpen__2hg77::-webkit-scrollbar {\n display: none;\n /* Safari and Chrome */ }\n .MobileSearch_suggestionsContainerOpen__2hg77 .MobileSearch_suggestionsList__cWAt3 {\n width: 100vw;\n list-style: none;\n padding-left: 0;\n margin: 0;\n background: #f4f4f5; }\n\n.MobileSearch_clear-search-history__3A-ea {\n display: -ms-flexbox;\n display: flex;\n margin-top: auto;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n width: 100%;\n height: 62px;\n background: #f4f4f5;\n color: var(--color);\n font-size: 15px;\n font-weight: var(--font-weight-medium);\n letter-spacing: -0.42px;\n border-top: 1px solid #ddd; }\n\n.MobileSearch_mobile-modal-overlay__1SB12 {\n z-index: 9999;\n top: 0;\n left: 0;\n right: unset;\n bottom: unset;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n background-color: white;\n position: fixed; }\n\n.MobileSearch_mobile-modal__H2JRE {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n /* stylelint-disable-next-line */\n /* stylelint-disable-next-line */ }\n .MobileSearch_mobile-modal__H2JRE.ReactModal__Content--after-open > div {\n transform: translateY(0); }\n .MobileSearch_mobile-modal__H2JRE.ReactModal__Content--before-close > div {\n transform: translateY(10%); }\n\n.MobileSearch_mobile-modal-content__vH5o7 {\n position: fixed;\n width: 100%;\n height: 100%;\n outline: none;\n background-color: #ffffff;\n transition: transform 0.25s;\n transform: translateY(10%); }\n");var He=function(e){Z(n,e);var c=Ie(n);function n(e){var o;K(this,n);var a=$(o=c.call(this,e));return a.onSuggestionTouchMove=function(){a.justSelectedSuggestion=!1,a.pressedSuggestion=null},o}return n}(X.default),Ye=function(e){var c,o=e.appElement,a=e.id,t=e.closeHandle,i=e.clearInput,r=e.value,M=e.suggestions,s=e.inputProps,p=e.fetchFunction,u=e.renderSuggestion,l=e.getSuggestionValue,d=e.ariaLabel,b=e.label,A=e.onSuggestionSelected,z=e.clearOldSearches,f=e.onKeyDown,h=e.dialogHeaderText,O=e.dialogPrimaryButtonText,L=e.dialogSecondaryButtonText,m=e.clearInputButtonText,q=e.focusInput,N=e.color,W=e.hoverColor,T=e.searchOpen,X=e.fontWeights,B="".concat(a,"-input"),_="".concat(a,"-label"),y=ne(n.useState(!1),2),S=y[0],v=y[1],k=g.default.useRef(),C=n.useCallback((function(){t()}));n.useEffect((function(){H.default.setAppElement(o)}),[]);var E=function(e,c){"clear-search-history"===c.suggestion.type?v(!0):c.suggestion.properties.arrowClicked||A(e,c)},R=function(e){return"clear-search-history"===e.type?"":l(e)},w=function(e){return"clear-search-history"===e.type?g.default.createElement("span",{className:xe["clear-search-history"]},e.labelId):u(e)};return q&&null!==(c=k.current)&&void 0!==c&&c.input&&k.current.input.focus(),g.default.createElement(H.default,{isOpen:T,className:xe["mobile-modal"],overlayClassName:xe["mobile-modal-overlay"],onAfterClose:C,shouldCloseOnEsc:!0},g.default.createElement("div",{className:xe["mobile-modal-content"],style:{"--color":"".concat(N),"--hover-color":"".concat(W),"--font-weight-medium":X.medium}},g.default.createElement("label",{className:xe["combobox-container"],htmlFor:B},g.default.createElement("div",{className:xe["combobox-icon"],onClick:C},g.default.createElement(x.default,{img:"arrow"})),g.default.createElement("span",{className:xe["right-column"]},g.default.createElement("span",{className:xe["combobox-label"],id:_},b),g.default.createElement(He,{alwaysRenderSuggestions:!0,id:a,suggestions:M,onSuggestionsFetchRequested:p,getSuggestionValue:R,renderSuggestion:w,focusInputOnSuggestionClick:!0,shouldRenderSuggestions:function(){return!0},inputProps:U({},s,{className:"".concat(xe.input," ").concat(xe[a]||""," ").concat(s.value?xe.hasValue:""),autoFocus:!0}),renderInputComponent:function(e){return g.default.createElement(g.default.Fragment,null,g.default.createElement("input",Object.assign({"aria-label":d,id:a,onKeyDown:f},e)),r&&g.default.createElement("button",{type:"button",className:xe["clear-input"],onClick:i,"aria-label":m},g.default.createElement(x.default,{img:"close",color:N})))},theme:xe,onSuggestionSelected:E,ref:k}))),g.default.createElement(Y.default,{appElement:o,isModalOpen:S,handleClose:function(){return v(!1)},headerText:h,primaryButtonText:O,secondaryButtonText:L,primaryButtonOnClick:function(){z(),v(!1)},secondaryButtonOnClick:function(){return v(!1)},color:N,hoverColor:W,fontWeights:X})))};"production"!==process.env.NODE_ENV&&(Ye.propTypes={appElement:N.default.string.isRequired,id:N.default.string.isRequired,closeHandle:N.default.func.isRequired,clearInput:N.default.func.isRequired,value:N.default.string,clearInputButtonText:N.default.string.isRequired,suggestions:N.default.array.isRequired,inputProps:N.default.shape({onChange:N.default.func.isRequired,onBlur:N.default.func.isRequired,value:N.default.string.isRequired,placeholder:N.default.string.isRequired,className:N.default.string.isRequired}).isRequired,fetchFunction:N.default.func.isRequired,getSuggestionValue:N.default.func.isRequired,renderSuggestion:N.default.func.isRequired,onSuggestionSelected:N.default.func.isRequired,label:N.default.string.isRequired,clearOldSearches:N.default.func.isRequired,onKeyDown:N.default.func.isRequired,ariaLabel:N.default.string,dialogHeaderText:N.default.string,dialogPrimaryButtonText:N.default.string,dialogSecondaryButtonText:N.default.string,focusInput:N.default.bool,color:N.default.string,hoverColor:N.default.string,searchOpen:N.default.bool.isRequired,fontWeights:N.default.shape({medium:N.default.number.isRequired}).isRequired});var Fe,Ue=Te((function(e,c){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var c={};function n(o){if(c[o])return c[o].exports;var a=c[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=c,n.d=function(e,c,o){n.o(e,c)||Object.defineProperty(e,c,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,c){if(1&c&&(e=n(e)),8&c)return e;if(4&c&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&c&&"string"!=typeof e)for(var a in e)n.d(o,a,function(c){return e[c]}.bind(null,a));return o},n.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(c,"a",c),c},n.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},n.p="",n(n.s="./packages/hooks/src/index.ts")}({"./packages/hooks/src/index.ts":
|
|
13
|
+
function c(e,c,n,o){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return c?a[n][0]:a[n][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:c,mm:"%d Minuten",h:c,hh:"%d Stunden",d:c,dd:c,w:c,ww:"%d Wochen",M:c,MM:c,y:c,yy:c},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})},n(Be)})),{de:{address:"Adresse","address-place-or-business":"Adress, Ort or Geschäft","add-via-button-label":"Füge Zwischenziel hinzu","add-via-duration-button-label":"Set stop duration at via point {{index}}","add-via-duration-button-label-close":"Close stop duration selector at via point {{index}}","add-via-duration-button-label-open":"Open stop duration selector at via point {{index}}",airplane:"Flug",arrival:"Ankunft",back:"Zurück",bikerentalstation:"Leihrad-Station",bus:"Bus",cancel:"Abbrechen","clear-button-label":"Löschen","clear-search-history":"Suchhistorie löschen",currentposition:"Aktuelle Position",delete:"Löschen","delete-old-searches-header":"Wollen Sie die Such-Historie löschen?",departure:"Abfahrt",destination:"Ziel","give-origin":"Start eingeben.","give-destination":"Ziel eingeben.",favourite:"Favoriten",ferry:"Fähre","future-route":"Zukünftige Verbindung",origin:"Start","origin-stop-near-you":"Start",ownlocations:"Eigene Favoriten",loading:"Laden...","minute-short":"min",rail:"Zug",search:"Suche","search-address-or-place":"Suche anhand von Adresse oder Ortsangabe","search-button-label":"Suche","search-destination":"Suche Zielort, Linie or Haltestelle","search-destination-index":"Zielort eingeben","search-destination-results-but-no-search":"Ergebnisse in “Zielort”-Reiter anzeigen","search-no-results":"Kein Ort gefunden.","search-origin":"Suche Startort, Linie oder Haltestelle","search-origin-index":"Startort eingeben","search-position":"Standort ermitteln","search-autosuggest-label-desktop":"Venue, place and stopsearch. Navigate list with arrow keys and select with enter key","search-autosuggest-label-mobile":"Venue, place and stopsearch.","search-autosuggest-len":"There is {{count}} suggestion available","search-autosuggest-len_plural":"There are {{count}} suggestions available","search-current-suggestion":"Aktuelle Auswahl: {{selection}}",subway:"U-Bahn",station:"Station",stop:"Haltestelle","stop-near-you":"Suche Haltestellen und Linien in der Nähe","stop-near-you-bus":"Suche Buslinien or Haltestellen","stop-near-you-citybike":"Suche Leihrad-Stationen","stop-near-you-rail":"Suche Zugverbindungen oder Bahnhöfe","stop-near-you-subway":"Suche U-Bahn-Linien oder Haltestellen","stop-near-you-tram":"Suche Stadtbahn-Haltestellen-Suche","today-at":"Heute um","tomorrow-at":"Morgen um",tram:"Straßenbahn","use-own-position":"Benutze aktuellen Standort","select-from-map":"Wähle Position anhand Karte","select-from-own-locations":"Aus eigenen Favoriten auswählen",venue:"Venue","via-point":"Zwischenziel",where:"Wohin?",place:"Ort"},en:{address:"Address","address-place-or-business":"Address, place or business","add-via-button-label":"Add via point","add-via-duration-button-label":"Set stop duration at via point {{index}}","add-via-duration-button-label-close":"Close stop duration selector at via point {{index}}","add-via-duration-button-label-open":"Open stop duration selector at via point {{index}}",airplane:"Flight",arrival:"Arrival",back:"Back",bikerentalstation:"Bike station",bus:"bus",cancel:"Cancel","clear-button-label":"Clear","clear-search-history":"Clear search history",currentposition:"Current position",delete:"Delete","delete-old-searches-header":"Do you want to clear the search history?",departure:"Departure",destination:"Destination","give-origin":"Enter your origin.","give-destination":"Enter your destination",favourite:"Favourite",ferry:"Ferry","future-route":"Future route",origin:"Start","origin-stop-near-you":"Start",ownlocations:"Own locations",loading:"Loading...","minute-short":"m",rail:"Train",required:"required field",search:"Search","search-address-or-place":"Search by address or place name","search-button-label":"Search","search-destination":"Search destination, route or stop","search-destination-index":"Enter destination","search-destination-results-but-no-search":"View results in the adjacent “Destination” tab","search-no-results":"No location","search-origin":"Search origin, route or stop","search-origin-index":"Enter origin","search-position":"Detect location","search-autosuggest-label-desktop":"Venue, place and stopsearch. Navigate list with arrow keys and select with enter key","search-autosuggest-label-mobile":"Venue, place and stopsearch. Enter the location and navigate in the list by swiping.","search-autosuggest-len":"There is {{count}} suggestion available","search-autosuggest-len_plural":"There are {{count}} suggestions available","search-current-suggestion":"Current selection: {{selection}}",subway:"Metro",station:"Station",stop:"Stop","stop-near-you":"Search stops and routes","stop-near-you-airplane":"Search flights or airports","stop-near-you-bus":"Search bus routes or stops","stop-near-you-citybike":"Search city bike stations","stop-near-you-rail":"Search train routes or stations","stop-near-you-subway":"Search metro routes or stations ","stop-near-you-tram":"Search tram routes or stops","stop-route-station":"Bus and stop search","today-at":"today at","tomorrow-at":"tomorrow at",tram:"Tram","use-own-position":"Use current location","select-from-map":"Select position from map","select-from-own-locations":"Select from own locations",venue:"Venue","via-point":"Via point",where:"Where to?",place:"Location"},fi:{address:"Osoite","address-place-or-business":"Osoite, paikka tai yritys","add-via-button-label":"Lisää välipiste","add-via-duration-button-label":"Aseta välipisteelle {{index}} pysähdyksen kesto","add-via-duration-button-label-close":"Avaa välipisteen {{index}} pysähdyksen kesto valitsin","add-via-duration-button-label-open":"Sulje välipisteen {{index}} pysähdyksen kesto valitsin",airplane:"Lentokone",arrival:"Perillä",back:"Takaisin",bikerentalstation:"Pyöräasema",bus:"bussi",cancel:"Peruuta","clear-button-label":"Tyhjennä","clear-search-history":"Tyhjennä hakuhistoria",currentposition:"Tämänhetkinen sijainti",delete:"Poista","delete-old-searches-header":"Haluatko tyhjentää hakuhistorian?",departure:"Lähtöaika",destination:"Määränpää",favourite:"Suosikki",ferry:"Lautta","future-route":"Tuleva reitti","give-origin":"Lähtöpaikka","give-destination":"Määränpää",origin:"Lähtöpaikka","origin-stop-near-you":"Lähtöpaikka",ownlocations:"Omat paikat",loading:"Ladataan...","minute-short":"min",rail:"Juna",required:"pakollinen kenttä",search:"Etsi","search-address-or-place":"Hae osoitteella tai paikan nimellä","search-button-label":"Hae","search-destination":"Hae määränpäätä, linjaa tai pysäkkiä","search-destination-index":"Syötä määränpää","search-destination-results-but-no-search":"Katso tulokset viereiseltä Määränpää-välilehdeltä","search-no-results":"Ei tuloksia","search-origin":"Hae lähtöpaikkaa, linjaa tai pysäkkiä","search-origin-index":"Syötä lähtöpaikka","search-autosuggest-label-desktop":"Paikka, linja ja pysäkkihaku. Navigoi listassa nuolinäppäimillä ja valitse enterillä","search-autosuggest-label-mobile":"Paikka, linja ja pysäkkihaku. Syötä sijainti ja navigoi listassa pyyhkäisemällä.","search-autosuggest-len":" Löydettiin {{count}} ehdotus","search-autosuggest-len_plural":" Löydettiin {{count}} ehdotusta","search-current-suggestion":"Tämänhetkinen valinta: {{selection}}","search-position":"Paikanna",subway:"Metro",station:"Asema",stop:"Pysäkki","stop-near-you":"Linja, pysäkki tai asema","stop-near-you-airplane":"Hae lentoja tai lentoasemaa","stop-near-you-bus":"Hae bussilinjaa tai pysäkkiä","stop-near-you-citybike":"Hae kaupunkipyöräasemaa","stop-near-you-rail":"Hae lähijunaa tai asemaa","stop-near-you-subway":"Hae metrolinjaa tai asemaa","stop-near-you-tram":"Hae raitiolinjaa tai pysäkkiä","stop-route-station":"Linja- ja pysäkkihaku","today-at":"tänään klo","tomorrow-at":"huomenna klo",tram:"Raitiovaunu","use-own-position":"Käytä nykyistä sijaintia","select-from-map":"Valitse sijainti kartalta","select-from-own-locations":"Valitse omista paikoista",venue:"Paikka","via-point":"Välipiste",where:"Minne mennään?",place:"Paikka"},sv:{address:"Adress","address-place-or-business":"Adress, plats eller företag","add-via-button-label":"Lägg till viapunkt","add-via-duration-button-label":"Ställ in varaktighet för viapunkten {{index}}","add-via-duration-button-label-close":"Stäng väljaren för varaktighet vid via-punkten {{index}}","add-via-duration-button-label-open":"Öppna väljaren för varaktighet vid via-punkten {{index}}",airplane:"Flyg",arrival:"Anländer",back:"Tillbaka",bikerentalstation:"Stadscykelstation",bus:"Bussi",cancel:"Avbryt","clear-button-label":"Töm","clear-search-history":"Töm sökhistoriken",currentposition:"Nuvarande position",delete:"Ta bort","delete-old-searches-header":"Vill du tömma sökhistoriken?",departure:"Avgångstid",destination:"Destination",favourite:"Favorit",ferry:"Färja","future-route":"Framtida rutt","give-destination":"Skriv in din destination","give-origin":"Skriv in din avfärdsplats",origin:"Avfärdsplats","origin-stop-near-you":"Avfärdsplats",ownlocations:"Egna platser",loading:"Laddar...","minute-short":"min",rail:"Tåg",required:"obligatoriskt fält",search:"Sök","search-address-or-place":"Sök med adressen eller platsens namn","search-button-label":"Sök","search-destination":"Sök destination, linje eller hållplats","search-destination-index":"Skriv destination","search-destination-results-but-no-search":"Se resultaten under fliken Destination","search-no-results":"Inga sökresultat","search-origin":"Sök avfärdsplats, linje eller hållplats","search-origin-index":"Skriv avfärdsplats","search-position":"Sök position","search-autosuggest-label-desktop":"Plats, linje och hållplatssökning. Navigera listan med piltangenterna och välj med Enter-tangeten","search-autosuggest-label-mobile":"Plats, linje och hållplatssökning. Ange platsen och navigera i listan genom att svepa.","search-autosuggest-len":"Hittade {{count}} förslag","search-current-suggestion":"Nuvarande val: {{selection}}",subway:"Metro",station:"Station",stop:"Hållplats","stop-near-you":"Sök hållplatser eller linjer","stop-near-you-airplane":"Sök flyg eller flygplatser","stop-near-you-bus":"Sök busslinjer eller hållplatser","stop-near-you-citybike":"Sök stadscykelstationer","stop-near-you-rail":"Sök närtåger eller stationer","stop-near-you-subway":"Sök metrolinjer eller stationer","stop-near-you-tram":"Sök spårvagnlinjer eller hållplatser","stop-route-station":"Buss och stopp sökningen","today-at":"i dag kl","tomorrow-at":"i morgon",tram:"Spårvagn","use-own-position":"Använd min position","select-from-map":"Välj position från kartan","select-from-own-locations":"Välj från egna platser",venue:"Mötesplats","via-point":"Via punkt",where:"Vart vill du åka?",place:"Plats"}});function De(e,c){void 0===c&&(c={});var n=c.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var Pe={container:"styles_container__1NKX8",input:"styles_input__J8Q0h",favourite:"styles_favourite__384ME",thin:"styles_thin__31pf2",hasValue:"styles_hasValue__3IDIO",suggestionsContainerOpen:"styles_suggestionsContainerOpen__1uEOH",suggestionsContainer:"styles_suggestionsContainer__3P1xL",suggestionsList:"styles_suggestionsList__3DnHc",suggestion:"styles_suggestion__1YRxV",suggestionHighlighted:"styles_suggestionHighlighted__28ZnP","autosuggest-input-container":"styles_autosuggest-input-container__IxbT_",origin:"styles_origin__1qX8p",destination:"styles_destination__3DZBi","stop-route-station":"styles_stop-route-station__2PwTH","autosuggest-input-icon":"styles_autosuggest-input-icon__2PARI","origin-stop-near-you":"styles_origin-stop-near-you__1-J6m","clear-input":"styles_clear-input__1_PXf","sr-only":"styles_sr-only__B2xmy"};De("/* stylelint-disable */\ninput[type='text'] {\n margin: 0; }\n\n.styles_container__1NKX8 {\n display: -ms-flexbox;\n display: flex;\n width: 100%; }\n .styles_container__1NKX8 .styles_input__J8Q0h {\n font-size: 16px;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 44px;\n border-radius: 5px;\n border: solid 1px #888888;\n background-color: #ffffff;\n padding-left: 50px;\n padding-right: 44px;\n line-height: 1.2;\n letter-spacing: -0.5px;\n color: #333;\n box-sizing: border-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none; }\n .styles_container__1NKX8 .styles_input__J8Q0h.styles_favourite__384ME {\n padding-left: 47px; }\n .styles_container__1NKX8 .styles_input__J8Q0h.styles_thin__31pf2 {\n height: 34px; }\n .styles_container__1NKX8 .styles_input__J8Q0h:focus {\n background: #fff;\n outline: none;\n border: solid 1px var(--color);\n box-shadow: none;\n box-shadow: 0px 0px 2px 1px var(--hover-color); }\n @media screen and (min-width: 768px) {\n .styles_container__1NKX8 .styles_input__J8Q0h {\n font-size: 15px;\n height: 44px;\n padding-left: 49px; } }\n .styles_container__1NKX8 .styles_input__J8Q0h:-ms-input-placeholder {\n color: #666666;\n font-size: 15px; }\n .styles_container__1NKX8 .styles_input__J8Q0h::placeholder {\n color: #666666;\n font-size: 15px; }\n\n.styles_hasValue__3IDIO {\n color: #333333; }\n\n.styles_suggestionsContainerOpen__1uEOH {\n width: 100%;\n max-height: 44vh;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: solid 1px rgba(0, 0, 0, 0.1);\n overflow-x: hidden;\n overflow-y: scroll;\n position: absolute;\n background-color: white;\n top: calc(3 * 0.875rem + 9px);\n z-index: 20; }\n\n.styles_suggestionsContainer__3P1xL {\n background-color: white;\n z-index: 20; }\n .styles_suggestionsContainer__3P1xL .styles_suggestionsList__3DnHc {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n background: white; }\n .styles_suggestionsContainer__3P1xL .styles_suggestionsList__3DnHc li:hover {\n background: #F4F4F5; }\n\n.styles_suggestion__1YRxV {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n cursor: pointer;\n list-style: none;\n display: block;\n overflow-x: hidden;\n overflow-y: hidden;\n white-space: nowrap; }\n\n.styles_suggestionHighlighted__28ZnP {\n background-color: #F4F4F5; }\n\n.styles_autosuggest-input-container__IxbT_ {\n position: relative;\n width: 100%; }\n .styles_autosuggest-input-container__IxbT_.styles_origin__1qX8p {\n z-index: 16; }\n .styles_autosuggest-input-container__IxbT_.styles_destination__3DZBi {\n z-index: 10; }\n .styles_autosuggest-input-container__IxbT_.styles_stop-route-station__2PwTH {\n z-index: 9; }\n\n.styles_autosuggest-input-icon__2PARI {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n -ms-flex-align: center;\n align-items: center;\n width: 16px;\n height: 100%;\n margin-top: 0;\n margin-left: 19px; }\n .styles_autosuggest-input-icon__2PARI svg {\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_origin__1qX8p svg {\n fill: #4ea700;\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_destination__3DZBi svg {\n fill: #ec5188;\n width: 16px;\n height: 24px; }\n .styles_autosuggest-input-icon__2PARI.styles_stop-route-station__2PwTH svg, .styles_autosuggest-input-icon__2PARI.styles_favourite__384ME svg {\n fill: #888888;\n width: 16px;\n height: 16px; }\n .styles_autosuggest-input-icon__2PARI.styles_origin-stop-near-you__1-J6m svg {\n fill: #888888;\n width: 16px;\n height: 16px; }\n\nbutton.styles_clear-input__1_PXf {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n padding: 14px 0;\n right: 0px;\n width: 44px;\n height: 100%;\n color: var(--color);\n outline: none;\n border: 0px;\n margin: 0px;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: left;\n background: none;\n border-style: none;\n border-width: 0px;\n cursor: pointer;\n font-family: inherit;\n background-color: transparent;\n transition: none; }\n button.styles_clear-input__1_PXf svg {\n fill: var(--color);\n width: 16px;\n height: 16px; }\n button.styles_clear-input__1_PXf:focus {\n background-color: transparent;\n color: inherit;\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color; }\n button.styles_clear-input__1_PXf:active {\n background-color: transparent;\n color: inherit; }\n button.styles_clear-input__1_PXf:hover {\n background-color: transparent;\n color: inherit; }\n\n.styles_sr-only__B2xmy:not(:focus):not(:active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n");var xe={"fullscreen-root":"MobileSearch_fullscreen-root__3mzJu","combobox-container":"MobileSearch_combobox-container__2dXKy","right-column":"MobileSearch_right-column__KzsqW","combobox-icon":"MobileSearch_combobox-icon__2y89R","combobox-label":"MobileSearch_combobox-label__20dJF",container:"MobileSearch_container__33kZY",input:"MobileSearch_input__1-Zl9","clear-input":"MobileSearch_clear-input__1x_WA",hasValue:"MobileSearch_hasValue__1ByEp",suggestion:"MobileSearch_suggestion__2AjCH",suggestionHighlighted:"MobileSearch_suggestionHighlighted__14vbR",suggestionsContainerOpen:"MobileSearch_suggestionsContainerOpen__2hg77",suggestionsList:"MobileSearch_suggestionsList__cWAt3","clear-search-history":"MobileSearch_clear-search-history__3A-ea","mobile-modal-overlay":"MobileSearch_mobile-modal-overlay__1SB12","mobile-modal":"MobileSearch_mobile-modal__H2JRE","mobile-modal-content":"MobileSearch_mobile-modal-content__vH5o7"};function Ie(e){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=ce(e);if(c){var a=ce(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return ee(this,n)}}De("input[type='text'] {\n margin: 0;\n padding: 0; }\n\n.MobileSearch_fullscreen-root__3mzJu {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n background: #fff;\n z-index: 1000; }\n\n.MobileSearch_combobox-container__2dXKy {\n margin: 15px 10px 0;\n border: solid #888888 1px;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n border-radius: 5px;\n height: 60px;\n -ms-flex-pack: justify;\n justify-content: space-between; }\n .MobileSearch_combobox-container__2dXKy .MobileSearch_right-column__KzsqW {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: 9px; }\n\n.MobileSearch_combobox-icon__2y89R {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n height: 100%;\n width: 52px; }\n .MobileSearch_combobox-icon__2y89R svg {\n fill: #007ac9;\n width: 14px;\n height: 21px;\n transform: rotate(-180deg); }\n\n.MobileSearch_combobox-label__20dJF {\n position: relative;\n top: -2px;\n font-size: 12px;\n font-weight: var(--font-weight-medium);\n letter-spacing: -0.2px;\n color: #333333; }\n\n.MobileSearch_container__33kZY {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n width: 100%; }\n .MobileSearch_container__33kZY .MobileSearch_input__1-Zl9 {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n width: 100%;\n position: relative;\n padding-bottom: 7px;\n top: 2px;\n border: none;\n height: 26px;\n font-weight: normal;\n box-shadow: none;\n font-size: 16px;\n letter-spacing: -0.5px;\n color: #666666;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none; }\n .MobileSearch_container__33kZY .MobileSearch_input__1-Zl9:focus {\n outline: none;\n border: none;\n box-shadow: none;\n background: #fff; }\n\nbutton.MobileSearch_clear-input__1x_WA {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n right: 0px;\n padding: 0 15px 7px 0;\n height: 26px;\n color: var(--color);\n outline: none;\n border: 0px;\n margin: 0px;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: left;\n background: none;\n border-style: none;\n border-width: 0px;\n cursor: pointer;\n font-family: inherit;\n background-color: transparent;\n transition: none; }\n button.MobileSearch_clear-input__1x_WA svg {\n fill: var(--color);\n width: 16px;\n height: 16px; }\n button.MobileSearch_clear-input__1x_WA:focus {\n background-color: transparent;\n color: inherit; }\n button.MobileSearch_clear-input__1x_WA:active {\n background-color: transparent;\n color: inherit; }\n button.MobileSearch_clear-input__1x_WA:hover {\n background-color: transparent;\n color: inherit; }\n\n.MobileSearch_hasValue__1ByEp {\n color: #333333; }\n\n.MobileSearch_suggestion__2AjCH {\n font-size: 15px;\n min-height: 50px;\n letter-spacing: -0.6px;\n color: #333333;\n font-weight: 500;\n background: #fff;\n margin: 0;\n padding: 0; }\n\n.MobileSearch_suggestionHighlighted__14vbR {\n background-color: #F4F4F5; }\n\n.MobileSearch_suggestionsContainerOpen__2hg77 {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n margin-bottom: auto;\n z-index: 20;\n width: 100vw;\n max-height: calc(100% - 75px);\n height: 100%;\n top: 75px;\n left: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n -ms-overflow-style: none;\n /* Internet Explorer 10+ */\n scrollbar-width: none;\n /* Firefox */ }\n .MobileSearch_suggestionsContainerOpen__2hg77::-webkit-scrollbar {\n display: none;\n /* Safari and Chrome */ }\n .MobileSearch_suggestionsContainerOpen__2hg77 .MobileSearch_suggestionsList__cWAt3 {\n width: 100vw;\n list-style: none;\n padding-left: 0;\n margin: 0;\n background: #f4f4f5; }\n\n.MobileSearch_clear-search-history__3A-ea {\n display: -ms-flexbox;\n display: flex;\n margin-top: auto;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n width: 100%;\n height: 62px;\n background: #f4f4f5;\n color: var(--color);\n font-size: 15px;\n font-weight: var(--font-weight-medium);\n letter-spacing: -0.42px;\n border-top: 1px solid #ddd; }\n\n.MobileSearch_mobile-modal-overlay__1SB12 {\n z-index: 9999;\n top: 0;\n left: 0;\n right: unset;\n bottom: unset;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n background-color: white;\n position: fixed; }\n\n.MobileSearch_mobile-modal__H2JRE {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n /* stylelint-disable-next-line */\n /* stylelint-disable-next-line */ }\n .MobileSearch_mobile-modal__H2JRE.ReactModal__Content--after-open > div {\n transform: translateY(0); }\n .MobileSearch_mobile-modal__H2JRE.ReactModal__Content--before-close > div {\n transform: translateY(10%); }\n\n.MobileSearch_mobile-modal-content__vH5o7 {\n position: fixed;\n width: 100%;\n height: 100%;\n outline: none;\n background-color: #ffffff;\n transition: transform 0.25s;\n transform: translateY(10%); }\n");var He=function(e){Z(n,e);var c=Ie(n);function n(e){var o;K(this,n);var a=$(o=c.call(this,e));return a.onSuggestionTouchMove=function(){a.justSelectedSuggestion=!1,a.pressedSuggestion=null},o}return n}(X.default),Ye=function(e){var c,o=e.appElement,a=e.id,t=e.closeHandle,i=e.clearInput,r=e.value,M=e.suggestions,s=e.inputProps,p=e.fetchFunction,u=e.renderSuggestion,l=e.getSuggestionValue,d=e.ariaLabel,b=e.label,A=e.onSuggestionSelected,z=e.clearOldSearches,f=e.onKeyDown,h=e.dialogHeaderText,O=e.dialogPrimaryButtonText,L=e.dialogSecondaryButtonText,m=e.clearInputButtonText,q=e.focusInput,N=e.color,W=e.hoverColor,T=e.searchOpen,X=e.fontWeights,B="".concat(a,"-input"),_="".concat(a,"-label"),y=ne(n.useState(!1),2),S=y[0],v=y[1],k=g.default.useRef(),C=n.useCallback((function(){t()}));n.useEffect((function(){H.default.setAppElement(o)}),[]);var E=function(e,c){"clear-search-history"===c.suggestion.type?v(!0):c.suggestion.properties.arrowClicked||A(e,c)},R=function(e){var c=e&&(e.key||e.which||e.keyCode)||"";return!(!c||![13," ","Spacebar"].concat([32,"Enter"]).includes(c))&&(e.preventDefault(),!0)},w=function(e){return"clear-search-history"===e.type?"":l(e)},D=function(e){return"clear-search-history"===e.type?g.default.createElement("span",{className:xe["clear-search-history"]},e.labelId):u(e)};return q&&null!==(c=k.current)&&void 0!==c&&c.input&&k.current.input.focus(),g.default.createElement(H.default,{isOpen:T,className:xe["mobile-modal"],overlayClassName:xe["mobile-modal-overlay"],onAfterClose:C,shouldCloseOnEsc:!0},g.default.createElement("div",{className:xe["mobile-modal-content"],style:{"--color":"".concat(N),"--hover-color":"".concat(W),"--font-weight-medium":X.medium}},g.default.createElement("div",{className:xe["combobox-container"],htmlFor:B},g.default.createElement("button",{type:"button",className:xe["combobox-icon"],onClick:function(){return C()},onKeyDown:function(e){return R(e)&&C()},"aria-label":L,tabIndex:0},g.default.createElement(x.default,{img:"arrow"})),g.default.createElement("span",{className:xe["right-column"]},g.default.createElement("span",{className:xe["combobox-label"],id:_},b),g.default.createElement(He,{alwaysRenderSuggestions:!0,id:a,suggestions:M,onSuggestionsFetchRequested:p,getSuggestionValue:w,renderSuggestion:D,focusInputOnSuggestionClick:!0,shouldRenderSuggestions:function(){return!0},inputProps:U({},s,{className:"".concat(xe.input," ").concat(xe[a]||""," ").concat(s.value?xe.hasValue:""),autoFocus:!0}),renderInputComponent:function(e){return g.default.createElement(g.default.Fragment,null,g.default.createElement("input",Object.assign({"aria-label":d,id:a,onKeyDown:f},e)),r&&g.default.createElement("button",{type:"button",className:xe["clear-input"],onClick:i,onKeyDown:function(e){return R(e)&&i()},"aria-label":m},g.default.createElement(x.default,{img:"close",color:N})))},theme:xe,onSuggestionSelected:E,ref:k}))),g.default.createElement(Y.default,{appElement:o,isModalOpen:S,handleClose:function(){return v(!1)},headerText:h,primaryButtonText:O,secondaryButtonText:L,primaryButtonOnClick:function(){z(),v(!1)},secondaryButtonOnClick:function(){return v(!1)},color:N,hoverColor:W,fontWeights:X})))};"production"!==process.env.NODE_ENV&&(Ye.propTypes={appElement:N.default.string.isRequired,id:N.default.string.isRequired,closeHandle:N.default.func.isRequired,clearInput:N.default.func.isRequired,value:N.default.string,clearInputButtonText:N.default.string.isRequired,suggestions:N.default.array.isRequired,inputProps:N.default.shape({onChange:N.default.func.isRequired,onBlur:N.default.func.isRequired,value:N.default.string.isRequired,placeholder:N.default.string.isRequired,className:N.default.string.isRequired}).isRequired,fetchFunction:N.default.func.isRequired,getSuggestionValue:N.default.func.isRequired,renderSuggestion:N.default.func.isRequired,onSuggestionSelected:N.default.func.isRequired,label:N.default.string.isRequired,clearOldSearches:N.default.func.isRequired,onKeyDown:N.default.func.isRequired,ariaLabel:N.default.string,dialogHeaderText:N.default.string,dialogPrimaryButtonText:N.default.string,dialogSecondaryButtonText:N.default.string,focusInput:N.default.bool,color:N.default.string,hoverColor:N.default.string,searchOpen:N.default.bool.isRequired,fontWeights:N.default.shape({medium:N.default.number.isRequired}).isRequired});var Fe,Ue=Te((function(e,c){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var c={};function n(o){if(c[o])return c[o].exports;var a=c[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=c,n.d=function(e,c,o){n.o(e,c)||Object.defineProperty(e,c,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,c){if(1&c&&(e=n(e)),8&c)return e;if(4&c&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&c&&"string"!=typeof e)for(var a in e)n.d(o,a,function(c){return e[c]}.bind(null,a));return o},n.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(c,"a",c),c},n.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},n.p="",n(n.s="./packages/hooks/src/index.ts")}({"./packages/hooks/src/index.ts":
|
|
14
14
|
/*!*************************************!*\
|
|
15
15
|
!*** ./packages/hooks/src/index.ts ***!
|
|
16
16
|
\*************************************/
|
|
@@ -30,5 +30,5 @@ function c(e,c,n,o){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","ei
|
|
|
30
30
|
/*!************************!*\
|
|
31
31
|
!*** external "react" ***!
|
|
32
32
|
\************************/
|
|
33
|
-
/*! no static exports found */function(c,n){c.exports=e}})},e.exports=n(g.default)})),je=(Fe=Ue)&&Fe.__esModule&&Object.prototype.hasOwnProperty.call(Fe,"default")?Fe.default:Fe;function Ge(e){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=ce(e);if(c){var a=ce(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return ee(this,n)}}Re.locale("en"),W.default.init({fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}});function Ve(e){if("FutureRoute"!==e.type){var c,n=ne(de(e.properties,!0),2),o=n[0],a=n[1];if(e.properties.layer.toLowerCase().includes("bikerental")||e.properties.layer.toLowerCase().includes("bikestation"))return[c=W.default.t("bikerentalstation"),o,void 0,e.properties.labelId];if(e.properties.mode)c=W.default.t(e.properties.mode.toLowerCase().replace("favourite",""));else{var t=e.properties.layer.replace("route-","").toLowerCase().replace("favourite","");c=W.default.t(t)}if(e.properties.id&&("stop"===e.properties.layer||"station"===e.properties.layer)){var i,r=le(e.properties),M=null===(i=e.properties.addendum)||void 0===i?void 0:i.GTFS.modes;return[c,pe(o,r),a,r,M]}if("favouriteStop"===e.properties.layer||"favouriteStation"===e.properties.layer){var s=e.properties,p=s.address,u=s.code;return[c,p?pe(p.split(",")[0],u):o,a,u]}return[c,o,a]}var l=e.properties,d=l.origin,b=l.destination,A=d.locality?", ".concat(d.locality," foobar"):"",z=b.locality?", ".concat(b.locality):"",f=d.name,h=b.name;return[W.default.t("future-route"),"".concat(W.default.t("origin")," ").concat(f).concat(A," ").concat(W.default.t("destination")," ").concat(h).concat(z),e.translatedText]}function Ke(e){var c=Re.unix(e.properties.time),n=e.properties.arriveBy?W.default.t("arrival"):W.default.t("departure");return n=c.isSame(Re(),"day")?"".concat(n," ").concat(W.default.t("today-at")):c.isSame(Re().add(1,"day"),"day")?"".concat(n," ").concat(W.default.t("tomorrow-at")):"".concat(n," ").concat(c.format("dd D.M.")),n="".concat(n," ").concat(Re(c).format("HH:mm"))}"production"!==process.env.NODE_ENV&&N.default.node;var Qe=function(e){Z(t,e);var c,n,o,a=Ge(t);function t(e){var c;return K(this,t),(c=a.call(this,e)).componentDidUpdate=function(){W.default.language!==c.props.lang&&W.default.changeLanguage(c.props.lang)},c.UNSAFE_componentWillReceiveProps=function(e){e.value===c.state.value||c.state.editing||c.setState({value:e.value})},c.onChange=function(e,n){var o=n.newValue,a=n.method,t={value:c.fInput||o||""};if(c.fInput=null,c.state.editing){if("enter"!==a||c.state.valid){if(c.state.typingTimer&&clearTimeout(c.state.typingTimer),"type"===a){var i=setTimeout((function(){c.setState({typing:!1})}),1e3);t.typingTimer=i,t.typing=!0}c.setState(t)}}else t.editing=!0,c.setState(t,(function(){return c.fetchFunction({value:o||""})}))},c.onBlur=function(){c.state.editing&&c.input.focus(),c.setState({editing:!1,renderMobileSearch:!1,value:c.props.value})},c.onSelected=function(e,n){if(c.state.valid){if("SelectFromOwnLocations"===n.suggestion.type)return void c.setState({sources:["Favourite","Back"],ownPlaces:!0,pendingSelection:n.suggestion.type,value:""},(function(){c.fetchFunction({value:""})}));if("back"===n.suggestion.type||"FutureRoute"===n.suggestion.type)return void c.setState({sources:c.props.sources,ownPlaces:!1,pendingSelection:n.suggestion.type,suggestionIndex:n.suggestionIndex},(function(){c.fetchFunction({value:""})}));c.setState({editing:!1,value:n.suggestionValue},(function(){c.input.blur(),c.props.handleViaPoints?c.props.handleViaPoints(n.suggestion,n.suggestionIndex):c.props.onSelect(n.suggestion,c.props.id),c.setState({renderMobileSearch:!1,sources:c.props.sources,ownPlaces:!1,suggestions:[]}),c.props.focusChange&&!c.props.isMobile&&c.props.focusChange()}))}else c.setState((function(e){return{pendingSelection:e.value}}),(function(){return c.checkPendingSelection()}))},c.onSuggestionsClearRequested=function(){c.setState({suggestions:[],sources:c.props.sources,ownPlaces:!1,editing:!1})},c.getSuggestionValue=function(e){return"SelectFromOwnLocations"===e.type||"back"===e.type?"":function(e){var c=de(e,!0);switch(e.layer){case"selectFromMap":case"currentPosition":case"ownLocations":case"back":return c[1]||c[0];case"favouriteBikeRentalStation":case"favouritePlace":return c[0];default:return c.length>1&&""!==c[1]?c.join(", "):c[1]||c[0]}}(e.properties)},c.checkPendingSelection=function(){"SelectFromOwnLocations"!==c.state.pendingSelection&&"back"!==c.state.pendingSelection||!c.state.valid?c.state.pendingSelection&&c.state.valid&&c.setState({pendingSelection:null,editing:!1},(function(){c.state.suggestions.length&&(c.input.blur(),c.props.onSelect(c.state.suggestions[c.state.suggestionIndex],c.props.id))})):c.setState({pendingSelection:null,editing:!0},(function(){c.input.focus()}))},c.clearButton=function(){return g.default.createElement("button",{type:"button",className:Pe["clear-input"],onClick:c.clearInput,"aria-label":W.default.t("clear-button-label")},g.default.createElement(x.default,{img:"close",color:c.props.color}))},c.fetchFunction=function(e){var n=e.value,o=e.cleanExecuted;return c.setState({valid:!1,cleanExecuted:o||!1},(function(){var e,o=I.default(c.props.targets)||c.props.targets.includes("Locations");c.state.ownPlaces?(e=["Locations"],(I.default(c.props.targets)||c.props.targets.includes("Stops"))&&e.push("Stops")):I.default(c.props.targets)||(e=V(c.props.targets),o&&!c.props.isMobile&&(I.default(c.props.sources)||c.props.sources.includes("Favourite"))&&e.push("SelectFromOwnLocations")),function(e,c,n,o,a,t,i,r,M,s){r(null),ge(e,c,n,o,a,t,i,r,M,s)}(e,c.state.sources&&c.state.sources.filter((function(e){return!(o&&"Favourite"===e&&!c.state.ownPlaces&&!c.props.isMobile)})),c.props.transportMode,c.props.searchContext,c.props.filterResults,c.props.geocodingSize,{input:n||""},(function(e){if(null!=e){var o=(e.results||[]).filter((function(e){return"FutureRoute"!==e.type||"FutureRoute"===e.type&&e.properties.time>Re().unix()})).map((function(e){if("CurrentLocation"===e.type||"SelectFromMap"===e.type||"SelectFromOwnLocations"===e.type||"back"===e.type){var c=U({},e);return c.properties.labelId=W.default.t(e.properties.labelId),c}return e}));n!==c.state.value&&n!==c.state.pendingSelection&&"SelectFromOwnLocations"!==c.state.pendingSelection&&"back"!==c.state.pendingSelection&&"FutureRoute"!==c.state.pendingSelection||c.setState({valid:!0,suggestions:o},(function(){return c.checkPendingSelection()}))}}),c.props.pathOpts,c.props.refPoint)}))},c.clearInput=function(){var e={editing:!0,value:"",sources:c.props.sources,ownPlaces:!1};c.setState(e,(function(){return c.fetchFunction({value:"",cleanExecuted:!0})})),c.props.onClear&&c.props.onClear(),c.input.focus()},c.inputClicked=function(e){if(c.input.focus(),!c.state.editing){var n={editing:!0,pendingSelection:null},o={editing:!0,pendingSelection:null,value:e};c.state.suggestions.length?(c.fetchFunction({value:c.state.value}),c.setState(n)):"object"!==F(e)&&e?c.setState(o,(function(){return c.fetchFunction({value:e})})):c.setState(n,(function(){return c.fetchFunction({value:c.state.value})}))}},c.storeInputReference=function(e){null!==e&&(c.input=e.input,c.props.storeRef&&c.props.storeRef(e.input))},c.fillInput=function(e){c.fInput=e.properties.name;var n={editing:!0,value:e.properties.name,checkPendingSelection:e,valid:!0};c.setState(n),c.fetchFunction({value:e.properties.name}),c.input.focus()},c.renderItem=function(e){var n="FutureRoute"===e.type?U({},e,{translatedText:Ke(e)}):e,o=Ve(e);return g.default.createElement(P.default,{item:n,content:o,loading:!c.state.valid,isMobile:c.props.isMobile,ariaFavouriteString:W.default.t("favourite"),color:c.props.color,fillInput:c.fillInput,fontWeights:c.props.fontWeights,modeIconColors:c.props.modeIconColors,modeSet:c.props.modeSet})},c.closeMobileSearch=function(){c.props.unlock(),c.setState({renderMobileSearch:!1,value:c.props.value},(function(){window.scrollTo(0,c.state.scrollY),c.onSuggestionsClearRequested()}))},c.keyDown=function(e){var n=e.key;if("Escape"===n&&c.setState({editing:!1}),c.state.editing)return"Enter"===n&&c.fetchFunction({value:c.state.value}),c.inputClicked();if(("Enter"===n||"ArrowDown"===n)&&""===c.state.value)return c.clearInput();if("ArrowDown"===n&&""!==c.state.value){var o={editing:!0,value:c.state.value};c.setState(o,(function(){return c.fetchFunction({value:c.state.value})}))}return c.state.editing||c.setState({editing:!0}),"Tab"===n?c.onBlur():void 0},c.suggestionAsAriaContent=function(){var e=[],n=c.state.suggestions[0];return n&&(n.type&&n.type.includes("Favourite")&&e.push(W.default.t("favourite")),e=e.concat(Ve(c.state.suggestions[0]))),V(new Set(e)).join(" - ")},c.clearOldSearches=function(){var e=c.props.searchContext,n=e.context,o=e.clearOldSearches,a=e.clearFutureRoutes;n&&o&&(o(n),a&&a(n),c.fetchFunction({value:c.state.value}))},c.isOriginDestinationOrViapoint=function(){return"origin"===c.props.id||"destination"===c.props.id||"via-point"===c.props.id||"origin-stop-near-you"===c.props.id},c.onFocus=function(){["Valittu sijainti","Nykyinen sijaintisi","Current position","Selected location","Vald position","Använd min position","Min position","Käytä nykyistä sijaintia","Use current location","Your current location"].includes(c.state.value)&&c.clearInput();var e=window.pageYOffset;return c.props.isMobile&&c.props.lock(),c.setState({renderMobileSearch:c.props.isMobile,scrollY:e})},Re.tz.setDefault(e.timeZone),Re.locale(e.lang),c.state={value:e.value,suggestions:[],editing:!1,valid:!0,renderMobileSearch:!1,sources:e.sources,ownPlaces:!1,typingTimer:null,typing:!1,pendingSelection:null,suggestionIndex:0,cleanExecuted:!1,scrollY:0},Object.keys(we).forEach((function(e){W.default.addResourceBundle(e,"translation",we[e])})),c}return c=t,(n=[{key:"shouldComponentUpdate",value:function(e,c){return!C.default(c,this.state)||!C.default(e,this.props)}},{key:"render",value:function(){var e=this;W.default.language!==this.props.lang&&W.default.changeLanguage(this.props.lang);var c=this.state,n=c.value,o=c.suggestions,a=c.renderMobileSearch,t=c.cleanExecuted,i={placeholder:this.props.translatedPlaceholder?this.props.translatedPlaceholder:W.default.t(this.props.placeholder),value:n,onChange:this.onChange,onBlur:this.props.isMobile?function(){return null}:this.onBlur,className:"".concat(Pe.input," ").concat(this.props.isMobile&&this.props.transportMode?Pe.thin:""," ").concat(Pe[this.props.id]||""," ").concat(this.state.value?Pe.hasValue:""," ").concat(this.props.inputClassName),onKeyDown:this.keyDown,required:this.props.required},r=this.props.id.replace("searchfield-",""),M=this.props.ariaLabel||W.default.t(r);M=M.replace("searchfield-","");var s=this.props.required?"".concat(W.default.t("required"),"."):"",p=W.default.t("search-autosuggest-label"),u=W.default.t("search-autosuggest-len",{count:o.length}),l=W.default.t("search-current-suggestion",{selection:this.suggestionAsAriaContent()});return g.default.createElement(g.default.Fragment,null,g.default.createElement("span",{className:Pe["sr-only"],role:this.state.typing?void 0:"alert","aria-hidden":!this.state.editing},u),g.default.createElement("span",{className:Pe["sr-only"],role:this.state.typing?void 0:"alert","aria-hidden":!this.state.editing||0===o.length},l),this.props.isMobile&&g.default.createElement(Ye,{searchOpen:a,appElement:this.props.appElement,clearOldSearches:this.clearOldSearches,id:this.props.id,clearInput:this.clearInput,value:this.state.value,suggestions:[].concat(V(o),[{type:"clear-search-history",labelId:W.default.t("clear-search-history")}]),inputProps:U({},i,{placeholder:this.isOriginDestinationOrViapoint()?W.default.t("address-place-or-business"):i.placeholder}),fetchFunction:this.fetchFunction,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderItem,closeHandle:this.closeMobileSearch,ariaLabel:s.concat(" ").concat(M).concat(" ").concat(p),label:this.props.mobileLabel?this.props.mobileLabel:W.default.t(this.props.id),onSuggestionSelected:this.onSelected,onKeyDown:this.keyDown,dialogHeaderText:W.default.t("delete-old-searches-header"),dialogPrimaryButtonText:W.default.t("delete"),dialogSecondaryButtonText:W.default.t("cancel"),clearInputButtonText:W.default.t("clear-button-label"),focusInput:t,color:this.props.color,hoverColor:this.props.hoverColor,fontWeights:this.props.fontWeights}),!a&&g.default.createElement("div",{className:T.default(Pe["autosuggest-input-container"],Pe[this.props.id]),style:{"--color":"".concat(this.props.color),"--hover-color":"".concat(this.props.hoverColor)}},this.props.icon&&g.default.createElement("div",{className:T.default(Pe["autosuggest-input-icon"],Pe[this.props.id],this.props.inputClassName&&"".concat(this.props.inputClassName,"-input-icon"))},g.default.createElement(x.default,{img:"".concat(this.props.icon)})),g.default.createElement(X.default,{alwaysRenderSuggestions:this.state.editing,id:this.props.id,suggestions:o,onSuggestionsFetchRequested:this.fetchFunction,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderItem,inputProps:U({},i,{onFocus:this.onFocus}),focusInputOnSuggestionClick:!0,shouldRenderSuggestions:function(){return e.state.editing},highlightFirstSuggestion:!0,theme:Pe,renderInputComponent:function(c){return g.default.createElement(g.default.Fragment,null,g.default.createElement("input",Object.assign({"aria-label":s.concat(" ").concat(M).concat(" ").concat(p),id:e.props.id,onClick:e.inputClicked,onKeyDown:e.keyDown},c)),e.state.value&&e.clearButton())},onSuggestionSelected:this.onSelected,ref:this.storeInputReference})))}}])&&Q(c.prototype,n),o&&Q(c,o),t}(g.default.Component);Qe.defaultProps={autoFocus:!1,className:"",icon:void 0,value:"",transportMode:void 0,lang:"fi",sources:[],isMobile:!1,color:"#007ac9",hoverColor:"#0062a1",timeZone:"Europe/Helsinki",pathOpts:{routesPrefix:"linjat",stopsPrefix:"pysakit"},mobileLabel:void 0,inputClassName:"",translatedPlaceholder:void 0,fontWeights:{medium:500},modeIconColors:{"mode-bus":"#007ac9","mode-rail":"#8c4799","mode-tram":"#008151","mode-metro":"#ed8c00","mode-ferry":"#007A97"},required:!1,modeSet:void 0},"production"!==process.env.NODE_ENV&&(Qe.propTypes={appElement:N.default.string.isRequired,autoFocus:N.default.bool,className:N.default.string,icon:N.default.string,id:N.default.string.isRequired,placeholder:N.default.string.isRequired,translatedPlaceholder:N.default.string,value:N.default.string,searchContext:N.default.any.isRequired,ariaLabel:N.default.string,onSelect:N.default.func,transportMode:N.default.string,filterResults:N.default.func,geocodingSize:N.default.number,onClear:N.default.func,storeRef:N.default.func,handleViaPoints:N.default.func,focusChange:N.default.func,lang:N.default.string,sources:N.default.arrayOf(N.default.string),targets:N.default.arrayOf(N.default.string),isMobile:N.default.bool,color:N.default.string,hoverColor:N.default.string,timeZone:N.default.string,pathOpts:N.default.shape({routesPrefix:N.default.string,stopsPrefix:N.default.string}),mobileLabel:N.default.string,lock:N.default.func.isRequired,unlock:N.default.func.isRequired,refPoint:N.default.object,inputClassName:N.default.string,fontWeights:N.default.shape({medium:N.default.number}),modeIconColors:N.default.object,required:N.default.bool,modeSet:N.default.string});var Je,Ze=(Je=Qe,function(e){var c=je.useScrollLock(),n=c.lock,o=c.unlock;return g.default.createElement(Je,Object.assign({lock:n,unlock:o},e))});e.default=Ze,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
33
|
+
/*! no static exports found */function(c,n){c.exports=e}})},e.exports=n(g.default)})),je=(Fe=Ue)&&Fe.__esModule&&Object.prototype.hasOwnProperty.call(Fe,"default")?Fe.default:Fe;function Ge(e){var c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=ce(e);if(c){var a=ce(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return ee(this,n)}}Re.locale("en"),W.default.init({fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}});function Ve(e){if("FutureRoute"!==e.type){var c,n=ne(de(e.properties,!0),2),o=n[0],a=n[1];if(e.properties.layer.toLowerCase().includes("bikerental")||e.properties.layer.toLowerCase().includes("bikestation"))return[c=W.default.t("bikerentalstation"),o,void 0,e.properties.labelId];if(e.properties.mode)c=W.default.t(e.properties.mode.toLowerCase().replace("favourite",""));else{var t=e.properties.layer.replace("route-","").toLowerCase().replace("favourite","");c=W.default.t(t)}if(e.properties.id&&("stop"===e.properties.layer||"station"===e.properties.layer)){var i,r=le(e.properties),M=null===(i=e.properties.addendum)||void 0===i?void 0:i.GTFS.modes;return[c,pe(o,r),a,r,M]}if("favouriteStop"===e.properties.layer||"favouriteStation"===e.properties.layer){var s=e.properties,p=s.address,u=s.code;return[c,p?pe(p.split(",")[0],u):o,a,u]}return[c,o,a]}var l=e.properties,d=l.origin,b=l.destination,A=d.locality?", ".concat(d.locality," foobar"):"",z=b.locality?", ".concat(b.locality):"",f=d.name,h=b.name;return[W.default.t("future-route"),"".concat(W.default.t("origin")," ").concat(f).concat(A," ").concat(W.default.t("destination")," ").concat(h).concat(z),e.translatedText]}function Ke(e){var c=Re.unix(e.properties.time),n=e.properties.arriveBy?W.default.t("arrival"):W.default.t("departure");return n=c.isSame(Re(),"day")?"".concat(n," ").concat(W.default.t("today-at")):c.isSame(Re().add(1,"day"),"day")?"".concat(n," ").concat(W.default.t("tomorrow-at")):"".concat(n," ").concat(c.format("dd D.M.")),n="".concat(n," ").concat(Re(c).format("HH:mm"))}"production"!==process.env.NODE_ENV&&N.default.node;var Qe=function(e){Z(t,e);var c,n,o,a=Ge(t);function t(e){var c;return K(this,t),(c=a.call(this,e)).componentDidUpdate=function(){W.default.language!==c.props.lang&&W.default.changeLanguage(c.props.lang)},c.UNSAFE_componentWillReceiveProps=function(e){e.value===c.state.value||c.state.editing||c.setState({value:e.value})},c.onChange=function(e,n){var o=n.newValue,a=n.method,t={value:c.fInput||o||"",renderMobileSearch:c.props.isMobile};if(c.fInput=null,c.state.editing){if("enter"!==a||c.state.valid){if(c.state.typingTimer&&clearTimeout(c.state.typingTimer),"type"===a){var i=setTimeout((function(){c.setState({typing:!1})}),1e3);t.typingTimer=i,t.typing=!0}c.setState(t)}}else t.editing=!0,c.setState(t,(function(){return c.fetchFunction({value:o||""})}))},c.onBlur=function(){c.state.editing&&c.input.focus(),c.setState({editing:!1,renderMobileSearch:!1,value:c.props.value})},c.onSelected=function(e,n){if(c.state.valid){if("SelectFromOwnLocations"===n.suggestion.type)return void c.setState({sources:["Favourite","Back"],ownPlaces:!0,pendingSelection:n.suggestion.type,value:""},(function(){c.fetchFunction({value:""})}));if("back"===n.suggestion.type||"FutureRoute"===n.suggestion.type)return void c.setState({sources:c.props.sources,ownPlaces:!1,pendingSelection:n.suggestion.type,suggestionIndex:n.suggestionIndex},(function(){c.fetchFunction({value:""})}));c.setState({editing:!1,value:n.suggestionValue},(function(){c.input.blur(),c.props.handleViaPoints?c.props.handleViaPoints(n.suggestion,n.suggestionIndex):c.props.onSelect(n.suggestion,c.props.id),c.setState({renderMobileSearch:!1,sources:c.props.sources,ownPlaces:!1,suggestions:[]}),c.props.focusChange&&!c.props.isMobile&&c.props.focusChange()}))}else c.setState((function(e){return{pendingSelection:e.value}}),(function(){return c.checkPendingSelection()}))},c.onSuggestionsClearRequested=function(){c.setState({suggestions:[],sources:c.props.sources,ownPlaces:!1,editing:!1})},c.getSuggestionValue=function(e){return"SelectFromOwnLocations"===e.type||"back"===e.type?"":function(e){var c=de(e,!0);switch(e.layer){case"selectFromMap":case"currentPosition":case"ownLocations":case"back":return c[1]||c[0];case"favouriteBikeRentalStation":case"favouritePlace":return c[0];default:return c.length>1&&""!==c[1]?c.join(", "):c[1]||c[0]}}(e.properties)},c.checkPendingSelection=function(){"SelectFromOwnLocations"!==c.state.pendingSelection&&"back"!==c.state.pendingSelection||!c.state.valid?c.state.pendingSelection&&c.state.valid&&c.setState({pendingSelection:null,editing:!1},(function(){c.state.suggestions.length&&(c.input.blur(),c.props.onSelect(c.state.suggestions[c.state.suggestionIndex],c.props.id))})):c.setState({pendingSelection:null,editing:!0},(function(){c.input.focus()}))},c.clearButton=function(){return g.default.createElement("button",{type:"button",className:Pe["clear-input"],onClick:c.clearInput,"aria-label":W.default.t("clear-button-label")},g.default.createElement(x.default,{img:"close",color:c.props.color}))},c.fetchFunction=function(e){var n=e.value,o=e.cleanExecuted;return c.setState({valid:!1,cleanExecuted:o||!1},(function(){var e,o=I.default(c.props.targets)||c.props.targets.includes("Locations");c.state.ownPlaces?(e=["Locations"],(I.default(c.props.targets)||c.props.targets.includes("Stops"))&&e.push("Stops")):I.default(c.props.targets)||(e=V(c.props.targets),o&&!c.props.isMobile&&(I.default(c.props.sources)||c.props.sources.includes("Favourite"))&&e.push("SelectFromOwnLocations")),function(e,c,n,o,a,t,i,r,M,s){r(null),ge(e,c,n,o,a,t,i,r,M,s)}(e,c.state.sources&&c.state.sources.filter((function(e){return!(o&&"Favourite"===e&&!c.state.ownPlaces&&!c.props.isMobile)})),c.props.transportMode,c.props.searchContext,c.props.filterResults,c.props.geocodingSize,{input:n||""},(function(e){if(null!=e){var o=(e.results||[]).filter((function(e){return"FutureRoute"!==e.type||"FutureRoute"===e.type&&e.properties.time>Re().unix()})).map((function(e){if("CurrentLocation"===e.type||"SelectFromMap"===e.type||"SelectFromOwnLocations"===e.type||"back"===e.type){var c=U({},e);return c.properties.labelId=W.default.t(e.properties.labelId),c}return e}));n!==c.state.value&&n!==c.state.pendingSelection&&"SelectFromOwnLocations"!==c.state.pendingSelection&&"back"!==c.state.pendingSelection&&"FutureRoute"!==c.state.pendingSelection||c.setState({valid:!0,suggestions:o},(function(){return c.checkPendingSelection()}))}}),c.props.pathOpts,c.props.refPoint)}))},c.clearInput=function(){var e={editing:!0,value:"",sources:c.props.sources,ownPlaces:!1};c.setState(e,(function(){return c.fetchFunction({value:"",cleanExecuted:!0})})),c.props.onClear&&c.props.onClear(),c.input.focus()},c.inputClicked=function(e){if(c.input.focus(),c.props.isMobile&&c.props.lock(),!c.state.editing){var n={editing:!0,pendingSelection:null,renderMobileSearch:c.props.isMobile},o={editing:!0,pendingSelection:null,value:e};c.state.suggestions.length?(c.fetchFunction({value:c.state.value}),c.setState(n)):"object"!==F(e)&&e?c.setState(o,(function(){return c.fetchFunction({value:e})})):c.setState(n,(function(){return c.fetchFunction({value:c.state.value})}))}},c.storeInputReference=function(e){null!==e&&(c.input=e.input,c.props.storeRef&&c.props.storeRef(e.input))},c.fillInput=function(e){c.fInput=e.properties.name;var n={editing:!0,value:e.properties.name,checkPendingSelection:e,valid:!0};c.setState(n),c.fetchFunction({value:e.properties.name}),c.input.focus()},c.renderItem=function(e){var n="FutureRoute"===e.type?U({},e,{translatedText:Ke(e)}):e,o=Ve(e);return g.default.createElement(P.default,{item:n,content:o,loading:!c.state.valid,isMobile:c.props.isMobile,ariaFavouriteString:W.default.t("favourite"),color:c.props.color,fillInput:c.fillInput,fontWeights:c.props.fontWeights,modeIconColors:c.props.modeIconColors,modeSet:c.props.modeSet})},c.closeMobileSearch=function(){c.props.unlock(),c.setState({renderMobileSearch:!1,value:c.props.value},(function(){window.scrollTo(0,c.state.scrollY),c.onSuggestionsClearRequested()}))},c.keyDown=function(e){var n=e.key;if("Escape"===n&&c.setState({editing:!1}),c.state.editing)return"Enter"===n&&c.fetchFunction({value:c.state.value}),c.inputClicked();if(("Enter"===n||"ArrowDown"===n)&&""===c.state.value)return c.clearInput();if("ArrowDown"===n&&""!==c.state.value){var o={editing:!0,value:c.state.value};c.setState(o,(function(){return c.fetchFunction({value:c.state.value})}))}return c.state.editing||c.setState({editing:!0}),"Tab"===n?c.onBlur():void 0},c.suggestionAsAriaContent=function(){var e=[],n=c.state.suggestions[0];return n&&(n.type&&n.type.includes("Favourite")&&e.push(W.default.t("favourite")),e=e.concat(Ve(c.state.suggestions[0]))),V(new Set(e)).join(" - ")},c.clearOldSearches=function(){var e=c.props.searchContext,n=e.context,o=e.clearOldSearches,a=e.clearFutureRoutes;n&&o&&(o(n),a&&a(n),c.fetchFunction({value:c.state.value}))},c.isOriginDestinationOrViapoint=function(){return"origin"===c.props.id||"destination"===c.props.id||"via-point"===c.props.id||"origin-stop-near-you"===c.props.id},c.onFocus=function(){["Valittu sijainti","Nykyinen sijaintisi","Current position","Selected location","Vald position","Använd min position","Min position","Käytä nykyistä sijaintia","Use current location","Your current location"].includes(c.state.value)&&c.clearInput();var e=window.pageYOffset;return c.setState({scrollY:e})},Re.tz.setDefault(e.timeZone),Re.locale(e.lang),c.state={value:e.value,suggestions:[],editing:!1,valid:!0,renderMobileSearch:!1,sources:e.sources,ownPlaces:!1,typingTimer:null,typing:!1,pendingSelection:null,suggestionIndex:0,cleanExecuted:!1,scrollY:0},Object.keys(we).forEach((function(e){W.default.addResourceBundle(e,"translation",we[e])})),c}return c=t,(n=[{key:"shouldComponentUpdate",value:function(e,c){return!C.default(c,this.state)||!C.default(e,this.props)}},{key:"render",value:function(){var e=this;W.default.language!==this.props.lang&&W.default.changeLanguage(this.props.lang);var c=this.state,n=c.value,o=c.suggestions,a=c.renderMobileSearch,t=c.cleanExecuted,i={placeholder:this.props.translatedPlaceholder?this.props.translatedPlaceholder:W.default.t(this.props.placeholder),value:n,onChange:this.onChange,onBlur:this.props.isMobile?function(){return null}:this.onBlur,className:"".concat(Pe.input," ").concat(this.props.isMobile&&this.props.transportMode?Pe.thin:""," ").concat(Pe[this.props.id]||""," ").concat(this.state.value?Pe.hasValue:""," ").concat(this.props.inputClassName),onKeyDown:this.keyDown,required:this.props.required},r=this.props.id.replace("searchfield-",""),M=this.props.ariaLabel||W.default.t(r);M=M.replace("searchfield-","");var s=this.props.required?"".concat(W.default.t("required"),"."):"",p=this.props.isMobile?W.default.t("search-autosuggest-label-mobile"):W.default.t("search-autosuggest-label-desktop"),u=W.default.t("search-autosuggest-len",{count:o.length}),l=function(){return e.suggestionAsAriaContent()||e.props.value?W.default.t("search-current-suggestion",{selection:e.suggestionAsAriaContent()||e.props.value}):""};return g.default.createElement(g.default.Fragment,null,g.default.createElement("span",{className:Pe["sr-only"],role:this.state.typing?void 0:"alert","aria-hidden":!this.state.editing},u),g.default.createElement("span",{className:Pe["sr-only"],role:this.state.typing?void 0:"alert","aria-hidden":!this.state.editing||0===o.length},l()),this.props.isMobile&&g.default.createElement(Ye,{searchOpen:a,appElement:this.props.appElement,clearOldSearches:this.clearOldSearches,id:this.props.id,clearInput:this.clearInput,value:this.state.value,suggestions:[].concat(V(o),[{type:"clear-search-history",labelId:W.default.t("clear-search-history")}]),inputProps:U({},i,{placeholder:this.isOriginDestinationOrViapoint()?W.default.t("address-place-or-business"):i.placeholder}),fetchFunction:this.fetchFunction,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderItem,closeHandle:this.closeMobileSearch,ariaLabel:s.concat(" ").concat(M).concat(" ").concat(l()),label:this.props.mobileLabel?this.props.mobileLabel:W.default.t(this.props.id),onSuggestionSelected:this.onSelected,onKeyDown:this.keyDown,dialogHeaderText:W.default.t("delete-old-searches-header"),dialogPrimaryButtonText:W.default.t("delete"),dialogSecondaryButtonText:W.default.t("cancel"),clearInputButtonText:W.default.t("clear-button-label"),focusInput:t,color:this.props.color,hoverColor:this.props.hoverColor,fontWeights:this.props.fontWeights}),!a&&g.default.createElement("div",{className:T.default(Pe["autosuggest-input-container"],Pe[this.props.id]),style:{"--color":"".concat(this.props.color),"--hover-color":"".concat(this.props.hoverColor)}},this.props.icon&&g.default.createElement("div",{className:T.default(Pe["autosuggest-input-icon"],Pe[this.props.id],this.props.inputClassName&&"".concat(this.props.inputClassName,"-input-icon"))},g.default.createElement(x.default,{img:"".concat(this.props.icon)})),g.default.createElement(X.default,{alwaysRenderSuggestions:this.state.editing,id:this.props.id,suggestions:o,onSuggestionsFetchRequested:this.fetchFunction,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderItem,inputProps:U({},i,{onFocus:this.onFocus}),focusInputOnSuggestionClick:!0,shouldRenderSuggestions:function(){return e.state.editing},highlightFirstSuggestion:!0,theme:Pe,renderInputComponent:function(c){return g.default.createElement(g.default.Fragment,null,g.default.createElement("label",{className:"sr-only",htmlFor:e.props.id},l().concat(" ").concat(s).concat(" ").concat(M).concat(" ").concat(p)),g.default.createElement("input",Object.assign({"aria-label":l().concat(" ").concat(s).concat(" ").concat(M).concat(" ").concat(p),id:e.props.id,onClick:e.inputClicked,onKeyDown:e.keyDown},c)),e.state.value&&e.clearButton())},onSuggestionSelected:this.onSelected,ref:this.storeInputReference})))}}])&&Q(c.prototype,n),o&&Q(c,o),t}(g.default.Component);Qe.defaultProps={autoFocus:!1,className:"",icon:void 0,value:"",transportMode:void 0,lang:"fi",sources:[],isMobile:!1,color:"#007ac9",hoverColor:"#0062a1",timeZone:"Europe/Helsinki",pathOpts:{routesPrefix:"linjat",stopsPrefix:"pysakit"},mobileLabel:void 0,inputClassName:"",translatedPlaceholder:void 0,fontWeights:{medium:500},modeIconColors:{"mode-bus":"#007ac9","mode-rail":"#8c4799","mode-tram":"#008151","mode-metro":"#ed8c00","mode-ferry":"#007A97"},required:!1,modeSet:void 0},"production"!==process.env.NODE_ENV&&(Qe.propTypes={appElement:N.default.string.isRequired,autoFocus:N.default.bool,className:N.default.string,icon:N.default.string,id:N.default.string.isRequired,placeholder:N.default.string.isRequired,translatedPlaceholder:N.default.string,value:N.default.string,searchContext:N.default.any.isRequired,ariaLabel:N.default.string,onSelect:N.default.func,transportMode:N.default.string,filterResults:N.default.func,geocodingSize:N.default.number,onClear:N.default.func,storeRef:N.default.func,handleViaPoints:N.default.func,focusChange:N.default.func,lang:N.default.string,sources:N.default.arrayOf(N.default.string),targets:N.default.arrayOf(N.default.string),isMobile:N.default.bool,color:N.default.string,hoverColor:N.default.string,timeZone:N.default.string,pathOpts:N.default.shape({routesPrefix:N.default.string,stopsPrefix:N.default.string}),mobileLabel:N.default.string,lock:N.default.func.isRequired,unlock:N.default.func.isRequired,refPoint:N.default.object,inputClassName:N.default.string,fontWeights:N.default.shape({medium:N.default.number}),modeIconColors:N.default.object,required:N.default.bool,modeSet:N.default.string});var Je,Ze=(Je=Qe,function(e){var c=je.useScrollLock(),n=c.lock,o=c.unlock;return g.default.createElement(Je,Object.assign({lock:n,unlock:o},e))});e.default=Ze,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
34
34
|
//# sourceMappingURL=index.js.map
|