diff --git a/dist/DateRangePicker.js b/dist/DateRangePicker.js index 1a264c49..d01b85e7 100644 --- a/dist/DateRangePicker.js +++ b/dist/DateRangePicker.js @@ -10,9 +10,11 @@ var _reactAddons = require('react/addons'); var _reactAddons2 = _interopRequireDefault(_reactAddons); -var _momentRange = require('moment-range'); +var _moment = require('moment'); -var _momentRange2 = _interopRequireDefault(_momentRange); +var _moment2 = _interopRequireDefault(_moment); + +require('moment-range'); var _immutable = require('immutable'); @@ -51,8 +53,8 @@ var _utilsIsMomentRange = require('./utils/isMomentRange'); var _utilsIsMomentRange2 = _interopRequireDefault(_utilsIsMomentRange); var PureRenderMixin = _reactAddons2['default'].addons.PureRenderMixin; -var absoluteMinimum = (0, _momentRange2['default'])(new Date(-8640000000000000 / 2)).startOf('day'); -var absoluteMaximum = (0, _momentRange2['default'])(new Date(8640000000000000 / 2)).startOf('day'); +var absoluteMinimum = (0, _moment2['default'])(new Date(-8640000000000000 / 2)).startOf('day'); +var absoluteMaximum = (0, _moment2['default'])(new Date(8640000000000000 / 2)).startOf('day'); _reactAddons2['default'].initializeTouchEvents(true); @@ -89,7 +91,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ singleDateRange: _reactAddons2['default'].PropTypes.bool, showLegend: _reactAddons2['default'].PropTypes.bool, stateDefinitions: _reactAddons2['default'].PropTypes.object, - value: _utilsCustomPropTypes2['default'].momentOrMomentRange }, + value: _utilsCustomPropTypes2['default'].momentOrMomentRange + }, getDefaultProps: function getDefaultProps() { var date = new Date(); @@ -111,13 +114,16 @@ var DateRangePicker = _reactAddons2['default'].createClass({ '__default': { color: null, selectable: true, - label: null } }, - selectedLabel: 'Your selected dates', + label: null + } + }, + selectedLabel: "Your selected dates", defaultState: '__default', dateStates: [], showLegend: false, onSelect: noop, - paginationArrowComponent: _PaginationArrow2['default'] }; + paginationArrowComponent: _PaginationArrow2['default'] + }; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { @@ -126,7 +132,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ this.setState({ dateStates: this.state.dateStates && _immutable2['default'].is(this.state.dateStates, nextDateStates) ? this.state.dateStates : nextDateStates, - enabledRange: this.state.enabledRange && this.state.enabledRange.isSame(nextEnabledRange) ? this.state.enabledRange : nextEnabledRange }); + enabledRange: this.state.enabledRange && this.state.enabledRange.isSame(nextEnabledRange) ? this.state.enabledRange : nextEnabledRange + }); }, getInitialState: function getInitialState() { @@ -165,14 +172,15 @@ var DateRangePicker = _reactAddons2['default'].createClass({ highlightRange: null, hideSelection: false, enabledRange: this.getEnabledRange(this.props), - dateStates: this.getDateStates(this.props) }; + dateStates: this.getDateStates(this.props) + }; }, getEnabledRange: function getEnabledRange(props) { - var min = props.minimumDate ? (0, _momentRange2['default'])(props.minimumDate).startOf('day') : absoluteMinimum; - var max = props.maximumDate ? (0, _momentRange2['default'])(props.maximumDate).startOf('day') : absoluteMaximum; + var min = props.minimumDate ? (0, _moment2['default'])(props.minimumDate).startOf('day') : absoluteMinimum; + var max = props.maximumDate ? (0, _moment2['default'])(props.maximumDate).startOf('day') : absoluteMaximum; - return _momentRange2['default'].range(min, max); + return _moment2['default'].range(min, max); }, getDateStates: function getDateStates(props) { @@ -183,7 +191,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ var actualStates = []; var minDate = absoluteMinimum; var maxDate = absoluteMaximum; - var dateCursor = (0, _momentRange2['default'])(minDate).startOf('day'); + var dateCursor = (0, _moment2['default'])(minDate).startOf('day'); var defs = _immutable2['default'].fromJS(stateDefinitions); @@ -195,7 +203,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ if (!dateCursor.isSame(start, 'day')) { actualStates.push({ state: defaultState, - range: _momentRange2['default'].range(dateCursor, start) }); + range: _moment2['default'].range(dateCursor, start) + }); } actualStates.push(s); dateCursor = end; @@ -203,7 +212,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ actualStates.push({ state: defaultState, - range: _momentRange2['default'].range(dateCursor, maxDate) }); + range: _moment2['default'].range(dateCursor, maxDate) + }); // sanitize date states return _immutable2['default'].List(actualStates).map(function (s) { @@ -212,7 +222,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ range: s.range, state: s.state, selectable: def.get('selectable', true), - color: def.get('color') }); + color: def.get('color') + }); }); }, @@ -253,7 +264,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ return range.intersect(r); }); if (intersect) { - return _momentRange2['default'].range(range.start, intersect.start); + return _moment2['default'].range(range.start, intersect.start); } } else { intersect = blockedRanges.findLast(function (r) { @@ -261,16 +272,16 @@ var DateRangePicker = _reactAddons2['default'].createClass({ }); if (intersect) { - return _momentRange2['default'].range(intersect.end, range.end); + return _moment2['default'].range(intersect.end, range.end); } } if (range.start.isBefore(this.state.enabledRange.start)) { - return _momentRange2['default'].range(this.state.enabledRange.start, range.end); + return _moment2['default'].range(this.state.enabledRange.start, range.end); } if (range.end.isAfter(this.state.enabledRange.end)) { - return _momentRange2['default'].range(range.start, this.state.enabledRange.end); + return _moment2['default'].range(range.start, this.state.enabledRange.end); } return range; @@ -279,7 +290,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ highlightRange: function highlightRange(range) { this.setState({ highlightedRange: range, - highlightedDate: null }); + highlightedDate: null + }); if (typeof this.props.onHighlightRange === 'function') { this.props.onHighlightRange(range, this.statesForRange(range)); } @@ -287,7 +299,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ onUnHighlightDate: function onUnHighlightDate() { this.setState({ - highlightedDate: null }); + highlightedDate: null + }); }, onSelectDate: function onSelectDate(date) { @@ -300,7 +313,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ } else if (!this.isDateDisabled(date) && this.isDateSelectable(date)) { this.startRangeSelection(date); if (this.props.singleDateRange) { - this.highlightRange(_momentRange2['default'].range(date, date)); + this.highlightRange(_moment2['default'].range(date, date)); } } } else { @@ -323,7 +336,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ datePair = _immutable2['default'].List.of(selectedStartDate, date).sortBy(function (d) { return d.unix(); }); - range = _momentRange2['default'].range(datePair.get(0), datePair.get(1)); + range = _moment2['default'].range(datePair.get(0), datePair.get(1)); forwards = range.start.unix() === selectedStartDate.unix(); range = this.sanitizeRange(range, forwards); this.highlightRange(range); @@ -340,9 +353,10 @@ var DateRangePicker = _reactAddons2['default'].createClass({ startRangeSelection: function startRangeSelection(date) { this.setState({ hideSelection: true, - selectedStartDate: date }); + selectedStartDate: date + }); if (typeof this.props.onSelectStart === 'function') { - this.props.onSelectStart((0, _momentRange2['default'])(date)); + this.props.onSelectStart((0, _moment2['default'])(date)); } }, @@ -370,7 +384,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ if (highlightedDate) { this.setState({ hideSelection: false, - highlightedDate: null }); + highlightedDate: null + }); this.props.onSelect(highlightedDate, this.statesForDate(highlightedDate)); } }, @@ -383,21 +398,23 @@ var DateRangePicker = _reactAddons2['default'].createClass({ selectedStartDate: null, highlightedRange: null, highlightedDate: null, - hideSelection: false }); + hideSelection: false + }); this.props.onSelect(range, this.statesForRange(range)); } }, highlightDate: function highlightDate(date) { this.setState({ - highlightedDate: date }); + highlightedDate: date + }); if (typeof this.props.onHighlightDate === 'function') { this.props.onHighlightDate(date, this.statesForDate(date)); } }, getMonthDate: function getMonthDate() { - return (0, _momentRange2['default'])(new Date(this.state.year, this.state.month, 1)); + return (0, _moment2['default'])(new Date(this.state.year, this.state.month, 1)); }, canMoveBack: function canMoveBack() { @@ -415,7 +432,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ monthDate.subtract(1, 'months'); this.setState({ year: monthDate.year(), - month: monthDate.month() }); + month: monthDate.month() + }); } }, @@ -434,7 +452,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ monthDate.add(1, 'months'); this.setState({ year: monthDate.year(), - month: monthDate.month() }); + month: monthDate.month() + }); } }, @@ -443,22 +462,24 @@ var DateRangePicker = _reactAddons2['default'].createClass({ var enabledRange = _state.enabledRange; var month = _state.month; - if ((0, _momentRange2['default'])({ years: year, months: month, date: 1 }).unix() < enabledRange.start.unix()) { + if ((0, _moment2['default'])({ years: year, months: month, date: 1 }).unix() < enabledRange.start.unix()) { month = enabledRange.start.month(); } - if ((0, _momentRange2['default'])({ years: year, months: month + 1, date: 1 }).unix() > enabledRange.end.unix()) { + if ((0, _moment2['default'])({ years: year, months: month + 1, date: 1 }).unix() > enabledRange.end.unix()) { month = enabledRange.end.month(); } this.setState({ year: year, - month: month }); + month: month + }); }, changeMonth: function changeMonth(date) { this.setState({ - month: date }); + month: date + }); }, renderCalendar: function renderCalendar(index) { @@ -479,7 +500,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ var monthDate = this.getMonthDate(); var year = monthDate.year(); var month = monthDate.month(); - var key = '' + index + '-' + year + '-' + month; + var key = index + '-' + year + '-' + month; var props = undefined; monthDate.add(index, 'months'); @@ -488,9 +509,9 @@ var DateRangePicker = _reactAddons2['default'].createClass({ var monthDates = _immutable2['default'].fromJS(cal.monthDates(monthDate.year(), monthDate.month())); var monthStart = monthDates.first().first(); var monthEnd = monthDates.last().last(); - var monthRange = _momentRange2['default'].range(monthStart, monthEnd); + var monthRange = _moment2['default'].range(monthStart, monthEnd); - if (_momentRange2['default'].isMoment(value)) { + if (_moment2['default'].isMoment(value)) { if (!monthRange.contains(value)) { value = null; } @@ -500,7 +521,7 @@ var DateRangePicker = _reactAddons2['default'].createClass({ } } - if (!_momentRange2['default'].isMoment(highlightedDate) || !monthRange.contains(highlightedDate)) { + if (!_moment2['default'].isMoment(highlightedDate) || !monthRange.contains(highlightedDate)) { highlightedDate = null; } @@ -529,7 +550,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ onHighlightDate: this.onHighlightDate, onUnHighlightDate: this.onUnHighlightDate, dateRangesForDate: this.dateRangesForDate, - dateComponent: _calendarCalendarDate2['default'] }; + dateComponent: _calendarCalendarDate2['default'] + }; return _reactAddons2['default'].createElement(_calendarCalendarMonth2['default'], props); }, @@ -558,7 +580,8 @@ var DateRangePicker = _reactAddons2['default'].createClass({ ) : null, showLegend ? _reactAddons2['default'].createElement(_Legend2['default'], { stateDefinitions: stateDefinitions, selectedLabel: selectedLabel }) : null ); - } }); + } +}); exports['default'] = DateRangePicker; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/Legend.js b/dist/Legend.js index 21d6af9b..5bcb3cd7 100644 --- a/dist/Legend.js +++ b/dist/Legend.js @@ -23,7 +23,8 @@ var Legend = _reactAddons2['default'].createClass({ propTypes: { selectedLabel: _reactAddons2['default'].PropTypes.string.isRequired, - stateDefinitions: _reactAddons2['default'].PropTypes.object.isRequired }, + stateDefinitions: _reactAddons2['default'].PropTypes.object.isRequired + }, render: function render() { var _props = this.props; @@ -39,7 +40,8 @@ var Legend = _reactAddons2['default'].createClass({ def = stateDefinitions[name]; if (def.label && def.color) { style = { - backgroundColor: def.color }; + backgroundColor: def.color + }; items.push(_reactAddons2['default'].createElement( 'li', { className: this.cx({ element: 'LegendItem' }), key: name }, @@ -68,7 +70,8 @@ var Legend = _reactAddons2['default'].createClass({ ), items ); - } }); + } +}); exports['default'] = Legend; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/PaginationArrow.js b/dist/PaginationArrow.js index 34122bf7..e9e11f7e 100644 --- a/dist/PaginationArrow.js +++ b/dist/PaginationArrow.js @@ -10,7 +10,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } -function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _reactAddons = require('react/addons'); @@ -30,11 +30,13 @@ var PaginationArrow = _reactAddons2['default'].createClass({ propTypes: { disabled: _reactAddons2['default'].PropTypes.bool, onTrigger: _reactAddons2['default'].PropTypes.func, - direction: _reactAddons2['default'].PropTypes.oneOf(['next', 'previous']) }, + direction: _reactAddons2['default'].PropTypes.oneOf(['next', 'previous']) + }, getDefaultProps: function getDefaultProps() { return { - disabled: false }; + disabled: false + }; }, render: function render() { @@ -50,19 +52,22 @@ var PaginationArrow = _reactAddons2['default'].createClass({ var elementOpts = { modifiers: modifiers, - states: states }; + states: states + }; var iconOpts = { element: 'PaginationArrowIcon', modifiers: modifiers, - states: states }; + states: states + }; return _reactAddons2['default'].createElement( 'div', _extends({ className: this.cx(elementOpts) }, props, { onClick: onTrigger }), _reactAddons2['default'].createElement('div', { className: this.cx(iconOpts) }) ); - } }); + } +}); exports['default'] = PaginationArrow; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/calendar/CalendarDate.js b/dist/calendar/CalendarDate.js index 702d2bd8..ac7f0fb1 100644 --- a/dist/calendar/CalendarDate.js +++ b/dist/calendar/CalendarDate.js @@ -70,11 +70,13 @@ var CalendarDate = _reactAddons2['default'].createClass({ dateRangesForDate: _reactAddons2['default'].PropTypes.func, onHighlightDate: _reactAddons2['default'].PropTypes.func, onUnHighlightDate: _reactAddons2['default'].PropTypes.func, - onSelectDate: _reactAddons2['default'].PropTypes.func }, + onSelectDate: _reactAddons2['default'].PropTypes.func + }, getInitialState: function getInitialState() { return { - mouseDown: false }; + mouseDown: false + }; }, mouseUp: function mouseUp() { @@ -82,14 +84,16 @@ var CalendarDate = _reactAddons2['default'].createClass({ if (this.state.mouseDown) { this.setState({ - mouseDown: false }); + mouseDown: false + }); } document.removeEventListener('mouseup', this.mouseUp); }, mouseDown: function mouseDown() { this.setState({ - mouseDown: true }); + mouseDown: true + }); document.addEventListener('mouseup', this.mouseUp); }, @@ -99,7 +103,8 @@ var CalendarDate = _reactAddons2['default'].createClass({ if (this.state.mouseDown) { this.setState({ - mouseDown: false }); + mouseDown: false + }); } document.removeEventListener('touchend', this.touchEnd); }, @@ -107,7 +112,8 @@ var CalendarDate = _reactAddons2['default'].createClass({ touchStart: function touchStart(event) { event.preventDefault(); this.setState({ - mouseDown: true }); + mouseDown: true + }); document.addEventListener('touchend', this.touchEnd); }, @@ -120,7 +126,8 @@ var CalendarDate = _reactAddons2['default'].createClass({ this.props.onSelectDate(this.props.date); this.setState({ - mouseDown: false }); + mouseDown: false + }); } this.props.onUnHighlightDate(this.props.date); }, @@ -207,10 +214,12 @@ var CalendarDate = _reactAddons2['default'].createClass({ if (color) { style = { - backgroundColor: color }; + backgroundColor: color + }; cellStyle = { borderLeftColor: (0, _utilsLightenDarkenColor2['default'])(color, -10), - borderRightColor: (0, _utilsLightenDarkenColor2['default'])(color, -10) }; + borderRightColor: (0, _utilsLightenDarkenColor2['default'])(color, -10) + }; } } else { amColor = states.getIn([0, 'color']); @@ -235,20 +244,21 @@ var CalendarDate = _reactAddons2['default'].createClass({ onMouseDown: this.mouseDown }, numStates > 1 && _reactAddons2['default'].createElement( 'div', - { className: this.cx({ element: 'HalfDateStates' }) }, + { className: this.cx({ element: "HalfDateStates" }) }, _reactAddons2['default'].createElement(_CalendarDatePeriod2['default'], { period: 'am', color: amColor }), _reactAddons2['default'].createElement(_CalendarDatePeriod2['default'], { period: 'pm', color: pmColor }) ), - numStates === 1 && _reactAddons2['default'].createElement('div', { className: this.cx({ element: 'FullDateStates' }), style: style }), + numStates === 1 && _reactAddons2['default'].createElement('div', { className: this.cx({ element: "FullDateStates" }), style: style }), _reactAddons2['default'].createElement( 'span', - { className: this.cx({ element: 'DateLabel' }) }, + { className: this.cx({ element: "DateLabel" }) }, date.format('D') ), selectionModifier ? _reactAddons2['default'].createElement(_CalendarSelection2['default'], { modifier: selectionModifier, pending: pending }) : null, highlightModifier ? _reactAddons2['default'].createElement(_CalendarHighlight2['default'], { modifier: highlightModifier }) : null ); - } }); + } +}); exports['default'] = CalendarDate; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/calendar/CalendarDatePeriod.js b/dist/calendar/CalendarDatePeriod.js index 22ef1592..dfa494f2 100644 --- a/dist/calendar/CalendarDatePeriod.js +++ b/dist/calendar/CalendarDatePeriod.js @@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _reactAddons = require('react/addons'); @@ -27,7 +27,8 @@ var CalendarDatePeriod = _reactAddons2['default'].createClass({ propTypes: { color: _reactAddons2['default'].PropTypes.string, - period: _reactAddons2['default'].PropTypes.string }, + period: _reactAddons2['default'].PropTypes.string + }, render: function render() { var _props = this.props; @@ -42,7 +43,8 @@ var CalendarDatePeriod = _reactAddons2['default'].createClass({ } return _reactAddons2['default'].createElement('div', { style: style, className: this.cx({ modifiers: modifiers }) }); - } }); + } +}); exports['default'] = CalendarDatePeriod; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/calendar/CalendarHighlight.js b/dist/calendar/CalendarHighlight.js index b741a5af..b1b1399b 100644 --- a/dist/calendar/CalendarHighlight.js +++ b/dist/calendar/CalendarHighlight.js @@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _reactAddons = require('react/addons'); @@ -26,7 +26,8 @@ var CalendarHighlight = _reactAddons2['default'].createClass({ mixins: [_utilsBemMixin2['default'], _utilsPureRenderMixin2['default']], propTypes: { - modifier: _reactAddons2['default'].PropTypes.string }, + modifier: _reactAddons2['default'].PropTypes.string + }, render: function render() { var modifier = this.props.modifier; @@ -35,7 +36,8 @@ var CalendarHighlight = _reactAddons2['default'].createClass({ var states = {}; return _reactAddons2['default'].createElement('div', { className: this.cx({ states: states, modifiers: modifiers }) }); - } }); + } +}); exports['default'] = CalendarHighlight; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/calendar/CalendarMonth.js b/dist/calendar/CalendarMonth.js index 189f54bd..89bcd2e1 100644 --- a/dist/calendar/CalendarMonth.js +++ b/dist/calendar/CalendarMonth.js @@ -14,9 +14,11 @@ var _reactAddons = require('react/addons'); var _reactAddons2 = _interopRequireDefault(_reactAddons); -var _momentRange = require('moment-range'); +var _moment = require('moment'); -var _momentRange2 = _interopRequireDefault(_momentRange); +var _moment2 = _interopRequireDefault(_moment); + +require('moment-range'); var _calendar = require('calendar'); @@ -42,7 +44,7 @@ var _utilsPureRenderMixin = require('../utils/PureRenderMixin'); var _utilsPureRenderMixin2 = _interopRequireDefault(_utilsPureRenderMixin); -var lang = (0, _momentRange2['default'])().localeData(); +var lang = (0, _moment2['default'])().localeData(); var WEEKDAYS = _immutable2['default'].List(lang._weekdays).zip(_immutable2['default'].List(lang._weekdaysShort)); var MONTHS = _immutable2['default'].List(lang._months); @@ -63,7 +65,8 @@ var CalendarMonth = _reactAddons2['default'].createClass({ highlightedRange: _reactAddons2['default'].PropTypes.object, onMonthChange: _reactAddons2['default'].PropTypes.func, onYearChange: _reactAddons2['default'].PropTypes.func, - value: _utilsCustomPropTypes2['default'].momentOrMomentRange }, + value: _utilsCustomPropTypes2['default'].momentOrMomentRange + }, renderDay: function renderDay(date, i) { var _props = this.props; @@ -76,14 +79,14 @@ var CalendarMonth = _reactAddons2['default'].createClass({ var props = _objectWithoutProperties(_props, ['dateComponent', 'value', 'highlightedDate', 'highlightedRange', 'hideSelection', 'enabledRange']); - var d = (0, _momentRange2['default'])(date); + var d = (0, _moment2['default'])(date); var isInSelectedRange = undefined; var isSelectedDate = undefined; var isSelectedRangeStart = undefined; var isSelectedRangeEnd = undefined; - if (!hideSelection && value && _momentRange2['default'].isMoment(value) && value.isSame(d, 'day')) { + if (!hideSelection && value && _moment2['default'].isMoment(value) && value.isSame(d, 'day')) { isSelectedDate = true; } else if (!hideSelection && value && (0, _utilsIsMomentRange2['default'])(value) && value.contains(d)) { isInSelectedRange = true; @@ -94,7 +97,7 @@ var CalendarMonth = _reactAddons2['default'].createClass({ return _reactAddons2['default'].createElement(CalendarDate, _extends({ key: i, - isToday: d.isSame((0, _momentRange2['default'])(), 'day'), + isToday: d.isSame((0, _moment2['default'])(), 'day'), isDisabled: !enabledRange.contains(d), isHighlightedDate: !!(highlightedDate && highlightedDate.isSame(d, 'day')), isHighlightedRangeStart: !!(highlightedRange && highlightedRange.start.isSame(d, 'day')), @@ -196,11 +199,11 @@ var CalendarMonth = _reactAddons2['default'].createClass({ var disabled = false; var year = firstOfMonth.year(); - if ((0, _momentRange2['default'])({ years: year, months: i + 1, date: 1 }).unix() < enabledRange.start.unix()) { + if ((0, _moment2['default'])({ years: year, months: i + 1, date: 1 }).unix() < enabledRange.start.unix()) { disabled = true; } - if ((0, _momentRange2['default'])({ years: year, months: i, date: 1 }).unix() > enabledRange.end.unix()) { + if ((0, _moment2['default'])({ years: year, months: i, date: 1 }).unix() > enabledRange.end.unix()) { disabled = true; } @@ -267,7 +270,8 @@ var CalendarMonth = _reactAddons2['default'].createClass({ ) ) ); - } }); + } +}); exports['default'] = CalendarMonth; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/calendar/CalendarSelection.js b/dist/calendar/CalendarSelection.js index 5a84d71d..c48c08b5 100644 --- a/dist/calendar/CalendarSelection.js +++ b/dist/calendar/CalendarSelection.js @@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _reactAddons = require('react/addons'); @@ -27,7 +27,8 @@ var CalendarSelection = _reactAddons2['default'].createClass({ propTypes: { modifier: _reactAddons2['default'].PropTypes.string, - pending: _reactAddons2['default'].PropTypes.bool.isRequired }, + pending: _reactAddons2['default'].PropTypes.bool.isRequired + }, render: function render() { var _props = this.props; @@ -36,10 +37,12 @@ var CalendarSelection = _reactAddons2['default'].createClass({ var modifiers = _defineProperty({}, modifier, true); var states = { - pending: pending }; + pending: pending + }; return _reactAddons2['default'].createElement('div', { className: this.cx({ states: states, modifiers: modifiers }) }); - } }); + } +}); exports['default'] = CalendarSelection; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/utils/BemMixin.js b/dist/utils/BemMixin.js index 017f89f7..aa43785a 100644 --- a/dist/utils/BemMixin.js +++ b/dist/utils/BemMixin.js @@ -19,20 +19,24 @@ var _bemCx2 = _interopRequireDefault(_bemCx); var BemMixin = { propTypes: { bemNamespace: _react2['default'].PropTypes.string, - bemBlock: _react2['default'].PropTypes.string }, + bemBlock: _react2['default'].PropTypes.string + }, contextTypes: { bemNamespace: _react2['default'].PropTypes.string, - bemBlock: _react2['default'].PropTypes.string }, + bemBlock: _react2['default'].PropTypes.string + }, childContextTypes: { bemNamespace: _react2['default'].PropTypes.string, - bemBlock: _react2['default'].PropTypes.string }, + bemBlock: _react2['default'].PropTypes.string + }, getChildContext: function getChildContext() { return { bemNamespace: this.getBemNamespace(), - bemBlock: this.getBemBlock() }; + bemBlock: this.getBemBlock() + }; }, getBemNamespace: function getBemNamespace() { @@ -56,16 +60,18 @@ var BemMixin = { }, cx: function cx() { - var options = arguments[0] === undefined ? {} : arguments[0]; + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var opts = { namespace: this.getBemNamespace(), element: this.constructor.displayName, - block: this.getBemBlock() }; + block: this.getBemBlock() + }; _extends(opts, options); return (0, _bemCx2['default'])(opts); - } }; + } +}; exports['default'] = BemMixin; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/utils/CustomPropTypes.js b/dist/utils/CustomPropTypes.js index baea76c4..b33e7722 100644 --- a/dist/utils/CustomPropTypes.js +++ b/dist/utils/CustomPropTypes.js @@ -6,9 +6,11 @@ Object.defineProperty(exports, '__esModule', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _momentRange = require('moment-range'); +var _moment2 = require('moment'); -var _momentRange2 = _interopRequireDefault(_momentRange); +var _moment3 = _interopRequireDefault(_moment2); + +require('moment-range'); var _isMomentRange = require('./isMomentRange'); @@ -20,7 +22,7 @@ exports['default'] = { if (!val) { return null; - } else if (_momentRange2['default'].isMoment(val)) { + } else if (_moment3['default'].isMoment(val)) { return null; } else if ((0, _isMomentRange2['default'])(val)) { return null; @@ -33,7 +35,7 @@ exports['default'] = { if (!val) { return null; - } else if (_momentRange2['default'].isMoment(val)) { + } else if (_moment3['default'].isMoment(val)) { return null; } return new Error('\'' + propName + '\' must be a moment'); @@ -48,5 +50,6 @@ exports['default'] = { return null; } return new Error('\'' + propName + '\' must be a moment range'); - } }; + } +}; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/utils/PureRenderMixin.js b/dist/utils/PureRenderMixin.js index 76a6461e..99df30dd 100644 --- a/dist/utils/PureRenderMixin.js +++ b/dist/utils/PureRenderMixin.js @@ -13,7 +13,8 @@ var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); var PureRenderMixin = { shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { return !(0, _utilsShallowEqual2['default'])(this.props, nextProps) || !(0, _utilsShallowEqual2['default'])(this.state, nextState); - } }; + } +}; exports['default'] = PureRenderMixin; module.exports = exports['default']; \ No newline at end of file diff --git a/dist/utils/bemCx.js b/dist/utils/bemCx.js index e12371a3..4e6d6b70 100644 --- a/dist/utils/bemCx.js +++ b/dist/utils/bemCx.js @@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { exports['default'] = bemCx; function bemCx() { - var options = arguments[0] === undefined ? {} : arguments[0]; + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var block = options.block; var element = options.element; var namespace = options.namespace; @@ -18,13 +18,13 @@ function bemCx() { if (element) { if (namespace) { - baseClassName = '' + namespace + '-' + block + '__' + element; + baseClassName = namespace + '-' + block + '__' + element; } else { - baseClassName = '' + block + '__' + element; + baseClassName = block + '__' + element; } } else { if (namespace) { - baseClassName = '' + namespace + '-' + block; + baseClassName = namespace + '-' + block; } else { baseClassName = block; } @@ -40,7 +40,7 @@ function bemCx() { } states.forEach(function (state) { - bemClasses.push('' + baseClassName + '--is-' + state); + bemClasses.push(baseClassName + '--is-' + state); }); } @@ -52,11 +52,11 @@ function bemCx() { } modifiers.forEach(function (modifier) { - bemClasses.push('' + baseClassName + '--' + modifier); + bemClasses.push(baseClassName + '--' + modifier); if (states) { states.forEach(function (state) { - bemClasses.push('' + baseClassName + '--' + modifier + '--is-' + state); + bemClasses.push(baseClassName + '--' + modifier + '--is-' + state); }); } }); diff --git a/dist/utils/isMomentRange.js b/dist/utils/isMomentRange.js index 7f216a3f..45509961 100644 --- a/dist/utils/isMomentRange.js +++ b/dist/utils/isMomentRange.js @@ -7,12 +7,14 @@ exports['default'] = isMomentRange; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _momentRange = require('moment-range'); +var _moment = require('moment'); -var _momentRange2 = _interopRequireDefault(_momentRange); +var _moment2 = _interopRequireDefault(_moment); + +require('moment-range'); function isMomentRange(val) { - return val && val.start && val.end && _momentRange2['default'].isMoment(val.start) && _momentRange2['default'].isMoment(val.end); + return val && val.start && val.end && _moment2['default'].isMoment(val.start) && _moment2['default'].isMoment(val.end); } module.exports = exports['default']; \ No newline at end of file diff --git a/dist/utils/lightenDarkenColor.js b/dist/utils/lightenDarkenColor.js index 52020772..2cd22bd3 100644 --- a/dist/utils/lightenDarkenColor.js +++ b/dist/utils/lightenDarkenColor.js @@ -27,7 +27,7 @@ function lightenDarkenColor(col, amt) { r = 0; } - b = (num >> 8 & 255) + amt; + b = (num >> 8 & 0x00FF) + amt; if (b > 255) { b = 255; @@ -35,7 +35,7 @@ function lightenDarkenColor(col, amt) { b = 0; } - g = (num & 255) + amt; + g = (num & 0x0000FF) + amt; if (g > 255) { g = 255; diff --git a/dist/utils/shallowEqual.js b/dist/utils/shallowEqual.js index 6b94ca20..5328d83f 100644 --- a/dist/utils/shallowEqual.js +++ b/dist/utils/shallowEqual.js @@ -6,9 +6,11 @@ Object.defineProperty(exports, '__esModule', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _momentRange = require('moment-range'); +var _moment = require('moment'); -var _momentRange2 = _interopRequireDefault(_momentRange); +var _moment2 = _interopRequireDefault(_moment); + +require('moment-range'); var _areMomentRangesEqual = require('./areMomentRangesEqual'); @@ -29,7 +31,7 @@ function shallowEqual(objA, objB) { if (objA.hasOwnProperty(key)) { if (!objB.hasOwnProperty(key)) { return false; - } else if (_momentRange2['default'].isMoment(objA[key]) && _momentRange2['default'].isMoment(objB[key])) { + } else if (_moment2['default'].isMoment(objA[key]) && _moment2['default'].isMoment(objB[key])) { if (!objA[key].isSame(objB[key], 'day')) { return false; }