Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
} else {
[9000] Fix | Delete
this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
[9001] Fix | Delete
}
[9002] Fix | Delete
[9003] Fix | Delete
this.setCalendarMonthWeeks(currentMonth);
[9004] Fix | Delete
}
[9005] Fix | Delete
[9006] Fix | Delete
return componentDidMount;
[9007] Fix | Delete
}()
[9008] Fix | Delete
}, {
[9009] Fix | Delete
key: 'componentWillReceiveProps',
[9010] Fix | Delete
value: function () {
[9011] Fix | Delete
function componentWillReceiveProps(nextProps) {
[9012] Fix | Delete
var hidden = nextProps.hidden,
[9013] Fix | Delete
isFocused = nextProps.isFocused,
[9014] Fix | Delete
showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
[9015] Fix | Delete
onBlur = nextProps.onBlur,
[9016] Fix | Delete
renderMonthText = nextProps.renderMonthText,
[9017] Fix | Delete
horizontalMonthPadding = nextProps.horizontalMonthPadding;
[9018] Fix | Delete
var currentMonth = this.state.currentMonth;
[9019] Fix | Delete
[9020] Fix | Delete
[9021] Fix | Delete
if (!hidden) {
[9022] Fix | Delete
if (!this.hasSetInitialVisibleMonth) {
[9023] Fix | Delete
this.hasSetInitialVisibleMonth = true;
[9024] Fix | Delete
this.setState({
[9025] Fix | Delete
currentMonth: nextProps.initialVisibleMonth()
[9026] Fix | Delete
});
[9027] Fix | Delete
}
[9028] Fix | Delete
}
[9029] Fix | Delete
[9030] Fix | Delete
var _props = this.props,
[9031] Fix | Delete
daySize = _props.daySize,
[9032] Fix | Delete
prevIsFocused = _props.isFocused,
[9033] Fix | Delete
prevRenderMonthText = _props.renderMonthText;
[9034] Fix | Delete
[9035] Fix | Delete
[9036] Fix | Delete
if (nextProps.daySize !== daySize) {
[9037] Fix | Delete
this.setState({
[9038] Fix | Delete
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
[9039] Fix | Delete
});
[9040] Fix | Delete
}
[9041] Fix | Delete
[9042] Fix | Delete
if (isFocused !== prevIsFocused) {
[9043] Fix | Delete
if (isFocused) {
[9044] Fix | Delete
var focusedDate = this.getFocusedDay(currentMonth);
[9045] Fix | Delete
[9046] Fix | Delete
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
[9047] Fix | Delete
[9048] Fix | Delete
if (nextProps.showKeyboardShortcuts) {
[9049] Fix | Delete
// the ? shortcut came from the input and we should return input there once it is close
[9050] Fix | Delete
onKeyboardShortcutsPanelClose = onBlur;
[9051] Fix | Delete
}
[9052] Fix | Delete
[9053] Fix | Delete
this.setState({
[9054] Fix | Delete
showKeyboardShortcuts: showKeyboardShortcuts,
[9055] Fix | Delete
onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
[9056] Fix | Delete
focusedDate: focusedDate,
[9057] Fix | Delete
withMouseInteractions: false
[9058] Fix | Delete
});
[9059] Fix | Delete
} else {
[9060] Fix | Delete
this.setState({ focusedDate: null });
[9061] Fix | Delete
}
[9062] Fix | Delete
}
[9063] Fix | Delete
[9064] Fix | Delete
if (renderMonthText !== prevRenderMonthText) {
[9065] Fix | Delete
this.setState({
[9066] Fix | Delete
monthTitleHeight: null
[9067] Fix | Delete
});
[9068] Fix | Delete
}
[9069] Fix | Delete
}
[9070] Fix | Delete
[9071] Fix | Delete
return componentWillReceiveProps;
[9072] Fix | Delete
}()
[9073] Fix | Delete
}, {
[9074] Fix | Delete
key: 'shouldComponentUpdate',
[9075] Fix | Delete
value: function () {
[9076] Fix | Delete
function shouldComponentUpdate(nextProps, nextState) {
[9077] Fix | Delete
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
[9078] Fix | Delete
}
[9079] Fix | Delete
[9080] Fix | Delete
return shouldComponentUpdate;
[9081] Fix | Delete
}()
[9082] Fix | Delete
}, {
[9083] Fix | Delete
key: 'componentWillUpdate',
[9084] Fix | Delete
value: function () {
[9085] Fix | Delete
function componentWillUpdate() {
[9086] Fix | Delete
var _this2 = this;
[9087] Fix | Delete
[9088] Fix | Delete
var transitionDuration = this.props.transitionDuration;
[9089] Fix | Delete
[9090] Fix | Delete
// Calculating the dimensions trigger a DOM repaint which
[9091] Fix | Delete
// breaks the CSS transition.
[9092] Fix | Delete
// The setTimeout will wait until the transition ends.
[9093] Fix | Delete
[9094] Fix | Delete
if (this.calendarInfo) {
[9095] Fix | Delete
this.setCalendarInfoWidthTimeout = setTimeout(function () {
[9096] Fix | Delete
var calendarInfoWidth = _this2.state.calendarInfoWidth;
[9097] Fix | Delete
[9098] Fix | Delete
var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
[9099] Fix | Delete
if (calendarInfoWidth !== calendarInfoPanelWidth) {
[9100] Fix | Delete
_this2.setState({
[9101] Fix | Delete
calendarInfoWidth: calendarInfoPanelWidth
[9102] Fix | Delete
});
[9103] Fix | Delete
}
[9104] Fix | Delete
}, transitionDuration);
[9105] Fix | Delete
}
[9106] Fix | Delete
}
[9107] Fix | Delete
[9108] Fix | Delete
return componentWillUpdate;
[9109] Fix | Delete
}()
[9110] Fix | Delete
}, {
[9111] Fix | Delete
key: 'componentDidUpdate',
[9112] Fix | Delete
value: function () {
[9113] Fix | Delete
function componentDidUpdate(prevProps) {
[9114] Fix | Delete
var _props2 = this.props,
[9115] Fix | Delete
orientation = _props2.orientation,
[9116] Fix | Delete
daySize = _props2.daySize,
[9117] Fix | Delete
isFocused = _props2.isFocused,
[9118] Fix | Delete
numberOfMonths = _props2.numberOfMonths;
[9119] Fix | Delete
var _state = this.state,
[9120] Fix | Delete
focusedDate = _state.focusedDate,
[9121] Fix | Delete
monthTitleHeight = _state.monthTitleHeight;
[9122] Fix | Delete
[9123] Fix | Delete
[9124] Fix | Delete
if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
[9125] Fix | Delete
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
[9126] Fix | Delete
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
[9127] Fix | Delete
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
[9128] Fix | Delete
this.adjustDayPickerHeight(newMonthHeight);
[9129] Fix | Delete
}
[9130] Fix | Delete
[9131] Fix | Delete
if (!prevProps.isFocused && isFocused && !focusedDate) {
[9132] Fix | Delete
this.container.focus();
[9133] Fix | Delete
}
[9134] Fix | Delete
}
[9135] Fix | Delete
[9136] Fix | Delete
return componentDidUpdate;
[9137] Fix | Delete
}()
[9138] Fix | Delete
}, {
[9139] Fix | Delete
key: 'componentWillUnmount',
[9140] Fix | Delete
value: function () {
[9141] Fix | Delete
function componentWillUnmount() {
[9142] Fix | Delete
clearTimeout(this.setCalendarInfoWidthTimeout);
[9143] Fix | Delete
}
[9144] Fix | Delete
[9145] Fix | Delete
return componentWillUnmount;
[9146] Fix | Delete
}()
[9147] Fix | Delete
}, {
[9148] Fix | Delete
key: 'onKeyDown',
[9149] Fix | Delete
value: function () {
[9150] Fix | Delete
function onKeyDown(e) {
[9151] Fix | Delete
e.stopPropagation();
[9152] Fix | Delete
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
[9153] Fix | Delete
this.throttledKeyDown(e);
[9154] Fix | Delete
}
[9155] Fix | Delete
}
[9156] Fix | Delete
[9157] Fix | Delete
return onKeyDown;
[9158] Fix | Delete
}()
[9159] Fix | Delete
}, {
[9160] Fix | Delete
key: 'onFinalKeyDown',
[9161] Fix | Delete
value: function () {
[9162] Fix | Delete
function onFinalKeyDown(e) {
[9163] Fix | Delete
this.setState({ withMouseInteractions: false });
[9164] Fix | Delete
[9165] Fix | Delete
var _props3 = this.props,
[9166] Fix | Delete
onBlur = _props3.onBlur,
[9167] Fix | Delete
isRTL = _props3.isRTL;
[9168] Fix | Delete
var _state2 = this.state,
[9169] Fix | Delete
focusedDate = _state2.focusedDate,
[9170] Fix | Delete
showKeyboardShortcuts = _state2.showKeyboardShortcuts;
[9171] Fix | Delete
[9172] Fix | Delete
if (!focusedDate) return;
[9173] Fix | Delete
[9174] Fix | Delete
var newFocusedDate = focusedDate.clone();
[9175] Fix | Delete
[9176] Fix | Delete
var didTransitionMonth = false;
[9177] Fix | Delete
[9178] Fix | Delete
// focus might be anywhere when the keyboard shortcuts panel is opened so we want to
[9179] Fix | Delete
// return it to wherever it was before when the panel was opened
[9180] Fix | Delete
var activeElement = (0, _getActiveElement2['default'])();
[9181] Fix | Delete
var onKeyboardShortcutsPanelClose = function () {
[9182] Fix | Delete
function onKeyboardShortcutsPanelClose() {
[9183] Fix | Delete
if (activeElement) activeElement.focus();
[9184] Fix | Delete
}
[9185] Fix | Delete
[9186] Fix | Delete
return onKeyboardShortcutsPanelClose;
[9187] Fix | Delete
}();
[9188] Fix | Delete
[9189] Fix | Delete
switch (e.key) {
[9190] Fix | Delete
case 'ArrowUp':
[9191] Fix | Delete
e.preventDefault();
[9192] Fix | Delete
newFocusedDate.subtract(1, 'week');
[9193] Fix | Delete
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
[9194] Fix | Delete
break;
[9195] Fix | Delete
case 'ArrowLeft':
[9196] Fix | Delete
e.preventDefault();
[9197] Fix | Delete
if (isRTL) {
[9198] Fix | Delete
newFocusedDate.add(1, 'day');
[9199] Fix | Delete
} else {
[9200] Fix | Delete
newFocusedDate.subtract(1, 'day');
[9201] Fix | Delete
}
[9202] Fix | Delete
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
[9203] Fix | Delete
break;
[9204] Fix | Delete
case 'Home':
[9205] Fix | Delete
e.preventDefault();
[9206] Fix | Delete
newFocusedDate.startOf('week');
[9207] Fix | Delete
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
[9208] Fix | Delete
break;
[9209] Fix | Delete
case 'PageUp':
[9210] Fix | Delete
e.preventDefault();
[9211] Fix | Delete
newFocusedDate.subtract(1, 'month');
[9212] Fix | Delete
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
[9213] Fix | Delete
break;
[9214] Fix | Delete
[9215] Fix | Delete
case 'ArrowDown':
[9216] Fix | Delete
e.preventDefault();
[9217] Fix | Delete
newFocusedDate.add(1, 'week');
[9218] Fix | Delete
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
[9219] Fix | Delete
break;
[9220] Fix | Delete
case 'ArrowRight':
[9221] Fix | Delete
e.preventDefault();
[9222] Fix | Delete
if (isRTL) {
[9223] Fix | Delete
newFocusedDate.subtract(1, 'day');
[9224] Fix | Delete
} else {
[9225] Fix | Delete
newFocusedDate.add(1, 'day');
[9226] Fix | Delete
}
[9227] Fix | Delete
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
[9228] Fix | Delete
break;
[9229] Fix | Delete
case 'End':
[9230] Fix | Delete
e.preventDefault();
[9231] Fix | Delete
newFocusedDate.endOf('week');
[9232] Fix | Delete
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
[9233] Fix | Delete
break;
[9234] Fix | Delete
case 'PageDown':
[9235] Fix | Delete
e.preventDefault();
[9236] Fix | Delete
newFocusedDate.add(1, 'month');
[9237] Fix | Delete
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
[9238] Fix | Delete
break;
[9239] Fix | Delete
[9240] Fix | Delete
case '?':
[9241] Fix | Delete
this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
[9242] Fix | Delete
break;
[9243] Fix | Delete
[9244] Fix | Delete
case 'Escape':
[9245] Fix | Delete
if (showKeyboardShortcuts) {
[9246] Fix | Delete
this.closeKeyboardShortcutsPanel();
[9247] Fix | Delete
} else {
[9248] Fix | Delete
onBlur();
[9249] Fix | Delete
}
[9250] Fix | Delete
break;
[9251] Fix | Delete
[9252] Fix | Delete
default:
[9253] Fix | Delete
break;
[9254] Fix | Delete
}
[9255] Fix | Delete
[9256] Fix | Delete
// If there was a month transition, do not update the focused date until the transition has
[9257] Fix | Delete
// completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
[9258] Fix | Delete
// didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
[9259] Fix | Delete
if (!didTransitionMonth) {
[9260] Fix | Delete
this.setState({
[9261] Fix | Delete
focusedDate: newFocusedDate
[9262] Fix | Delete
});
[9263] Fix | Delete
}
[9264] Fix | Delete
}
[9265] Fix | Delete
[9266] Fix | Delete
return onFinalKeyDown;
[9267] Fix | Delete
}()
[9268] Fix | Delete
}, {
[9269] Fix | Delete
key: 'onPrevMonthClick',
[9270] Fix | Delete
value: function () {
[9271] Fix | Delete
function onPrevMonthClick(nextFocusedDate, e) {
[9272] Fix | Delete
var _props4 = this.props,
[9273] Fix | Delete
daySize = _props4.daySize,
[9274] Fix | Delete
isRTL = _props4.isRTL,
[9275] Fix | Delete
numberOfMonths = _props4.numberOfMonths;
[9276] Fix | Delete
var _state3 = this.state,
[9277] Fix | Delete
calendarMonthWidth = _state3.calendarMonthWidth,
[9278] Fix | Delete
monthTitleHeight = _state3.monthTitleHeight;
[9279] Fix | Delete
[9280] Fix | Delete
[9281] Fix | Delete
if (e) e.preventDefault();
[9282] Fix | Delete
[9283] Fix | Delete
var translationValue = void 0;
[9284] Fix | Delete
if (this.isVertical()) {
[9285] Fix | Delete
var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
[9286] Fix | Delete
translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
[9287] Fix | Delete
} else if (this.isHorizontal()) {
[9288] Fix | Delete
translationValue = calendarMonthWidth;
[9289] Fix | Delete
if (isRTL) {
[9290] Fix | Delete
translationValue = -2 * calendarMonthWidth;
[9291] Fix | Delete
}
[9292] Fix | Delete
[9293] Fix | Delete
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
[9294] Fix | Delete
var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
[9295] Fix | Delete
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
[9296] Fix | Delete
this.adjustDayPickerHeight(newMonthHeight);
[9297] Fix | Delete
}
[9298] Fix | Delete
[9299] Fix | Delete
this.setState({
[9300] Fix | Delete
monthTransition: PREV_TRANSITION,
[9301] Fix | Delete
translationValue: translationValue,
[9302] Fix | Delete
focusedDate: null,
[9303] Fix | Delete
nextFocusedDate: nextFocusedDate
[9304] Fix | Delete
});
[9305] Fix | Delete
}
[9306] Fix | Delete
[9307] Fix | Delete
return onPrevMonthClick;
[9308] Fix | Delete
}()
[9309] Fix | Delete
}, {
[9310] Fix | Delete
key: 'onMonthChange',
[9311] Fix | Delete
value: function () {
[9312] Fix | Delete
function onMonthChange(currentMonth) {
[9313] Fix | Delete
this.setCalendarMonthWeeks(currentMonth);
[9314] Fix | Delete
this.calculateAndSetDayPickerHeight();
[9315] Fix | Delete
[9316] Fix | Delete
// Translation value is a hack to force an invisible transition that
[9317] Fix | Delete
// properly rerenders the CalendarMonthGrid
[9318] Fix | Delete
this.setState({
[9319] Fix | Delete
monthTransition: MONTH_SELECTION_TRANSITION,
[9320] Fix | Delete
translationValue: 0.00001,
[9321] Fix | Delete
focusedDate: null,
[9322] Fix | Delete
nextFocusedDate: currentMonth,
[9323] Fix | Delete
currentMonth: currentMonth
[9324] Fix | Delete
});
[9325] Fix | Delete
}
[9326] Fix | Delete
[9327] Fix | Delete
return onMonthChange;
[9328] Fix | Delete
}()
[9329] Fix | Delete
}, {
[9330] Fix | Delete
key: 'onYearChange',
[9331] Fix | Delete
value: function () {
[9332] Fix | Delete
function onYearChange(currentMonth) {
[9333] Fix | Delete
this.setCalendarMonthWeeks(currentMonth);
[9334] Fix | Delete
this.calculateAndSetDayPickerHeight();
[9335] Fix | Delete
[9336] Fix | Delete
// Translation value is a hack to force an invisible transition that
[9337] Fix | Delete
// properly rerenders the CalendarMonthGrid
[9338] Fix | Delete
this.setState({
[9339] Fix | Delete
monthTransition: YEAR_SELECTION_TRANSITION,
[9340] Fix | Delete
translationValue: 0.0001,
[9341] Fix | Delete
focusedDate: null,
[9342] Fix | Delete
nextFocusedDate: currentMonth,
[9343] Fix | Delete
currentMonth: currentMonth
[9344] Fix | Delete
});
[9345] Fix | Delete
}
[9346] Fix | Delete
[9347] Fix | Delete
return onYearChange;
[9348] Fix | Delete
}()
[9349] Fix | Delete
}, {
[9350] Fix | Delete
key: 'onNextMonthClick',
[9351] Fix | Delete
value: function () {
[9352] Fix | Delete
function onNextMonthClick(nextFocusedDate, e) {
[9353] Fix | Delete
var _props5 = this.props,
[9354] Fix | Delete
isRTL = _props5.isRTL,
[9355] Fix | Delete
numberOfMonths = _props5.numberOfMonths,
[9356] Fix | Delete
daySize = _props5.daySize;
[9357] Fix | Delete
var _state4 = this.state,
[9358] Fix | Delete
calendarMonthWidth = _state4.calendarMonthWidth,
[9359] Fix | Delete
monthTitleHeight = _state4.monthTitleHeight;
[9360] Fix | Delete
[9361] Fix | Delete
[9362] Fix | Delete
if (e) e.preventDefault();
[9363] Fix | Delete
[9364] Fix | Delete
var translationValue = void 0;
[9365] Fix | Delete
[9366] Fix | Delete
if (this.isVertical()) {
[9367] Fix | Delete
var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
[9368] Fix | Delete
var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
[9369] Fix | Delete
translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
[9370] Fix | Delete
}
[9371] Fix | Delete
[9372] Fix | Delete
if (this.isHorizontal()) {
[9373] Fix | Delete
translationValue = -calendarMonthWidth;
[9374] Fix | Delete
if (isRTL) {
[9375] Fix | Delete
translationValue = 0;
[9376] Fix | Delete
}
[9377] Fix | Delete
[9378] Fix | Delete
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
[9379] Fix | Delete
var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
[9380] Fix | Delete
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
[9381] Fix | Delete
this.adjustDayPickerHeight(newMonthHeight);
[9382] Fix | Delete
}
[9383] Fix | Delete
[9384] Fix | Delete
this.setState({
[9385] Fix | Delete
monthTransition: NEXT_TRANSITION,
[9386] Fix | Delete
translationValue: translationValue,
[9387] Fix | Delete
focusedDate: null,
[9388] Fix | Delete
nextFocusedDate: nextFocusedDate
[9389] Fix | Delete
});
[9390] Fix | Delete
}
[9391] Fix | Delete
[9392] Fix | Delete
return onNextMonthClick;
[9393] Fix | Delete
}()
[9394] Fix | Delete
}, {
[9395] Fix | Delete
key: 'getFirstDayOfWeek',
[9396] Fix | Delete
value: function () {
[9397] Fix | Delete
function getFirstDayOfWeek() {
[9398] Fix | Delete
var firstDayOfWeek = this.props.firstDayOfWeek;
[9399] Fix | Delete
[9400] Fix | Delete
if (firstDayOfWeek == null) {
[9401] Fix | Delete
return _moment2['default'].localeData().firstDayOfWeek();
[9402] Fix | Delete
}
[9403] Fix | Delete
[9404] Fix | Delete
return firstDayOfWeek;
[9405] Fix | Delete
}
[9406] Fix | Delete
[9407] Fix | Delete
return getFirstDayOfWeek;
[9408] Fix | Delete
}()
[9409] Fix | Delete
}, {
[9410] Fix | Delete
key: 'getFirstVisibleIndex',
[9411] Fix | Delete
value: function () {
[9412] Fix | Delete
function getFirstVisibleIndex() {
[9413] Fix | Delete
var orientation = this.props.orientation;
[9414] Fix | Delete
var monthTransition = this.state.monthTransition;
[9415] Fix | Delete
[9416] Fix | Delete
[9417] Fix | Delete
if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
[9418] Fix | Delete
[9419] Fix | Delete
var firstVisibleMonthIndex = 1;
[9420] Fix | Delete
if (monthTransition === PREV_TRANSITION) {
[9421] Fix | Delete
firstVisibleMonthIndex -= 1;
[9422] Fix | Delete
} else if (monthTransition === NEXT_TRANSITION) {
[9423] Fix | Delete
firstVisibleMonthIndex += 1;
[9424] Fix | Delete
}
[9425] Fix | Delete
[9426] Fix | Delete
return firstVisibleMonthIndex;
[9427] Fix | Delete
}
[9428] Fix | Delete
[9429] Fix | Delete
return getFirstVisibleIndex;
[9430] Fix | Delete
}()
[9431] Fix | Delete
}, {
[9432] Fix | Delete
key: 'getFocusedDay',
[9433] Fix | Delete
value: function () {
[9434] Fix | Delete
function getFocusedDay(newMonth) {
[9435] Fix | Delete
var _props6 = this.props,
[9436] Fix | Delete
getFirstFocusableDay = _props6.getFirstFocusableDay,
[9437] Fix | Delete
numberOfMonths = _props6.numberOfMonths;
[9438] Fix | Delete
[9439] Fix | Delete
[9440] Fix | Delete
var focusedDate = void 0;
[9441] Fix | Delete
if (getFirstFocusableDay) {
[9442] Fix | Delete
focusedDate = getFirstFocusableDay(newMonth);
[9443] Fix | Delete
}
[9444] Fix | Delete
[9445] Fix | Delete
if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
[9446] Fix | Delete
focusedDate = newMonth.clone().startOf('month');
[9447] Fix | Delete
}
[9448] Fix | Delete
[9449] Fix | Delete
return focusedDate;
[9450] Fix | Delete
}
[9451] Fix | Delete
[9452] Fix | Delete
return getFocusedDay;
[9453] Fix | Delete
}()
[9454] Fix | Delete
}, {
[9455] Fix | Delete
key: 'setMonthTitleHeight',
[9456] Fix | Delete
value: function () {
[9457] Fix | Delete
function setMonthTitleHeight(monthTitleHeight) {
[9458] Fix | Delete
var _this3 = this;
[9459] Fix | Delete
[9460] Fix | Delete
this.setState({
[9461] Fix | Delete
monthTitleHeight: monthTitleHeight
[9462] Fix | Delete
}, function () {
[9463] Fix | Delete
_this3.calculateAndSetDayPickerHeight();
[9464] Fix | Delete
});
[9465] Fix | Delete
}
[9466] Fix | Delete
[9467] Fix | Delete
return setMonthTitleHeight;
[9468] Fix | Delete
}()
[9469] Fix | Delete
}, {
[9470] Fix | Delete
key: 'setCalendarMonthWeeks',
[9471] Fix | Delete
value: function () {
[9472] Fix | Delete
function setCalendarMonthWeeks(currentMonth) {
[9473] Fix | Delete
var numberOfMonths = this.props.numberOfMonths;
[9474] Fix | Delete
[9475] Fix | Delete
[9476] Fix | Delete
this.calendarMonthWeeks = [];
[9477] Fix | Delete
var month = currentMonth.clone().subtract(1, 'months');
[9478] Fix | Delete
var firstDayOfWeek = this.getFirstDayOfWeek();
[9479] Fix | Delete
for (var i = 0; i < numberOfMonths + 2; i += 1) {
[9480] Fix | Delete
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
[9481] Fix | Delete
this.calendarMonthWeeks.push(numberOfWeeks);
[9482] Fix | Delete
month = month.add(1, 'months');
[9483] Fix | Delete
}
[9484] Fix | Delete
}
[9485] Fix | Delete
[9486] Fix | Delete
return setCalendarMonthWeeks;
[9487] Fix | Delete
}()
[9488] Fix | Delete
}, {
[9489] Fix | Delete
key: 'setContainerRef',
[9490] Fix | Delete
value: function () {
[9491] Fix | Delete
function setContainerRef(ref) {
[9492] Fix | Delete
this.container = ref;
[9493] Fix | Delete
}
[9494] Fix | Delete
[9495] Fix | Delete
return setContainerRef;
[9496] Fix | Delete
}()
[9497] Fix | Delete
}, {
[9498] Fix | Delete
key: 'setCalendarInfoRef',
[9499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function