@transferwise/components 0.0.0-experimental-35d02b6 → 0.0.0-experimental-8f9699a
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/index.esm.js +11 -14
- package/build/index.esm.js.map +1 -1
- package/build/index.js +11 -14
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts +2 -6
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/dateLookup/DateLookup.css +1 -1
- package/src/dateLookup/DateLookup.less +4 -11
- package/src/dateLookup/dayCalendar/table/DayCalendarTable.js +9 -2
- package/src/dateLookup/tableLink/TableLink.spec.js +6 -15
- package/src/dateLookup/tableLink/TableLink.tsx +6 -7
- package/src/dateLookup/yearCalendar/table/YearCalendarTable.js +3 -3
- package/src/main.css +1 -1
package/build/index.js
CHANGED
|
@@ -3633,12 +3633,10 @@ const TableLink = ({
|
|
|
3633
3633
|
disabled,
|
|
3634
3634
|
today,
|
|
3635
3635
|
autofocus,
|
|
3636
|
-
onClick
|
|
3637
|
-
intl: {
|
|
3638
|
-
formatMessage
|
|
3639
|
-
}
|
|
3636
|
+
onClick
|
|
3640
3637
|
}) => {
|
|
3641
3638
|
const buttonRef = React.useRef(null);
|
|
3639
|
+
const intl = reactIntl.useIntl();
|
|
3642
3640
|
React.useEffect(() => {
|
|
3643
3641
|
if (autofocus) {
|
|
3644
3642
|
setTimeout(() => {
|
|
@@ -3654,7 +3652,7 @@ const TableLink = ({
|
|
|
3654
3652
|
};
|
|
3655
3653
|
const calculateAriaLabel = () => {
|
|
3656
3654
|
if (active) {
|
|
3657
|
-
return `${longTitle || title || ''}, ${formatMessage(messages$6.selected)} ${formatMessage(messages$6[type])}`;
|
|
3655
|
+
return `${longTitle || title || ''}, ${intl.formatMessage(messages$6.selected)} ${intl.formatMessage(messages$6[type])}`;
|
|
3658
3656
|
}
|
|
3659
3657
|
return longTitle || title;
|
|
3660
3658
|
};
|
|
@@ -3676,7 +3674,6 @@ const TableLink = ({
|
|
|
3676
3674
|
})
|
|
3677
3675
|
});
|
|
3678
3676
|
};
|
|
3679
|
-
var TableLink$1 = reactIntl.injectIntl(TableLink);
|
|
3680
3677
|
|
|
3681
3678
|
const SHORT_DAY_FORMAT = {
|
|
3682
3679
|
day: 'numeric'
|
|
@@ -3778,7 +3775,7 @@ class DayCalendarTable extends React.PureComponent {
|
|
|
3778
3775
|
children: [/*#__PURE__*/jsxRuntime.jsx("thead", {
|
|
3779
3776
|
children: /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
3780
3777
|
children: this.days.map((day, index) => /*#__PURE__*/jsxRuntime.jsxs("th", {
|
|
3781
|
-
className:
|
|
3778
|
+
className: index > 4 ? 'text-xs-center np-text-body-default' : 'text-xs-center np-text-body-default-bold',
|
|
3782
3779
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3783
3780
|
className: "hidden-xs",
|
|
3784
3781
|
children: /*#__PURE__*/jsxRuntime.jsx("abbr", {
|
|
@@ -3797,8 +3794,8 @@ class DayCalendarTable extends React.PureComponent {
|
|
|
3797
3794
|
}), /*#__PURE__*/jsxRuntime.jsx("tbody", {
|
|
3798
3795
|
children: weeks.map((week, weekIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
|
|
3799
3796
|
children: week.map((day, dayIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
|
|
3800
|
-
className: dayIndex > 4 ? '
|
|
3801
|
-
children: day && /*#__PURE__*/jsxRuntime.jsx(TableLink
|
|
3797
|
+
className: dayIndex > 4 ? 'weekend' : '',
|
|
3798
|
+
children: day && /*#__PURE__*/jsxRuntime.jsx(TableLink, {
|
|
3802
3799
|
item: day,
|
|
3803
3800
|
type: "day",
|
|
3804
3801
|
title: formatting.formatDate(new Date(viewYear, viewMonth, day), locale, SHORT_DAY_FORMAT),
|
|
@@ -3922,7 +3919,7 @@ const MonthCalendarTable = ({
|
|
|
3922
3919
|
locale
|
|
3923
3920
|
} = reactIntl.useIntl();
|
|
3924
3921
|
const getLink = month => {
|
|
3925
|
-
return /*#__PURE__*/jsxRuntime.jsx(TableLink
|
|
3922
|
+
return /*#__PURE__*/jsxRuntime.jsx(TableLink, {
|
|
3926
3923
|
item: month,
|
|
3927
3924
|
type: "month",
|
|
3928
3925
|
title: formatting.formatDate(new Date(viewYear, month), locale, MONTH_ONLY_FORMAT),
|
|
@@ -4071,19 +4068,19 @@ const YearCalendarTable = ({
|
|
|
4071
4068
|
} = reactIntl.useIntl();
|
|
4072
4069
|
const startYear = viewYear - viewYear % 20;
|
|
4073
4070
|
const getLink = year => {
|
|
4074
|
-
return /*#__PURE__*/jsxRuntime.jsx(TableLink
|
|
4071
|
+
return /*#__PURE__*/jsxRuntime.jsx(TableLink, {
|
|
4075
4072
|
item: year,
|
|
4076
4073
|
type: "year",
|
|
4077
4074
|
title: formatting.formatDate(new Date(year, 0), locale, YEAR_ONLY_FORMAT),
|
|
4078
|
-
active:
|
|
4075
|
+
active: isActive(year),
|
|
4079
4076
|
disabled: isDisabled(year),
|
|
4080
|
-
today: year
|
|
4077
|
+
today: isThisYear(year),
|
|
4081
4078
|
autofocus: autofocusYear === year,
|
|
4082
4079
|
onClick: onSelect
|
|
4083
4080
|
});
|
|
4084
4081
|
};
|
|
4085
4082
|
const isActive = year => {
|
|
4086
|
-
return selectedDate && year === selectedDate.getFullYear();
|
|
4083
|
+
return !!(selectedDate && year === selectedDate.getFullYear());
|
|
4087
4084
|
};
|
|
4088
4085
|
const isThisYear = year => {
|
|
4089
4086
|
return year === new Date().getFullYear();
|