@transferwise/components 0.0.0-experimental-7173830 → 0.0.0-experimental-4f82861
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/build/i18n/de.json +1 -0
- package/build/i18n/es.json +1 -0
- package/build/i18n/fr.json +1 -0
- package/build/i18n/hu.json +1 -0
- package/build/i18n/id.json +1 -0
- package/build/i18n/it.json +1 -0
- package/build/i18n/ja.json +1 -0
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pt.json +1 -0
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ru.json +1 -0
- package/build/i18n/th.json +1 -0
- package/build/i18n/tr.json +1 -0
- package/build/i18n/zh-CN.json +1 -0
- package/build/i18n/zh-HK.json +1 -0
- package/build/index.esm.js +154 -46
- package/build/index.esm.js.map +1 -1
- package/build/index.js +154 -46
- package/build/index.js.map +1 -1
- package/build/main.css +2 -1
- package/build/styles/main.css +2 -1
- package/build/styles/modal/Modal.css +2 -1
- package/build/types/typeahead/Typeahead.d.ts +57 -98
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts +41 -23
- package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +17 -9
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/i18n/de.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/fr.json +1 -0
- package/src/i18n/hu.json +1 -0
- package/src/i18n/id.json +1 -0
- package/src/i18n/it.json +1 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/pl.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/ro.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/th.json +1 -0
- package/src/i18n/tr.json +1 -0
- package/src/i18n/zh-CN.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/main.css +2 -1
- package/src/modal/Modal.css +2 -1
- package/src/modal/Modal.less +1 -1
- package/src/modal/Modal.story.tsx +53 -21
- package/src/typeahead/{Typeahead.tsx → Typeahead.js} +106 -105
- package/src/typeahead/{Typeahead.story.tsx → Typeahead.story.js} +7 -8
- package/src/typeahead/typeaheadInput/{TypeaheadInput.tsx → TypeaheadInput.js} +42 -43
- package/src/typeahead/typeaheadOption/{TypeaheadOption.tsx → TypeaheadOption.js} +20 -10
package/build/i18n/de.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Weitere Informationen",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
25
26
|
"neptune.Summary.statusDone": "Schritt erledigt",
|
package/build/i18n/es.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Más información",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
25
26
|
"neptune.Summary.statusDone": "Apartado listo",
|
package/build/i18n/fr.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Plus d'informations",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
25
26
|
"neptune.Summary.statusDone": "Validé",
|
package/build/i18n/hu.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "További információ",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
25
26
|
"neptune.Summary.statusDone": "Kész",
|
package/build/i18n/id.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Informasi lebih lanjut",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(terbuka di tab baru)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Pilih opsi...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Pilih opsi...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
25
26
|
"neptune.Summary.statusDone": "Item selesai",
|
package/build/i18n/it.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Maggiori informazioni",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(si apre in una nuova scheda)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Seleziona un'opzione...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Seleziona un'opzione...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Cerca...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
|
|
25
26
|
"neptune.Summary.statusDone": "Completato",
|
package/build/i18n/ja.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "詳細",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(新しいタブで開きます)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "選択してください...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選択してください…",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "検索... ",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
25
26
|
"neptune.Summary.statusDone": "完了",
|
package/build/i18n/pl.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Więcej informacji",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(otworzy się w nowej zakładce)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Wybierz opcję...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wybierz opcję...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
25
26
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
package/build/i18n/pt.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Mais informações",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(abre em uma nova aba)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Escolha uma opção...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Escolha uma opção...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
25
26
|
"neptune.Summary.statusDone": "Pronto",
|
package/build/i18n/ro.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Mai multe informații",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(se deschide într-o filă nouă)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Selectează o opţiune...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
25
26
|
"neptune.Summary.statusDone": "Finalizat",
|
package/build/i18n/ru.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Подробнее",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
25
26
|
"neptune.Summary.statusDone": "Этап завершен",
|
package/build/i18n/th.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "ข้อมูลเพิ่มเติม",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(เปิดในแท็บใหม่)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
25
26
|
"neptune.Summary.statusDone": "รายการที่ทำแล้ว",
|
package/build/i18n/tr.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "Daha fazla bilgi",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(yeni sekmede açılır)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "Bir seçenek seçin...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Bir seçenek seçin...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
25
26
|
"neptune.Summary.statusDone": "Tamamlanan aşama",
|
package/build/i18n/zh-CN.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "更多信息",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择一个选项...",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
25
26
|
"neptune.Summary.statusDone": "已完成",
|
package/build/i18n/zh-HK.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"neptune.Info.ariaLabel": "更多資訊",
|
|
21
21
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
22
22
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
23
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
23
24
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
24
25
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
25
26
|
"neptune.Summary.statusDone": "已完成事項",
|
package/build/index.esm.js
CHANGED
|
@@ -12210,10 +12210,8 @@ const TextareaWithDisplayFormat = props => /*#__PURE__*/jsx(WithDisplayFormat, {
|
|
|
12210
12210
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12211
12211
|
const DEFAULT_INPUT_MIN_WIDTH = 10;
|
|
12212
12212
|
class TypeaheadInput extends Component {
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
constructor(props) {
|
|
12216
|
-
super(props);
|
|
12213
|
+
constructor() {
|
|
12214
|
+
super();
|
|
12217
12215
|
this.state = {
|
|
12218
12216
|
inputWidth: DEFAULT_INPUT_MIN_WIDTH
|
|
12219
12217
|
};
|
|
@@ -12223,7 +12221,7 @@ class TypeaheadInput extends Component {
|
|
|
12223
12221
|
autoFocus
|
|
12224
12222
|
} = this.props;
|
|
12225
12223
|
if (autoFocus) {
|
|
12226
|
-
this.inputRef
|
|
12224
|
+
this.inputRef.focus();
|
|
12227
12225
|
}
|
|
12228
12226
|
}
|
|
12229
12227
|
componentDidUpdate(previousProps) {
|
|
@@ -12234,19 +12232,19 @@ class TypeaheadInput extends Component {
|
|
|
12234
12232
|
recalculateWidth = () => {
|
|
12235
12233
|
requestAnimationFrame(() => {
|
|
12236
12234
|
this.setState({
|
|
12237
|
-
inputWidth:
|
|
12235
|
+
inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.scrollWidth + 10)
|
|
12238
12236
|
});
|
|
12239
12237
|
});
|
|
12240
12238
|
};
|
|
12241
12239
|
renderInput = () => {
|
|
12242
12240
|
const {
|
|
12243
12241
|
typeaheadId,
|
|
12244
|
-
autoFocus
|
|
12242
|
+
autoFocus,
|
|
12245
12243
|
multiple,
|
|
12246
12244
|
name,
|
|
12247
|
-
optionsShown
|
|
12248
|
-
placeholder
|
|
12249
|
-
selected
|
|
12245
|
+
optionsShown,
|
|
12246
|
+
placeholder,
|
|
12247
|
+
selected,
|
|
12250
12248
|
value,
|
|
12251
12249
|
onChange,
|
|
12252
12250
|
onKeyDown,
|
|
@@ -12287,18 +12285,18 @@ class TypeaheadInput extends Component {
|
|
|
12287
12285
|
render() {
|
|
12288
12286
|
const {
|
|
12289
12287
|
multiple,
|
|
12290
|
-
selected
|
|
12288
|
+
selected,
|
|
12291
12289
|
value,
|
|
12292
|
-
maxHeight
|
|
12290
|
+
maxHeight,
|
|
12293
12291
|
renderChip
|
|
12294
12292
|
} = this.props;
|
|
12295
12293
|
return multiple ? /*#__PURE__*/jsxs("div", {
|
|
12296
12294
|
className: "form-control typeahead__input-container",
|
|
12297
|
-
style: {
|
|
12298
|
-
maxHeight
|
|
12295
|
+
style: maxHeight && {
|
|
12296
|
+
maxHeight
|
|
12299
12297
|
},
|
|
12300
12298
|
onClick: () => {
|
|
12301
|
-
this.inputRef
|
|
12299
|
+
this.inputRef.focus();
|
|
12302
12300
|
},
|
|
12303
12301
|
children: [/*#__PURE__*/jsxs("div", {
|
|
12304
12302
|
className: "typeahead__input-wrapper",
|
|
@@ -12315,6 +12313,30 @@ class TypeaheadInput extends Component {
|
|
|
12315
12313
|
}) : this.renderInput();
|
|
12316
12314
|
}
|
|
12317
12315
|
}
|
|
12316
|
+
TypeaheadInput.propTypes = {
|
|
12317
|
+
typeaheadId: PropTypes.string.isRequired,
|
|
12318
|
+
name: PropTypes.string.isRequired,
|
|
12319
|
+
autoFocus: PropTypes.bool,
|
|
12320
|
+
multiple: PropTypes.bool.isRequired,
|
|
12321
|
+
value: PropTypes.string.isRequired,
|
|
12322
|
+
selected: PropTypes.arrayOf(PropTypes.object),
|
|
12323
|
+
placeholder: PropTypes.string,
|
|
12324
|
+
optionsShown: PropTypes.bool,
|
|
12325
|
+
maxHeight: PropTypes.number,
|
|
12326
|
+
autoComplete: PropTypes.string.isRequired,
|
|
12327
|
+
onChange: PropTypes.func.isRequired,
|
|
12328
|
+
renderChip: PropTypes.func.isRequired,
|
|
12329
|
+
onKeyDown: PropTypes.func.isRequired,
|
|
12330
|
+
onFocus: PropTypes.func.isRequired,
|
|
12331
|
+
onPaste: PropTypes.func.isRequired
|
|
12332
|
+
};
|
|
12333
|
+
TypeaheadInput.defaultProps = {
|
|
12334
|
+
autoFocus: false,
|
|
12335
|
+
maxHeight: null,
|
|
12336
|
+
placeholder: '',
|
|
12337
|
+
optionsShown: false,
|
|
12338
|
+
selected: []
|
|
12339
|
+
};
|
|
12318
12340
|
|
|
12319
12341
|
function highlight(value, query) {
|
|
12320
12342
|
if (value && query) {
|
|
@@ -12335,9 +12357,9 @@ function highlight(value, query) {
|
|
|
12335
12357
|
const Option = props => {
|
|
12336
12358
|
const {
|
|
12337
12359
|
option,
|
|
12338
|
-
selected
|
|
12339
|
-
onClick
|
|
12340
|
-
query
|
|
12360
|
+
selected,
|
|
12361
|
+
onClick,
|
|
12362
|
+
query
|
|
12341
12363
|
} = props;
|
|
12342
12364
|
const {
|
|
12343
12365
|
label,
|
|
@@ -12367,33 +12389,30 @@ const Option = props => {
|
|
|
12367
12389
|
})
|
|
12368
12390
|
});
|
|
12369
12391
|
};
|
|
12392
|
+
Option.propTypes = {
|
|
12393
|
+
option: PropTypes.shape({
|
|
12394
|
+
label: PropTypes.string.isRequired,
|
|
12395
|
+
note: PropTypes.string,
|
|
12396
|
+
secondary: PropTypes.string
|
|
12397
|
+
}).isRequired,
|
|
12398
|
+
query: PropTypes.string,
|
|
12399
|
+
selected: PropTypes.bool,
|
|
12400
|
+
onClick: PropTypes.func
|
|
12401
|
+
};
|
|
12402
|
+
Option.defaultProps = {
|
|
12403
|
+
selected: false,
|
|
12404
|
+
query: '',
|
|
12405
|
+
onClick: () => {}
|
|
12406
|
+
};
|
|
12370
12407
|
var TypeaheadOption = Option;
|
|
12371
12408
|
|
|
12372
12409
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
12373
12410
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
12374
12411
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12412
|
+
|
|
12375
12413
|
const DEFAULT_MIN_QUERY_LENGTH = 3;
|
|
12376
12414
|
const SEARCH_DELAY = 200;
|
|
12377
12415
|
class Typeahead extends Component {
|
|
12378
|
-
static defaultProps = {
|
|
12379
|
-
addon: null,
|
|
12380
|
-
allowNew: false,
|
|
12381
|
-
autoFillOnBlur: true,
|
|
12382
|
-
autoFocus: false,
|
|
12383
|
-
chipSeparators: [],
|
|
12384
|
-
clearable: true,
|
|
12385
|
-
footer: null,
|
|
12386
|
-
initialValue: [],
|
|
12387
|
-
inputAutoComplete: 'new-password',
|
|
12388
|
-
maxHeight: null,
|
|
12389
|
-
minQueryLength: DEFAULT_MIN_QUERY_LENGTH,
|
|
12390
|
-
multiple: false,
|
|
12391
|
-
searchDelay: SEARCH_DELAY,
|
|
12392
|
-
showSuggestions: true,
|
|
12393
|
-
showNewEntry: true,
|
|
12394
|
-
size: Size.MEDIUM,
|
|
12395
|
-
validateChip: () => true
|
|
12396
|
-
};
|
|
12397
12416
|
constructor(props) {
|
|
12398
12417
|
super(props);
|
|
12399
12418
|
const {
|
|
@@ -12410,7 +12429,6 @@ class Typeahead extends Component {
|
|
|
12410
12429
|
keyboardFocusedOptionIndex: null
|
|
12411
12430
|
};
|
|
12412
12431
|
}
|
|
12413
|
-
handleSearchDebounced;
|
|
12414
12432
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
12415
12433
|
if (nextProps.multiple !== this.props.multiple) {
|
|
12416
12434
|
this.setState(previousState => {
|
|
@@ -12424,8 +12442,7 @@ class Typeahead extends Component {
|
|
|
12424
12442
|
};
|
|
12425
12443
|
}
|
|
12426
12444
|
return {
|
|
12427
|
-
query: ''
|
|
12428
|
-
selected: previousState.selected
|
|
12445
|
+
query: ''
|
|
12429
12446
|
};
|
|
12430
12447
|
});
|
|
12431
12448
|
}
|
|
@@ -12434,8 +12451,13 @@ class Typeahead extends Component {
|
|
|
12434
12451
|
this.handleSearchDebounced.cancel();
|
|
12435
12452
|
}
|
|
12436
12453
|
handleOnFocus = () => {
|
|
12454
|
+
const {
|
|
12455
|
+
onFocus
|
|
12456
|
+
} = this.props;
|
|
12437
12457
|
this.showMenu();
|
|
12438
|
-
|
|
12458
|
+
if (onFocus) {
|
|
12459
|
+
this.props.onFocus();
|
|
12460
|
+
}
|
|
12439
12461
|
};
|
|
12440
12462
|
onOptionSelected = (event, item) => {
|
|
12441
12463
|
event.preventDefault();
|
|
@@ -12518,7 +12540,7 @@ class Typeahead extends Component {
|
|
|
12518
12540
|
break;
|
|
12519
12541
|
case 'Enter':
|
|
12520
12542
|
event.preventDefault();
|
|
12521
|
-
if (
|
|
12543
|
+
if (options[keyboardFocusedOptionIndex]) {
|
|
12522
12544
|
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
12523
12545
|
} else if (allowNew && query.trim()) {
|
|
12524
12546
|
this.selectItem({
|
|
@@ -12570,6 +12592,13 @@ class Typeahead extends Component {
|
|
|
12570
12592
|
query
|
|
12571
12593
|
});
|
|
12572
12594
|
};
|
|
12595
|
+
stopPropagation = event => {
|
|
12596
|
+
event.stopPropagation();
|
|
12597
|
+
event.preventDefault();
|
|
12598
|
+
if (event.nativeEvent && event.nativeEvent.stopImmediatePropagation) {
|
|
12599
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
12600
|
+
}
|
|
12601
|
+
};
|
|
12573
12602
|
handleSearch = query => {
|
|
12574
12603
|
const {
|
|
12575
12604
|
onSearch
|
|
@@ -12654,7 +12683,7 @@ class Typeahead extends Component {
|
|
|
12654
12683
|
}
|
|
12655
12684
|
};
|
|
12656
12685
|
renderChip = (option, idx) => {
|
|
12657
|
-
const valid = this.props.validateChip
|
|
12686
|
+
const valid = this.props.validateChip(option);
|
|
12658
12687
|
return /*#__PURE__*/jsx(Chip, {
|
|
12659
12688
|
label: option.label,
|
|
12660
12689
|
className: classNames('m-t-1', {
|
|
@@ -12732,7 +12761,6 @@ class Typeahead extends Component {
|
|
|
12732
12761
|
const menu = this.renderMenu({
|
|
12733
12762
|
footer,
|
|
12734
12763
|
options,
|
|
12735
|
-
id,
|
|
12736
12764
|
keyboardFocusedOptionIndex,
|
|
12737
12765
|
query,
|
|
12738
12766
|
allowNew,
|
|
@@ -12751,7 +12779,7 @@ class Typeahead extends Component {
|
|
|
12751
12779
|
'typeahead--multiple': multiple,
|
|
12752
12780
|
open: dropdownOpen
|
|
12753
12781
|
}),
|
|
12754
|
-
onClick: stopPropagation
|
|
12782
|
+
onClick: this.stopPropagation,
|
|
12755
12783
|
children: /*#__PURE__*/jsxs("div", {
|
|
12756
12784
|
className: classNames('form-group', {
|
|
12757
12785
|
'has-error': hasError,
|
|
@@ -12772,7 +12800,6 @@ class Typeahead extends Component {
|
|
|
12772
12800
|
placeholder,
|
|
12773
12801
|
selected,
|
|
12774
12802
|
maxHeight,
|
|
12775
|
-
id: id,
|
|
12776
12803
|
name: name,
|
|
12777
12804
|
value: query,
|
|
12778
12805
|
typeaheadId: id,
|
|
@@ -12799,6 +12826,72 @@ class Typeahead extends Component {
|
|
|
12799
12826
|
});
|
|
12800
12827
|
}
|
|
12801
12828
|
}
|
|
12829
|
+
Typeahead.propTypes = {
|
|
12830
|
+
id: PropTypes.string.isRequired,
|
|
12831
|
+
name: PropTypes.string.isRequired,
|
|
12832
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
12833
|
+
label: PropTypes.string.isRequired,
|
|
12834
|
+
note: PropTypes.string,
|
|
12835
|
+
secondary: PropTypes.string,
|
|
12836
|
+
value: PropTypes.object
|
|
12837
|
+
})).isRequired,
|
|
12838
|
+
initialValue: PropTypes.arrayOf(PropTypes.shape({
|
|
12839
|
+
label: PropTypes.string.isRequired,
|
|
12840
|
+
note: PropTypes.string,
|
|
12841
|
+
secondary: PropTypes.string
|
|
12842
|
+
})),
|
|
12843
|
+
onChange: PropTypes.func.isRequired,
|
|
12844
|
+
allowNew: PropTypes.bool,
|
|
12845
|
+
autoFocus: PropTypes.bool,
|
|
12846
|
+
clearable: PropTypes.bool,
|
|
12847
|
+
multiple: PropTypes.bool,
|
|
12848
|
+
showSuggestions: PropTypes.bool,
|
|
12849
|
+
showNewEntry: PropTypes.bool,
|
|
12850
|
+
searchDelay: PropTypes.number,
|
|
12851
|
+
maxHeight: PropTypes.number,
|
|
12852
|
+
minQueryLength: PropTypes.number,
|
|
12853
|
+
addon: PropTypes.node,
|
|
12854
|
+
placeholder: PropTypes.string,
|
|
12855
|
+
alert: PropTypes.shape({
|
|
12856
|
+
message: PropTypes.string.isRequired,
|
|
12857
|
+
type: PropTypes.oneOf(['error', 'warning', 'neutral']).isRequired
|
|
12858
|
+
}),
|
|
12859
|
+
footer: PropTypes.node,
|
|
12860
|
+
validateChip: PropTypes.func,
|
|
12861
|
+
onSearch: PropTypes.func,
|
|
12862
|
+
onBlur: PropTypes.func,
|
|
12863
|
+
onInputChange: PropTypes.func,
|
|
12864
|
+
onFocus: PropTypes.func,
|
|
12865
|
+
chipSeparators: PropTypes.arrayOf(PropTypes.string),
|
|
12866
|
+
size: PropTypes.oneOf(['md', 'lg']),
|
|
12867
|
+
inputAutoComplete: PropTypes.string,
|
|
12868
|
+
autoFillOnBlur: PropTypes.bool
|
|
12869
|
+
};
|
|
12870
|
+
Typeahead.defaultProps = {
|
|
12871
|
+
allowNew: false,
|
|
12872
|
+
autoFocus: false,
|
|
12873
|
+
clearable: true,
|
|
12874
|
+
multiple: false,
|
|
12875
|
+
maxHeight: null,
|
|
12876
|
+
showSuggestions: true,
|
|
12877
|
+
showNewEntry: true,
|
|
12878
|
+
searchDelay: SEARCH_DELAY,
|
|
12879
|
+
minQueryLength: DEFAULT_MIN_QUERY_LENGTH,
|
|
12880
|
+
addon: null,
|
|
12881
|
+
placeholder: null,
|
|
12882
|
+
alert: null,
|
|
12883
|
+
footer: null,
|
|
12884
|
+
size: Size.MEDIUM,
|
|
12885
|
+
chipSeparators: [],
|
|
12886
|
+
initialValue: [],
|
|
12887
|
+
onSearch: null,
|
|
12888
|
+
onBlur: null,
|
|
12889
|
+
onInputChange: null,
|
|
12890
|
+
onFocus: null,
|
|
12891
|
+
validateChip: () => true,
|
|
12892
|
+
inputAutoComplete: 'new-password',
|
|
12893
|
+
autoFillOnBlur: true
|
|
12894
|
+
};
|
|
12802
12895
|
|
|
12803
12896
|
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
12804
12897
|
var UploadStep;
|
|
@@ -14494,6 +14587,7 @@ var de = {
|
|
|
14494
14587
|
"neptune.Info.ariaLabel": "Weitere Informationen",
|
|
14495
14588
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
14496
14589
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
14590
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
14497
14591
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
14498
14592
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
14499
14593
|
"neptune.Summary.statusDone": "Schritt erledigt",
|
|
@@ -14551,6 +14645,7 @@ var es = {
|
|
|
14551
14645
|
"neptune.Info.ariaLabel": "Más información",
|
|
14552
14646
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
14553
14647
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
14648
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
14554
14649
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
14555
14650
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
14556
14651
|
"neptune.Summary.statusDone": "Apartado listo",
|
|
@@ -14608,6 +14703,7 @@ var fr = {
|
|
|
14608
14703
|
"neptune.Info.ariaLabel": "Plus d'informations",
|
|
14609
14704
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
14610
14705
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
14706
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
14611
14707
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
14612
14708
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
14613
14709
|
"neptune.Summary.statusDone": "Validé",
|
|
@@ -14665,6 +14761,7 @@ var hu = {
|
|
|
14665
14761
|
"neptune.Info.ariaLabel": "További információ",
|
|
14666
14762
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
14667
14763
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
14764
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
14668
14765
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
14669
14766
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
14670
14767
|
"neptune.Summary.statusDone": "Kész",
|
|
@@ -14722,6 +14819,7 @@ var id = {
|
|
|
14722
14819
|
"neptune.Info.ariaLabel": "Informasi lebih lanjut",
|
|
14723
14820
|
"neptune.Link.opensInNewTab": "(terbuka di tab baru)",
|
|
14724
14821
|
"neptune.MoneyInput.Select.placeholder": "Pilih opsi...",
|
|
14822
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Pilih opsi...",
|
|
14725
14823
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
14726
14824
|
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
14727
14825
|
"neptune.Summary.statusDone": "Item selesai",
|
|
@@ -14779,6 +14877,7 @@ var it = {
|
|
|
14779
14877
|
"neptune.Info.ariaLabel": "Maggiori informazioni",
|
|
14780
14878
|
"neptune.Link.opensInNewTab": "(si apre in una nuova scheda)",
|
|
14781
14879
|
"neptune.MoneyInput.Select.placeholder": "Seleziona un'opzione...",
|
|
14880
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Seleziona un'opzione...",
|
|
14782
14881
|
"neptune.Select.searchPlaceholder": "Cerca...",
|
|
14783
14882
|
"neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
|
|
14784
14883
|
"neptune.Summary.statusDone": "Completato",
|
|
@@ -14836,6 +14935,7 @@ var ja = {
|
|
|
14836
14935
|
"neptune.Info.ariaLabel": "詳細",
|
|
14837
14936
|
"neptune.Link.opensInNewTab": "(新しいタブで開きます)",
|
|
14838
14937
|
"neptune.MoneyInput.Select.placeholder": "選択してください...",
|
|
14938
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選択してください…",
|
|
14839
14939
|
"neptune.Select.searchPlaceholder": "検索... ",
|
|
14840
14940
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
14841
14941
|
"neptune.Summary.statusDone": "完了",
|
|
@@ -14893,6 +14993,7 @@ var pl = {
|
|
|
14893
14993
|
"neptune.Info.ariaLabel": "Więcej informacji",
|
|
14894
14994
|
"neptune.Link.opensInNewTab": "(otworzy się w nowej zakładce)",
|
|
14895
14995
|
"neptune.MoneyInput.Select.placeholder": "Wybierz opcję...",
|
|
14996
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wybierz opcję...",
|
|
14896
14997
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
14897
14998
|
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
14898
14999
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
|
@@ -14950,6 +15051,7 @@ var pt = {
|
|
|
14950
15051
|
"neptune.Info.ariaLabel": "Mais informações",
|
|
14951
15052
|
"neptune.Link.opensInNewTab": "(abre em uma nova aba)",
|
|
14952
15053
|
"neptune.MoneyInput.Select.placeholder": "Escolha uma opção...",
|
|
15054
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Escolha uma opção...",
|
|
14953
15055
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
14954
15056
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
14955
15057
|
"neptune.Summary.statusDone": "Pronto",
|
|
@@ -15007,6 +15109,7 @@ var ro = {
|
|
|
15007
15109
|
"neptune.Info.ariaLabel": "Mai multe informații",
|
|
15008
15110
|
"neptune.Link.opensInNewTab": "(se deschide într-o filă nouă)",
|
|
15009
15111
|
"neptune.MoneyInput.Select.placeholder": "Selectează o opţiune...",
|
|
15112
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
15010
15113
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
15011
15114
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
15012
15115
|
"neptune.Summary.statusDone": "Finalizat",
|
|
@@ -15064,6 +15167,7 @@ var ru = {
|
|
|
15064
15167
|
"neptune.Info.ariaLabel": "Подробнее",
|
|
15065
15168
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
15066
15169
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
15170
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
15067
15171
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
15068
15172
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
15069
15173
|
"neptune.Summary.statusDone": "Этап завершен",
|
|
@@ -15121,6 +15225,7 @@ var th = {
|
|
|
15121
15225
|
"neptune.Info.ariaLabel": "ข้อมูลเพิ่มเติม",
|
|
15122
15226
|
"neptune.Link.opensInNewTab": "(เปิดในแท็บใหม่)",
|
|
15123
15227
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
15228
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
15124
15229
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
15125
15230
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
15126
15231
|
"neptune.Summary.statusDone": "รายการที่ทำแล้ว",
|
|
@@ -15178,6 +15283,7 @@ var tr = {
|
|
|
15178
15283
|
"neptune.Info.ariaLabel": "Daha fazla bilgi",
|
|
15179
15284
|
"neptune.Link.opensInNewTab": "(yeni sekmede açılır)",
|
|
15180
15285
|
"neptune.MoneyInput.Select.placeholder": "Bir seçenek seçin...",
|
|
15286
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Bir seçenek seçin...",
|
|
15181
15287
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
15182
15288
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
15183
15289
|
"neptune.Summary.statusDone": "Tamamlanan aşama",
|
|
@@ -15292,6 +15398,7 @@ var zhCN = {
|
|
|
15292
15398
|
"neptune.Info.ariaLabel": "更多信息",
|
|
15293
15399
|
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
15294
15400
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
15401
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择一个选项...",
|
|
15295
15402
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
15296
15403
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
15297
15404
|
"neptune.Summary.statusDone": "已完成",
|
|
@@ -15349,6 +15456,7 @@ var zhHK = {
|
|
|
15349
15456
|
"neptune.Info.ariaLabel": "更多資訊",
|
|
15350
15457
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
15351
15458
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
15459
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
15352
15460
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
15353
15461
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
15354
15462
|
"neptune.Summary.statusDone": "已完成事項",
|