@transferwise/components 46.9.0 → 46.10.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/de.json +1 -0
- package/build/i18n/en.json +1 -0
- package/build/i18n/es.json +1 -0
- package/build/i18n/fr.json +1 -0
- package/build/i18n/hu.json +1 -0
- package/build/i18n/id.json +1 -0
- package/build/i18n/it.json +1 -0
- package/build/i18n/ja.json +1 -0
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pt.json +1 -0
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ru.json +1 -0
- package/build/i18n/th.json +1 -0
- package/build/i18n/tr.json +1 -0
- package/build/i18n/zh-CN.json +1 -0
- package/build/i18n/zh-HK.json +1 -0
- package/build/index.esm.js +82 -88
- package/build/index.esm.js.map +1 -1
- package/build/index.js +82 -88
- package/build/index.js.map +1 -1
- package/build/main.css +6 -0
- package/build/styles/drawer/Drawer.css +3 -0
- package/build/styles/main.css +6 -0
- package/build/styles/modal/Modal.css +3 -0
- package/build/types/common/index.d.ts +0 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +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/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts +8 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts.map +1 -0
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +14 -17
- package/src/button/Button.story.tsx +3 -3
- package/src/common/fakeEvents.js +2 -2
- package/src/common/index.js +0 -1
- package/src/dateInput/DateInput.story.tsx +4 -3
- package/src/dateLookup/DateLookup.js +6 -7
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +24 -25
- package/src/dateLookup/DateLookup.story.js +4 -3
- package/src/dateLookup/dateTrigger/DateTrigger.spec.js +3 -3
- package/src/drawer/Drawer.css +3 -0
- package/src/drawer/Drawer.less +4 -0
- package/src/i18n/de.json +1 -0
- package/src/i18n/en.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/fr.json +1 -0
- package/src/i18n/hu.json +1 -0
- package/src/i18n/id.json +1 -0
- package/src/i18n/it.json +1 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/pl.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/ro.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/th.json +1 -0
- package/src/i18n/tr.json +1 -0
- package/src/i18n/zh-CN.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/info/Info.story.tsx +3 -3
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +2 -7
- package/src/inputs/SelectInput.spec.tsx +7 -0
- package/src/inputs/SelectInput.story.tsx +223 -317
- package/src/inputs/SelectInput.tsx +4 -0
- package/src/logo/Logo.js +4 -4
- package/src/main.css +6 -0
- package/src/modal/Modal.css +3 -0
- package/src/modal/Modal.less +4 -0
- package/src/modal/Modal.story.tsx +55 -21
- package/src/moneyInput/MoneyInput.story.tsx +3 -3
- package/src/moneyInput/MoneyInput.tsx +14 -24
- package/src/phoneNumberInput/PhoneNumberInput.messages.ts +8 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.js +12 -7
- package/src/phoneNumberInput/PhoneNumberInput.tsx +3 -2
- package/src/select/Select.js +8 -9
- package/src/snackbar/Snackbar.story.tsx +3 -3
- package/src/switch/Switch.spec.js +2 -3
- package/src/switch/Switch.tsx +1 -2
- package/src/switchOption/SwitchOption.spec.js +1 -4
- package/src/tabs/Tabs.js +1 -2
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +5 -4
- package/src/tile/Tile.js +2 -2
- package/src/tile/Tile.spec.js +5 -5
- package/src/tooltip/Tooltip.story.tsx +3 -3
- package/src/typeahead/Typeahead.js +5 -6
- package/src/typeahead/Typeahead.spec.js +3 -8
- package/src/typeahead/Typeahead.story.js +3 -4
- package/build/types/common/key.d.ts +0 -9
- package/build/types/common/key.d.ts.map +0 -1
- package/build/types/common/keyCodes.d.ts +0 -16
- package/build/types/common/keyCodes.d.ts.map +0 -1
- package/src/common/key.js +0 -8
- package/src/common/keyCodes.js +0 -19
package/build/index.esm.js
CHANGED
|
@@ -333,15 +333,6 @@ var FileType;
|
|
|
333
333
|
FileType["CSV"] = ".csv,text/csv";
|
|
334
334
|
})(FileType || (FileType = {}));
|
|
335
335
|
|
|
336
|
-
const Key = {
|
|
337
|
-
ENTER: 'Enter',
|
|
338
|
-
ESCAPE: 'Escape',
|
|
339
|
-
SPACE: [' ', 'Spacebar'],
|
|
340
|
-
TAB: 'Tab',
|
|
341
|
-
PERIOD: '.',
|
|
342
|
-
COMMA: ','
|
|
343
|
-
};
|
|
344
|
-
|
|
345
336
|
const DEFAULT_LANG = 'en';
|
|
346
337
|
const DEFAULT_LOCALE = 'en-GB';
|
|
347
338
|
/**
|
|
@@ -731,7 +722,7 @@ const ActionOption = ({
|
|
|
731
722
|
});
|
|
732
723
|
};
|
|
733
724
|
|
|
734
|
-
var messages$
|
|
725
|
+
var messages$d = defineMessages({
|
|
735
726
|
ariaLabel: {
|
|
736
727
|
id: "neptune.CloseButton.ariaLabel"
|
|
737
728
|
}
|
|
@@ -747,7 +738,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
747
738
|
testId
|
|
748
739
|
}, reference) {
|
|
749
740
|
const intl = useIntl();
|
|
750
|
-
ariaLabel ??= intl.formatMessage(messages$
|
|
741
|
+
ariaLabel ??= intl.formatMessage(messages$d.ariaLabel);
|
|
751
742
|
const Icon = filled ? CrossCircleFill : Cross;
|
|
752
743
|
return /*#__PURE__*/jsx("button", {
|
|
753
744
|
ref: reference,
|
|
@@ -767,7 +758,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
767
758
|
});
|
|
768
759
|
});
|
|
769
760
|
|
|
770
|
-
var messages$
|
|
761
|
+
var messages$c = defineMessages({
|
|
771
762
|
opensInNewTab: {
|
|
772
763
|
id: "neptune.Link.opensInNewTab"
|
|
773
764
|
}
|
|
@@ -796,7 +787,7 @@ const Link = ({
|
|
|
796
787
|
onClick: onClick,
|
|
797
788
|
...props,
|
|
798
789
|
children: [children, " ", isBlank && /*#__PURE__*/jsx(NavigateAway, {
|
|
799
|
-
title: formatMessage(messages$
|
|
790
|
+
title: formatMessage(messages$c.opensInNewTab)
|
|
800
791
|
})]
|
|
801
792
|
});
|
|
802
793
|
};
|
|
@@ -2226,7 +2217,7 @@ ProcessIndicator.defaultProps = {
|
|
|
2226
2217
|
};
|
|
2227
2218
|
var ProcessIndicator$1 = ProcessIndicator;
|
|
2228
2219
|
|
|
2229
|
-
var messages$
|
|
2220
|
+
var messages$b = defineMessages({
|
|
2230
2221
|
loadingAriaLabel: {
|
|
2231
2222
|
id: "neptune.Button.loadingAriaLabel"
|
|
2232
2223
|
}
|
|
@@ -2345,7 +2336,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2345
2336
|
className: classes,
|
|
2346
2337
|
...props,
|
|
2347
2338
|
"aria-live": loading ? 'polite' : 'off',
|
|
2348
|
-
"aria-label": loading ? intl.formatMessage(messages$
|
|
2339
|
+
"aria-label": loading ? intl.formatMessage(messages$b.loadingAriaLabel) : rest['aria-label'],
|
|
2349
2340
|
children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator$1, {
|
|
2350
2341
|
size: processIndicatorSize(),
|
|
2351
2342
|
className: "btn-loader"
|
|
@@ -2638,7 +2629,7 @@ const Chip = ({
|
|
|
2638
2629
|
}, value);
|
|
2639
2630
|
};
|
|
2640
2631
|
|
|
2641
|
-
var messages$
|
|
2632
|
+
var messages$a = defineMessages({
|
|
2642
2633
|
ariaLabel: {
|
|
2643
2634
|
id: "neptune.Chips.ariaLabel"
|
|
2644
2635
|
}
|
|
@@ -2670,7 +2661,7 @@ const Chips = ({
|
|
|
2670
2661
|
value: chip.value,
|
|
2671
2662
|
label: chip.label,
|
|
2672
2663
|
closeButton: {
|
|
2673
|
-
'aria-label': intl.formatMessage(messages$
|
|
2664
|
+
'aria-label': intl.formatMessage(messages$a.ariaLabel, {
|
|
2674
2665
|
choice: chip.label
|
|
2675
2666
|
})
|
|
2676
2667
|
},
|
|
@@ -2778,7 +2769,7 @@ const validDateObject = dateObject => dateObject instanceof Date && !isNaN(dateO
|
|
|
2778
2769
|
|
|
2779
2770
|
const isMonthAndYearFormat = dateString => validDateString(dateString) && dateString.split('-').length < 3;
|
|
2780
2771
|
|
|
2781
|
-
var messages$
|
|
2772
|
+
var messages$9 = defineMessages({
|
|
2782
2773
|
monthLabel: {
|
|
2783
2774
|
id: "neptune.DateInput.month.label"
|
|
2784
2775
|
},
|
|
@@ -2864,13 +2855,13 @@ const DateInput = ({
|
|
|
2864
2855
|
const [month, setMonth] = useState(() => getExplodedDate('month'));
|
|
2865
2856
|
const [year, setYear] = useState(() => getExplodedDate('year'));
|
|
2866
2857
|
const [lastBroadcastedValue, setLastBroadcastedValue] = useState(getDateObject);
|
|
2867
|
-
dayLabel = dayLabel || formatMessage(messages$
|
|
2868
|
-
monthLabel = monthLabel || formatMessage(messages$
|
|
2869
|
-
yearLabel = yearLabel || formatMessage(messages$
|
|
2858
|
+
dayLabel = dayLabel || formatMessage(messages$9.dayLabel);
|
|
2859
|
+
monthLabel = monthLabel || formatMessage(messages$9.monthLabel);
|
|
2860
|
+
yearLabel = yearLabel || formatMessage(messages$9.yearLabel);
|
|
2870
2861
|
placeholders = {
|
|
2871
|
-
day: placeholders?.day || formatMessage(messages$
|
|
2872
|
-
month: placeholders?.month || formatMessage(messages$
|
|
2873
|
-
year: placeholders?.year || formatMessage(messages$
|
|
2862
|
+
day: placeholders?.day || formatMessage(messages$9.dayPlaceholder),
|
|
2863
|
+
month: placeholders?.month || formatMessage(messages$9.monthLabel),
|
|
2864
|
+
year: placeholders?.year || formatMessage(messages$9.yearPlaceholder)
|
|
2874
2865
|
};
|
|
2875
2866
|
const getDateAsString = date => {
|
|
2876
2867
|
if (!isDateValid(date)) {
|
|
@@ -3134,26 +3125,6 @@ DateInput.defaultProps = {
|
|
|
3134
3125
|
};
|
|
3135
3126
|
var DateInput$1 = DateInput;
|
|
3136
3127
|
|
|
3137
|
-
/**
|
|
3138
|
-
* TODO: mention what to use instead or consider to delete this object
|
|
3139
|
-
*
|
|
3140
|
-
* @deprecated
|
|
3141
|
-
*/
|
|
3142
|
-
var KeyCodes = {
|
|
3143
|
-
DOWN: 40,
|
|
3144
|
-
UP: 38,
|
|
3145
|
-
LEFT: 37,
|
|
3146
|
-
RIGHT: 39,
|
|
3147
|
-
ENTER: 13,
|
|
3148
|
-
ESCAPE: 27,
|
|
3149
|
-
TAB: 9,
|
|
3150
|
-
SPACE: 32,
|
|
3151
|
-
BACKSPACE: 8,
|
|
3152
|
-
DELETE: 46,
|
|
3153
|
-
COMMA: 188,
|
|
3154
|
-
PERIOD: 190
|
|
3155
|
-
};
|
|
3156
|
-
|
|
3157
3128
|
const POPOVER_OFFSET = [0, 16];
|
|
3158
3129
|
// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space
|
|
3159
3130
|
// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.
|
|
@@ -3399,7 +3370,7 @@ DateTrigger.defaultProps = {
|
|
|
3399
3370
|
};
|
|
3400
3371
|
var DateTrigger$1 = DateTrigger;
|
|
3401
3372
|
|
|
3402
|
-
var messages$
|
|
3373
|
+
var messages$8 = defineMessages({
|
|
3403
3374
|
next: {
|
|
3404
3375
|
id: "neptune.DateLookup.next"
|
|
3405
3376
|
},
|
|
@@ -3445,7 +3416,7 @@ const DateHeader = ({
|
|
|
3445
3416
|
children: /*#__PURE__*/jsx("button", {
|
|
3446
3417
|
type: "button",
|
|
3447
3418
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3448
|
-
"aria-label": `${intl.formatMessage(messages$
|
|
3419
|
+
"aria-label": `${intl.formatMessage(messages$8.previous)} ${dateMode}`,
|
|
3449
3420
|
onClick: onPreviousClick,
|
|
3450
3421
|
children: /*#__PURE__*/jsx(Chevron, {
|
|
3451
3422
|
orientation: Position.LEFT,
|
|
@@ -3459,7 +3430,7 @@ const DateHeader = ({
|
|
|
3459
3430
|
children: /*#__PURE__*/jsx("button", {
|
|
3460
3431
|
type: "button",
|
|
3461
3432
|
className: `tw-date-lookup-header-current ${buttonClasses}`,
|
|
3462
|
-
"aria-label": intl.formatMessage(messages$
|
|
3433
|
+
"aria-label": intl.formatMessage(messages$8.goTo20YearView),
|
|
3463
3434
|
onClick: onLabelClick,
|
|
3464
3435
|
children: label
|
|
3465
3436
|
})
|
|
@@ -3468,7 +3439,7 @@ const DateHeader = ({
|
|
|
3468
3439
|
children: /*#__PURE__*/jsx("button", {
|
|
3469
3440
|
type: "button",
|
|
3470
3441
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3471
|
-
"aria-label": `${useIntl().formatMessage(messages$
|
|
3442
|
+
"aria-label": `${useIntl().formatMessage(messages$8.next)} ${dateMode}`,
|
|
3472
3443
|
onClick: onNextClick,
|
|
3473
3444
|
children: /*#__PURE__*/jsx(Chevron, {
|
|
3474
3445
|
orientation: Position.RIGHT,
|
|
@@ -3535,7 +3506,7 @@ const TableLink = ({
|
|
|
3535
3506
|
};
|
|
3536
3507
|
const calculateAriaLabel = () => {
|
|
3537
3508
|
if (active) {
|
|
3538
|
-
return `${longTitle || title || ''}, ${intl.formatMessage(messages$
|
|
3509
|
+
return `${longTitle || title || ''}, ${intl.formatMessage(messages$8.selected)} ${intl.formatMessage(messages$8[type])}`;
|
|
3539
3510
|
}
|
|
3540
3511
|
return longTitle || title;
|
|
3541
3512
|
};
|
|
@@ -3752,7 +3723,7 @@ class DayCalendar extends PureComponent {
|
|
|
3752
3723
|
month: monthFormat,
|
|
3753
3724
|
year: 'numeric'
|
|
3754
3725
|
}),
|
|
3755
|
-
dateMode: formatMessage(messages$
|
|
3726
|
+
dateMode: formatMessage(messages$8.month),
|
|
3756
3727
|
onLabelClick: onLabelClick,
|
|
3757
3728
|
onPreviousClick: this.selectPreviousMonth,
|
|
3758
3729
|
onNextClick: this.selectNextMonth
|
|
@@ -3898,7 +3869,7 @@ class MonthCalendar extends PureComponent {
|
|
|
3898
3869
|
} = this.props;
|
|
3899
3870
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
3900
3871
|
children: [/*#__PURE__*/jsx(DateHeader$1, {
|
|
3901
|
-
dateMode: formatMessage(messages$
|
|
3872
|
+
dateMode: formatMessage(messages$8.year),
|
|
3902
3873
|
label: formatDate(new Date(viewYear, 0), locale, {
|
|
3903
3874
|
year: 'numeric'
|
|
3904
3875
|
}),
|
|
@@ -4044,7 +4015,7 @@ class YearCalendar extends PureComponent {
|
|
|
4044
4015
|
} = this.props;
|
|
4045
4016
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
4046
4017
|
children: [/*#__PURE__*/jsx(DateHeader$1, {
|
|
4047
|
-
dateMode: formatMessage(messages$
|
|
4018
|
+
dateMode: formatMessage(messages$8.twentyYears),
|
|
4048
4019
|
onPreviousClick: this.selectPreviousYears,
|
|
4049
4020
|
onNextClick: this.selectNextYears
|
|
4050
4021
|
}), /*#__PURE__*/jsx(YearCalendarTable$1, {
|
|
@@ -4175,8 +4146,8 @@ class DateLookup extends PureComponent {
|
|
|
4175
4146
|
open,
|
|
4176
4147
|
originalDate
|
|
4177
4148
|
} = this.state;
|
|
4178
|
-
switch (event.
|
|
4179
|
-
case
|
|
4149
|
+
switch (event.key) {
|
|
4150
|
+
case 'ArrowLeft':
|
|
4180
4151
|
if (open) {
|
|
4181
4152
|
this.adjustDate(-1, -1, -1);
|
|
4182
4153
|
} else {
|
|
@@ -4184,7 +4155,7 @@ class DateLookup extends PureComponent {
|
|
|
4184
4155
|
}
|
|
4185
4156
|
event.preventDefault();
|
|
4186
4157
|
break;
|
|
4187
|
-
case
|
|
4158
|
+
case 'ArrowUp':
|
|
4188
4159
|
if (open) {
|
|
4189
4160
|
this.adjustDate(-7, -4, -4);
|
|
4190
4161
|
} else {
|
|
@@ -4192,7 +4163,7 @@ class DateLookup extends PureComponent {
|
|
|
4192
4163
|
}
|
|
4193
4164
|
event.preventDefault();
|
|
4194
4165
|
break;
|
|
4195
|
-
case
|
|
4166
|
+
case 'ArrowRight':
|
|
4196
4167
|
if (open) {
|
|
4197
4168
|
this.adjustDate(1, 1, 1);
|
|
4198
4169
|
} else {
|
|
@@ -4200,7 +4171,7 @@ class DateLookup extends PureComponent {
|
|
|
4200
4171
|
}
|
|
4201
4172
|
event.preventDefault();
|
|
4202
4173
|
break;
|
|
4203
|
-
case
|
|
4174
|
+
case 'ArrowDown':
|
|
4204
4175
|
if (open) {
|
|
4205
4176
|
this.adjustDate(7, 4, 4);
|
|
4206
4177
|
} else {
|
|
@@ -4208,7 +4179,7 @@ class DateLookup extends PureComponent {
|
|
|
4208
4179
|
}
|
|
4209
4180
|
event.preventDefault();
|
|
4210
4181
|
break;
|
|
4211
|
-
case
|
|
4182
|
+
case 'Escape':
|
|
4212
4183
|
if (originalDate !== null) {
|
|
4213
4184
|
this.props.onChange(originalDate);
|
|
4214
4185
|
}
|
|
@@ -4531,7 +4502,7 @@ const Tile = ({
|
|
|
4531
4502
|
onKeyDown: disabled ? null : ({
|
|
4532
4503
|
key
|
|
4533
4504
|
}) => {
|
|
4534
|
-
if (key ===
|
|
4505
|
+
if (key === 'Enter' || key === ' ') {
|
|
4535
4506
|
onClick();
|
|
4536
4507
|
}
|
|
4537
4508
|
},
|
|
@@ -5695,7 +5666,7 @@ const Stepper = ({
|
|
|
5695
5666
|
});
|
|
5696
5667
|
};
|
|
5697
5668
|
|
|
5698
|
-
var messages$
|
|
5669
|
+
var messages$7 = defineMessages({
|
|
5699
5670
|
back: {
|
|
5700
5671
|
id: "neptune.FlowNavigation.back"
|
|
5701
5672
|
}
|
|
@@ -5787,7 +5758,7 @@ const FlowNavigation = ({
|
|
|
5787
5758
|
}),
|
|
5788
5759
|
leftContent: /*#__PURE__*/jsxs(Fragment, {
|
|
5789
5760
|
children: [isSmall && displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5790
|
-
"aria-label": intl.formatMessage(messages$
|
|
5761
|
+
"aria-label": intl.formatMessage(messages$7.back),
|
|
5791
5762
|
onClick: onGoBack
|
|
5792
5763
|
}) : /*#__PURE__*/jsx("div", {
|
|
5793
5764
|
className: "np-flow-header__left",
|
|
@@ -6095,7 +6066,7 @@ const deprecatedPlacements = {
|
|
|
6095
6066
|
};
|
|
6096
6067
|
var Popover$2 = Popover$1;
|
|
6097
6068
|
|
|
6098
|
-
var messages$
|
|
6069
|
+
var messages$6 = defineMessages({
|
|
6099
6070
|
ariaLabel: {
|
|
6100
6071
|
id: "neptune.Info.ariaLabel"
|
|
6101
6072
|
}
|
|
@@ -6113,7 +6084,7 @@ const Info = ({
|
|
|
6113
6084
|
}) => {
|
|
6114
6085
|
const intl = useIntl();
|
|
6115
6086
|
const [open, setOpen] = useState(false);
|
|
6116
|
-
ariaLabel ??= intl.formatMessage(messages$
|
|
6087
|
+
ariaLabel ??= intl.formatMessage(messages$6.ariaLabel);
|
|
6117
6088
|
const isModal = presentation === InfoPresentation.MODAL;
|
|
6118
6089
|
const isSmall = size === Size.SMALL;
|
|
6119
6090
|
const buttonProps = {
|
|
@@ -6399,7 +6370,7 @@ const PolymorphicWithOverrides = /*#__PURE__*/forwardRef(function PolymorphicWit
|
|
|
6399
6370
|
});
|
|
6400
6371
|
});
|
|
6401
6372
|
|
|
6402
|
-
var messages$
|
|
6373
|
+
var messages$5 = defineMessages({
|
|
6403
6374
|
noResultsFound: {
|
|
6404
6375
|
id: "neptune.SelectInput.noResultsFound"
|
|
6405
6376
|
}
|
|
@@ -6762,6 +6733,7 @@ function SelectInputClearButton({
|
|
|
6762
6733
|
}
|
|
6763
6734
|
const noop = () => {};
|
|
6764
6735
|
function SelectInput({
|
|
6736
|
+
id,
|
|
6765
6737
|
name,
|
|
6766
6738
|
multiple,
|
|
6767
6739
|
placeholder,
|
|
@@ -6827,6 +6799,7 @@ function SelectInput({
|
|
|
6827
6799
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
6828
6800
|
value: {
|
|
6829
6801
|
ref: mergeRefs([ref, triggerRef]),
|
|
6802
|
+
id,
|
|
6830
6803
|
...mergeProps({
|
|
6831
6804
|
onClick: () => {
|
|
6832
6805
|
setOpen(prev => !prev);
|
|
@@ -7017,7 +6990,7 @@ function SelectInputOptions({
|
|
|
7017
6990
|
children: [/*#__PURE__*/jsx(CrossCircle, {
|
|
7018
6991
|
size: 16,
|
|
7019
6992
|
className: "np-select-input-options-status-icon"
|
|
7020
|
-
}), intl.formatMessage(messages$
|
|
6993
|
+
}), intl.formatMessage(messages$5.noResultsFound)]
|
|
7021
6994
|
}) : null, /*#__PURE__*/jsx("div", {
|
|
7022
6995
|
ref: listboxRef,
|
|
7023
6996
|
id: listboxId,
|
|
@@ -7683,7 +7656,7 @@ Money.propTypes = {
|
|
|
7683
7656
|
};
|
|
7684
7657
|
var Money$1 = Money;
|
|
7685
7658
|
|
|
7686
|
-
var messages$
|
|
7659
|
+
var messages$4 = defineMessages({
|
|
7687
7660
|
selectPlaceholder: {
|
|
7688
7661
|
id: "neptune.MoneyInput.Select.placeholder"
|
|
7689
7662
|
}
|
|
@@ -7775,8 +7748,7 @@ const parseNumber = ({
|
|
|
7775
7748
|
}
|
|
7776
7749
|
return Number(amount);
|
|
7777
7750
|
};
|
|
7778
|
-
const
|
|
7779
|
-
const inputKeyAllowlist = new Set([Key.PERIOD, Key.COMMA]);
|
|
7751
|
+
const allowedInputKeys = new Set(['Backspace', 'Delete', ',', '.', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'Enter', 'Escape', 'Tab']);
|
|
7780
7752
|
class MoneyInput extends Component {
|
|
7781
7753
|
static defaultProps = {
|
|
7782
7754
|
size: Size.LARGE,
|
|
@@ -7814,13 +7786,12 @@ class MoneyInput extends Component {
|
|
|
7814
7786
|
}
|
|
7815
7787
|
isInputAllowedForKeyEvent = event => {
|
|
7816
7788
|
const {
|
|
7817
|
-
keyCode,
|
|
7818
7789
|
metaKey,
|
|
7819
7790
|
key,
|
|
7820
7791
|
ctrlKey
|
|
7821
7792
|
} = event;
|
|
7822
7793
|
const isNumberKey = isNumber(parseInt(key, 10));
|
|
7823
|
-
return isNumberKey || metaKey || ctrlKey ||
|
|
7794
|
+
return isNumberKey || metaKey || ctrlKey || allowedInputKeys.has(key);
|
|
7824
7795
|
};
|
|
7825
7796
|
handleKeyDown = event => {
|
|
7826
7797
|
if (!this.isInputAllowedForKeyEvent(event)) {
|
|
@@ -8029,7 +8000,7 @@ class MoneyInput extends Component {
|
|
|
8029
8000
|
onClick: this.handleCustomAction,
|
|
8030
8001
|
children: this.props.customActionLabel
|
|
8031
8002
|
}) : undefined,
|
|
8032
|
-
placeholder: this.props.intl.formatMessage(messages$
|
|
8003
|
+
placeholder: this.props.intl.formatMessage(messages$4.selectPlaceholder),
|
|
8033
8004
|
filterable: true,
|
|
8034
8005
|
filterPlaceholder: this.props.searchPlaceholder,
|
|
8035
8006
|
disabled: disabled,
|
|
@@ -8240,6 +8211,12 @@ OverlayHeader.propTypes = {
|
|
|
8240
8211
|
};
|
|
8241
8212
|
var OverlayHeader$1 = OverlayHeader;
|
|
8242
8213
|
|
|
8214
|
+
var messages$3 = defineMessages({
|
|
8215
|
+
selectInputPlaceholder: {
|
|
8216
|
+
id: "neptune.PhoneNumberInput.SelectInput.placeholder"
|
|
8217
|
+
}
|
|
8218
|
+
});
|
|
8219
|
+
|
|
8243
8220
|
const countries = [{
|
|
8244
8221
|
name: 'Afghanistan',
|
|
8245
8222
|
iso2: 'AF',
|
|
@@ -9622,7 +9599,8 @@ const PhoneNumberInput = ({
|
|
|
9622
9599
|
disabledCountries = defaultDisabledCountries
|
|
9623
9600
|
}) => {
|
|
9624
9601
|
const {
|
|
9625
|
-
locale
|
|
9602
|
+
locale,
|
|
9603
|
+
formatMessage
|
|
9626
9604
|
} = useIntl();
|
|
9627
9605
|
const [internalValue, setInternalValue] = useState(() => {
|
|
9628
9606
|
const cleanValue = initialValue ? cleanNumber(initialValue) : null;
|
|
@@ -9673,7 +9651,7 @@ const PhoneNumberInput = ({
|
|
|
9673
9651
|
children: [/*#__PURE__*/jsx("div", {
|
|
9674
9652
|
className: "tw-telephone__country-select",
|
|
9675
9653
|
children: /*#__PURE__*/jsx(SelectInput, {
|
|
9676
|
-
placeholder:
|
|
9654
|
+
placeholder: formatMessage(messages$3.selectInputPlaceholder),
|
|
9677
9655
|
items: [...countriesByPrefix].map(([prefix, countries]) => ({
|
|
9678
9656
|
type: 'option',
|
|
9679
9657
|
value: prefix,
|
|
@@ -10029,6 +10007,7 @@ var en = {
|
|
|
10029
10007
|
"neptune.Info.ariaLabel": "More information",
|
|
10030
10008
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
10031
10009
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
10010
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Select an option...",
|
|
10032
10011
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
10033
10012
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
10034
10013
|
"neptune.Summary.statusDone": "Item done",
|
|
@@ -10660,17 +10639,17 @@ function Select({
|
|
|
10660
10639
|
}
|
|
10661
10640
|
};
|
|
10662
10641
|
const handleKeyDown = event => {
|
|
10663
|
-
switch (event.
|
|
10664
|
-
case
|
|
10665
|
-
case
|
|
10642
|
+
switch (event.key) {
|
|
10643
|
+
case 'ArrowUp':
|
|
10644
|
+
case 'ArrowDown':
|
|
10666
10645
|
if (open) {
|
|
10667
|
-
moveFocusWithDifference(event.
|
|
10646
|
+
moveFocusWithDifference(event.key === 'ArrowUp' ? -1 : 1);
|
|
10668
10647
|
} else {
|
|
10669
10648
|
setOpen(true);
|
|
10670
10649
|
}
|
|
10671
10650
|
stopPropagation$1(event);
|
|
10672
10651
|
break;
|
|
10673
|
-
case
|
|
10652
|
+
case ' ':
|
|
10674
10653
|
if (event.target !== searchBoxReference.current) {
|
|
10675
10654
|
if (open) {
|
|
10676
10655
|
selectKeyboardFocusedOption();
|
|
@@ -10680,7 +10659,7 @@ function Select({
|
|
|
10680
10659
|
stopPropagation$1(event);
|
|
10681
10660
|
}
|
|
10682
10661
|
break;
|
|
10683
|
-
case
|
|
10662
|
+
case 'Enter':
|
|
10684
10663
|
if (open) {
|
|
10685
10664
|
selectKeyboardFocusedOption();
|
|
10686
10665
|
} else {
|
|
@@ -10688,11 +10667,11 @@ function Select({
|
|
|
10688
10667
|
}
|
|
10689
10668
|
stopPropagation$1(event);
|
|
10690
10669
|
break;
|
|
10691
|
-
case
|
|
10670
|
+
case 'Escape':
|
|
10692
10671
|
handleCloseOptions();
|
|
10693
10672
|
stopPropagation$1(event);
|
|
10694
10673
|
break;
|
|
10695
|
-
case
|
|
10674
|
+
case 'Tab':
|
|
10696
10675
|
if (open) {
|
|
10697
10676
|
selectKeyboardFocusedOption();
|
|
10698
10677
|
}
|
|
@@ -11451,7 +11430,7 @@ const Switch = props => {
|
|
|
11451
11430
|
disabled
|
|
11452
11431
|
} = props;
|
|
11453
11432
|
const handleKeyDown = event => {
|
|
11454
|
-
if (event.
|
|
11433
|
+
if (event.key === ' ') {
|
|
11455
11434
|
event.preventDefault();
|
|
11456
11435
|
onClick();
|
|
11457
11436
|
}
|
|
@@ -11948,7 +11927,7 @@ class Tabs extends Component {
|
|
|
11948
11927
|
this.switchTab(index);
|
|
11949
11928
|
};
|
|
11950
11929
|
onKeyDown = index => event => {
|
|
11951
|
-
if (event && event.
|
|
11930
|
+
if (event && event.key === 'Enter') {
|
|
11952
11931
|
this.switchTab(index);
|
|
11953
11932
|
}
|
|
11954
11933
|
};
|
|
@@ -12550,16 +12529,16 @@ class Typeahead extends Component {
|
|
|
12550
12529
|
label: query
|
|
12551
12530
|
});
|
|
12552
12531
|
} else {
|
|
12553
|
-
switch (event.
|
|
12554
|
-
case
|
|
12532
|
+
switch (event.key) {
|
|
12533
|
+
case 'ArrowDown':
|
|
12555
12534
|
event.preventDefault();
|
|
12556
12535
|
this.moveFocusedOption(1);
|
|
12557
12536
|
break;
|
|
12558
|
-
case
|
|
12537
|
+
case 'ArrowUp':
|
|
12559
12538
|
event.preventDefault();
|
|
12560
12539
|
this.moveFocusedOption(-1);
|
|
12561
12540
|
break;
|
|
12562
|
-
case
|
|
12541
|
+
case 'Enter':
|
|
12563
12542
|
event.preventDefault();
|
|
12564
12543
|
if (options[keyboardFocusedOptionIndex]) {
|
|
12565
12544
|
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
@@ -12569,7 +12548,7 @@ class Typeahead extends Component {
|
|
|
12569
12548
|
});
|
|
12570
12549
|
}
|
|
12571
12550
|
break;
|
|
12572
|
-
case
|
|
12551
|
+
case 'Backspace':
|
|
12573
12552
|
if (multiple && !query && selected.length > 0) {
|
|
12574
12553
|
this.updateSelectedValue(selected.slice(0, -1));
|
|
12575
12554
|
}
|
|
@@ -14608,6 +14587,7 @@ var de = {
|
|
|
14608
14587
|
"neptune.Info.ariaLabel": "Weitere Informationen",
|
|
14609
14588
|
"neptune.Link.opensInNewTab": "(wird in einem neuen Tab geöffnet)",
|
|
14610
14589
|
"neptune.MoneyInput.Select.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
14590
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine der Möglichkeiten aus...",
|
|
14611
14591
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
14612
14592
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
14613
14593
|
"neptune.Summary.statusDone": "Schritt erledigt",
|
|
@@ -14665,6 +14645,7 @@ var es = {
|
|
|
14665
14645
|
"neptune.Info.ariaLabel": "Más información",
|
|
14666
14646
|
"neptune.Link.opensInNewTab": "(se abre en una pestaña nueva)",
|
|
14667
14647
|
"neptune.MoneyInput.Select.placeholder": "Selecciona una opción...",
|
|
14648
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selecciona una opción...",
|
|
14668
14649
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
14669
14650
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
14670
14651
|
"neptune.Summary.statusDone": "Apartado listo",
|
|
@@ -14722,6 +14703,7 @@ var fr = {
|
|
|
14722
14703
|
"neptune.Info.ariaLabel": "Plus d'informations",
|
|
14723
14704
|
"neptune.Link.opensInNewTab": "(ouvre dans un nouvel onglet)",
|
|
14724
14705
|
"neptune.MoneyInput.Select.placeholder": "Sélectionner une option...",
|
|
14706
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
|
|
14725
14707
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
14726
14708
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
14727
14709
|
"neptune.Summary.statusDone": "Validé",
|
|
@@ -14779,6 +14761,7 @@ var hu = {
|
|
|
14779
14761
|
"neptune.Info.ariaLabel": "További információ",
|
|
14780
14762
|
"neptune.Link.opensInNewTab": "(új lapon nyílik meg)",
|
|
14781
14763
|
"neptune.MoneyInput.Select.placeholder": "Válassz ki egy lehetőséget...",
|
|
14764
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Válassz ki egy lehetőséget...",
|
|
14782
14765
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
14783
14766
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
14784
14767
|
"neptune.Summary.statusDone": "Kész",
|
|
@@ -14836,6 +14819,7 @@ var id = {
|
|
|
14836
14819
|
"neptune.Info.ariaLabel": "Informasi lebih lanjut",
|
|
14837
14820
|
"neptune.Link.opensInNewTab": "(terbuka di tab baru)",
|
|
14838
14821
|
"neptune.MoneyInput.Select.placeholder": "Pilih opsi...",
|
|
14822
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Pilih opsi...",
|
|
14839
14823
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
14840
14824
|
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
14841
14825
|
"neptune.Summary.statusDone": "Item selesai",
|
|
@@ -14893,6 +14877,7 @@ var it = {
|
|
|
14893
14877
|
"neptune.Info.ariaLabel": "Maggiori informazioni",
|
|
14894
14878
|
"neptune.Link.opensInNewTab": "(si apre in una nuova scheda)",
|
|
14895
14879
|
"neptune.MoneyInput.Select.placeholder": "Seleziona un'opzione...",
|
|
14880
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Seleziona un'opzione...",
|
|
14896
14881
|
"neptune.Select.searchPlaceholder": "Cerca...",
|
|
14897
14882
|
"neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
|
|
14898
14883
|
"neptune.Summary.statusDone": "Completato",
|
|
@@ -14950,6 +14935,7 @@ var ja = {
|
|
|
14950
14935
|
"neptune.Info.ariaLabel": "詳細",
|
|
14951
14936
|
"neptune.Link.opensInNewTab": "(新しいタブで開きます)",
|
|
14952
14937
|
"neptune.MoneyInput.Select.placeholder": "選択してください...",
|
|
14938
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選択してください…",
|
|
14953
14939
|
"neptune.Select.searchPlaceholder": "検索... ",
|
|
14954
14940
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
14955
14941
|
"neptune.Summary.statusDone": "完了",
|
|
@@ -15007,6 +14993,7 @@ var pl = {
|
|
|
15007
14993
|
"neptune.Info.ariaLabel": "Więcej informacji",
|
|
15008
14994
|
"neptune.Link.opensInNewTab": "(otworzy się w nowej zakładce)",
|
|
15009
14995
|
"neptune.MoneyInput.Select.placeholder": "Wybierz opcję...",
|
|
14996
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Wybierz opcję...",
|
|
15010
14997
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
15011
14998
|
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
15012
14999
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
|
@@ -15064,6 +15051,7 @@ var pt = {
|
|
|
15064
15051
|
"neptune.Info.ariaLabel": "Mais informações",
|
|
15065
15052
|
"neptune.Link.opensInNewTab": "(abre em uma nova aba)",
|
|
15066
15053
|
"neptune.MoneyInput.Select.placeholder": "Escolha uma opção...",
|
|
15054
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Escolha uma opção...",
|
|
15067
15055
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
15068
15056
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
15069
15057
|
"neptune.Summary.statusDone": "Pronto",
|
|
@@ -15121,6 +15109,7 @@ var ro = {
|
|
|
15121
15109
|
"neptune.Info.ariaLabel": "Mai multe informații",
|
|
15122
15110
|
"neptune.Link.opensInNewTab": "(se deschide într-o filă nouă)",
|
|
15123
15111
|
"neptune.MoneyInput.Select.placeholder": "Selectează o opţiune...",
|
|
15112
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Selectează o opțiune...",
|
|
15124
15113
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
15125
15114
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
15126
15115
|
"neptune.Summary.statusDone": "Finalizat",
|
|
@@ -15178,6 +15167,7 @@ var ru = {
|
|
|
15178
15167
|
"neptune.Info.ariaLabel": "Подробнее",
|
|
15179
15168
|
"neptune.Link.opensInNewTab": "(откроется в новой вкладке)",
|
|
15180
15169
|
"neptune.MoneyInput.Select.placeholder": "Выберите вариант...",
|
|
15170
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Выберите вариант...",
|
|
15181
15171
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
15182
15172
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
15183
15173
|
"neptune.Summary.statusDone": "Этап завершен",
|
|
@@ -15235,6 +15225,7 @@ var th = {
|
|
|
15235
15225
|
"neptune.Info.ariaLabel": "ข้อมูลเพิ่มเติม",
|
|
15236
15226
|
"neptune.Link.opensInNewTab": "(เปิดในแท็บใหม่)",
|
|
15237
15227
|
"neptune.MoneyInput.Select.placeholder": "เลือกตัวเลือก...",
|
|
15228
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
15238
15229
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
15239
15230
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
15240
15231
|
"neptune.Summary.statusDone": "รายการที่ทำแล้ว",
|
|
@@ -15292,6 +15283,7 @@ var tr = {
|
|
|
15292
15283
|
"neptune.Info.ariaLabel": "Daha fazla bilgi",
|
|
15293
15284
|
"neptune.Link.opensInNewTab": "(yeni sekmede açılır)",
|
|
15294
15285
|
"neptune.MoneyInput.Select.placeholder": "Bir seçenek seçin...",
|
|
15286
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "Bir seçenek seçin...",
|
|
15295
15287
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
15296
15288
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
15297
15289
|
"neptune.Summary.statusDone": "Tamamlanan aşama",
|
|
@@ -15406,6 +15398,7 @@ var zhCN = {
|
|
|
15406
15398
|
"neptune.Info.ariaLabel": "更多信息",
|
|
15407
15399
|
"neptune.Link.opensInNewTab": "(在新标签页中打开)",
|
|
15408
15400
|
"neptune.MoneyInput.Select.placeholder": "请选择...",
|
|
15401
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择一个选项...",
|
|
15409
15402
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
15410
15403
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
15411
15404
|
"neptune.Summary.statusDone": "已完成",
|
|
@@ -15463,6 +15456,7 @@ var zhHK = {
|
|
|
15463
15456
|
"neptune.Info.ariaLabel": "更多資訊",
|
|
15464
15457
|
"neptune.Link.opensInNewTab": "(在新分頁中開啟)",
|
|
15465
15458
|
"neptune.MoneyInput.Select.placeholder": "選擇一個選項…",
|
|
15459
|
+
"neptune.PhoneNumberInput.SelectInput.placeholder": "選擇其中一項…",
|
|
15466
15460
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
15467
15461
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
15468
15462
|
"neptune.Summary.statusDone": "已完成事項",
|