@transferwise/components 45.27.0 → 45.28.1
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/cs.json +2 -0
- package/build/i18n/de.json +2 -0
- package/build/i18n/es.json +2 -0
- package/build/i18n/fr.json +2 -0
- package/build/i18n/hu.json +2 -0
- package/build/i18n/id.json +2 -0
- package/build/i18n/it.json +2 -0
- package/build/i18n/ja.json +2 -0
- package/build/i18n/pl.json +2 -0
- package/build/i18n/pt.json +5 -3
- package/build/i18n/ro.json +5 -3
- package/build/i18n/ru.json +3 -1
- package/build/i18n/th.json +2 -0
- package/build/i18n/tr.json +2 -0
- package/build/i18n/uk.json +2 -0
- package/build/i18n/zh-CN.json +8 -6
- package/build/i18n/zh-HK.json +2 -0
- package/build/index.esm.js +1344 -1253
- package/build/index.esm.js.map +1 -1
- package/build/index.js +1343 -1252
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/moneyInput/MoneyInput.css +1 -1
- package/build/types/inputs/SelectInput.d.ts +2 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/i18n/cs.json +2 -0
- package/src/i18n/de.json +2 -0
- package/src/i18n/es.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/hu.json +2 -0
- package/src/i18n/id.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/pl.json +2 -0
- package/src/i18n/pt.json +5 -3
- package/src/i18n/ro.json +5 -3
- package/src/i18n/ru.json +3 -1
- package/src/i18n/th.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/i18n/uk.json +2 -0
- package/src/i18n/zh-CN.json +8 -6
- package/src/i18n/zh-HK.json +2 -0
- package/src/inputs/SelectInput.spec.tsx +5 -5
- package/src/inputs/SelectInput.tsx +24 -3
- package/src/main.css +1 -1
- package/src/moneyInput/MoneyInput.css +1 -1
- package/src/moneyInput/MoneyInput.js +85 -42
- package/src/moneyInput/MoneyInput.less +40 -159
- package/src/moneyInput/MoneyInput.rtl.spec.js +71 -0
- package/src/moneyInput/MoneyInput.spec.js +247 -116
- package/src/moneyInput/MoneyInput.story.tsx +54 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.tw-money-input .tw-money-input__fixed-currency{padding-left:0!important}[dir=rtl] .tw-money-input .tw-money-input__fixed-currency{padding-left:0!important;padding-right:0!important}.tw-money-input .tw-money-input__fixed-currency
|
|
1
|
+
.tw-money-input{display:flex}.tw-money-input .tw-money-input__fixed-currency{padding-left:0!important}[dir=rtl] .tw-money-input .tw-money-input__fixed-currency{padding-left:0!important;padding-right:0!important}.tw-money-input .tw-money-input__fixed-currency .np-text-title-subsection{color:#768e9c;color:var(--color-content-tertiary);font-weight:600;font-weight:var(--font-weight-semi-bold)}.tw-money-input.input-group-sm .form-control{min-height:34px}.tw-money-input.input-group-sm .np-text-title-subsection{font-size:.875rem;font-size:var(--font-size-14)}.tw-money-input.input-group-md .form-control{min-height:53px}.tw-money-input.input-group-md .np-text-title-subsection{font-size:1rem;font-size:var(--font-size-16)}.tw-money-input .input-group-addon{flex-shrink:0}.tw-money-input .input-group-addon:not(.amount-currency-select-btn){align-items:center;display:flex;flex-shrink:0;width:auto}.tw-money-input .amount-currency-select-btn{flex-shrink:0;line-height:normal;width:auto}.tw-money-input .np-button-input{border-bottom-right-radius:10px!important;border-bottom-right-radius:var(--radius-small)!important;border-top-right-radius:10px!important;border-top-right-radius:var(--radius-small)!important}.tw-money-input .np-button-input:not(.disabled,:disabled):focus-visible{border-radius:10px!important;border-radius:var(--radius-small)!important}.has-error .tw-money-input .np-button-input,.has-error .tw-money-input .np-button-input:not(.disabled,:disabled):hover,.tw-money-input .np-button-input,.tw-money-input .np-button-input:active,.tw-money-input .np-button-input:not(.disabled,:disabled):hover{box-shadow:none}.tw-money-input:not(.disabled,:disabled):not(.np-button-input:active):has(.np-button-input:focus-visible){box-shadow:inset 0 0 0 1px #c9cbce!important;box-shadow:inset 0 0 0 1px var(--color-interactive-secondary)!important}
|
|
@@ -41,9 +41,10 @@ export interface SelectInputProps<T = string> {
|
|
|
41
41
|
size?: 'md' | 'lg';
|
|
42
42
|
className?: string;
|
|
43
43
|
onChange?: (value: T) => void;
|
|
44
|
+
onSearchChange?: (query: string) => void;
|
|
44
45
|
onClear?: () => void;
|
|
45
46
|
}
|
|
46
|
-
export declare function SelectInput<T = string>({ name, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onChange, onClear, }: SelectInputProps<T>): import("react").JSX.Element;
|
|
47
|
+
export declare function SelectInput<T = string>({ name, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onChange, onSearchChange, onClear, }: SelectInputProps<T>): import("react").JSX.Element;
|
|
47
48
|
type SelectInputTriggerButtonElementType = 'button' | React.ComponentType;
|
|
48
49
|
export type SelectInputTriggerButtonProps<T extends SelectInputTriggerButtonElementType = 'button'> = Merge<React.ComponentPropsWithoutRef<T>, {
|
|
49
50
|
as?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmCjC,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,C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,CAAC,SAAS,mCAAmC,GAAG,QAAQ,EAAE,EACjG,EAAkB,EAClB,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,+BAalC;AAoTD,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAiD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.js"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.js"],"names":[],"mappings":";;;;AA+DA;IACE,wBAeC;IAZC,mBAAkD;IAClD;;;;;MAUC;IAGH,uDAaC;IAED,+CAWE;IAEF,oCAIE;IAEF,kCAyBE;IAEF,qCAgBE;IAEF,yBAGE;IAFA,mCAA0B;IAI5B,0BAEE;IAEF;;;;MAME;IAEF,0BAuBC;IAED,kBAsBC;IAED,yCAIE;IAEF,+BAKE;IAEF,+CAQE;IAEF,+BAAqE;IAErE,sCAmIC;CACF"}
|
package/package.json
CHANGED
package/src/i18n/cs.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 let",
|
|
16
16
|
"neptune.DateLookup.year": "rok",
|
|
17
17
|
"neptune.FlowNavigation.back": "back to previous step",
|
|
18
|
+
"neptune.Info.ariaLabel": "Více informací",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Vybrat možnost...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
21
23
|
"neptune.Summary.statusDone": "Položka dokončena",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Položka k dokončení",
|
|
23
25
|
"neptune.Summary.statusPending": "Čekající položka",
|
package/src/i18n/de.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 Jahre",
|
|
16
16
|
"neptune.DateLookup.year": "Jahr",
|
|
17
17
|
"neptune.FlowNavigation.back": "zurück zum vorherigen Schritt",
|
|
18
|
+
"neptune.Info.ariaLabel": "Weitere Informationen",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
21
23
|
"neptune.Summary.statusDone": "Schritt erledigt",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Schritt noch zu erledigen",
|
|
23
25
|
"neptune.Summary.statusPending": "Schritt ausstehend",
|
package/src/i18n/es.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 años",
|
|
16
16
|
"neptune.DateLookup.year": "año",
|
|
17
17
|
"neptune.FlowNavigation.back": "volver al paso anterior",
|
|
18
|
+
"neptune.Info.ariaLabel": "Más información",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
21
23
|
"neptune.Summary.statusDone": "Apartado listo",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Apartado a completar",
|
|
23
25
|
"neptune.Summary.statusPending": "Apartado pendiente",
|
package/src/i18n/fr.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 ans",
|
|
16
16
|
"neptune.DateLookup.year": "année",
|
|
17
17
|
"neptune.FlowNavigation.back": "revenir à l'étape précédente",
|
|
18
|
+
"neptune.Info.ariaLabel": "Plus d'informations",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
21
23
|
"neptune.Summary.statusDone": "Validé",
|
|
22
24
|
"neptune.Summary.statusNotDone": "À compléter",
|
|
23
25
|
"neptune.Summary.statusPending": "En attente",
|
package/src/i18n/hu.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 év",
|
|
16
16
|
"neptune.DateLookup.year": "év",
|
|
17
17
|
"neptune.FlowNavigation.back": "vissza az előző lépéshez",
|
|
18
|
+
"neptune.Info.ariaLabel": "További információ",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
21
23
|
"neptune.Summary.statusDone": "Kész",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Hátravan",
|
|
23
25
|
"neptune.Summary.statusPending": "Függőben",
|
package/src/i18n/id.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 tahun",
|
|
16
16
|
"neptune.DateLookup.year": "tahun",
|
|
17
17
|
"neptune.FlowNavigation.back": "kembali ke langkah sebelumnya",
|
|
18
|
+
"neptune.Info.ariaLabel": "Informasi lebih lanjut",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(terbuka di tab baru)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Pilih opsi...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
21
23
|
"neptune.Summary.statusDone": "Item selesai",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Item yang harus dilakukan",
|
|
23
25
|
"neptune.Summary.statusPending": "Item tertunda",
|
package/src/i18n/it.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 anni",
|
|
16
16
|
"neptune.DateLookup.year": "anno",
|
|
17
17
|
"neptune.FlowNavigation.back": "torna al passaggio precedente",
|
|
18
|
+
"neptune.Info.ariaLabel": "Maggiori informazioni",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(si apre in una nuova scheda)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Seleziona un'opzione...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Cerca...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
|
|
21
23
|
"neptune.Summary.statusDone": "Completato",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Da completare",
|
|
23
25
|
"neptune.Summary.statusPending": "In corso",
|
package/src/i18n/ja.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20年",
|
|
16
16
|
"neptune.DateLookup.year": "年",
|
|
17
17
|
"neptune.FlowNavigation.back": "前のステップに戻る",
|
|
18
|
+
"neptune.Info.ariaLabel": "詳細",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(新しいタブで開きます)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "選択してください...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "検索... ",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
21
23
|
"neptune.Summary.statusDone": "完了",
|
|
22
24
|
"neptune.Summary.statusNotDone": "未対応",
|
|
23
25
|
"neptune.Summary.statusPending": "保留中",
|
package/src/i18n/pl.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 lat",
|
|
16
16
|
"neptune.DateLookup.year": "rok",
|
|
17
17
|
"neptune.FlowNavigation.back": "wróć do poprzedniego kroku",
|
|
18
|
+
"neptune.Info.ariaLabel": "Więcej informacji",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(otworzy się w nowej zakładce)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Wybierz opcję...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
21
23
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Czynność do wykonania",
|
|
23
25
|
"neptune.Summary.statusPending": "Czynność oczekująca",
|
package/src/i18n/pt.json
CHANGED
|
@@ -7,17 +7,19 @@
|
|
|
7
7
|
"neptune.DateInput.month.label": "Mês",
|
|
8
8
|
"neptune.DateInput.year.label": "Ano",
|
|
9
9
|
"neptune.DateLookup.day": "dia",
|
|
10
|
-
"neptune.DateLookup.goTo20YearView": "
|
|
10
|
+
"neptune.DateLookup.goTo20YearView": "Acessar a visualização de 20 anos",
|
|
11
11
|
"neptune.DateLookup.month": "mês",
|
|
12
12
|
"neptune.DateLookup.next": "próximo",
|
|
13
13
|
"neptune.DateLookup.previous": "anterior",
|
|
14
14
|
"neptune.DateLookup.selected": "selecionada",
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 anos",
|
|
16
16
|
"neptune.DateLookup.year": "ano",
|
|
17
|
-
"neptune.FlowNavigation.back": "
|
|
18
|
-
"neptune.
|
|
17
|
+
"neptune.FlowNavigation.back": "voltar à etapa anterior",
|
|
18
|
+
"neptune.Info.ariaLabel": "Mais informações",
|
|
19
|
+
"neptune.Link.opensInNewTab": "(abre em uma nova aba)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Escolha uma opção...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
21
23
|
"neptune.Summary.statusDone": "Pronto",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Não iniciado",
|
|
23
25
|
"neptune.Summary.statusPending": "Pendente",
|
package/src/i18n/ro.json
CHANGED
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
"neptune.DateInput.year.label": "An",
|
|
9
9
|
"neptune.DateLookup.day": "zi",
|
|
10
10
|
"neptune.DateLookup.goTo20YearView": "Accesează vizualizarea pe 20 de ani",
|
|
11
|
-
"neptune.DateLookup.month": "
|
|
11
|
+
"neptune.DateLookup.month": "lună",
|
|
12
12
|
"neptune.DateLookup.next": "înainte",
|
|
13
|
-
"neptune.DateLookup.previous": "
|
|
13
|
+
"neptune.DateLookup.previous": "înapoi",
|
|
14
14
|
"neptune.DateLookup.selected": "selectată",
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 de ani",
|
|
16
|
-
"neptune.DateLookup.year": "
|
|
16
|
+
"neptune.DateLookup.year": "an",
|
|
17
17
|
"neptune.FlowNavigation.back": "înapoi la pasul anterior",
|
|
18
|
+
"neptune.Info.ariaLabel": "Mai multe informații",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(se deschide într-o filă nouă)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Selectează o opţiune...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
21
23
|
"neptune.Summary.statusDone": "Finalizat",
|
|
22
24
|
"neptune.Summary.statusNotDone": "De făcut",
|
|
23
25
|
"neptune.Summary.statusPending": "În așteptare",
|
package/src/i18n/ru.json
CHANGED
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
"neptune.DateLookup.goTo20YearView": "Перейти к обзору 20 лет",
|
|
11
11
|
"neptune.DateLookup.month": "месяц",
|
|
12
12
|
"neptune.DateLookup.next": "далее",
|
|
13
|
-
"neptune.DateLookup.previous": "
|
|
13
|
+
"neptune.DateLookup.previous": "назад",
|
|
14
14
|
"neptune.DateLookup.selected": "выбрано",
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 лет",
|
|
16
16
|
"neptune.DateLookup.year": "год",
|
|
17
17
|
"neptune.FlowNavigation.back": "вернуться к предыдущему шагу",
|
|
18
|
+
"neptune.Info.ariaLabel": "Подробнее",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
21
23
|
"neptune.Summary.statusDone": "Этап завершен",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Этап к выполнению",
|
|
23
25
|
"neptune.Summary.statusPending": "Этап в процессе",
|
package/src/i18n/th.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 ปี",
|
|
16
16
|
"neptune.DateLookup.year": "ปี",
|
|
17
17
|
"neptune.FlowNavigation.back": "back to previous step",
|
|
18
|
+
"neptune.Info.ariaLabel": "ข้อมูลเพิ่มเติม",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
21
23
|
"neptune.Summary.statusDone": "รายการที่ทำแล้ว",
|
|
22
24
|
"neptune.Summary.statusNotDone": "รายการที่ต้องทำ",
|
|
23
25
|
"neptune.Summary.statusPending": "รายการที่รอดำเนินการ",
|
package/src/i18n/tr.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 yıl",
|
|
16
16
|
"neptune.DateLookup.year": "yıl",
|
|
17
17
|
"neptune.FlowNavigation.back": "önceki adıma dön",
|
|
18
|
+
"neptune.Info.ariaLabel": "Daha fazla bilgi",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(yeni sekmede açılır)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Bir seçenek seçin...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
21
23
|
"neptune.Summary.statusDone": "Tamamlanan aşama",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Yapılacak",
|
|
23
25
|
"neptune.Summary.statusPending": "Bekliyor",
|
package/src/i18n/uk.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 років",
|
|
16
16
|
"neptune.DateLookup.year": "рік",
|
|
17
17
|
"neptune.FlowNavigation.back": "back to previous step",
|
|
18
|
+
"neptune.Info.ariaLabel": "Більше відомостей",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Виберіть варіант…",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Пошук…",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "Нічого не знайдено",
|
|
21
23
|
"neptune.Summary.statusDone": "Виконано",
|
|
22
24
|
"neptune.Summary.statusNotDone": "Не виконано",
|
|
23
25
|
"neptune.Summary.statusPending": "Виконується",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"neptune.Button.loadingAriaLabel": "正在加载",
|
|
3
3
|
"neptune.Chips.ariaLabel": "清除 {choice}",
|
|
4
|
-
"neptune.ClearButton.ariaLabel": "
|
|
4
|
+
"neptune.ClearButton.ariaLabel": "清除",
|
|
5
5
|
"neptune.CloseButton.ariaLabel": "关闭",
|
|
6
6
|
"neptune.DateInput.day.label": "日",
|
|
7
7
|
"neptune.DateInput.month.label": "月",
|
|
8
8
|
"neptune.DateInput.year.label": "年",
|
|
9
9
|
"neptune.DateLookup.day": "日",
|
|
10
|
-
"neptune.DateLookup.goTo20YearView": "
|
|
10
|
+
"neptune.DateLookup.goTo20YearView": "转到 20 年视图",
|
|
11
11
|
"neptune.DateLookup.month": "月",
|
|
12
12
|
"neptune.DateLookup.next": "下一页",
|
|
13
13
|
"neptune.DateLookup.previous": "上一页",
|
|
14
14
|
"neptune.DateLookup.selected": "已选",
|
|
15
|
-
"neptune.DateLookup.twentyYears": "20年",
|
|
15
|
+
"neptune.DateLookup.twentyYears": "20 年",
|
|
16
16
|
"neptune.DateLookup.year": "年",
|
|
17
|
-
"neptune.FlowNavigation.back": "
|
|
18
|
-
"neptune.
|
|
17
|
+
"neptune.FlowNavigation.back": "返回上一步",
|
|
18
|
+
"neptune.Info.ariaLabel": "更多信息",
|
|
19
|
+
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
21
23
|
"neptune.Summary.statusDone": "已完成",
|
|
22
24
|
"neptune.Summary.statusNotDone": "未完成",
|
|
23
25
|
"neptune.Summary.statusPending": "待处理",
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"neptune.Upload.usPlaceholder": "拖放小于 5MB 的文件",
|
|
34
36
|
"neptune.UploadButton.allFileTypes": "所有文件类型",
|
|
35
37
|
"neptune.UploadButton.dropFiles": "拖放文件开始上传",
|
|
36
|
-
"neptune.UploadButton.instructions": "{fileTypes},小于 {size}MB",
|
|
38
|
+
"neptune.UploadButton.instructions": "{fileTypes},小于 {size} MB",
|
|
37
39
|
"neptune.UploadButton.uploadFile": "上传文件",
|
|
38
40
|
"neptune.UploadButton.uploadFiles": "上传文件",
|
|
39
41
|
"neptune.UploadInput.deleteModalBody": "删除此文件会将其从我们的系统中删除",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20年",
|
|
16
16
|
"neptune.DateLookup.year": "年",
|
|
17
17
|
"neptune.FlowNavigation.back": "返回上一個步驟",
|
|
18
|
+
"neptune.Info.ariaLabel": "更多資訊",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
22
|
+
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
21
23
|
"neptune.Summary.statusDone": "已完成事項",
|
|
22
24
|
"neptune.Summary.statusNotDone": "未完成事項",
|
|
23
25
|
"neptune.Summary.statusPending": "待處理事項",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { act, screen, within } from '@testing-library/react';
|
|
2
|
-
import userEvent
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
3
|
|
|
4
4
|
import { render, mockMatchMedia, mockResizeObserver } from '../test-utils';
|
|
5
5
|
|
|
@@ -44,7 +44,7 @@ describe('SelectInput', () => {
|
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
45
45
|
await act(async () => {
|
|
46
46
|
userEvent.tab();
|
|
47
|
-
userEvent.keyboard(
|
|
47
|
+
userEvent.keyboard(' ');
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const footer = screen.getByText('All items shown');
|
|
@@ -59,7 +59,7 @@ describe('SelectInput', () => {
|
|
|
59
59
|
userEvent.keyboard('x');
|
|
60
60
|
expect(footer).toHaveTextContent(/‘urx’$/);
|
|
61
61
|
|
|
62
|
-
userEvent.keyboard(
|
|
62
|
+
userEvent.keyboard('{Backspace}');
|
|
63
63
|
expect(footer).toHaveTextContent(/‘ur’$/);
|
|
64
64
|
});
|
|
65
65
|
|
|
@@ -110,7 +110,7 @@ describe('SelectInput', () => {
|
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
111
111
|
await act(async () => {
|
|
112
112
|
userEvent.tab();
|
|
113
|
-
userEvent.keyboard(
|
|
113
|
+
userEvent.keyboard(' ');
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
const listbox = screen.getByRole('listbox');
|
|
@@ -125,7 +125,7 @@ describe('SelectInput', () => {
|
|
|
125
125
|
userEvent.keyboard('x');
|
|
126
126
|
expect(within(listbox).queryByRole('option')).not.toBeInTheDocument();
|
|
127
127
|
|
|
128
|
-
userEvent.keyboard(
|
|
128
|
+
userEvent.keyboard('{Backspace}');
|
|
129
129
|
expect(within(listbox).getByRole('option')).toBeInTheDocument();
|
|
130
130
|
|
|
131
131
|
const option = within(listbox).getAllByRole('option')[0];
|
|
@@ -42,7 +42,8 @@ function inferSearchableStrings(value: unknown) {
|
|
|
42
42
|
|
|
43
43
|
const SelectInputTriggerButtonPropsContext = createContext<{
|
|
44
44
|
ref?: React.ForwardedRef<HTMLButtonElement>;
|
|
45
|
-
onClick?: () => void;
|
|
45
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
46
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
46
47
|
[key: string]: unknown;
|
|
47
48
|
}>({});
|
|
48
49
|
const SelectInputOptionContentWithinTriggerContext = createContext(false);
|
|
@@ -153,6 +154,7 @@ export interface SelectInputProps<T = string> {
|
|
|
153
154
|
size?: 'md' | 'lg';
|
|
154
155
|
className?: string;
|
|
155
156
|
onChange?: (value: T) => void;
|
|
157
|
+
onSearchChange?: (query: string) => void;
|
|
156
158
|
onClear?: () => void;
|
|
157
159
|
}
|
|
158
160
|
|
|
@@ -223,6 +225,7 @@ export function SelectInput<T = string>({
|
|
|
223
225
|
size = 'md',
|
|
224
226
|
className,
|
|
225
227
|
onChange,
|
|
228
|
+
onSearchChange,
|
|
226
229
|
onClear,
|
|
227
230
|
}: SelectInputProps<T>) {
|
|
228
231
|
const [open, setOpen] = useState(false);
|
|
@@ -264,6 +267,16 @@ export function SelectInput<T = string>({
|
|
|
264
267
|
onClick: () => {
|
|
265
268
|
setOpen((prev) => !prev);
|
|
266
269
|
},
|
|
270
|
+
onKeyDown: (event: React.KeyboardEvent) => {
|
|
271
|
+
if (
|
|
272
|
+
event.key === ' ' ||
|
|
273
|
+
event.key === 'Enter' ||
|
|
274
|
+
event.key === 'ArrowDown' ||
|
|
275
|
+
event.key === 'ArrowUp'
|
|
276
|
+
) {
|
|
277
|
+
setOpen((prev) => !prev);
|
|
278
|
+
}
|
|
279
|
+
},
|
|
267
280
|
},
|
|
268
281
|
getInteractionProps(),
|
|
269
282
|
),
|
|
@@ -306,6 +319,7 @@ export function SelectInput<T = string>({
|
|
|
306
319
|
filterPlaceholder={filterPlaceholder}
|
|
307
320
|
searchInputRef={searchInputRef}
|
|
308
321
|
listboxRef={listboxRef}
|
|
322
|
+
onSearchChange={onSearchChange}
|
|
309
323
|
/>
|
|
310
324
|
</OptionsOverlay>
|
|
311
325
|
)}
|
|
@@ -323,14 +337,16 @@ export function SelectInputTriggerButton<T extends SelectInputTriggerButtonEleme
|
|
|
323
337
|
as = 'button' as T,
|
|
324
338
|
...restProps
|
|
325
339
|
}: SelectInputTriggerButtonProps<T>) {
|
|
326
|
-
const { ref, onClick, ...interactionProps } = useContext(
|
|
340
|
+
const { ref, onClick, onKeyDown, ...interactionProps } = useContext(
|
|
341
|
+
SelectInputTriggerButtonPropsContext,
|
|
342
|
+
);
|
|
327
343
|
|
|
328
344
|
return (
|
|
329
345
|
<ListboxBase.Button
|
|
330
346
|
ref={ref}
|
|
331
347
|
as={PolymorphicWithOverrides}
|
|
332
348
|
__overrides={{ as, ...interactionProps }}
|
|
333
|
-
{...mergeProps({ onClick }, restProps)}
|
|
349
|
+
{...mergeProps({ onClick, onKeyDown }, restProps)}
|
|
334
350
|
/>
|
|
335
351
|
);
|
|
336
352
|
}
|
|
@@ -390,6 +406,7 @@ interface SelectInputOptionsProps<T = string>
|
|
|
390
406
|
> {
|
|
391
407
|
searchInputRef: React.RefObject<HTMLInputElement>;
|
|
392
408
|
listboxRef: React.RefObject<HTMLDivElement>;
|
|
409
|
+
onSearchChange?: (query: string) => void;
|
|
393
410
|
}
|
|
394
411
|
|
|
395
412
|
function SelectInputOptions<T = string>({
|
|
@@ -400,6 +417,7 @@ function SelectInputOptions<T = string>({
|
|
|
400
417
|
filterPlaceholder,
|
|
401
418
|
searchInputRef,
|
|
402
419
|
listboxRef,
|
|
420
|
+
onSearchChange,
|
|
403
421
|
}: SelectInputOptionsProps<T>) {
|
|
404
422
|
const intl = useIntl();
|
|
405
423
|
|
|
@@ -461,6 +479,9 @@ function SelectInputOptions<T = string>({
|
|
|
461
479
|
}}
|
|
462
480
|
onChange={(event) => {
|
|
463
481
|
setQuery(event.currentTarget.value);
|
|
482
|
+
if (onSearchChange) {
|
|
483
|
+
onSearchChange(event.currentTarget.value);
|
|
484
|
+
}
|
|
464
485
|
}}
|
|
465
486
|
/>
|
|
466
487
|
</div>
|