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.
- package/index.js +29 -0
- package/package.json +17 -3
- package/src/Caption.js +56 -0
- package/src/DateUtils.js +227 -0
- package/src/Day.js +157 -0
- package/src/DayPicker.js +601 -0
- package/src/DayPickerInput.js +611 -0
- package/src/Helpers.js +145 -0
- package/src/LocaleUtils.js +59 -0
- package/src/ModifiersUtils.js +72 -0
- package/src/Month.js +218 -0
- package/src/Navbar.js +147 -0
- package/src/Weekday.js +45 -0
- package/src/Weekdays.js +65 -0
- package/src/classNames.js +31 -0
- package/src/keys.js +8 -0
- package/README.md +0 -5
package/src/Weekdays.js
ADDED
@@ -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
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.
|