@transferwise/components 39.7.0 → 39.8.3
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/CHANGELOG.md +38 -0
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/i18n/cs.json +1 -0
- package/build/es/no-polyfill/i18n/de.json +1 -0
- package/build/es/no-polyfill/i18n/es.json +1 -0
- package/build/es/no-polyfill/i18n/fr.json +1 -0
- package/build/es/no-polyfill/i18n/hu.json +1 -0
- package/build/es/no-polyfill/i18n/id.json +1 -0
- package/build/es/no-polyfill/i18n/it.json +1 -0
- package/build/es/no-polyfill/i18n/ja.json +1 -0
- package/build/es/no-polyfill/i18n/pl.json +1 -0
- package/build/es/no-polyfill/i18n/pt.json +1 -0
- package/build/es/no-polyfill/i18n/ro.json +1 -0
- package/build/es/no-polyfill/i18n/ru.json +1 -0
- package/build/es/no-polyfill/i18n/tr.json +1 -0
- package/build/es/no-polyfill/i18n/uk.json +1 -0
- package/build/es/no-polyfill/i18n/zh.json +1 -0
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/switch/Switch.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/i18n/cs.json +1 -0
- package/build/es/polyfill/i18n/de.json +1 -0
- package/build/es/polyfill/i18n/es.json +1 -0
- package/build/es/polyfill/i18n/fr.json +1 -0
- package/build/es/polyfill/i18n/hu.json +1 -0
- package/build/es/polyfill/i18n/id.json +1 -0
- package/build/es/polyfill/i18n/it.json +1 -0
- package/build/es/polyfill/i18n/ja.json +1 -0
- package/build/es/polyfill/i18n/pl.json +1 -0
- package/build/es/polyfill/i18n/pt.json +1 -0
- package/build/es/polyfill/i18n/ro.json +1 -0
- package/build/es/polyfill/i18n/ru.json +1 -0
- package/build/es/polyfill/i18n/tr.json +1 -0
- package/build/es/polyfill/i18n/uk.json +1 -0
- package/build/es/polyfill/i18n/zh.json +1 -0
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/switch/Switch.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/i18n/cs.json +1 -0
- 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/tr.json +1 -0
- package/build/i18n/uk.json +1 -0
- package/build/i18n/zh.json +1 -0
- package/build/main.css +1 -1
- package/build/styles/accordion/Accordion.css +1 -1
- package/build/styles/avatar/Avatar.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/RadioButton/RadioButton.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -1
- package/build/styles/lab/pagination/Pagination.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/moneyInput/MoneyInput.css +1 -1
- package/build/styles/navigationOption/NavigationOption.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/switch/Switch.css +1 -1
- package/build/styles/tabs/Tabs.css +1 -1
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -1
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
- package/build/types/checkbox/Checkbox.d.ts +1 -0
- package/build/types/radio/Radio.d.ts +1 -0
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [39.8.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@39.8.2...@transferwise/components@39.8.3) (2022-02-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* stepper label positions ([#1310](https://github.com/transferwise/neptune-web/issues/1310)) ([cd68b56](https://github.com/transferwise/neptune-web/commit/cd68b564d07d178d4745ab54b5ba7a726f73c68b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [39.8.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@39.8.1...@transferwise/components@39.8.2) (2022-01-31)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @transferwise/components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [39.8.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@39.8.0...@transferwise/components@39.8.1) (2022-01-31)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @transferwise/components
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [39.8.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@39.7.0...@transferwise/components@39.8.0) (2022-01-31)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* new disabled state approach ([#1285](https://github.com/transferwise/neptune-web/issues/1285)) ([3bed0c3](https://github.com/transferwise/neptune-web/commit/3bed0c390c90d0b1ec8f1578eb6b1cad2a02dc51))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
# [39.7.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@39.6.2...@transferwise/components@39.7.0) (2022-01-28)
|
|
7
45
|
|
|
8
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",i&&/*#__PURE__*/_jsx("small",{children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Jistě chcete odstranit tento soubor?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Soubor je příliš velký",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Typ souboru není podporován",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Mažeme...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Odstranit soubor {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Nahráno",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Möchtest du diese Datei wirklich entfernen?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Die Datei ist zu groß",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Dateityp wird nicht unterstützt",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Leider ist das Hochladen fehlgeschlagen, da wir nicht mehr als {maxFilesAllowed} Dateien auf einmal akzeptieren können.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Wird gelöscht...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Datei {filename} entfernen",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Hochgeladen",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "¿Estás seguro que quieres eliminar este archivo?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "El archivo es demasiado grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo de archivo no compatible",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos, la carga falló porque solo podemos aceptar {maxFilesAllowed} archivos a la vez.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Eliminar el archivo {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Subido",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Voulez-vous vraiment supprimer ce fichier ?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Fichier trop lourd",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Type de fichier non pris en charge",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Nous sommes désolés, ce téléchargement a échoué car nous ne pouvons accepter que {maxFilesAllowed} fichiers à la fois.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Suppression...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Supprimer le fichier {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Téléchargé",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Biztosan törölni szeretnéd ezt a fájlt?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "A fájl túl nagy",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Nem támogatott fájltípus",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sajnos ez a feltöltés sikertelen volt, mert csak {maxFilesAllowed} fájlt tudunk egyszerre elfogadni.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Törlés...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} fájl törlése",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Feltöltve",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Yakin ingin menghapus file ini?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "File terlalu besar",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Jenis file tidak didukung",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Maaf, unggahan ini gagal karena kami hanya dapat menerima {maxFilesAllowed} file sekaligus.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Menghapus...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Hapus file {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Diunggah",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Vuoi davvero cancellare questo file?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "File troppo grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo di file non supportato",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Rimuovi file {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Caricato",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "このファイルを削除しますか?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "ファイルが大きすぎます。",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "このファイルの種類はサポートされていません",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "申し訳ございませんが、このアップロードに失敗しました。一度に{maxFilesAllowed}個のファイルのみ受付可能です。",
|
|
36
37
|
"neptune.UploadItem.deleting": "削除中...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} を削除",
|
|
38
39
|
"neptune.UploadItem.uploaded": "アップロード済み",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Czy na pewno chcesz usunąć ten plik?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Plik jest za duży",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Nieobsługiwany typ pliku",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Usuwanie...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Usuń plik {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Przesłano",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Tem certeza que deseja remover esta arquivo?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "O arquivo é muito grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Não aceitamos arquivos neste formato",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Ocorreu um erro. Você só pode enviar {maxFilesAllowed} arquivos por vez.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Removendo...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Remover arquivo {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Enviado",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Sigur vrei să elimini acest fișier?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Fișierul este prea mare",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipul fișierului nu este acceptat",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Ne pare rău, această încărcare nu a reușit, deoarece putem accepta doar {maxFilesAllowed} fișiere simultan.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Se șterge...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Elimină fișierul {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Încărcat",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Уверены, что хотите удалить этот файл?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Файл слишком большой",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Тип файла не поддерживается",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "К сожалению, эта загрузка не удалась, так как одновременно мы можем принять только {maxFilesAllowed} файла(-ов).",
|
|
36
37
|
"neptune.UploadItem.deleting": "Удаляется...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Удалить файл {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Завершено",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Bu dosyayı kaldırmak istediğinizden emin misiniz?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Dosya çok büyük",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Dosya tipi desteklenmiyor",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Siliniyor...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} dosyasını kaldır",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Yüklendi",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Справді вилучити цей файл?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Файл завеликий",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Тип файлу не підтримується",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Видалення…",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Вилучити файл {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Завантажено",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "你確定要移除此檔案嗎?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "檔案太大",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "不支持檔案類型",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "抱歉,這次上載失敗,因為我們每次最多只能接受{maxFilesAllowed}個檔案。",
|
|
36
37
|
"neptune.UploadItem.deleting": "刪除中…",
|
|
37
38
|
"neptune.UploadItem.removeFile": "移除檔案{filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "已上載",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){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(a){return!1}}import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import Select from"../select";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=function(a){return isNumber(a)||isNull(a)},formatAmountIfSet=function(a,b,c){return"number"==typeof a?formatAmount(a,b,c):""},inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]),MoneyInput=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"isInputAllowedForKeyEvent",function(a){var b=a.keyCode,c=a.metaKey,d=a.key,e=a.ctrlKey,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){d.isInputAllowedForKeyEvent(a)||a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"handlePaste",function(a){var b=(a.clipboardData||window.clipboardData).getData("text"),c=d.state.locale,e=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,c);isNumberOrNull(e)&&(d.setState({formattedAmount:formatAmountIfSet(e,d.props.selectedCurrency.currency,c)}),d.props.onAmountChange(e)),a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"onAmountChange",function(a){var b=a.target.value;d.setState({formattedAmount:b});var c=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,d.state.locale);isNumberOrNull(c)&&d.props.onAmountChange(c)}),_defineProperty(_assertThisInitialized(d),"onAmountBlur",function(){d.amountFocused=!1,d.setAmount()}),_defineProperty(_assertThisInitialized(d),"onAmountFocus",function(){d.amountFocused=!0}),_defineProperty(_assertThisInitialized(d),"handleSelectChange",function(a){d.handleSearchChange(""),d.props.onCustomAction&&a.value===CUSTOM_ACTION?d.props.onCustomAction():d.props.onCurrencyChange(a)}),_defineProperty(_assertThisInitialized(d),"handleSearchChange",function(a){d.setState({searchQuery:a}),d.props.onSearchChange&&d.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(d.props.currencies,a)})}),_defineProperty(_assertThisInitialized(d),"style",function(a){return d.props.classNames[a]||a});var e=d.props.intl.locale;return d.formatMessage=d.props.intl.formatMessage,d.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,e),locale:e},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(a){var b;if(this.setState({locale:null===a||void 0===a||null===(b=a.intl)||void 0===b?void 0:b.locale}),!this.amountFocused){var c;this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,null===a||void 0===a||null===(c=a.intl)||void 0===c?void 0:c.locale)})}}},{key:"getSelectOptions",value:function getSelectOptions(){var a=_toConsumableArray(filterOptionsForQuery(this.props.currencies,this.state.searchQuery));return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}},{key:"setAmount",value:function setAmount(){var a=this;this.setState(function(b){var c=parseAmount(b.formattedAmount,a.props.selectedCurrency.currency,a.state.locale);return isNumberOrNull(c)?{formattedAmount:formatAmountIfSet(c,a.props.selectedCurrency.currency,b.locale)}:{formattedAmount:b.formattedAmount}})}},{key:"render",value:function render(){var a=this.props,b=a.selectedCurrency,c=a.onCurrencyChange,d=a.size,e=a.addon,f=this.getSelectOptions(),g=!this.state.searchQuery&&(1===f.length&&f[0].currency===b.currency||!c),h=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style("input-group-".concat(d))),children:[/*#__PURE__*/_jsx("input",{id:this.props.id,value:this.state.formattedAmount,type:"text",inputMode:"decimal",className:classNames(this.style("form-control")),disabled:h,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),e&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),h?this.style("
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){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(a){return!1}}import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import Select from"../select";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=function(a){return isNumber(a)||isNull(a)},formatAmountIfSet=function(a,b,c){return"number"==typeof a?formatAmount(a,b,c):""},inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]),MoneyInput=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"isInputAllowedForKeyEvent",function(a){var b=a.keyCode,c=a.metaKey,d=a.key,e=a.ctrlKey,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){d.isInputAllowedForKeyEvent(a)||a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"handlePaste",function(a){var b=(a.clipboardData||window.clipboardData).getData("text"),c=d.state.locale,e=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,c);isNumberOrNull(e)&&(d.setState({formattedAmount:formatAmountIfSet(e,d.props.selectedCurrency.currency,c)}),d.props.onAmountChange(e)),a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"onAmountChange",function(a){var b=a.target.value;d.setState({formattedAmount:b});var c=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,d.state.locale);isNumberOrNull(c)&&d.props.onAmountChange(c)}),_defineProperty(_assertThisInitialized(d),"onAmountBlur",function(){d.amountFocused=!1,d.setAmount()}),_defineProperty(_assertThisInitialized(d),"onAmountFocus",function(){d.amountFocused=!0}),_defineProperty(_assertThisInitialized(d),"handleSelectChange",function(a){d.handleSearchChange(""),d.props.onCustomAction&&a.value===CUSTOM_ACTION?d.props.onCustomAction():d.props.onCurrencyChange(a)}),_defineProperty(_assertThisInitialized(d),"handleSearchChange",function(a){d.setState({searchQuery:a}),d.props.onSearchChange&&d.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(d.props.currencies,a)})}),_defineProperty(_assertThisInitialized(d),"style",function(a){return d.props.classNames[a]||a});var e=d.props.intl.locale;return d.formatMessage=d.props.intl.formatMessage,d.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,e),locale:e},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(a){var b;if(this.setState({locale:null===a||void 0===a||null===(b=a.intl)||void 0===b?void 0:b.locale}),!this.amountFocused){var c;this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,null===a||void 0===a||null===(c=a.intl)||void 0===c?void 0:c.locale)})}}},{key:"getSelectOptions",value:function getSelectOptions(){var a=_toConsumableArray(filterOptionsForQuery(this.props.currencies,this.state.searchQuery));return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}},{key:"setAmount",value:function setAmount(){var a=this;this.setState(function(b){var c=parseAmount(b.formattedAmount,a.props.selectedCurrency.currency,a.state.locale);return isNumberOrNull(c)?{formattedAmount:formatAmountIfSet(c,a.props.selectedCurrency.currency,b.locale)}:{formattedAmount:b.formattedAmount}})}},{key:"render",value:function render(){var a=this.props,b=a.selectedCurrency,c=a.onCurrencyChange,d=a.size,e=a.addon,f=this.getSelectOptions(),g=!this.state.searchQuery&&(1===f.length&&f[0].currency===b.currency||!c),h=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style("input-group-".concat(d))),children:[/*#__PURE__*/_jsx("input",{id:this.props.id,value:this.state.formattedAmount,type:"text",inputMode:"decimal",className:classNames(this.style("form-control")),disabled:h,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),e&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),h?this.style("disabled"):""),children:e}),g?/*#__PURE__*/_jsxs("div",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),this.style("tw-money-input__fixed-currency"),h?this.style("disabled"):""),children:[("lg"===d||"md"===d)&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("i",{className:classNames(this.style("tw-money-input__keyline"))}),/*#__PURE__*/_jsx("i",{className:classNames(this.style("currency-flag"),this.style("currency-flag-".concat(b.currency.toLowerCase())),this.style("hidden-xs"),this.style("m-r-2"))})]}),/*#__PURE__*/_jsx("span",{className:"lg"===d?this.style("m-r-1"):"",children:b.currency.toUpperCase()})]}):/*#__PURE__*/_jsx("div",{className:classNames(this.style("input-group-btn"),this.style("amount-currency-select-btn")),children:/*#__PURE__*/_jsx(Select,{classNames:this.props.classNames,options:f,selected:_objectSpread(_objectSpread({},b),{},{note:null}),placeholder:this.formatMessage(messages.selectPlaceholder),searchPlaceholder:this.props.searchPlaceholder,searchValue:this.state.searchQuery,size:d,required:!0,dropdownRight:"xs",dropdownWidth:"lg",inverse:!0,onChange:this.handleSelectChange,onSearchChange:this.handleSearchChange})})]})}}]),b}(Component);function filterOptionsForQuery(a,b){if(!b)return a;var c=removeDuplicateValueOptions(a).filter(function(a){return isCurrencyOptionAndFitsQuery(a,b)});return sortOptionsLabelsToFirst(c,b)}function removeDuplicateValueOptions(a){var b=[],c=[];return a.forEach(function(a){a.value&&!c.includes(a.value)&&(b.push(a),c.push(a.value))}),b}function isCurrencyOptionAndFitsQuery(a,b){return!!a.value&&(contains(a.label,b)||contains(a.searchable,b)||contains(a.note,b))}function contains(a,b){return a&&a.toLowerCase().includes(b.toLowerCase())}function sortOptionsLabelsToFirst(a,b){return a.sort(function(a,c){var d=contains(a.label,b),e=contains(c.label,b);return d&&e?0:d?-1:e?1:0})}MoneyInput.propTypes={id:PropTypes.string,currencies:PropTypes.arrayOf(Currency).isRequired,selectedCurrency:Currency.isRequired,onCurrencyChange:PropTypes.func,placeholder:PropTypes.number,amount:PropTypes.number,size:PropTypes.oneOf(["sm","md","lg"]),onAmountChange:PropTypes.func,addon:PropTypes.node,searchPlaceholder:PropTypes.string,/**
|
|
2
2
|
* Allows the consumer to react to searching, while the search itself is handled internally. Called with `{ searchQuery: string, filteredOptions: Currency[] }`
|
|
3
3
|
*/onSearchChange:PropTypes.func,customActionLabel:PropTypes.node,onCustomAction:PropTypes.func,classNames:PropTypes.objectOf(PropTypes.string)},MoneyInput.defaultProps={id:null,size:Size.LARGE,addon:null,searchPlaceholder:"",onSearchChange:void 0,onCurrencyChange:null,placeholder:null,amount:null,onAmountChange:null,customActionLabel:"",onCustomAction:null,classNames:{}};// this export is necessary for react-to-typescript-definitions
|
|
4
4
|
// to be able to properly generate TS types, this is due to us wrapping this component in `injectIntl` before exporting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","avatar","secondary"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","className","avatar","secondary"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.className,f=a.avatar,g=a.secondary,h=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:"np-radio-button p-r-2",children:/*#__PURE__*/_jsx(RadioButton,_objectSpread({id:c,disabled:d},h))}),/*#__PURE__*/_jsxs("span",{className:"np-radio__text",children:[b,g&&/*#__PURE__*/_jsx("small",{children:g})]}),f&&/*#__PURE__*/_jsx("span",{className:"np-radio__avatar m-l-auto",children:f})]})})};Radio.propTypes={avatar:PropTypes.element,checked:PropTypes.bool,disabled:PropTypes.bool,id:PropTypes.string,label:PropTypes.string.isRequired,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,secondary:PropTypes.string,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),className:PropTypes.string},Radio.defaultProps={avatar:void 0,checked:!1,disabled:!1,id:null,secondary:null,value:"",className:void 0};export default Radio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className;if(0===b.length)return null;var
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",disabled:!d,onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})});return/*#__PURE__*/_jsx("li",{className:"\n hidden-xs\n tw-stepper__step\n ".concat(c?"tw-stepper__step--active":"","\n ").concat(d?"tw-stepper__step--clickable":"","\n "),style:f?{right:"".concat(100*(b*h),"%")}:{left:"".concat(100*(b*h),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CheckCircle,CrossCircle}from"@transferwise/icons";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Switch=function(a){var b=a.checked,c=a.className,d=a.id,e=a.onClick,f=a.disabled,g=a["aria-label"],h=g?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!g&&!h),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!b,"np-switch--checked":b,
|
|
1
|
+
import{CheckCircle,CrossCircle}from"@transferwise/icons";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Switch=function(a){var b=a.checked,c=a.className,d=a.id,e=a.onClick,f=a.disabled,g=a["aria-label"],h=g?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!g&&!h),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!b,"np-switch--checked":b,disabled:f},c),tabIndex:0,role:"switch","aria-checked":b,"aria-label":g,"aria-labelledby":h,id:d,"aria-disabled":f,onClick:f?void 0:e,onKeyDown:f?void 0:function handleKeyDown(a){("32"===a.code||a.keyCode===KeyCodes.SPACE)&&(a.preventDefault(),e())},children:[/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:b?/*#__PURE__*/_jsx(CheckCircle,{filled:!0,size:24}):/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:24})}),/*#__PURE__*/_jsx("input",{type:"checkbox",checked:b,readOnly:!0})]})};export default Switch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var Tab=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.id,e=a.disabled,f=a.panelId,g=a.selected,h=a.onKeyDown,i=a.onClick,j=a.style,k=a.focusTab,l=useRef(!0),m=function(){return l.current?void(l.current=!1):void(g&&k&&k())};return useEffect(function(){m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",{"tabs__tab--selected":g,
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var Tab=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.id,e=a.disabled,f=a.panelId,g=a.selected,h=a.onKeyDown,i=a.onClick,j=a.style,k=a.focusTab,l=useRef(!0),m=function(){return l.current?void(l.current=!1):void(g&&k&&k())};return useEffect(function(){m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",{"tabs__tab--selected":g,disabled:e}),role:"tab",id:d,"aria-selected":g?"true":"false","aria-disabled":e?"true":"false","aria-controls":e?null:f,tabIndex:"0",style:j,onKeyDown:e?null:h,onClick:i,children:c})});Tab.defaultProps={disabled:!1,selected:!1,onClick:null,style:null,focusTab:null},Tab.propTypes={children:PropTypes.node.isRequired,disabled:PropTypes.bool,selected:PropTypes.bool,id:PropTypes.string.isRequired,panelId:PropTypes.string.isRequired,onKeyDown:PropTypes.func.isRequired,onClick:PropTypes.func,style:PropTypes.shape({width:PropTypes.string}),focusTab:PropTypes.func};export default Tab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",i&&/*#__PURE__*/_jsx("small",{children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Jistě chcete odstranit tento soubor?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Soubor je příliš velký",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Typ souboru není podporován",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Mažeme...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Odstranit soubor {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Nahráno",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Möchtest du diese Datei wirklich entfernen?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Die Datei ist zu groß",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Dateityp wird nicht unterstützt",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Leider ist das Hochladen fehlgeschlagen, da wir nicht mehr als {maxFilesAllowed} Dateien auf einmal akzeptieren können.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Wird gelöscht...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Datei {filename} entfernen",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Hochgeladen",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "¿Estás seguro que quieres eliminar este archivo?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "El archivo es demasiado grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo de archivo no compatible",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos, la carga falló porque solo podemos aceptar {maxFilesAllowed} archivos a la vez.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Eliminar el archivo {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Subido",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Voulez-vous vraiment supprimer ce fichier ?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Fichier trop lourd",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Type de fichier non pris en charge",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Nous sommes désolés, ce téléchargement a échoué car nous ne pouvons accepter que {maxFilesAllowed} fichiers à la fois.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Suppression...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Supprimer le fichier {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Téléchargé",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Biztosan törölni szeretnéd ezt a fájlt?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "A fájl túl nagy",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Nem támogatott fájltípus",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sajnos ez a feltöltés sikertelen volt, mert csak {maxFilesAllowed} fájlt tudunk egyszerre elfogadni.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Törlés...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} fájl törlése",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Feltöltve",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Yakin ingin menghapus file ini?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "File terlalu besar",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Jenis file tidak didukung",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Maaf, unggahan ini gagal karena kami hanya dapat menerima {maxFilesAllowed} file sekaligus.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Menghapus...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Hapus file {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Diunggah",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Vuoi davvero cancellare questo file?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "File troppo grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo di file non supportato",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Rimuovi file {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Caricato",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "このファイルを削除しますか?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "ファイルが大きすぎます。",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "このファイルの種類はサポートされていません",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "申し訳ございませんが、このアップロードに失敗しました。一度に{maxFilesAllowed}個のファイルのみ受付可能です。",
|
|
36
37
|
"neptune.UploadItem.deleting": "削除中...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} を削除",
|
|
38
39
|
"neptune.UploadItem.uploaded": "アップロード済み",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Czy na pewno chcesz usunąć ten plik?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Plik jest za duży",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Nieobsługiwany typ pliku",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Usuwanie...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Usuń plik {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Przesłano",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Tem certeza que deseja remover esta arquivo?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "O arquivo é muito grande",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Não aceitamos arquivos neste formato",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Ocorreu um erro. Você só pode enviar {maxFilesAllowed} arquivos por vez.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Removendo...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Remover arquivo {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Enviado",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Sigur vrei să elimini acest fișier?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Fișierul este prea mare",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Tipul fișierului nu este acceptat",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Ne pare rău, această încărcare nu a reușit, deoarece putem accepta doar {maxFilesAllowed} fișiere simultan.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Se șterge...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Elimină fișierul {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Încărcat",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Уверены, что хотите удалить этот файл?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Файл слишком большой",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Тип файла не поддерживается",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "К сожалению, эта загрузка не удалась, так как одновременно мы можем принять только {maxFilesAllowed} файла(-ов).",
|
|
36
37
|
"neptune.UploadItem.deleting": "Удаляется...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Удалить файл {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Завершено",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Bu dosyayı kaldırmak istediğinizden emin misiniz?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Dosya çok büyük",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Dosya tipi desteklenmiyor",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Siliniyor...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "{filename} dosyasını kaldır",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Yüklendi",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Справді вилучити цей файл?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Файл завеликий",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Тип файлу не підтримується",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Видалення…",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Вилучити файл {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Завантажено",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "你確定要移除此檔案嗎?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "檔案太大",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "不支持檔案類型",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "抱歉,這次上載失敗,因為我們每次最多只能接受{maxFilesAllowed}個檔案。",
|
|
36
37
|
"neptune.UploadItem.deleting": "刪除中…",
|
|
37
38
|
"neptune.UploadItem.removeFile": "移除檔案{filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "已上載",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){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(a){return!1}}import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.sort.js";import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import Select from"../select";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=function(a){return isNumber(a)||isNull(a)},formatAmountIfSet=function(a,b,c){return"number"==typeof a?formatAmount(a,b,c):""},inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]),MoneyInput=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"isInputAllowedForKeyEvent",function(a){var b=a.keyCode,c=a.metaKey,d=a.key,e=a.ctrlKey,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){d.isInputAllowedForKeyEvent(a)||a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"handlePaste",function(a){var b=(a.clipboardData||window.clipboardData).getData("text"),c=d.state.locale,e=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,c);isNumberOrNull(e)&&(d.setState({formattedAmount:formatAmountIfSet(e,d.props.selectedCurrency.currency,c)}),d.props.onAmountChange(e)),a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"onAmountChange",function(a){var b=a.target.value;d.setState({formattedAmount:b});var c=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,d.state.locale);isNumberOrNull(c)&&d.props.onAmountChange(c)}),_defineProperty(_assertThisInitialized(d),"onAmountBlur",function(){d.amountFocused=!1,d.setAmount()}),_defineProperty(_assertThisInitialized(d),"onAmountFocus",function(){d.amountFocused=!0}),_defineProperty(_assertThisInitialized(d),"handleSelectChange",function(a){d.handleSearchChange(""),d.props.onCustomAction&&a.value===CUSTOM_ACTION?d.props.onCustomAction():d.props.onCurrencyChange(a)}),_defineProperty(_assertThisInitialized(d),"handleSearchChange",function(a){d.setState({searchQuery:a}),d.props.onSearchChange&&d.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(d.props.currencies,a)})}),_defineProperty(_assertThisInitialized(d),"style",function(a){return d.props.classNames[a]||a});var e=d.props.intl.locale;return d.formatMessage=d.props.intl.formatMessage,d.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,e),locale:e},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(a){var b;if(this.setState({locale:null===a||void 0===a||null===(b=a.intl)||void 0===b?void 0:b.locale}),!this.amountFocused){var c;this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,null===a||void 0===a||null===(c=a.intl)||void 0===c?void 0:c.locale)})}}},{key:"getSelectOptions",value:function getSelectOptions(){var a=_toConsumableArray(filterOptionsForQuery(this.props.currencies,this.state.searchQuery));return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}},{key:"setAmount",value:function setAmount(){var a=this;this.setState(function(b){var c=parseAmount(b.formattedAmount,a.props.selectedCurrency.currency,a.state.locale);return isNumberOrNull(c)?{formattedAmount:formatAmountIfSet(c,a.props.selectedCurrency.currency,b.locale)}:{formattedAmount:b.formattedAmount}})}},{key:"render",value:function render(){var a=this.props,b=a.selectedCurrency,c=a.onCurrencyChange,d=a.size,e=a.addon,f=this.getSelectOptions(),g=!this.state.searchQuery&&(1===f.length&&f[0].currency===b.currency||!c),h=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style("input-group-".concat(d))),children:[/*#__PURE__*/_jsx("input",{id:this.props.id,value:this.state.formattedAmount,type:"text",inputMode:"decimal",className:classNames(this.style("form-control")),disabled:h,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),e&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),h?this.style("
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){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(a){return!1}}import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.sort.js";import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import Select from"../select";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=function(a){return isNumber(a)||isNull(a)},formatAmountIfSet=function(a,b,c){return"number"==typeof a?formatAmount(a,b,c):""},inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]),MoneyInput=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"isInputAllowedForKeyEvent",function(a){var b=a.keyCode,c=a.metaKey,d=a.key,e=a.ctrlKey,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){d.isInputAllowedForKeyEvent(a)||a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"handlePaste",function(a){var b=(a.clipboardData||window.clipboardData).getData("text"),c=d.state.locale,e=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,c);isNumberOrNull(e)&&(d.setState({formattedAmount:formatAmountIfSet(e,d.props.selectedCurrency.currency,c)}),d.props.onAmountChange(e)),a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"onAmountChange",function(a){var b=a.target.value;d.setState({formattedAmount:b});var c=isEmpty(b)?null:parseAmount(b,d.props.selectedCurrency.currency,d.state.locale);isNumberOrNull(c)&&d.props.onAmountChange(c)}),_defineProperty(_assertThisInitialized(d),"onAmountBlur",function(){d.amountFocused=!1,d.setAmount()}),_defineProperty(_assertThisInitialized(d),"onAmountFocus",function(){d.amountFocused=!0}),_defineProperty(_assertThisInitialized(d),"handleSelectChange",function(a){d.handleSearchChange(""),d.props.onCustomAction&&a.value===CUSTOM_ACTION?d.props.onCustomAction():d.props.onCurrencyChange(a)}),_defineProperty(_assertThisInitialized(d),"handleSearchChange",function(a){d.setState({searchQuery:a}),d.props.onSearchChange&&d.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(d.props.currencies,a)})}),_defineProperty(_assertThisInitialized(d),"style",function(a){return d.props.classNames[a]||a});var e=d.props.intl.locale;return d.formatMessage=d.props.intl.formatMessage,d.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,e),locale:e},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(a){var b;if(this.setState({locale:null===a||void 0===a||null===(b=a.intl)||void 0===b?void 0:b.locale}),!this.amountFocused){var c;this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,null===a||void 0===a||null===(c=a.intl)||void 0===c?void 0:c.locale)})}}},{key:"getSelectOptions",value:function getSelectOptions(){var a=_toConsumableArray(filterOptionsForQuery(this.props.currencies,this.state.searchQuery));return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}},{key:"setAmount",value:function setAmount(){var a=this;this.setState(function(b){var c=parseAmount(b.formattedAmount,a.props.selectedCurrency.currency,a.state.locale);return isNumberOrNull(c)?{formattedAmount:formatAmountIfSet(c,a.props.selectedCurrency.currency,b.locale)}:{formattedAmount:b.formattedAmount}})}},{key:"render",value:function render(){var a=this.props,b=a.selectedCurrency,c=a.onCurrencyChange,d=a.size,e=a.addon,f=this.getSelectOptions(),g=!this.state.searchQuery&&(1===f.length&&f[0].currency===b.currency||!c),h=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style("input-group-".concat(d))),children:[/*#__PURE__*/_jsx("input",{id:this.props.id,value:this.state.formattedAmount,type:"text",inputMode:"decimal",className:classNames(this.style("form-control")),disabled:h,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),e&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),h?this.style("disabled"):""),children:e}),g?/*#__PURE__*/_jsxs("div",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),this.style("tw-money-input__fixed-currency"),h?this.style("disabled"):""),children:[("lg"===d||"md"===d)&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("i",{className:classNames(this.style("tw-money-input__keyline"))}),/*#__PURE__*/_jsx("i",{className:classNames(this.style("currency-flag"),this.style("currency-flag-".concat(b.currency.toLowerCase())),this.style("hidden-xs"),this.style("m-r-2"))})]}),/*#__PURE__*/_jsx("span",{className:"lg"===d?this.style("m-r-1"):"",children:b.currency.toUpperCase()})]}):/*#__PURE__*/_jsx("div",{className:classNames(this.style("input-group-btn"),this.style("amount-currency-select-btn")),children:/*#__PURE__*/_jsx(Select,{classNames:this.props.classNames,options:f,selected:_objectSpread(_objectSpread({},b),{},{note:null}),placeholder:this.formatMessage(messages.selectPlaceholder),searchPlaceholder:this.props.searchPlaceholder,searchValue:this.state.searchQuery,size:d,required:!0,dropdownRight:"xs",dropdownWidth:"lg",inverse:!0,onChange:this.handleSelectChange,onSearchChange:this.handleSearchChange})})]})}}]),b}(Component);function filterOptionsForQuery(a,b){if(!b)return a;var c=removeDuplicateValueOptions(a).filter(function(a){return isCurrencyOptionAndFitsQuery(a,b)});return sortOptionsLabelsToFirst(c,b)}function removeDuplicateValueOptions(a){var b=[],c=[];return a.forEach(function(a){a.value&&!c.includes(a.value)&&(b.push(a),c.push(a.value))}),b}function isCurrencyOptionAndFitsQuery(a,b){return!!a.value&&(contains(a.label,b)||contains(a.searchable,b)||contains(a.note,b))}function contains(a,b){return a&&a.toLowerCase().includes(b.toLowerCase())}function sortOptionsLabelsToFirst(a,b){return a.sort(function(a,c){var d=contains(a.label,b),e=contains(c.label,b);return d&&e?0:d?-1:e?1:0})}MoneyInput.propTypes={id:PropTypes.string,currencies:PropTypes.arrayOf(Currency).isRequired,selectedCurrency:Currency.isRequired,onCurrencyChange:PropTypes.func,placeholder:PropTypes.number,amount:PropTypes.number,size:PropTypes.oneOf(["sm","md","lg"]),onAmountChange:PropTypes.func,addon:PropTypes.node,searchPlaceholder:PropTypes.string,/**
|
|
2
2
|
* Allows the consumer to react to searching, while the search itself is handled internally. Called with `{ searchQuery: string, filteredOptions: Currency[] }`
|
|
3
3
|
*/onSearchChange:PropTypes.func,customActionLabel:PropTypes.node,onCustomAction:PropTypes.func,classNames:PropTypes.objectOf(PropTypes.string)},MoneyInput.defaultProps={id:null,size:Size.LARGE,addon:null,searchPlaceholder:"",onSearchChange:void 0,onCurrencyChange:null,placeholder:null,amount:null,onAmountChange:null,customActionLabel:"",onCustomAction:null,classNames:{}};// this export is necessary for react-to-typescript-definitions
|
|
4
4
|
// to be able to properly generate TS types, this is due to us wrapping this component in `injectIntl` before exporting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","avatar","secondary"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","className","avatar","secondary"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.className,f=a.avatar,g=a.secondary,h=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:"np-radio-button p-r-2",children:/*#__PURE__*/_jsx(RadioButton,_objectSpread({id:c,disabled:d},h))}),/*#__PURE__*/_jsxs("span",{className:"np-radio__text",children:[b,g&&/*#__PURE__*/_jsx("small",{children:g})]}),f&&/*#__PURE__*/_jsx("span",{className:"np-radio__avatar m-l-auto",children:f})]})})};Radio.propTypes={avatar:PropTypes.element,checked:PropTypes.bool,disabled:PropTypes.bool,id:PropTypes.string,label:PropTypes.string.isRequired,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,secondary:PropTypes.string,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),className:PropTypes.string},Radio.defaultProps={avatar:void 0,checked:!1,disabled:!1,id:null,secondary:null,value:"",className:void 0};export default Radio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className;if(0===b.length)return null;var
|
|
1
|
+
import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",disabled:!d,onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})});return/*#__PURE__*/_jsx("li",{className:"\n hidden-xs\n tw-stepper__step\n ".concat(c?"tw-stepper__step--active":"","\n ").concat(d?"tw-stepper__step--clickable":"","\n "),style:f?{right:"".concat(100*(b*h),"%")}:{left:"".concat(100*(b*h),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CheckCircle,CrossCircle}from"@transferwise/icons";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Switch=function(a){var b=a.checked,c=a.className,d=a.id,e=a.onClick,f=a.disabled,g=a["aria-label"],h=g?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!g&&!h),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!b,"np-switch--checked":b,
|
|
1
|
+
import{CheckCircle,CrossCircle}from"@transferwise/icons";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Switch=function(a){var b=a.checked,c=a.className,d=a.id,e=a.onClick,f=a.disabled,g=a["aria-label"],h=g?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!g&&!h),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!b,"np-switch--checked":b,disabled:f},c),tabIndex:0,role:"switch","aria-checked":b,"aria-label":g,"aria-labelledby":h,id:d,"aria-disabled":f,onClick:f?void 0:e,onKeyDown:f?void 0:function handleKeyDown(a){("32"===a.code||a.keyCode===KeyCodes.SPACE)&&(a.preventDefault(),e())},children:[/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:b?/*#__PURE__*/_jsx(CheckCircle,{filled:!0,size:24}):/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:24})}),/*#__PURE__*/_jsx("input",{type:"checkbox",checked:b,readOnly:!0})]})};export default Switch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var Tab=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.id,e=a.disabled,f=a.panelId,g=a.selected,h=a.onKeyDown,i=a.onClick,j=a.style,k=a.focusTab,l=useRef(!0),m=function(){return l.current?void(l.current=!1):void(g&&k&&k())};return useEffect(function(){m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",{"tabs__tab--selected":g,
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var Tab=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.id,e=a.disabled,f=a.panelId,g=a.selected,h=a.onKeyDown,i=a.onClick,j=a.style,k=a.focusTab,l=useRef(!0),m=function(){return l.current?void(l.current=!1):void(g&&k&&k())};return useEffect(function(){m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",{"tabs__tab--selected":g,disabled:e}),role:"tab",id:d,"aria-selected":g?"true":"false","aria-disabled":e?"true":"false","aria-controls":e?null:f,tabIndex:"0",style:j,onKeyDown:e?null:h,onClick:i,children:c})});Tab.defaultProps={disabled:!1,selected:!1,onClick:null,style:null,focusTab:null},Tab.propTypes={children:PropTypes.node.isRequired,disabled:PropTypes.bool,selected:PropTypes.bool,id:PropTypes.string.isRequired,panelId:PropTypes.string.isRequired,onKeyDown:PropTypes.func.isRequired,onClick:PropTypes.func,style:PropTypes.shape({width:PropTypes.string}),focusTab:PropTypes.func};export default Tab;
|
package/build/i18n/cs.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"neptune.UploadInput.deleteModalTitle": "Jistě chcete odstranit tento soubor?",
|
|
34
34
|
"neptune.UploadInput.fileIsTooLarge": "Soubor je příliš velký",
|
|
35
35
|
"neptune.UploadInput.fileTypeNotSupported": "Typ souboru není podporován",
|
|
36
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.",
|
|
36
37
|
"neptune.UploadItem.deleting": "Mažeme...",
|
|
37
38
|
"neptune.UploadItem.removeFile": "Odstranit soubor {filename}",
|
|
38
39
|
"neptune.UploadItem.uploaded": "Nahráno",
|