@digitransit-component/digitransit-component-autosuggest 11.0.14 → 11.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +2 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.development.cjs +38 -9
- package/lib/index.js +33 -4
- package/lib/index.js.map +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import require$$0, { memo, useState, useRef, useEffect, useCallback, useReducer,
|
|
|
3
3
|
import { useTranslation, I18nextProvider } from 'react-i18next';
|
|
4
4
|
import cx from 'classnames';
|
|
5
5
|
import { useCombobox } from 'downshift';
|
|
6
|
+
import SuggestionItem, { STOP_STATUS } from '@digitransit-component/digitransit-component-suggestion-item';
|
|
6
7
|
import Icon, { defaultColors } from '@digitransit-component/digitransit-component-icon';
|
|
7
8
|
import { createInstance as createInstance$1 } from 'i18next';
|
|
8
9
|
import { DateTime } from 'luxon';
|
|
9
10
|
import ReactModal from 'react-modal';
|
|
10
11
|
import DialogModal from '@digitransit-component/digitransit-component-dialog-modal';
|
|
11
|
-
import SuggestionItem from '@digitransit-component/digitransit-component-suggestion-item';
|
|
12
12
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
function _typeof(o) {
|
|
@@ -12853,7 +12853,6 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
|
|
|
12853
12853
|
searchComponents.push(selectFromOwnLocations(input));
|
|
12854
12854
|
}
|
|
12855
12855
|
if (allTargets || targets.includes('Locations')) {
|
|
12856
|
-
// eslint-disable-next-line prefer-destructuring
|
|
12857
12856
|
const searchParams = geocodingSearchParams;
|
|
12858
12857
|
if (sources.includes('Favourite')) {
|
|
12859
12858
|
const favouriteLocations = getFavouriteLocations(context);
|
|
@@ -13180,6 +13179,10 @@ const translations = {
|
|
|
13180
13179
|
'stop-near-you-subway': 'Search metro routes or stations ',
|
|
13181
13180
|
'stop-near-you-tram': 'Search tram routes or stops',
|
|
13182
13181
|
'stop-route-station': 'Bus and stop search',
|
|
13182
|
+
'stop-status-alert': 'Service alert at stop',
|
|
13183
|
+
'stop-status-info': 'Notice at stop',
|
|
13184
|
+
'stop-status-no-service-today': 'No departures today',
|
|
13185
|
+
'stop-status-out-of-service': 'Stop out of service',
|
|
13183
13186
|
street: 'Street',
|
|
13184
13187
|
subway: 'Metro',
|
|
13185
13188
|
'today-at': 'today at',
|
|
@@ -13260,6 +13263,10 @@ const translations = {
|
|
|
13260
13263
|
'stop-near-you-subway': 'Hae metrolinjaa tai asemaa',
|
|
13261
13264
|
'stop-near-you-tram': 'Hae raitiolinjaa tai pysäkkiä',
|
|
13262
13265
|
'stop-route-station': 'Linja- ja pysäkkihaku',
|
|
13266
|
+
'stop-status-alert': 'Häiriö pysäkillä',
|
|
13267
|
+
'stop-status-info': 'Tiedote pysäkillä',
|
|
13268
|
+
'stop-status-no-service-today': 'Ei lähtöjä tänään',
|
|
13269
|
+
'stop-status-out-of-service': 'Pysäkki poissa käytöstä',
|
|
13263
13270
|
street: 'Katu',
|
|
13264
13271
|
subway: 'Metro',
|
|
13265
13272
|
'today-at': 'tänään klo',
|
|
@@ -13339,6 +13346,10 @@ const translations = {
|
|
|
13339
13346
|
'stop-near-you-subway': 'Szukaj tras metra i przystanków ',
|
|
13340
13347
|
'stop-near-you-tram': 'Szukaj tras tramwajowych i przystanków',
|
|
13341
13348
|
'stop-route-station': 'Wyszukiwanie autobusów i przystanków',
|
|
13349
|
+
'stop-status-alert': 'Utrudnienie na przystanku',
|
|
13350
|
+
'stop-status-info': 'Komunikat na przystanku',
|
|
13351
|
+
'stop-status-no-service-today': 'Dziś brak odjazdów',
|
|
13352
|
+
'stop-status-out-of-service': 'Przystanek nieczynny',
|
|
13342
13353
|
street: 'Ulica',
|
|
13343
13354
|
subway: 'Metro',
|
|
13344
13355
|
'today-at': 'dziś o',
|
|
@@ -13419,6 +13430,10 @@ const translations = {
|
|
|
13419
13430
|
'stop-near-you-subway': 'Sök metrolinjer eller stationer',
|
|
13420
13431
|
'stop-near-you-tram': 'Sök spårvagnlinjer eller hållplatser',
|
|
13421
13432
|
'stop-route-station': 'Buss och stopp sökningen',
|
|
13433
|
+
'stop-status-alert': 'Störning vid hållplatsen',
|
|
13434
|
+
'stop-status-info': 'Meddelande vid hållplatsen',
|
|
13435
|
+
'stop-status-no-service-today': 'Inga avgångar idag',
|
|
13436
|
+
'stop-status-out-of-service': 'Hållplats ur bruk',
|
|
13422
13437
|
street: 'Gata',
|
|
13423
13438
|
subway: 'Metro',
|
|
13424
13439
|
'today-at': 'i dag kl',
|
|
@@ -15003,7 +15018,21 @@ function DTAutosuggest({
|
|
|
15003
15018
|
getAutoSuggestIcons,
|
|
15004
15019
|
colors,
|
|
15005
15020
|
modeSet,
|
|
15006
|
-
showStopStatusMarkers: !!searchContext.showStopStatusMarkers
|
|
15021
|
+
showStopStatusMarkers: !!searchContext.showStopStatusMarkers,
|
|
15022
|
+
stopStatusLabels: {
|
|
15023
|
+
[STOP_STATUS.OUT_OF_SERVICE]: t('stop-status-out-of-service', {
|
|
15024
|
+
lng
|
|
15025
|
+
}),
|
|
15026
|
+
[STOP_STATUS.NO_SERVICE_TODAY]: t('stop-status-no-service-today', {
|
|
15027
|
+
lng
|
|
15028
|
+
}),
|
|
15029
|
+
[STOP_STATUS.ALERT]: t('stop-status-alert', {
|
|
15030
|
+
lng
|
|
15031
|
+
}),
|
|
15032
|
+
[STOP_STATUS.INFO]: t('stop-status-info', {
|
|
15033
|
+
lng
|
|
15034
|
+
})
|
|
15035
|
+
}
|
|
15007
15036
|
}), [state.loading, isMobile, t, lng, getAutoSuggestIcons, colors, modeSet, searchContext.showStopStatusMarkers]);
|
|
15008
15037
|
const {
|
|
15009
15038
|
ariaCurrentSuggestion,
|
|
@@ -15135,7 +15164,7 @@ process.env.NODE_ENV !== "production" ? DTAutosuggest.propTypes = {
|
|
|
15135
15164
|
filterResults: PropTypes.func,
|
|
15136
15165
|
searchContext: PropTypes.shape({
|
|
15137
15166
|
URL_PELIAS: PropTypes.string,
|
|
15138
|
-
// eslint-disable-next-line
|
|
15167
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
15139
15168
|
context: PropTypes.object,
|
|
15140
15169
|
clearOldSearches: PropTypes.func,
|
|
15141
15170
|
clearFutureRoutes: PropTypes.func,
|