@transferwise/components 46.0.6 → 46.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/de.json +2 -2
- package/build/i18n/hu.json +2 -2
- package/build/index.esm.js +22 -20
- package/build/index.esm.js.map +1 -1
- package/build/index.js +22 -20
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts +2 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/i18n/de.json +2 -2
- package/src/i18n/hu.json +2 -2
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.tsx +1 -0
- package/src/inputs/_Popover.less +8 -1
- package/src/inputs/_Popover.tsx +8 -3
- package/src/main.css +1 -1
- package/src/moneyInput/MoneyInput.js +16 -21
- package/src/moneyInput/MoneyInput.spec.js +16 -3
- package/src/moneyInput/MoneyInput.story.tsx +1 -1
package/build/index.js
CHANGED
|
@@ -6636,6 +6636,7 @@ function Popover({
|
|
|
6636
6636
|
open,
|
|
6637
6637
|
renderTrigger,
|
|
6638
6638
|
title,
|
|
6639
|
+
size = 'md',
|
|
6639
6640
|
padding = 'md',
|
|
6640
6641
|
children,
|
|
6641
6642
|
onClose
|
|
@@ -6703,7 +6704,10 @@ function Popover({
|
|
|
6703
6704
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6704
6705
|
// Force inner state invalidation on open
|
|
6705
6706
|
ref: refs.setFloating,
|
|
6706
|
-
className:
|
|
6707
|
+
className: classNames__default.default('np-popover-v2-container', {
|
|
6708
|
+
'np-popover-v2-container--size-md': size === 'md',
|
|
6709
|
+
'np-popover-v2-container--size-lg': size === 'lg'
|
|
6710
|
+
})
|
|
6707
6711
|
// eslint-disable-next-line react/forbid-dom-props
|
|
6708
6712
|
,
|
|
6709
6713
|
style: floatingStyles,
|
|
@@ -6926,6 +6930,7 @@ function SelectInput({
|
|
|
6926
6930
|
})
|
|
6927
6931
|
}),
|
|
6928
6932
|
initialFocusRef: controllerRef,
|
|
6933
|
+
size: filterable ? 'lg' : 'md',
|
|
6929
6934
|
padding: "none",
|
|
6930
6935
|
onClose: () => {
|
|
6931
6936
|
setOpen(false);
|
|
@@ -8033,26 +8038,23 @@ class MoneyInput extends React.Component {
|
|
|
8033
8038
|
maxLengthOverride
|
|
8034
8039
|
} = this.props;
|
|
8035
8040
|
const selectOptions = this.getSelectOptions();
|
|
8036
|
-
const
|
|
8041
|
+
const hasSingleCurrency = () => {
|
|
8037
8042
|
if (selectOptions.length !== 0) {
|
|
8038
8043
|
const firstItem = selectOptions[0];
|
|
8039
|
-
if (
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
return {
|
|
8047
|
-
hasOneCurrency: firstItem.options.length === 1,
|
|
8048
|
-
currency: firstItem.options[0].value.currency
|
|
8049
|
-
};
|
|
8044
|
+
if (selectOptions.length === 1) {
|
|
8045
|
+
if (firstItem.type === 'option') {
|
|
8046
|
+
return firstItem.value.currency === selectedCurrency.currency;
|
|
8047
|
+
}
|
|
8048
|
+
if (firstItem.type === 'group') {
|
|
8049
|
+
return firstItem.options.length === 1 && !(this.props.onCustomAction && this.props.customActionLabel);
|
|
8050
|
+
}
|
|
8050
8051
|
}
|
|
8052
|
+
} else if (selectedCurrency?.currency) {
|
|
8053
|
+
return true;
|
|
8051
8054
|
}
|
|
8052
|
-
return
|
|
8055
|
+
return false;
|
|
8053
8056
|
};
|
|
8054
|
-
const
|
|
8055
|
-
const isFixedCurrency = !this.state.searchQuery && (firstSelectItem?.hasOneCurrency && firstSelectItem?.currency === selectedCurrency.currency || !onCurrencyChange);
|
|
8057
|
+
const isFixedCurrency = !this.state.searchQuery && hasSingleCurrency() || !onCurrencyChange;
|
|
8056
8058
|
const disabled = !this.props.onAmountChange;
|
|
8057
8059
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8058
8060
|
className: classNames__default.default(this.style('tw-money-input'), this.style('input-group'), this.style(`input-group-${size}`)),
|
|
@@ -14737,10 +14739,10 @@ var de = {
|
|
|
14737
14739
|
"neptune.ClearButton.ariaLabel": "Zurücksetzen",
|
|
14738
14740
|
"neptune.CloseButton.ariaLabel": "Schließen",
|
|
14739
14741
|
"neptune.DateInput.day.label": "Tag",
|
|
14740
|
-
"neptune.DateInput.day.placeholder": "
|
|
14742
|
+
"neptune.DateInput.day.placeholder": "TT",
|
|
14741
14743
|
"neptune.DateInput.month.label": "Monat",
|
|
14742
14744
|
"neptune.DateInput.year.label": "Jahr",
|
|
14743
|
-
"neptune.DateInput.year.placeholder": "
|
|
14745
|
+
"neptune.DateInput.year.placeholder": "JJJJ",
|
|
14744
14746
|
"neptune.DateLookup.day": "Tag",
|
|
14745
14747
|
"neptune.DateLookup.goTo20YearView": "Zur 20-Jahres-Ansicht",
|
|
14746
14748
|
"neptune.DateLookup.month": "Monat",
|
|
@@ -14908,10 +14910,10 @@ var hu = {
|
|
|
14908
14910
|
"neptune.ClearButton.ariaLabel": "Törlés",
|
|
14909
14911
|
"neptune.CloseButton.ariaLabel": "Bezárás",
|
|
14910
14912
|
"neptune.DateInput.day.label": "Nap",
|
|
14911
|
-
"neptune.DateInput.day.placeholder": "
|
|
14913
|
+
"neptune.DateInput.day.placeholder": "NN",
|
|
14912
14914
|
"neptune.DateInput.month.label": "Hónap",
|
|
14913
14915
|
"neptune.DateInput.year.label": "Év",
|
|
14914
|
-
"neptune.DateInput.year.placeholder": "
|
|
14916
|
+
"neptune.DateInput.year.placeholder": "ÉÉÉÉ",
|
|
14915
14917
|
"neptune.DateLookup.day": "nap",
|
|
14916
14918
|
"neptune.DateLookup.goTo20YearView": "Ugrás a 20 éves nézetre",
|
|
14917
14919
|
"neptune.DateLookup.month": "hónap",
|