wf-react-day-picker 0.0.1-security → 2.653.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of wf-react-day-picker might be problematic. Click here for more details.

@@ -0,0 +1,65 @@
1
+ import React, {Component} from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ export default class Weekdays extends Component {
5
+ static propTypes = {
6
+ classNames: PropTypes.shape({
7
+ weekday: PropTypes.node.isRequired,
8
+ weekdays: PropTypes.node.isRequired,
9
+ weekdaysRow: PropTypes.node.isRequired,
10
+ }).isRequired,
11
+
12
+ firstDayOfWeek: PropTypes.number.isRequired,
13
+ weekdaysLong: PropTypes.arrayOf(PropTypes.node),
14
+ weekdaysShort: PropTypes.arrayOf(PropTypes.node),
15
+ showWeekNumbers: PropTypes.bool,
16
+ locale: PropTypes.string.isRequired,
17
+ localeUtils: PropTypes.object.isRequired,
18
+ weekdayElement: PropTypes.oneOfType([
19
+ PropTypes.element,
20
+ PropTypes.func,
21
+ PropTypes.instanceOf(React.Component),
22
+ ]),
23
+ };
24
+ shouldComponentUpdate(nextProps) {
25
+ return this.props !== nextProps;
26
+ }
27
+ render() {
28
+ const {
29
+ classNames,
30
+ firstDayOfWeek,
31
+ showWeekNumbers,
32
+ weekdaysLong,
33
+ weekdaysShort,
34
+ locale,
35
+ localeUtils,
36
+ weekdayElement,
37
+ } = this.props;
38
+ const days = [];
39
+ for (let i = 0; i < 7; i += 1) {
40
+ const weekday = (i + firstDayOfWeek) % 7;
41
+ const elementProps = {
42
+ key: i,
43
+ className: classNames.weekday,
44
+ weekday,
45
+ weekdaysLong,
46
+ weekdaysShort,
47
+ localeUtils,
48
+ locale,
49
+ };
50
+ const element = React.isValidElement(weekdayElement)
51
+ ? React.cloneElement(weekdayElement, elementProps)
52
+ : React.createElement(weekdayElement, elementProps);
53
+ days.push(element);
54
+ }
55
+
56
+ return (
57
+ <div className={classNames.weekdays} role="rowgroup">
58
+ <div className={classNames.weekdaysRow} role="row">
59
+ {showWeekNumbers && <div className={classNames.weekday} />}
60
+ {days}
61
+ </div>
62
+ </div>
63
+ );
64
+ }
65
+ }
@@ -0,0 +1,31 @@
1
+ // Proxy object to map classnames when css modules are not used
2
+
3
+ export default {
4
+ container: 'DayPicker',
5
+ wrapper: 'DayPicker-wrapper',
6
+ interactionDisabled: 'DayPicker--interactionDisabled',
7
+ months: 'DayPicker-Months',
8
+ month: 'DayPicker-Month',
9
+
10
+ navBar: 'DayPicker-NavBar',
11
+ navButtonPrev: 'DayPicker-NavButton DayPicker-NavButton--prev',
12
+ navButtonNext: 'DayPicker-NavButton DayPicker-NavButton--next',
13
+ navButtonInteractionDisabled: 'DayPicker-NavButton--interactionDisabled',
14
+
15
+ caption: 'DayPicker-Caption',
16
+ weekdays: 'DayPicker-Weekdays',
17
+ weekdaysRow: 'DayPicker-WeekdaysRow',
18
+ weekday: 'DayPicker-Weekday',
19
+ body: 'DayPicker-Body',
20
+ week: 'DayPicker-Week',
21
+ weekNumber: 'DayPicker-WeekNumber',
22
+ day: 'DayPicker-Day',
23
+ footer: 'DayPicker-Footer',
24
+ todayButton: 'DayPicker-TodayButton',
25
+
26
+ // default modifiers
27
+ today: 'today',
28
+ selected: 'selected',
29
+ disabled: 'disabled',
30
+ outside: 'outside',
31
+ };
package/src/keys.js ADDED
@@ -0,0 +1,8 @@
1
+ export const LEFT = 37;
2
+ export const UP = 38;
3
+ export const RIGHT = 39;
4
+ export const DOWN = 40;
5
+ export const ENTER = 13;
6
+ export const SPACE = 32;
7
+ export const ESC = 27;
8
+ export const TAB = 9;
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=wf-react-day-picker for more information.