@seafile/seafile-calendar 0.0.24-beta → 0.0.24-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/RangeCalendar.js +797 -0
- package/lib/RangeCalendar.js +804 -0
- package/package.json +3 -3
@@ -0,0 +1,797 @@
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
4
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
6
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
7
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
12
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
13
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
15
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
17
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
20
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
23
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
24
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
25
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
26
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
27
|
+
import React from 'react';
|
28
|
+
import PropTypes from 'prop-types';
|
29
|
+
import classnames from 'classnames';
|
30
|
+
import { polyfill } from 'react-lifecycles-compat';
|
31
|
+
import KeyCode from "rc-util/es/KeyCode";
|
32
|
+
import CalendarPart from './range-calendar/CalendarPart';
|
33
|
+
import TodayButton from './calendar/TodayButton';
|
34
|
+
import OkButton from './calendar/OkButton';
|
35
|
+
import TimePickerButton from './calendar/TimePickerButton';
|
36
|
+
import { commonMixinWrapper, propType, defaultProp } from './mixin/CommonMixin';
|
37
|
+
import { syncTime, getTodayTime, isAllowedDate } from './util';
|
38
|
+
import { goTime, goStartMonth, goEndMonth, includesTime } from './util/toTime';
|
39
|
+
import dayjs from './util/dayjs';
|
40
|
+
function noop() {}
|
41
|
+
function isEmptyArray(arr) {
|
42
|
+
return Array.isArray(arr) && (arr.length === 0 || arr.every(function (i) {
|
43
|
+
return !i;
|
44
|
+
}));
|
45
|
+
}
|
46
|
+
function isArraysEqual(a, b) {
|
47
|
+
if (a === b) return true;
|
48
|
+
if (a === null || typeof a === 'undefined' || b === null || typeof b === 'undefined') {
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
if (a.length !== b.length) return false;
|
52
|
+
for (var i = 0; i < a.length; ++i) {
|
53
|
+
if (a[i] !== b[i]) return false;
|
54
|
+
}
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
function getValueFromSelectedValue(selectedValue) {
|
58
|
+
var _selectedValue = _slicedToArray(selectedValue, 2),
|
59
|
+
start = _selectedValue[0],
|
60
|
+
end = _selectedValue[1];
|
61
|
+
if (end && (start === undefined || start === null)) {
|
62
|
+
start = end.clone().subtract(1, 'month');
|
63
|
+
}
|
64
|
+
if (start && (end === undefined || end === null)) {
|
65
|
+
end = start.clone().add(1, 'month');
|
66
|
+
}
|
67
|
+
return [start, end];
|
68
|
+
}
|
69
|
+
function normalizeAnchor(props, init) {
|
70
|
+
var selectedValue = props.selectedValue || init && props.defaultSelectedValue;
|
71
|
+
var value = props.value || init && props.defaultValue;
|
72
|
+
var normalizedValue = value ? getValueFromSelectedValue(value) : getValueFromSelectedValue(selectedValue);
|
73
|
+
return !isEmptyArray(normalizedValue) ? normalizedValue : init && [dayjs(), dayjs().add(1, 'months')];
|
74
|
+
}
|
75
|
+
function generateOptions(length, extraOptionGen) {
|
76
|
+
var arr = extraOptionGen ? extraOptionGen().concat() : [];
|
77
|
+
for (var value = 0; value < length; value++) {
|
78
|
+
if (arr.indexOf(value) === -1) {
|
79
|
+
arr.push(value);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
return arr;
|
83
|
+
}
|
84
|
+
function onInputSelect(direction, value, cause) {
|
85
|
+
if (!value) {
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
var originalValue = this.state.selectedValue;
|
89
|
+
var selectedValue = originalValue.concat();
|
90
|
+
var index = direction === 'left' ? 0 : 1;
|
91
|
+
selectedValue[index] = value;
|
92
|
+
if (selectedValue[0] && this.compare(selectedValue[0], selectedValue[1]) > 0) {
|
93
|
+
selectedValue[1 - index] = this.state.showTimePicker ? selectedValue[index] : undefined;
|
94
|
+
}
|
95
|
+
this.props.onInputSelect(selectedValue);
|
96
|
+
this.fireSelectValueChange(selectedValue, null, cause || {
|
97
|
+
source: 'dateInput'
|
98
|
+
});
|
99
|
+
}
|
100
|
+
var RangeCalendar = /*#__PURE__*/function (_React$Component) {
|
101
|
+
function RangeCalendar(_props) {
|
102
|
+
var _this;
|
103
|
+
_classCallCheck(this, RangeCalendar);
|
104
|
+
_this = _callSuper(this, RangeCalendar, [_props]);
|
105
|
+
_defineProperty(_this, "onDatePanelEnter", function () {
|
106
|
+
if (_this.hasSelectedValue()) {
|
107
|
+
_this.fireHoverValueChange(_this.state.selectedValue.concat());
|
108
|
+
}
|
109
|
+
});
|
110
|
+
_defineProperty(_this, "onDatePanelLeave", function () {
|
111
|
+
if (_this.hasSelectedValue()) {
|
112
|
+
_this.fireHoverValueChange([]);
|
113
|
+
}
|
114
|
+
});
|
115
|
+
_defineProperty(_this, "onSelect", function (value) {
|
116
|
+
var type = _this.props.type;
|
117
|
+
var _this$state = _this.state,
|
118
|
+
selectedValue = _this$state.selectedValue,
|
119
|
+
prevSelectedValue = _this$state.prevSelectedValue,
|
120
|
+
firstSelectedValue = _this$state.firstSelectedValue;
|
121
|
+
var nextSelectedValue;
|
122
|
+
if (type === 'both') {
|
123
|
+
if (!firstSelectedValue) {
|
124
|
+
syncTime(prevSelectedValue[0], value);
|
125
|
+
nextSelectedValue = [value];
|
126
|
+
} else if (_this.compare(firstSelectedValue, value) < 0) {
|
127
|
+
syncTime(prevSelectedValue[1], value);
|
128
|
+
nextSelectedValue = [firstSelectedValue, value];
|
129
|
+
} else {
|
130
|
+
syncTime(prevSelectedValue[0], value);
|
131
|
+
syncTime(prevSelectedValue[1], firstSelectedValue);
|
132
|
+
nextSelectedValue = [value, firstSelectedValue];
|
133
|
+
}
|
134
|
+
} else if (type === 'start') {
|
135
|
+
syncTime(prevSelectedValue[0], value);
|
136
|
+
var endValue = selectedValue[1];
|
137
|
+
nextSelectedValue = endValue && _this.compare(endValue, value) > 0 ? [value, endValue] : [value];
|
138
|
+
} else {
|
139
|
+
// type === 'end'
|
140
|
+
var startValue = selectedValue[0];
|
141
|
+
if (startValue && _this.compare(startValue, value) <= 0) {
|
142
|
+
syncTime(prevSelectedValue[1], value);
|
143
|
+
nextSelectedValue = [startValue, value];
|
144
|
+
} else {
|
145
|
+
syncTime(prevSelectedValue[0], value);
|
146
|
+
nextSelectedValue = [value];
|
147
|
+
}
|
148
|
+
}
|
149
|
+
_this.fireSelectValueChange(nextSelectedValue);
|
150
|
+
});
|
151
|
+
_defineProperty(_this, "onKeyDown", function (event) {
|
152
|
+
if (event.target.nodeName.toLowerCase() === 'input') {
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
var keyCode = event.keyCode;
|
156
|
+
var ctrlKey = event.ctrlKey || event.metaKey;
|
157
|
+
var _this$state2 = _this.state,
|
158
|
+
selectedValue = _this$state2.selectedValue,
|
159
|
+
hoverValue = _this$state2.hoverValue,
|
160
|
+
firstSelectedValue = _this$state2.firstSelectedValue,
|
161
|
+
value = _this$state2.value;
|
162
|
+
var _this$props = _this.props,
|
163
|
+
onKeyDown = _this$props.onKeyDown,
|
164
|
+
disabledDate = _this$props.disabledDate;
|
165
|
+
|
166
|
+
// Update last time of the picker
|
167
|
+
var updateHoverPoint = function updateHoverPoint(func) {
|
168
|
+
// Change hover to make focus in UI
|
169
|
+
var currentHoverTime;
|
170
|
+
var nextHoverTime;
|
171
|
+
var nextHoverValue;
|
172
|
+
if (!firstSelectedValue) {
|
173
|
+
currentHoverTime = hoverValue[0] || selectedValue[0] || value[0] || dayjs();
|
174
|
+
nextHoverTime = func(currentHoverTime);
|
175
|
+
nextHoverValue = [nextHoverTime];
|
176
|
+
_this.fireHoverValueChange(nextHoverValue);
|
177
|
+
} else {
|
178
|
+
if (hoverValue.length === 1) {
|
179
|
+
currentHoverTime = hoverValue[0].clone();
|
180
|
+
nextHoverTime = func(currentHoverTime);
|
181
|
+
nextHoverValue = _this.onDayHover(nextHoverTime);
|
182
|
+
} else {
|
183
|
+
currentHoverTime = hoverValue[0].isSame(firstSelectedValue, 'day') ? hoverValue[1] : hoverValue[0];
|
184
|
+
nextHoverTime = func(currentHoverTime);
|
185
|
+
nextHoverValue = _this.onDayHover(nextHoverTime);
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
// Find origin hover time on value index
|
190
|
+
if (nextHoverValue.length >= 2) {
|
191
|
+
var miss = nextHoverValue.some(function (ht) {
|
192
|
+
return !includesTime(value, ht, 'month');
|
193
|
+
});
|
194
|
+
if (miss) {
|
195
|
+
var newValue = nextHoverValue.slice().sort(function (t1, t2) {
|
196
|
+
return t1.valueOf() - t2.valueOf();
|
197
|
+
});
|
198
|
+
if (newValue[0].isSame(newValue[1], 'month')) {
|
199
|
+
newValue[1] = newValue[0].clone().add(1, 'month');
|
200
|
+
}
|
201
|
+
_this.fireValueChange(newValue);
|
202
|
+
}
|
203
|
+
} else if (nextHoverValue.length === 1) {
|
204
|
+
// If only one value, let's keep the origin panel
|
205
|
+
var oriValueIndex = value.findIndex(function (time) {
|
206
|
+
return time.isSame(currentHoverTime, 'month');
|
207
|
+
});
|
208
|
+
if (oriValueIndex === -1) oriValueIndex = 0;
|
209
|
+
if (value.every(function (time) {
|
210
|
+
return !time.isSame(nextHoverTime, 'month');
|
211
|
+
})) {
|
212
|
+
var _newValue = value.slice();
|
213
|
+
_newValue[oriValueIndex] = nextHoverTime.clone();
|
214
|
+
_this.fireValueChange(_newValue);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
event.preventDefault();
|
218
|
+
return nextHoverTime;
|
219
|
+
};
|
220
|
+
switch (keyCode) {
|
221
|
+
case KeyCode.DOWN:
|
222
|
+
updateHoverPoint(function (time) {
|
223
|
+
return goTime(time, 1, 'weeks');
|
224
|
+
});
|
225
|
+
return;
|
226
|
+
case KeyCode.UP:
|
227
|
+
updateHoverPoint(function (time) {
|
228
|
+
return goTime(time, -1, 'weeks');
|
229
|
+
});
|
230
|
+
return;
|
231
|
+
case KeyCode.LEFT:
|
232
|
+
if (ctrlKey) {
|
233
|
+
updateHoverPoint(function (time) {
|
234
|
+
return goTime(time, -1, 'years');
|
235
|
+
});
|
236
|
+
} else {
|
237
|
+
updateHoverPoint(function (time) {
|
238
|
+
return goTime(time, -1, 'days');
|
239
|
+
});
|
240
|
+
}
|
241
|
+
return;
|
242
|
+
case KeyCode.RIGHT:
|
243
|
+
if (ctrlKey) {
|
244
|
+
updateHoverPoint(function (time) {
|
245
|
+
return goTime(time, 1, 'years');
|
246
|
+
});
|
247
|
+
} else {
|
248
|
+
updateHoverPoint(function (time) {
|
249
|
+
return goTime(time, 1, 'days');
|
250
|
+
});
|
251
|
+
}
|
252
|
+
return;
|
253
|
+
case KeyCode.HOME:
|
254
|
+
updateHoverPoint(function (time) {
|
255
|
+
return goStartMonth(time);
|
256
|
+
});
|
257
|
+
return;
|
258
|
+
case KeyCode.END:
|
259
|
+
updateHoverPoint(function (time) {
|
260
|
+
return goEndMonth(time);
|
261
|
+
});
|
262
|
+
return;
|
263
|
+
case KeyCode.PAGE_DOWN:
|
264
|
+
updateHoverPoint(function (time) {
|
265
|
+
return goTime(time, 1, 'month');
|
266
|
+
});
|
267
|
+
return;
|
268
|
+
case KeyCode.PAGE_UP:
|
269
|
+
updateHoverPoint(function (time) {
|
270
|
+
return goTime(time, -1, 'month');
|
271
|
+
});
|
272
|
+
return;
|
273
|
+
case KeyCode.ENTER:
|
274
|
+
{
|
275
|
+
var lastValue;
|
276
|
+
if (hoverValue.length === 0) {
|
277
|
+
lastValue = updateHoverPoint(function (time) {
|
278
|
+
return time;
|
279
|
+
});
|
280
|
+
} else if (hoverValue.length === 1) {
|
281
|
+
lastValue = hoverValue[0];
|
282
|
+
} else {
|
283
|
+
lastValue = hoverValue[0].isSame(firstSelectedValue, 'day') ? hoverValue[1] : hoverValue[0];
|
284
|
+
}
|
285
|
+
if (lastValue && (!disabledDate || !disabledDate(lastValue))) {
|
286
|
+
_this.onSelect(lastValue);
|
287
|
+
}
|
288
|
+
event.preventDefault();
|
289
|
+
return;
|
290
|
+
}
|
291
|
+
default:
|
292
|
+
if (onKeyDown) {
|
293
|
+
onKeyDown(event);
|
294
|
+
}
|
295
|
+
}
|
296
|
+
});
|
297
|
+
_defineProperty(_this, "onDayHover", function (value) {
|
298
|
+
var hoverValue = [];
|
299
|
+
var _this$state3 = _this.state,
|
300
|
+
selectedValue = _this$state3.selectedValue,
|
301
|
+
firstSelectedValue = _this$state3.firstSelectedValue;
|
302
|
+
var type = _this.props.type;
|
303
|
+
if (type === 'start' && selectedValue[1]) {
|
304
|
+
hoverValue = _this.compare(value, selectedValue[1]) < 0 ? [value, selectedValue[1]] : [value];
|
305
|
+
} else if (type === 'end' && selectedValue[0]) {
|
306
|
+
hoverValue = _this.compare(value, selectedValue[0]) > 0 ? [selectedValue[0], value] : [];
|
307
|
+
} else {
|
308
|
+
if (!firstSelectedValue) {
|
309
|
+
if (_this.state.hoverValue.length) {
|
310
|
+
_this.setState({
|
311
|
+
hoverValue: []
|
312
|
+
});
|
313
|
+
}
|
314
|
+
return hoverValue;
|
315
|
+
}
|
316
|
+
hoverValue = _this.compare(value, firstSelectedValue) < 0 ? [value, firstSelectedValue] : [firstSelectedValue, value];
|
317
|
+
}
|
318
|
+
_this.fireHoverValueChange(hoverValue);
|
319
|
+
return hoverValue;
|
320
|
+
});
|
321
|
+
_defineProperty(_this, "onToday", function () {
|
322
|
+
var startValue = getTodayTime(_this.state.value[0]);
|
323
|
+
var endValue = startValue.clone().add(1, 'months');
|
324
|
+
_this.setState({
|
325
|
+
value: [startValue, endValue]
|
326
|
+
});
|
327
|
+
});
|
328
|
+
_defineProperty(_this, "onOpenTimePicker", function () {
|
329
|
+
_this.setState({
|
330
|
+
showTimePicker: true
|
331
|
+
});
|
332
|
+
});
|
333
|
+
_defineProperty(_this, "onCloseTimePicker", function () {
|
334
|
+
_this.setState({
|
335
|
+
showTimePicker: false
|
336
|
+
});
|
337
|
+
});
|
338
|
+
_defineProperty(_this, "onOk", function () {
|
339
|
+
var selectedValue = _this.state.selectedValue;
|
340
|
+
if (_this.isAllowedDateAndTime(selectedValue)) {
|
341
|
+
_this.props.onOk(_this.state.selectedValue);
|
342
|
+
}
|
343
|
+
});
|
344
|
+
_defineProperty(_this, "onStartInputChange", function () {
|
345
|
+
for (var _len = arguments.length, oargs = new Array(_len), _key = 0; _key < _len; _key++) {
|
346
|
+
oargs[_key] = arguments[_key];
|
347
|
+
}
|
348
|
+
var args = ['left'].concat(oargs);
|
349
|
+
return onInputSelect.apply(_this, args);
|
350
|
+
});
|
351
|
+
_defineProperty(_this, "onEndInputChange", function () {
|
352
|
+
for (var _len2 = arguments.length, oargs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
353
|
+
oargs[_key2] = arguments[_key2];
|
354
|
+
}
|
355
|
+
var args = ['right'].concat(oargs);
|
356
|
+
return onInputSelect.apply(_this, args);
|
357
|
+
});
|
358
|
+
_defineProperty(_this, "onStartInputSelect", function (value) {
|
359
|
+
var args = ['left', value, {
|
360
|
+
source: 'dateInputSelect'
|
361
|
+
}];
|
362
|
+
return onInputSelect.apply(_this, args);
|
363
|
+
});
|
364
|
+
_defineProperty(_this, "onEndInputSelect", function (value) {
|
365
|
+
var args = ['right', value, {
|
366
|
+
source: 'dateInputSelect'
|
367
|
+
}];
|
368
|
+
return onInputSelect.apply(_this, args);
|
369
|
+
});
|
370
|
+
_defineProperty(_this, "onStartValueChange", function (leftValue) {
|
371
|
+
var value = _toConsumableArray(_this.state.value);
|
372
|
+
value[0] = leftValue;
|
373
|
+
return _this.fireValueChange(value);
|
374
|
+
});
|
375
|
+
_defineProperty(_this, "onEndValueChange", function (rightValue) {
|
376
|
+
var value = _toConsumableArray(_this.state.value);
|
377
|
+
value[1] = rightValue;
|
378
|
+
return _this.fireValueChange(value);
|
379
|
+
});
|
380
|
+
_defineProperty(_this, "onStartPanelChange", function (value, mode) {
|
381
|
+
var _this2 = _this,
|
382
|
+
props = _this2.props,
|
383
|
+
state = _this2.state;
|
384
|
+
var newMode = [mode, state.mode[1]];
|
385
|
+
var newState = {
|
386
|
+
panelTriggerSource: 'start'
|
387
|
+
};
|
388
|
+
if (!('mode' in props)) {
|
389
|
+
newState.mode = newMode;
|
390
|
+
}
|
391
|
+
_this.setState(newState);
|
392
|
+
var newValue = [value || state.value[0], state.value[1]];
|
393
|
+
props.onPanelChange(newValue, newMode);
|
394
|
+
});
|
395
|
+
_defineProperty(_this, "onEndPanelChange", function (value, mode) {
|
396
|
+
var _this3 = _this,
|
397
|
+
props = _this3.props,
|
398
|
+
state = _this3.state;
|
399
|
+
var newMode = [state.mode[0], mode];
|
400
|
+
var newState = {
|
401
|
+
panelTriggerSource: 'end'
|
402
|
+
};
|
403
|
+
if (!('mode' in props)) {
|
404
|
+
newState.mode = newMode;
|
405
|
+
}
|
406
|
+
_this.setState(newState);
|
407
|
+
var newValue = [state.value[0], value || state.value[1]];
|
408
|
+
props.onPanelChange(newValue, newMode);
|
409
|
+
});
|
410
|
+
_defineProperty(_this, "getStartValue", function () {
|
411
|
+
var _this$state4 = _this.state,
|
412
|
+
selectedValue = _this$state4.selectedValue,
|
413
|
+
showTimePicker = _this$state4.showTimePicker,
|
414
|
+
value = _this$state4.value,
|
415
|
+
mode = _this$state4.mode,
|
416
|
+
panelTriggerSource = _this$state4.panelTriggerSource;
|
417
|
+
var startValue = value[0];
|
418
|
+
// keep selectedTime when select date
|
419
|
+
if (selectedValue[0] && _this.props.timePicker) {
|
420
|
+
startValue = startValue.clone();
|
421
|
+
syncTime(selectedValue[0], startValue);
|
422
|
+
}
|
423
|
+
if (showTimePicker && selectedValue[0]) {
|
424
|
+
startValue = selectedValue[0];
|
425
|
+
}
|
426
|
+
|
427
|
+
// Adjust month if date not align
|
428
|
+
if (panelTriggerSource === 'end' && mode[0] === 'date' && mode[1] === 'date' && startValue.isSame(value[1], 'month')) {
|
429
|
+
startValue = startValue.clone().subtract(1, 'month');
|
430
|
+
}
|
431
|
+
return startValue;
|
432
|
+
});
|
433
|
+
_defineProperty(_this, "getEndValue", function () {
|
434
|
+
var _this$state5 = _this.state,
|
435
|
+
value = _this$state5.value,
|
436
|
+
selectedValue = _this$state5.selectedValue,
|
437
|
+
showTimePicker = _this$state5.showTimePicker,
|
438
|
+
mode = _this$state5.mode,
|
439
|
+
panelTriggerSource = _this$state5.panelTriggerSource;
|
440
|
+
var endValue = value[1] ? value[1].clone() : value[0].clone().add(1, 'month');
|
441
|
+
// keep selectedTime when select date
|
442
|
+
if (selectedValue[1] && _this.props.timePicker) {
|
443
|
+
syncTime(selectedValue[1], endValue);
|
444
|
+
}
|
445
|
+
if (showTimePicker) {
|
446
|
+
endValue = selectedValue[1] ? selectedValue[1] : _this.getStartValue();
|
447
|
+
}
|
448
|
+
|
449
|
+
// Adjust month if date not align
|
450
|
+
if (!showTimePicker && panelTriggerSource !== 'end' && mode[0] === 'date' && mode[1] === 'date' && endValue.isSame(value[0], 'month')) {
|
451
|
+
endValue = endValue.clone().add(1, 'month');
|
452
|
+
}
|
453
|
+
return endValue;
|
454
|
+
});
|
455
|
+
// get disabled hours for second picker
|
456
|
+
_defineProperty(_this, "getEndDisableTime", function () {
|
457
|
+
var _this$state6 = _this.state,
|
458
|
+
selectedValue = _this$state6.selectedValue,
|
459
|
+
value = _this$state6.value;
|
460
|
+
var disabledTime = _this.props.disabledTime;
|
461
|
+
var userSettingDisabledTime = disabledTime(selectedValue, 'end') || {};
|
462
|
+
var startValue = selectedValue && selectedValue[0] || value[0].clone();
|
463
|
+
// if startTime and endTime is same day..
|
464
|
+
// the second time picker will not able to pick time before first time picker
|
465
|
+
if (!selectedValue[1] || startValue.isSame(selectedValue[1], 'day')) {
|
466
|
+
var hours = startValue.hour();
|
467
|
+
var minutes = startValue.minute();
|
468
|
+
var second = startValue.second();
|
469
|
+
var _disabledHours = userSettingDisabledTime.disabledHours,
|
470
|
+
_disabledMinutes = userSettingDisabledTime.disabledMinutes,
|
471
|
+
_disabledSeconds = userSettingDisabledTime.disabledSeconds;
|
472
|
+
var oldDisabledMinutes = _disabledMinutes ? _disabledMinutes() : [];
|
473
|
+
var olddisabledSeconds = _disabledSeconds ? _disabledSeconds() : [];
|
474
|
+
_disabledHours = generateOptions(hours, _disabledHours);
|
475
|
+
_disabledMinutes = generateOptions(minutes, _disabledMinutes);
|
476
|
+
_disabledSeconds = generateOptions(second, _disabledSeconds);
|
477
|
+
return {
|
478
|
+
disabledHours: function disabledHours() {
|
479
|
+
return _disabledHours;
|
480
|
+
},
|
481
|
+
disabledMinutes: function disabledMinutes(hour) {
|
482
|
+
if (hour === hours) {
|
483
|
+
return _disabledMinutes;
|
484
|
+
}
|
485
|
+
return oldDisabledMinutes;
|
486
|
+
},
|
487
|
+
disabledSeconds: function disabledSeconds(hour, minute) {
|
488
|
+
if (hour === hours && minute === minutes) {
|
489
|
+
return _disabledSeconds;
|
490
|
+
}
|
491
|
+
return olddisabledSeconds;
|
492
|
+
}
|
493
|
+
};
|
494
|
+
}
|
495
|
+
return userSettingDisabledTime;
|
496
|
+
});
|
497
|
+
_defineProperty(_this, "isAllowedDateAndTime", function (selectedValue) {
|
498
|
+
return isAllowedDate(selectedValue[0], _this.props.disabledDate, _this.disabledStartTime) && isAllowedDate(selectedValue[1], _this.props.disabledDate, _this.disabledEndTime);
|
499
|
+
});
|
500
|
+
_defineProperty(_this, "isMonthYearPanelShow", function (mode) {
|
501
|
+
return ['month', 'year', 'decade'].indexOf(mode) > -1;
|
502
|
+
});
|
503
|
+
_defineProperty(_this, "hasSelectedValue", function () {
|
504
|
+
var selectedValue = _this.state.selectedValue;
|
505
|
+
return !!selectedValue[1] && !!selectedValue[0];
|
506
|
+
});
|
507
|
+
_defineProperty(_this, "compare", function (v1, v2) {
|
508
|
+
if (_this.props.timePicker) {
|
509
|
+
return v1.diff(v2);
|
510
|
+
}
|
511
|
+
return v1.diff(v2, 'days');
|
512
|
+
});
|
513
|
+
_defineProperty(_this, "fireSelectValueChange", function (selectedValue, direct, cause) {
|
514
|
+
var timePicker = _this.props.timePicker;
|
515
|
+
var prevSelectedValue = _this.state.prevSelectedValue;
|
516
|
+
if (timePicker && timePicker.props.defaultValue) {
|
517
|
+
var timePickerDefaultValue = timePicker.props.defaultValue;
|
518
|
+
if (!prevSelectedValue[0] && selectedValue[0]) {
|
519
|
+
syncTime(timePickerDefaultValue[0], selectedValue[0]);
|
520
|
+
}
|
521
|
+
if (!prevSelectedValue[1] && selectedValue[1]) {
|
522
|
+
syncTime(timePickerDefaultValue[1], selectedValue[1]);
|
523
|
+
}
|
524
|
+
}
|
525
|
+
if (!('selectedValue' in _this.props)) {
|
526
|
+
_this.setState({
|
527
|
+
selectedValue: selectedValue
|
528
|
+
});
|
529
|
+
}
|
530
|
+
|
531
|
+
// 尚未选择过时间,直接输入的话
|
532
|
+
if (!_this.state.selectedValue[0] || !_this.state.selectedValue[1]) {
|
533
|
+
var startValue = selectedValue[0] || dayjs();
|
534
|
+
var endValue = selectedValue[1] || startValue.clone().add(1, 'months');
|
535
|
+
_this.setState({
|
536
|
+
selectedValue: selectedValue,
|
537
|
+
value: getValueFromSelectedValue([startValue, endValue])
|
538
|
+
});
|
539
|
+
}
|
540
|
+
if (selectedValue[0] && !selectedValue[1]) {
|
541
|
+
_this.setState({
|
542
|
+
firstSelectedValue: selectedValue[0]
|
543
|
+
});
|
544
|
+
_this.fireHoverValueChange(selectedValue.concat());
|
545
|
+
}
|
546
|
+
_this.props.onChange(selectedValue);
|
547
|
+
if (direct || selectedValue[0] && selectedValue[1]) {
|
548
|
+
_this.setState({
|
549
|
+
prevSelectedValue: selectedValue,
|
550
|
+
firstSelectedValue: null
|
551
|
+
});
|
552
|
+
_this.fireHoverValueChange([]);
|
553
|
+
_this.props.onSelect(selectedValue, cause);
|
554
|
+
}
|
555
|
+
});
|
556
|
+
_defineProperty(_this, "fireValueChange", function (value) {
|
557
|
+
var props = _this.props;
|
558
|
+
if (!('value' in props)) {
|
559
|
+
_this.setState({
|
560
|
+
value: value
|
561
|
+
});
|
562
|
+
}
|
563
|
+
props.onValueChange(value);
|
564
|
+
});
|
565
|
+
_defineProperty(_this, "fireHoverValueChange", function (hoverValue) {
|
566
|
+
var props = _this.props;
|
567
|
+
if (!('hoverValue' in props)) {
|
568
|
+
_this.setState({
|
569
|
+
hoverValue: hoverValue
|
570
|
+
});
|
571
|
+
}
|
572
|
+
props.onHoverChange(hoverValue);
|
573
|
+
});
|
574
|
+
_defineProperty(_this, "clear", function () {
|
575
|
+
_this.fireSelectValueChange([], true);
|
576
|
+
_this.props.onClear();
|
577
|
+
});
|
578
|
+
_defineProperty(_this, "disabledStartTime", function (time) {
|
579
|
+
return _this.props.disabledTime(time, 'start');
|
580
|
+
});
|
581
|
+
_defineProperty(_this, "disabledEndTime", function (time) {
|
582
|
+
return _this.props.disabledTime(time, 'end');
|
583
|
+
});
|
584
|
+
_defineProperty(_this, "disabledStartMonth", function (month) {
|
585
|
+
var value = _this.state.value;
|
586
|
+
return month.isAfter(value[1], 'month');
|
587
|
+
});
|
588
|
+
_defineProperty(_this, "disabledEndMonth", function (month) {
|
589
|
+
var value = _this.state.value;
|
590
|
+
return month.isBefore(value[0], 'month');
|
591
|
+
});
|
592
|
+
var _selectedValue2 = _props.selectedValue || _props.defaultSelectedValue;
|
593
|
+
var _value = normalizeAnchor(_props, 1);
|
594
|
+
_this.state = {
|
595
|
+
selectedValue: _selectedValue2,
|
596
|
+
prevSelectedValue: _selectedValue2,
|
597
|
+
firstSelectedValue: null,
|
598
|
+
hoverValue: _props.hoverValue || [],
|
599
|
+
value: _value,
|
600
|
+
showTimePicker: false,
|
601
|
+
mode: _props.mode || ['date', 'date'],
|
602
|
+
panelTriggerSource: '' // Trigger by which picker panel: 'start' & 'end'
|
603
|
+
};
|
604
|
+
return _this;
|
605
|
+
}
|
606
|
+
_inherits(RangeCalendar, _React$Component);
|
607
|
+
return _createClass(RangeCalendar, [{
|
608
|
+
key: "render",
|
609
|
+
value: function render() {
|
610
|
+
var props = this.props,
|
611
|
+
state = this.state;
|
612
|
+
var prefixCls = props.prefixCls,
|
613
|
+
dateInputPlaceholder = props.dateInputPlaceholder,
|
614
|
+
seperator = props.seperator,
|
615
|
+
timePicker = props.timePicker,
|
616
|
+
showOk = props.showOk,
|
617
|
+
locale = props.locale,
|
618
|
+
showClear = props.showClear,
|
619
|
+
showToday = props.showToday,
|
620
|
+
type = props.type,
|
621
|
+
clearIcon = props.clearIcon;
|
622
|
+
var hoverValue = state.hoverValue,
|
623
|
+
selectedValue = state.selectedValue,
|
624
|
+
mode = state.mode,
|
625
|
+
showTimePicker = state.showTimePicker;
|
626
|
+
var className = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, props.className, !!props.className), prefixCls, 1), "".concat(prefixCls, "-hidden"), !props.visible), "".concat(prefixCls, "-range"), 1), "".concat(prefixCls, "-show-time-picker"), showTimePicker), "".concat(prefixCls, "-week-number"), props.showWeekNumber);
|
627
|
+
var classes = classnames(className);
|
628
|
+
var newProps = {
|
629
|
+
selectedValue: state.selectedValue,
|
630
|
+
onSelect: this.onSelect,
|
631
|
+
onDayHover: type === 'start' && selectedValue[1] || type === 'end' && selectedValue[0] || !!hoverValue.length ? this.onDayHover : undefined
|
632
|
+
};
|
633
|
+
var placeholder1;
|
634
|
+
var placeholder2;
|
635
|
+
if (dateInputPlaceholder) {
|
636
|
+
if (Array.isArray(dateInputPlaceholder)) {
|
637
|
+
var _dateInputPlaceholder = _slicedToArray(dateInputPlaceholder, 2);
|
638
|
+
placeholder1 = _dateInputPlaceholder[0];
|
639
|
+
placeholder2 = _dateInputPlaceholder[1];
|
640
|
+
} else {
|
641
|
+
placeholder1 = placeholder2 = dateInputPlaceholder;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
var showOkButton = showOk === true || showOk !== false && !!timePicker;
|
645
|
+
var cls = classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-footer"), true), "".concat(prefixCls, "-range-bottom"), true), "".concat(prefixCls, "-footer-show-ok"), showOkButton));
|
646
|
+
var startValue = this.getStartValue();
|
647
|
+
var endValue = this.getEndValue();
|
648
|
+
var todayTime = getTodayTime(startValue);
|
649
|
+
var thisMonth = todayTime.month();
|
650
|
+
var thisYear = todayTime.year();
|
651
|
+
var isTodayInView = startValue.year() === thisYear && startValue.month() === thisMonth || endValue.year() === thisYear && endValue.month() === thisMonth;
|
652
|
+
var nextMonthOfStart = startValue.clone().add(1, 'months');
|
653
|
+
var isClosestMonths = nextMonthOfStart.year() === endValue.year() && nextMonthOfStart.month() === endValue.month();
|
654
|
+
var extraFooter = props.renderFooter();
|
655
|
+
return /*#__PURE__*/React.createElement("div", {
|
656
|
+
ref: this.saveRoot,
|
657
|
+
className: classes,
|
658
|
+
style: props.style,
|
659
|
+
tabIndex: "0",
|
660
|
+
onKeyDown: this.onKeyDown
|
661
|
+
}, props.renderSidebar(), /*#__PURE__*/React.createElement("div", {
|
662
|
+
className: "".concat(prefixCls, "-panel")
|
663
|
+
}, showClear && selectedValue[0] && selectedValue[1] ? /*#__PURE__*/React.createElement("a", {
|
664
|
+
role: "button",
|
665
|
+
title: locale.clear,
|
666
|
+
onClick: this.clear
|
667
|
+
}, clearIcon || /*#__PURE__*/React.createElement("span", {
|
668
|
+
className: "".concat(prefixCls, "-clear-btn")
|
669
|
+
})) : null, /*#__PURE__*/React.createElement("div", {
|
670
|
+
className: "".concat(prefixCls, "-date-panel"),
|
671
|
+
onMouseLeave: type !== 'both' ? this.onDatePanelLeave : undefined,
|
672
|
+
onMouseEnter: type !== 'both' ? this.onDatePanelEnter : undefined
|
673
|
+
}, /*#__PURE__*/React.createElement(CalendarPart, _extends({}, props, newProps, {
|
674
|
+
hoverValue: hoverValue,
|
675
|
+
direction: "left",
|
676
|
+
disabledTime: this.disabledStartTime,
|
677
|
+
disabledMonth: this.disabledStartMonth,
|
678
|
+
format: this.getFormat(),
|
679
|
+
value: startValue,
|
680
|
+
mode: mode[0],
|
681
|
+
placeholder: placeholder1,
|
682
|
+
onInputChange: this.onStartInputChange,
|
683
|
+
onInputSelect: this.onStartInputSelect,
|
684
|
+
onValueChange: this.onStartValueChange,
|
685
|
+
onPanelChange: this.onStartPanelChange,
|
686
|
+
showDateInput: this.props.showDateInput,
|
687
|
+
timePicker: timePicker,
|
688
|
+
showTimePicker: showTimePicker || mode[0] === 'time',
|
689
|
+
enablePrev: true,
|
690
|
+
enableNext: !isClosestMonths || this.isMonthYearPanelShow(mode[1]),
|
691
|
+
clearIcon: clearIcon
|
692
|
+
})), /*#__PURE__*/React.createElement("span", {
|
693
|
+
className: "".concat(prefixCls, "-range-middle")
|
694
|
+
}, seperator), /*#__PURE__*/React.createElement(CalendarPart, _extends({}, props, newProps, {
|
695
|
+
hoverValue: hoverValue,
|
696
|
+
direction: "right",
|
697
|
+
format: this.getFormat(),
|
698
|
+
timePickerDisabledTime: this.getEndDisableTime(),
|
699
|
+
placeholder: placeholder2,
|
700
|
+
value: endValue,
|
701
|
+
mode: mode[1],
|
702
|
+
onInputChange: this.onEndInputChange,
|
703
|
+
onInputSelect: this.onEndInputSelect,
|
704
|
+
onValueChange: this.onEndValueChange,
|
705
|
+
onPanelChange: this.onEndPanelChange,
|
706
|
+
showDateInput: this.props.showDateInput,
|
707
|
+
timePicker: timePicker,
|
708
|
+
showTimePicker: showTimePicker || mode[1] === 'time',
|
709
|
+
disabledTime: this.disabledEndTime,
|
710
|
+
disabledMonth: this.disabledEndMonth,
|
711
|
+
enablePrev: !isClosestMonths || this.isMonthYearPanelShow(mode[0]),
|
712
|
+
enableNext: true,
|
713
|
+
clearIcon: clearIcon
|
714
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
715
|
+
className: cls
|
716
|
+
}, showToday || props.timePicker || showOkButton || extraFooter ? /*#__PURE__*/React.createElement("div", {
|
717
|
+
className: "".concat(prefixCls, "-footer-btn")
|
718
|
+
}, extraFooter, showToday ? /*#__PURE__*/React.createElement(TodayButton, _extends({}, props, {
|
719
|
+
disabled: isTodayInView,
|
720
|
+
value: state.value[0],
|
721
|
+
onToday: this.onToday,
|
722
|
+
text: locale.backToToday
|
723
|
+
})) : null, props.timePicker ? /*#__PURE__*/React.createElement(TimePickerButton, _extends({}, props, {
|
724
|
+
showTimePicker: showTimePicker || mode[0] === 'time' && mode[1] === 'time',
|
725
|
+
onOpenTimePicker: this.onOpenTimePicker,
|
726
|
+
onCloseTimePicker: this.onCloseTimePicker,
|
727
|
+
timePickerDisabled: !this.hasSelectedValue() || hoverValue.length
|
728
|
+
})) : null, showOkButton ? /*#__PURE__*/React.createElement(OkButton, _extends({}, props, {
|
729
|
+
onOk: this.onOk,
|
730
|
+
okDisabled: !this.isAllowedDateAndTime(selectedValue) || !this.hasSelectedValue() || hoverValue.length
|
731
|
+
})) : null) : null)));
|
732
|
+
}
|
733
|
+
}], [{
|
734
|
+
key: "getDerivedStateFromProps",
|
735
|
+
value: function getDerivedStateFromProps(nextProps, state) {
|
736
|
+
var newState = {};
|
737
|
+
if ('value' in nextProps) {
|
738
|
+
newState.value = normalizeAnchor(nextProps, 0);
|
739
|
+
}
|
740
|
+
if ('hoverValue' in nextProps && !isArraysEqual(state.hoverValue, nextProps.hoverValue)) {
|
741
|
+
newState.hoverValue = nextProps.hoverValue;
|
742
|
+
}
|
743
|
+
if ('selectedValue' in nextProps) {
|
744
|
+
newState.selectedValue = nextProps.selectedValue;
|
745
|
+
newState.prevSelectedValue = nextProps.selectedValue;
|
746
|
+
}
|
747
|
+
if ('mode' in nextProps && !isArraysEqual(state.mode, nextProps.mode)) {
|
748
|
+
newState.mode = nextProps.mode;
|
749
|
+
}
|
750
|
+
return newState;
|
751
|
+
}
|
752
|
+
}]);
|
753
|
+
}(React.Component);
|
754
|
+
_defineProperty(RangeCalendar, "propTypes", _objectSpread(_objectSpread({}, propType), {}, {
|
755
|
+
prefixCls: PropTypes.string,
|
756
|
+
dateInputPlaceholder: PropTypes.any,
|
757
|
+
seperator: PropTypes.string,
|
758
|
+
defaultValue: PropTypes.any,
|
759
|
+
value: PropTypes.any,
|
760
|
+
hoverValue: PropTypes.any,
|
761
|
+
mode: PropTypes.arrayOf(PropTypes.oneOf(['time', 'date', 'month', 'year', 'decade'])),
|
762
|
+
showDateInput: PropTypes.bool,
|
763
|
+
timePicker: PropTypes.any,
|
764
|
+
showOk: PropTypes.bool,
|
765
|
+
showToday: PropTypes.bool,
|
766
|
+
defaultSelectedValue: PropTypes.array,
|
767
|
+
selectedValue: PropTypes.array,
|
768
|
+
onOk: PropTypes.func,
|
769
|
+
showClear: PropTypes.bool,
|
770
|
+
locale: PropTypes.object,
|
771
|
+
onChange: PropTypes.func,
|
772
|
+
onSelect: PropTypes.func,
|
773
|
+
onValueChange: PropTypes.func,
|
774
|
+
onHoverChange: PropTypes.func,
|
775
|
+
onPanelChange: PropTypes.func,
|
776
|
+
format: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
777
|
+
onClear: PropTypes.func,
|
778
|
+
type: PropTypes.any,
|
779
|
+
disabledDate: PropTypes.func,
|
780
|
+
disabledTime: PropTypes.func,
|
781
|
+
clearIcon: PropTypes.node,
|
782
|
+
onKeyDown: PropTypes.func
|
783
|
+
}));
|
784
|
+
_defineProperty(RangeCalendar, "defaultProps", _objectSpread(_objectSpread({}, defaultProp), {}, {
|
785
|
+
type: 'both',
|
786
|
+
seperator: '~',
|
787
|
+
defaultSelectedValue: [],
|
788
|
+
onValueChange: noop,
|
789
|
+
onHoverChange: noop,
|
790
|
+
onPanelChange: noop,
|
791
|
+
disabledTime: noop,
|
792
|
+
onInputSelect: noop,
|
793
|
+
showToday: true,
|
794
|
+
showDateInput: true
|
795
|
+
}));
|
796
|
+
polyfill(RangeCalendar);
|
797
|
+
export default commonMixinWrapper(RangeCalendar);
|