Skip to content

Commit 90cf8be

Browse files
committed
chore(deps): update dependencies
affects: @datepicker-react/hooks, @datepicker-react/styled
1 parent eae4f52 commit 90cf8be

File tree

7 files changed

+467
-495
lines changed

7 files changed

+467
-495
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454
"@storybook/addon-viewport": "^5.3.19",
5555
"@storybook/addons": "^5.3.19",
5656
"@storybook/react": "^5.3.19",
57-
"@testing-library/jest-dom": "^5.9.0",
57+
"@testing-library/jest-dom": "^5.10.1",
5858
"@testing-library/react": "^10.2.1",
5959
"@testing-library/react-hooks": "^3.3.0",
6060
"@types/jest": "^26.0.0",
6161
"@types/node": "^13.7.4",
62-
"@types/react": "^16.9.35",
62+
"@types/react": "^16.9.38",
6363
"@types/react-dom": "^16.9.8",
64-
"@typescript-eslint/eslint-plugin": "^3.2.0",
65-
"@typescript-eslint/parser": "^3.2.0",
64+
"@typescript-eslint/eslint-plugin": "^3.3.0",
65+
"@typescript-eslint/parser": "^3.3.0",
6666
"awesome-typescript-loader": "^5.2.1",
6767
"babel-eslint": "^10.1.0",
6868
"babel-loader": "^8.1.0",
@@ -74,12 +74,12 @@
7474
"eslint-config-prettier": "^6.11.0",
7575
"eslint-config-react-app": "^5.2.1",
7676
"eslint-plugin-flowtype": "^5.1.3",
77-
"eslint-plugin-import": "^2.21.1",
77+
"eslint-plugin-import": "^2.21.2",
7878
"eslint-plugin-jsx-a11y": "^6.2.3",
7979
"eslint-plugin-react": "^7.20.0",
8080
"eslint-plugin-react-hooks": "^4.0.4",
8181
"husky": "^4.2.5",
82-
"is-ci-cli": "^2.0.0",
82+
"is-ci-cli": "^2.1.1",
8383
"jest": "^26.0.1",
8484
"jest-config": "^26.0.1",
8585
"jest-date-mock": "^1.0.8",
@@ -91,14 +91,14 @@
9191
"jest-watch-select-projects": "^2.0.0",
9292
"jest-watch-typeahead": "^0.6.0",
9393
"lerna": "^3.22.1",
94-
"lint-staged": "^10.2.9",
94+
"lint-staged": "^10.2.11",
9595
"npm-run-all": "^4.1.5",
9696
"prettier": "^2.0.5",
9797
"react": "^16.13.1",
9898
"react-dom": "^16.13.1",
9999
"react-test-renderer": "^16.13.1",
100100
"rimraf": "^3.0.2",
101-
"rollup": "^2.15.0",
101+
"rollup": "^2.16.1",
102102
"rollup-plugin-analyzer": "^3.2.3",
103103
"rollup-plugin-babel": "^4.4.0",
104104
"rollup-plugin-commonjs": "^10.1.0",
@@ -132,7 +132,7 @@
132132
]
133133
},
134134
"resolutions": {
135-
"@types/react": "^16.9.35"
135+
"@types/react": "^16.9.38"
136136
},
137137
"name": "react-datepicker"
138138
}

packages/hooks/lib/index.cjs.js

Lines changed: 58 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ function S(t) {
566566
a = (r < e ? 7 : 0) + r - e
567567
return n.setUTCDate(n.getUTCDate() - a), n.setUTCHours(0, 0, 0, 0), n
568568
}
569-
function E(t) {
569+
function P(t) {
570570
d(1, arguments)
571571
var e = l(t),
572572
n = e.getUTCFullYear(),
@@ -578,18 +578,18 @@ function E(t) {
578578
var o = S(i)
579579
return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= o.getTime() ? n : n - 1
580580
}
581-
function P(t) {
581+
function Y(t) {
582582
d(1, arguments)
583-
var e = E(t),
583+
var e = P(t),
584584
n = new Date(0)
585585
n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0)
586586
var r = S(n)
587587
return r
588588
}
589-
function Y(t) {
589+
function E(t) {
590590
d(1, arguments)
591591
var e = l(t),
592-
n = S(e).getTime() - P(e).getTime()
592+
n = S(e).getTime() - Y(e).getTime()
593593
return Math.round(n / 6048e5) + 1
594594
}
595595
function N(t, e) {
@@ -1030,7 +1030,7 @@ var mt = {
10301030
d(2, arguments)
10311031
var n = l(t),
10321032
r = c(e),
1033-
a = Y(n) - r
1033+
a = E(n) - r
10341034
return n.setUTCDate(n.getUTCDate() - 7 * a), n
10351035
})(t, n, r),
10361036
r,
@@ -1661,13 +1661,13 @@ var Ct = function (t, e) {
16611661
St = function (t, e) {
16621662
return xt(t.getUTCHours() % 12 || 12, e.length)
16631663
},
1664-
Et = function (t, e) {
1664+
Pt = function (t, e) {
16651665
return xt(t.getUTCHours(), e.length)
16661666
},
1667-
Pt = function (t, e) {
1667+
Yt = function (t, e) {
16681668
return xt(t.getUTCMinutes(), e.length)
16691669
},
1670-
Yt = function (t, e) {
1670+
Et = function (t, e) {
16711671
return xt(t.getUTCSeconds(), e.length)
16721672
},
16731673
Nt = function (t, e) {
@@ -1714,7 +1714,7 @@ var qt = 'midnight',
17141714
: xt(i, e.length)
17151715
},
17161716
R: function (t, e) {
1717-
return xt(E(t), e.length)
1717+
return xt(P(t), e.length)
17181718
},
17191719
u: function (t, e) {
17201720
return xt(t.getUTCFullYear(), e.length)
@@ -1795,7 +1795,7 @@ var qt = 'midnight',
17951795
return 'wo' === e ? n.ordinalNumber(a, {unit: 'week'}) : xt(a, e.length)
17961796
},
17971797
I: function (t, e, n) {
1798-
var r = Y(t)
1798+
var r = E(t)
17991799
return 'Io' === e ? n.ordinalNumber(r, {unit: 'week'}) : xt(r, e.length)
18001800
},
18011801
d: function (t, e, n) {
@@ -1944,7 +1944,7 @@ var qt = 'midnight',
19441944
return St(t, e)
19451945
},
19461946
H: function (t, e, n) {
1947-
return 'Ho' === e ? n.ordinalNumber(t.getUTCHours(), {unit: 'hour'}) : Et(t, e)
1947+
return 'Ho' === e ? n.ordinalNumber(t.getUTCHours(), {unit: 'hour'}) : Pt(t, e)
19481948
},
19491949
K: function (t, e, n) {
19501950
var r = t.getUTCHours() % 12
@@ -1955,10 +1955,10 @@ var qt = 'midnight',
19551955
return 0 === r && (r = 24), 'ko' === e ? n.ordinalNumber(r, {unit: 'hour'}) : xt(r, e.length)
19561956
},
19571957
m: function (t, e, n) {
1958-
return 'mo' === e ? n.ordinalNumber(t.getUTCMinutes(), {unit: 'minute'}) : Pt(t, e)
1958+
return 'mo' === e ? n.ordinalNumber(t.getUTCMinutes(), {unit: 'minute'}) : Yt(t, e)
19591959
},
19601960
s: function (t, e, n) {
1961-
return 'so' === e ? n.ordinalNumber(t.getUTCSeconds(), {unit: 'second'}) : Yt(t, e)
1961+
return 'so' === e ? n.ordinalNumber(t.getUTCSeconds(), {unit: 'second'}) : Et(t, e)
19621962
},
19631963
S: function (t, e) {
19641964
return Nt(t, e)
@@ -2420,38 +2420,38 @@ function pe(t) {
24202420
})
24212421
.join('')
24222422
.match(wt),
2423-
E = []
2423+
P = []
24242424
for (C = 0; C < S.length; C++) {
2425-
var P = S[C]
2426-
!o.useAdditionalWeekYearTokens && k(P) && x(P),
2427-
!o.useAdditionalDayOfYearTokens && T(P) && x(P)
2428-
var Y = P[0],
2429-
N = mt[Y]
2425+
var Y = S[C]
2426+
!o.useAdditionalWeekYearTokens && k(Y) && x(Y),
2427+
!o.useAdditionalDayOfYearTokens && T(Y) && x(Y)
2428+
var E = Y[0],
2429+
N = mt[E]
24302430
if (N) {
24312431
var q = N.incompatibleTokens
24322432
if (Array.isArray(q)) {
2433-
for (var B = void 0, O = 0; O < E.length; O++) {
2434-
var H = E[O].token
2435-
if (-1 !== q.indexOf(H) || H === Y) {
2436-
B = E[O]
2433+
for (var B = void 0, O = 0; O < P.length; O++) {
2434+
var H = P[O].token
2435+
if (-1 !== q.indexOf(H) || H === E) {
2436+
B = P[O]
24372437
break
24382438
}
24392439
}
24402440
if (B)
24412441
throw new RangeError(
24422442
"The format string mustn't contain `"
24432443
.concat(B.fullToken, '` and `')
2444-
.concat(P, '` at the same time'),
2444+
.concat(Y, '` at the same time'),
24452445
)
2446-
} else if ('*' === N.incompatibleTokens && E.length)
2446+
} else if ('*' === N.incompatibleTokens && P.length)
24472447
throw new RangeError(
24482448
"The format string mustn't contain `".concat(
2449-
P,
2449+
Y,
24502450
'` and any other token at the same time',
24512451
),
24522452
)
2453-
E.push({token: Y, fullToken: P})
2454-
var L = N.parse(a, P, u.match, M)
2453+
P.push({token: E, fullToken: Y})
2454+
var L = N.parse(a, Y, u.match, M)
24552455
if (!L) return new Date(NaN)
24562456
U.push({
24572457
priority: N.priority,
@@ -2462,13 +2462,13 @@ function pe(t) {
24622462
}),
24632463
(a = L.rest)
24642464
} else {
2465-
if (Y.match(pt))
2465+
if (E.match(pt))
24662466
throw new RangeError(
2467-
'Format string contains an unescaped latin alphabet character `' + Y + '`',
2467+
'Format string contains an unescaped latin alphabet character `' + E + '`',
24682468
)
2469-
if (("''" === P ? (P = "'") : "'" === Y && (P = Tt(P)), 0 !== a.indexOf(P)))
2469+
if (("''" === Y ? (Y = "'") : "'" === E && (Y = Tt(Y)), 0 !== a.indexOf(Y)))
24702470
return new Date(NaN)
2471-
a = a.slice(P.length)
2471+
a = a.slice(Y.length)
24722472
}
24732473
}
24742474
if (a.length > 0 && bt.test(a)) return new Date(NaN)
@@ -2536,7 +2536,7 @@ function pe(t) {
25362536
M = x[1],
25372537
U = t.useState(n),
25382538
S = U[0],
2539-
E = U[1]
2539+
P = U[1]
25402540
t.useEffect(function () {
25412541
return (
25422542
'undefined' != typeof window && window.addEventListener('keydown', q),
@@ -2545,11 +2545,11 @@ function pe(t) {
25452545
}
25462546
)
25472547
})
2548-
var P = function (t) {
2548+
var Y = function (t) {
25492549
return fe(p, t) || y(t)
25502550
},
2551-
Y = function (t) {
2552-
E(t), (!S || (S && !de(t, S))) && k(ye(m, t))
2551+
E = function (t) {
2552+
P(t), (!S || (S && !de(t, S))) && k(ye(m, t))
25532553
},
25542554
N = function (t) {
25552555
return we({
@@ -2559,7 +2559,7 @@ function pe(t) {
25592559
startDate: n,
25602560
endDate: r,
25612561
minBookingDays: f,
2562-
isDateBlockedFn: P,
2562+
isDateBlockedFn: Y,
25632563
})
25642564
}
25652565
function q(t) {
@@ -2571,7 +2571,7 @@ function pe(t) {
25712571
!S
25722572
) {
25732573
var e = T[0]
2574-
Y(e.date), k(ye(m, e.date))
2574+
E(e.date), k(ye(m, e.date))
25752575
}
25762576
}
25772577
return {
@@ -2608,7 +2608,7 @@ function pe(t) {
26082608
endDate: r,
26092609
minBookingDays: f,
26102610
exactMinBookingDays: d,
2611-
isDateBlocked: P,
2611+
isDateBlocked: Y,
26122612
})
26132613
},
26142614
isFirstOrLastSelectedDate: function (t) {
@@ -2650,46 +2650,46 @@ function pe(t) {
26502650
exactMinBookingDays: d,
26512651
minBookingDate: i,
26522652
maxBookingDate: o,
2653-
isDateBlocked: P,
2653+
isDateBlocked: Y,
26542654
startDate: t,
26552655
endDate: null,
26562656
})
26572657
? u({startDate: t, endDate: Jt(t, f - 1), focusedInput: null})
26582658
: (('endDate' === a && n && oe(t, n)) || ('startDate' === a && r && ue(t, r))) &&
26592659
!d &&
2660-
pe({minBookingDays: f, isDateBlocked: P, startDate: t, endDate: null})
2660+
pe({minBookingDays: f, isDateBlocked: Y, startDate: t, endDate: null})
26612661
? u({endDate: null, startDate: t, focusedInput: 'endDate'})
26622662
: 'startDate' === a &&
26632663
!d &&
2664-
pe({minBookingDays: f, isDateBlocked: P, endDate: r, startDate: t})
2664+
pe({minBookingDays: f, isDateBlocked: Y, endDate: r, startDate: t})
26652665
? u({endDate: r, startDate: t, focusedInput: 'endDate'})
26662666
: 'startDate' === a &&
26672667
!d &&
2668-
pe({minBookingDays: f, isDateBlocked: P, endDate: null, startDate: t})
2668+
pe({minBookingDays: f, isDateBlocked: Y, endDate: null, startDate: t})
26692669
? u({endDate: null, startDate: t, focusedInput: 'endDate'})
26702670
: 'endDate' === a &&
26712671
n &&
26722672
!oe(t, n) &&
26732673
!d &&
2674-
pe({minBookingDays: f, isDateBlocked: P, startDate: n, endDate: t}) &&
2674+
pe({minBookingDays: f, isDateBlocked: Y, startDate: n, endDate: t}) &&
26752675
u({startDate: n, endDate: t, focusedInput: null}),
26762676
'endDate' === a || (S && (!S || de(t, S))) || k(ye(m, t))
26772677
},
2678-
onDateFocus: Y,
2678+
onDateFocus: E,
26792679
goToPreviousMonths: function () {
2680-
k(be(T, m, -1)), E(null)
2680+
k(be(T, m, -1)), P(null)
26812681
},
26822682
goToNextMonths: function () {
2683-
k(be(T, m, 1)), E(null)
2683+
k(be(T, m, 1)), P(null)
26842684
},
26852685
goToDate: function (t) {
2686-
k(ye(m, t)), E(null)
2686+
k(ye(m, t)), P(null)
26872687
},
26882688
goToPreviousYear: function (t) {
2689-
void 0 === t && (t = 1), k(be(T, m, -(12 * t - m + 1))), E(null)
2689+
void 0 === t && (t = 1), k(be(T, m, -(12 * t - m + 1))), P(null)
26902690
},
26912691
goToNextYear: function (t) {
2692-
void 0 === t && (t = 1), k(be(T, m, 12 * t - m + 1)), E(null)
2692+
void 0 === t && (t = 1), k(be(T, m, 12 * t - m + 1)), P(null)
26932693
},
26942694
}
26952695
}),
@@ -2704,32 +2704,25 @@ function pe(t) {
27042704
c = e.onDateSelect,
27052705
d = e.onDateFocus,
27062706
l = e.onDateHover,
2707-
f = e.dayRef,
2708-
h = t.useCallback(
2707+
f = t.useCallback(
27092708
function () {
27102709
return c(n)
27112710
},
27122711
[n, c],
27132712
),
2714-
m = t.useCallback(
2713+
h = t.useCallback(
27152714
function () {
27162715
return l(n)
27172716
},
27182717
[n, l],
2719-
)
2720-
t.useEffect(
2721-
function () {
2722-
f && f.current && i(n) && f.current.focus()
2723-
},
2724-
[f, n, i],
2725-
)
2726-
var w = s(n) && !u(n)
2718+
),
2719+
m = s(n) && !u(n)
27272720
return {
27282721
tabIndex: null === r || i(n) ? 0 : -1,
27292722
isSelected: a(n),
27302723
isSelectedStartOrEnd: o(n),
27312724
isWithinHoverRange: u(n),
2732-
disabledDate: w,
2725+
disabledDate: m,
27332726
onKeyDown: function (t) {
27342727
'ArrowRight' === t.key
27352728
? d(Jt(n, 1))
@@ -2739,8 +2732,8 @@ function pe(t) {
27392732
? d(Jt(n, -7))
27402733
: 'ArrowDown' === t.key && d(Jt(n, 7))
27412734
},
2742-
onClick: w ? function () {} : h,
2743-
onMouseEnter: m,
2735+
onClick: m ? function () {} : f,
2736+
onMouseEnter: h,
27442737
}
27452738
}),
27462739
(exports.useMonth = function (e) {

0 commit comments

Comments
 (0)