commit | author | age
|
4f929e
|
1 |
(function webpackUniversalModuleDefinition(root, factory) { |
LC |
2 |
if(typeof exports === 'object' && typeof module === 'object') |
c7776a
|
3 |
module.exports = factory(require("React"), require("moment")); |
4f929e
|
4 |
else if(typeof define === 'function' && define.amd) |
c7776a
|
5 |
define(["React", "moment"], factory); |
4f929e
|
6 |
else if(typeof exports === 'object') |
c7776a
|
7 |
exports["Datetime"] = factory(require("React"), require("moment")); |
4f929e
|
8 |
else |
c7776a
|
9 |
root["Datetime"] = factory(root["React"], root["moment"]); |
M |
10 |
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__) { |
4f929e
|
11 |
return /******/ (function(modules) { // webpackBootstrap |
LC |
12 |
/******/ // The module cache |
|
13 |
/******/ var installedModules = {}; |
e44fda
|
14 |
|
4f929e
|
15 |
/******/ // The require function |
LC |
16 |
/******/ function __webpack_require__(moduleId) { |
e44fda
|
17 |
|
4f929e
|
18 |
/******/ // Check if module is in cache |
LC |
19 |
/******/ if(installedModules[moduleId]) |
|
20 |
/******/ return installedModules[moduleId].exports; |
e44fda
|
21 |
|
4f929e
|
22 |
/******/ // Create a new module (and put it into the cache) |
LC |
23 |
/******/ var module = installedModules[moduleId] = { |
|
24 |
/******/ exports: {}, |
|
25 |
/******/ id: moduleId, |
|
26 |
/******/ loaded: false |
|
27 |
/******/ }; |
e44fda
|
28 |
|
4f929e
|
29 |
/******/ // Execute the module function |
LC |
30 |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
e44fda
|
31 |
|
4f929e
|
32 |
/******/ // Flag the module as loaded |
LC |
33 |
/******/ module.loaded = true; |
e44fda
|
34 |
|
4f929e
|
35 |
/******/ // Return the exports of the module |
LC |
36 |
/******/ return module.exports; |
|
37 |
/******/ } |
e44fda
|
38 |
|
LC |
39 |
|
4f929e
|
40 |
/******/ // expose the modules object (__webpack_modules__) |
LC |
41 |
/******/ __webpack_require__.m = modules; |
e44fda
|
42 |
|
4f929e
|
43 |
/******/ // expose the module cache |
LC |
44 |
/******/ __webpack_require__.c = installedModules; |
e44fda
|
45 |
|
4f929e
|
46 |
/******/ // __webpack_public_path__ |
LC |
47 |
/******/ __webpack_require__.p = ""; |
e44fda
|
48 |
|
4f929e
|
49 |
/******/ // Load entry module and return exports |
LC |
50 |
/******/ return __webpack_require__(0); |
|
51 |
/******/ }) |
|
52 |
/************************************************************************/ |
|
53 |
/******/ ([ |
|
54 |
/* 0 */ |
|
55 |
/***/ function(module, exports, __webpack_require__) { |
|
56 |
|
|
57 |
module.exports = __webpack_require__(1); |
|
58 |
|
|
59 |
|
|
60 |
/***/ }, |
|
61 |
/* 1 */ |
|
62 |
/***/ function(module, exports, __webpack_require__) { |
|
63 |
|
c7776a
|
64 |
var DateTimeField, DateTimePicker, React, moment; |
4f929e
|
65 |
|
ddac85
|
66 |
React = __webpack_require__(2); |
4f929e
|
67 |
|
c7776a
|
68 |
DateTimePicker = __webpack_require__(3); |
4f929e
|
69 |
|
c7776a
|
70 |
moment = __webpack_require__(6); |
4f929e
|
71 |
|
c7776a
|
72 |
var Constants = __webpack_require__(11); |
972424
|
73 |
|
4f929e
|
74 |
DateTimeField = React.createClass({displayName: "DateTimeField", |
LC |
75 |
propTypes: { |
|
76 |
dateTime: React.PropTypes.string, |
|
77 |
onChange: React.PropTypes.func, |
|
78 |
format: React.PropTypes.string, |
194555
|
79 |
inputProps: React.PropTypes.object, |
972424
|
80 |
inputFormat: React.PropTypes.string, |
b4ea2f
|
81 |
defaultText: React.PropTypes.string, |
972424
|
82 |
mode: React.PropTypes.oneOf([Constants.MODE_DATE, Constants.MODE_DATETIME, Constants.MODE_TIME]), |
b4ea2f
|
83 |
minDate: React.PropTypes.object, |
LC |
84 |
maxDate: React.PropTypes.object |
4f929e
|
85 |
}, |
LC |
86 |
getDefaultProps: function() { |
|
87 |
return { |
e44fda
|
88 |
dateTime: moment().format('x'), |
LC |
89 |
format: 'x', |
4f929e
|
90 |
showToday: true, |
294242
|
91 |
viewMode: 'days', |
4f929e
|
92 |
daysOfWeekDisabled: [], |
972424
|
93 |
mode: Constants.MODE_DATETIME, |
4f929e
|
94 |
onChange: function (x) { |
LC |
95 |
console.log(x); |
|
96 |
} |
|
97 |
}; |
|
98 |
}, |
|
99 |
getInitialState: function() { |
|
100 |
return { |
972424
|
101 |
showDatePicker: this.props.mode !== Constants.MODE_TIME, |
LC |
102 |
showTimePicker: this.props.mode === Constants.MODE_TIME, |
|
103 |
inputFormat: this.resolvePropsInputFormat(), |
|
104 |
buttonIcon: this.props.mode === Constants.MODE_TIME ? "time" : "calendar", |
4f929e
|
105 |
widgetStyle: { |
LC |
106 |
display: 'block', |
|
107 |
position: 'absolute', |
|
108 |
left: -9999, |
|
109 |
zIndex: '9999 !important' |
|
110 |
}, |
e44fda
|
111 |
viewDate: moment(this.props.dateTime, this.props.format, true).startOf("month"), |
LC |
112 |
selectedDate: moment(this.props.dateTime, this.props.format, true), |
972424
|
113 |
inputValue: typeof this.props.defaultText != 'undefined' ? this.props.defaultText : moment(this.props.dateTime, this.props.format, true).format(this.resolvePropsInputFormat()) |
4f929e
|
114 |
}; |
LC |
115 |
}, |
|
116 |
componentWillReceiveProps: function(nextProps) { |
e44fda
|
117 |
if(moment(nextProps.dateTime, nextProps.format, true).isValid()) { |
LC |
118 |
return this.setState({ |
|
119 |
viewDate: moment(nextProps.dateTime, nextProps.format, true).startOf("month"), |
|
120 |
selectedDate: moment(nextProps.dateTime, nextProps.format, true), |
|
121 |
inputValue: moment(nextProps.dateTime, nextProps.format, true).format(nextProps.inputFormat) |
|
122 |
}); |
|
123 |
} |
972424
|
124 |
if (nextProps.inputFormat !== this.props.inputFormat) { |
LC |
125 |
return this.setState({ |
|
126 |
inputFormat: nextProps.inputFormat |
|
127 |
}); |
|
128 |
} |
|
129 |
}, |
|
130 |
resolvePropsInputFormat: function() { |
|
131 |
if(this.props.inputFormat) return this.props.inputFormat; |
|
132 |
switch(this.props.mode) { |
|
133 |
case Constants.MODE_TIME: |
|
134 |
return "h:mm A"; |
|
135 |
case Constants.MODE_DATE: |
|
136 |
return "MM/DD/YY"; |
|
137 |
default: |
|
138 |
return "MM/DD/YY h:mm A"; |
|
139 |
} |
4f929e
|
140 |
}, |
LC |
141 |
onChange: function(event) { |
e44fda
|
142 |
var value = event.target == null ? event : event.target.value; |
972424
|
143 |
if (moment(value, this.state.inputFormat, true).isValid()) { |
4f929e
|
144 |
this.setState({ |
972424
|
145 |
selectedDate: moment(value, this.state.inputFormat, true), |
LC |
146 |
viewDate: moment(value, this.state.inputFormat, true).startOf("month") |
4f929e
|
147 |
}); |
LC |
148 |
} |
e44fda
|
149 |
|
LC |
150 |
return this.setState({ |
|
151 |
inputValue: value |
|
152 |
}, function() { |
972424
|
153 |
return this.props.onChange(moment(this.state.inputValue, this.state.inputFormat, true).format(this.props.format)); |
e44fda
|
154 |
}); |
LC |
155 |
|
4f929e
|
156 |
}, |
LC |
157 |
setSelectedDate: function(e) { |
972424
|
158 |
var target = e.target; |
LC |
159 |
if (target.className && !target.className.match(/disabled/g)) { |
|
160 |
var month; |
c7776a
|
161 |
if(target.className.indexOf("new") >= 0) month = this.state.viewDate.month() + 1; |
M |
162 |
else if(target.className.indexOf("old") >= 0) month = this.state.viewDate.month() - 1; |
972424
|
163 |
else month = this.state.viewDate.month(); |
4f929e
|
164 |
return this.setState({ |
972424
|
165 |
selectedDate: this.state.viewDate.clone().month(month).date(parseInt(e.target.innerHTML)).hour(this.state.selectedDate.hours()).minute(this.state.selectedDate.minutes()) |
LC |
166 |
}, function() { |
b4ea2f
|
167 |
this.closePicker(); |
LC |
168 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
|
169 |
return this.setState({ |
972424
|
170 |
inputValue: this.state.selectedDate.format(this.state.inputFormat) |
b4ea2f
|
171 |
}); |
4f929e
|
172 |
}); |
b4ea2f
|
173 |
} |
4f929e
|
174 |
}, |
LC |
175 |
setSelectedHour: function(e) { |
|
176 |
return this.setState({ |
|
177 |
selectedDate: this.state.selectedDate.clone().hour(parseInt(e.target.innerHTML)).minute(this.state.selectedDate.minutes()) |
|
178 |
}, function() { |
|
179 |
this.closePicker(); |
|
180 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
|
181 |
return this.setState({ |
972424
|
182 |
inputValue: this.state.selectedDate.format(this.state.inputFormat) |
4f929e
|
183 |
}); |
LC |
184 |
}); |
|
185 |
}, |
|
186 |
setSelectedMinute: function(e) { |
|
187 |
return this.setState({ |
|
188 |
selectedDate: this.state.selectedDate.clone().hour(this.state.selectedDate.hours()).minute(parseInt(e.target.innerHTML)) |
|
189 |
}, function() { |
|
190 |
this.closePicker(); |
|
191 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
|
192 |
return this.setState({ |
972424
|
193 |
inputValue: this.state.selectedDate.format(this.state.inputFormat) |
4f929e
|
194 |
}); |
LC |
195 |
}); |
|
196 |
}, |
|
197 |
setViewMonth: function(month) { |
|
198 |
return this.setState({ |
|
199 |
viewDate: this.state.viewDate.clone().month(month) |
|
200 |
}); |
|
201 |
}, |
|
202 |
setViewYear: function(year) { |
|
203 |
return this.setState({ |
|
204 |
viewDate: this.state.viewDate.clone().year(year) |
|
205 |
}); |
|
206 |
}, |
|
207 |
addMinute: function() { |
|
208 |
return this.setState({ |
|
209 |
selectedDate: this.state.selectedDate.clone().add(1, "minutes") |
|
210 |
}, function() { |
b4ea2f
|
211 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
LC |
212 |
return this.setState({ |
972424
|
213 |
inputValue: this.state.selectedDate.format(this.resolvePropsInputFormat()) |
b4ea2f
|
214 |
}); |
4f929e
|
215 |
}); |
LC |
216 |
}, |
|
217 |
addHour: function() { |
|
218 |
return this.setState({ |
|
219 |
selectedDate: this.state.selectedDate.clone().add(1, "hours") |
|
220 |
}, function() { |
b4ea2f
|
221 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
LC |
222 |
return this.setState({ |
972424
|
223 |
inputValue: this.state.selectedDate.format(this.resolvePropsInputFormat()) |
b4ea2f
|
224 |
}); |
4f929e
|
225 |
}); |
LC |
226 |
}, |
|
227 |
addMonth: function() { |
|
228 |
return this.setState({ |
|
229 |
viewDate: this.state.viewDate.add(1, "months") |
|
230 |
}); |
|
231 |
}, |
|
232 |
addYear: function() { |
|
233 |
return this.setState({ |
|
234 |
viewDate: this.state.viewDate.add(1, "years") |
|
235 |
}); |
|
236 |
}, |
|
237 |
addDecade: function() { |
|
238 |
return this.setState({ |
|
239 |
viewDate: this.state.viewDate.add(10, "years") |
|
240 |
}); |
|
241 |
}, |
|
242 |
subtractMinute: function() { |
|
243 |
return this.setState({ |
|
244 |
selectedDate: this.state.selectedDate.clone().subtract(1, "minutes") |
|
245 |
}, function() { |
b4ea2f
|
246 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
LC |
247 |
return this.setState({ |
972424
|
248 |
inputValue: this.state.selectedDate.format(this.resolvePropsInputFormat()) |
b4ea2f
|
249 |
}); |
4f929e
|
250 |
}); |
LC |
251 |
}, |
|
252 |
subtractHour: function() { |
|
253 |
return this.setState({ |
|
254 |
selectedDate: this.state.selectedDate.clone().subtract(1, "hours") |
|
255 |
}, function() { |
b4ea2f
|
256 |
this.props.onChange(this.state.selectedDate.format(this.props.format)); |
LC |
257 |
return this.setState({ |
972424
|
258 |
inputValue: this.state.selectedDate.format(this.resolvePropsInputFormat()) |
b4ea2f
|
259 |
}); |
4f929e
|
260 |
}); |
LC |
261 |
}, |
|
262 |
subtractMonth: function() { |
|
263 |
return this.setState({ |
|
264 |
viewDate: this.state.viewDate.subtract(1, "months") |
|
265 |
}); |
|
266 |
}, |
|
267 |
subtractYear: function() { |
|
268 |
return this.setState({ |
|
269 |
viewDate: this.state.viewDate.subtract(1, "years") |
|
270 |
}); |
|
271 |
}, |
|
272 |
subtractDecade: function() { |
|
273 |
return this.setState({ |
|
274 |
viewDate: this.state.viewDate.subtract(10, "years") |
|
275 |
}); |
|
276 |
}, |
|
277 |
togglePeriod: function() { |
|
278 |
if (this.state.selectedDate.hour() > 12) { |
972424
|
279 |
return this.onChange(this.state.selectedDate.clone().subtract(12, 'hours').format(this.state.inputFormat)); |
4f929e
|
280 |
} else { |
972424
|
281 |
return this.onChange(this.state.selectedDate.clone().add(12, 'hours').format(this.state.inputFormat)); |
4f929e
|
282 |
} |
LC |
283 |
}, |
|
284 |
togglePicker: function() { |
|
285 |
return this.setState({ |
|
286 |
showDatePicker: !this.state.showDatePicker, |
|
287 |
showTimePicker: !this.state.showTimePicker |
|
288 |
}); |
|
289 |
}, |
|
290 |
onClick: function() { |
c7776a
|
291 |
var classes = [], |
M |
292 |
gBCR, offset, placePosition, scrollTop, styles |
|
293 |
; |
4f929e
|
294 |
if (this.state.showPicker) { |
LC |
295 |
return this.closePicker(); |
|
296 |
} else { |
c7776a
|
297 |
classes = [ "bootstrap-datetimepicker-widget", "dropdown-menu", "bottom", "pull-right" ]; |
4f929e
|
298 |
styles = { |
LC |
299 |
display: 'block', |
|
300 |
position: 'absolute', |
|
301 |
left: 'auto', |
|
302 |
right: 40 |
|
303 |
}; |
|
304 |
return this.setState({ |
|
305 |
widgetStyle: styles, |
c7776a
|
306 |
widgetClasses: classes.join(" "), |
M |
307 |
showPicker: true |
4f929e
|
308 |
}); |
LC |
309 |
} |
|
310 |
}, |
|
311 |
closePicker: function(e) { |
|
312 |
var style; |
|
313 |
style = this.state.widgetStyle; |
|
314 |
style['left'] = -9999; |
294242
|
315 |
style['display'] = 'none'; |
4f929e
|
316 |
return this.setState({ |
LC |
317 |
showPicker: false, |
|
318 |
widgetStyle: style |
|
319 |
}); |
|
320 |
}, |
|
321 |
renderOverlay: function() { |
|
322 |
var styles; |
|
323 |
styles = { |
|
324 |
position: 'fixed', |
|
325 |
top: 0, |
|
326 |
bottom: 0, |
|
327 |
left: 0, |
|
328 |
right: 0, |
|
329 |
zIndex: '999' |
|
330 |
}; |
|
331 |
if (this.state.showPicker) { |
|
332 |
return (React.createElement("div", {style: styles, onClick: this.closePicker})); |
|
333 |
} else { |
|
334 |
return React.createElement("span", null); |
|
335 |
} |
|
336 |
}, |
|
337 |
render: function() { |
|
338 |
return ( |
|
339 |
React.createElement("div", null, |
|
340 |
this.renderOverlay(), |
c7776a
|
341 |
React.createElement(DateTimePicker, { |
M |
342 |
widgetClasses: this.state.widgetClasses, |
|
343 |
widgetStyle: this.state.widgetStyle, |
|
344 |
showDatePicker: this.state.showDatePicker, |
|
345 |
showTimePicker: this.state.showTimePicker, |
|
346 |
viewDate: this.state.viewDate, |
|
347 |
selectedDate: this.state.selectedDate, |
|
348 |
showToday: this.props.showToday, |
|
349 |
viewMode: this.props.viewMode, |
|
350 |
daysOfWeekDisabled: this.props.daysOfWeekDisabled, |
|
351 |
mode: this.props.mode, |
|
352 |
minDate: this.props.minDate, |
|
353 |
maxDate: this.props.maxDate, |
|
354 |
addDecade: this.addDecade, |
|
355 |
addYear: this.addYear, |
|
356 |
addMonth: this.addMonth, |
|
357 |
addHour: this.addHour, |
|
358 |
addMinute: this.addMinute, |
|
359 |
subtractDecade: this.subtractDecade, |
|
360 |
subtractYear: this.subtractYear, |
|
361 |
subtractMonth: this.subtractMonth, |
|
362 |
subtractHour: this.subtractHour, |
|
363 |
subtractMinute: this.subtractMinute, |
|
364 |
setViewYear: this.setViewYear, |
|
365 |
setViewMonth: this.setViewMonth, |
|
366 |
setSelectedDate: this.setSelectedDate, |
|
367 |
setSelectedHour: this.setSelectedHour, |
|
368 |
setSelectedMinute: this.setSelectedMinute, |
|
369 |
togglePicker: this.togglePicker, |
|
370 |
togglePeriod: this.togglePeriod}), |
|
371 |
React.createElement("div", {className: "input-group date"}, |
194555
|
372 |
React.createElement("input", React.__spread({type: "text", className: "form-control", onChange: this.onChange, value: this.state.inputValue}, this.props.inputProps)), |
c7776a
|
373 |
React.createElement("span", {className: "input-group-addon", onClick: this.onClick, onBlur: this.onBlur}, "But") |
4f929e
|
374 |
) |
LC |
375 |
) |
|
376 |
); |
|
377 |
} |
|
378 |
}); |
|
379 |
|
|
380 |
module.exports = DateTimeField; |
|
381 |
|
|
382 |
|
|
383 |
/***/ }, |
|
384 |
/* 2 */ |
c7776a
|
385 |
/***/ function(module, exports) { |
4f929e
|
386 |
|
ddac85
|
387 |
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; |
HW |
388 |
|
|
389 |
/***/ }, |
|
390 |
/* 3 */ |
|
391 |
/***/ function(module, exports, __webpack_require__) { |
|
392 |
|
c7776a
|
393 |
var DateTimePicker, DateTimePickerDate, DateTimePickerTime, React; |
4f929e
|
394 |
|
ddac85
|
395 |
React = __webpack_require__(2); |
4f929e
|
396 |
|
c7776a
|
397 |
DateTimePickerDate = __webpack_require__(4); |
4f929e
|
398 |
|
c7776a
|
399 |
DateTimePickerTime = __webpack_require__(9); |
4f929e
|
400 |
|
c7776a
|
401 |
var Constants = __webpack_require__(11); |
4f929e
|
402 |
|
LC |
403 |
DateTimePicker = React.createClass({displayName: "DateTimePicker", |
|
404 |
propTypes: { |
|
405 |
showDatePicker: React.PropTypes.bool, |
|
406 |
showTimePicker: React.PropTypes.bool, |
|
407 |
subtractMonth: React.PropTypes.func.isRequired, |
|
408 |
addMonth: React.PropTypes.func.isRequired, |
|
409 |
viewDate: React.PropTypes.object.isRequired, |
|
410 |
selectedDate: React.PropTypes.object.isRequired, |
|
411 |
showToday: React.PropTypes.bool, |
294242
|
412 |
viewMode: React.PropTypes.oneOfType([ |
LC |
413 |
React.PropTypes.string, |
|
414 |
React.PropTypes.number |
|
415 |
]), |
972424
|
416 |
mode: React.PropTypes.oneOf([Constants.MODE_DATE, Constants.MODE_DATETIME, Constants.MODE_TIME]), |
4f929e
|
417 |
daysOfWeekDisabled: React.PropTypes.array, |
LC |
418 |
setSelectedDate: React.PropTypes.func.isRequired, |
|
419 |
subtractYear: React.PropTypes.func.isRequired, |
|
420 |
addYear: React.PropTypes.func.isRequired, |
|
421 |
setViewMonth: React.PropTypes.func.isRequired, |
|
422 |
setViewYear: React.PropTypes.func.isRequired, |
|
423 |
subtractHour: React.PropTypes.func.isRequired, |
|
424 |
addHour: React.PropTypes.func.isRequired, |
|
425 |
subtractMinute: React.PropTypes.func.isRequired, |
|
426 |
addMinute: React.PropTypes.func.isRequired, |
|
427 |
addDecade: React.PropTypes.func.isRequired, |
|
428 |
subtractDecade: React.PropTypes.func.isRequired, |
b4ea2f
|
429 |
togglePeriod: React.PropTypes.func.isRequired, |
LC |
430 |
minDate: React.PropTypes.object, |
|
431 |
maxDate: React.PropTypes.object |
4f929e
|
432 |
}, |
LC |
433 |
renderDatePicker: function() { |
|
434 |
if (this.props.showDatePicker) { |
|
435 |
return ( |
|
436 |
React.createElement("li", null, |
|
437 |
React.createElement(DateTimePickerDate, { |
|
438 |
addMonth: this.props.addMonth, |
|
439 |
subtractMonth: this.props.subtractMonth, |
|
440 |
setSelectedDate: this.props.setSelectedDate, |
|
441 |
viewDate: this.props.viewDate, |
|
442 |
selectedDate: this.props.selectedDate, |
|
443 |
showToday: this.props.showToday, |
294242
|
444 |
viewMode: this.props.viewMode, |
4f929e
|
445 |
daysOfWeekDisabled: this.props.daysOfWeekDisabled, |
LC |
446 |
subtractYear: this.props.subtractYear, |
|
447 |
addYear: this.props.addYear, |
|
448 |
setViewMonth: this.props.setViewMonth, |
|
449 |
setViewYear: this.props.setViewYear, |
|
450 |
addDecade: this.props.addDecade, |
b4ea2f
|
451 |
subtractDecade: this.props.subtractDecade, |
LC |
452 |
minDate: this.props.minDate, |
|
453 |
maxDate: this.props.maxDate} |
4f929e
|
454 |
) |
LC |
455 |
) |
|
456 |
); |
|
457 |
} |
|
458 |
}, |
|
459 |
renderTimePicker: function() { |
|
460 |
if (this.props.showTimePicker) { |
|
461 |
return ( |
|
462 |
React.createElement("li", null, |
|
463 |
React.createElement(DateTimePickerTime, { |
|
464 |
viewDate: this.props.viewDate, |
|
465 |
selectedDate: this.props.selectedDate, |
|
466 |
setSelectedHour: this.props.setSelectedHour, |
|
467 |
setSelectedMinute: this.props.setSelectedMinute, |
|
468 |
addHour: this.props.addHour, |
|
469 |
subtractHour: this.props.subtractHour, |
|
470 |
addMinute: this.props.addMinute, |
|
471 |
subtractMinute: this.props.subtractMinute, |
972424
|
472 |
togglePeriod: this.props.togglePeriod, |
LC |
473 |
mode: this.props.mode} |
4f929e
|
474 |
) |
LC |
475 |
) |
|
476 |
); |
|
477 |
} |
972424
|
478 |
}, |
LC |
479 |
renderSwitchButton: function() { |
|
480 |
return this.props.mode === Constants.MODE_DATETIME ? |
|
481 |
( |
|
482 |
React.createElement("li", null, |
c7776a
|
483 |
React.createElement("span", {className: "btn picker-switch", style: {width:'100%'}, onClick: this.props.togglePicker}, "Sw") |
972424
|
484 |
) |
LC |
485 |
) : |
|
486 |
null; |
4f929e
|
487 |
}, |
LC |
488 |
render: function() { |
c7776a
|
489 |
var className = ''; |
M |
490 |
if( this.props.widgetClasses ) |
|
491 |
className = this.props.widgetClasses.join(' '); |
4f929e
|
492 |
return ( |
c7776a
|
493 |
React.createElement("div", {className: className, style: this.props.widgetStyle}, |
4f929e
|
494 |
|
LC |
495 |
React.createElement("ul", {className: "list-unstyled"}, |
|
496 |
|
|
497 |
this.renderDatePicker(), |
|
498 |
|
972424
|
499 |
this.renderSwitchButton(), |
4f929e
|
500 |
|
LC |
501 |
this.renderTimePicker() |
|
502 |
|
|
503 |
) |
|
504 |
|
|
505 |
) |
|
506 |
|
|
507 |
); |
|
508 |
} |
|
509 |
}); |
|
510 |
|
|
511 |
module.exports = DateTimePicker; |
|
512 |
|
|
513 |
|
|
514 |
/***/ }, |
c7776a
|
515 |
/* 4 */ |
972424
|
516 |
/***/ function(module, exports, __webpack_require__) { |
LC |
517 |
|
1c8ac8
|
518 |
var DateTimePickerDate, DateTimePickerDays, DateTimePickerMonths, DateTimePickerYears, React; |
4f929e
|
519 |
|
ddac85
|
520 |
React = __webpack_require__(2); |
4f929e
|
521 |
|
c7776a
|
522 |
DateTimePickerDays = __webpack_require__(5); |
4f929e
|
523 |
|
c7776a
|
524 |
DateTimePickerMonths = __webpack_require__(7); |
1c8ac8
|
525 |
|
c7776a
|
526 |
DateTimePickerYears = __webpack_require__(8); |
1c8ac8
|
527 |
|
LC |
528 |
DateTimePickerDate = React.createClass({displayName: "DateTimePickerDate", |
4f929e
|
529 |
propTypes: { |
LC |
530 |
subtractMonth: React.PropTypes.func.isRequired, |
|
531 |
addMonth: React.PropTypes.func.isRequired, |
|
532 |
viewDate: React.PropTypes.object.isRequired, |
|
533 |
selectedDate: React.PropTypes.object.isRequired, |
|
534 |
showToday: React.PropTypes.bool, |
294242
|
535 |
viewMode: React.PropTypes.oneOfType([ |
LC |
536 |
React.PropTypes.string, |
|
537 |
React.PropTypes.number |
|
538 |
]), |
4f929e
|
539 |
daysOfWeekDisabled: React.PropTypes.array, |
LC |
540 |
setSelectedDate: React.PropTypes.func.isRequired, |
1c8ac8
|
541 |
subtractYear: React.PropTypes.func.isRequired, |
LC |
542 |
addYear: React.PropTypes.func.isRequired, |
|
543 |
setViewMonth: React.PropTypes.func.isRequired, |
|
544 |
setViewYear: React.PropTypes.func.isRequired, |
|
545 |
addDecade: React.PropTypes.func.isRequired, |
b4ea2f
|
546 |
subtractDecade: React.PropTypes.func.isRequired, |
LC |
547 |
minDate: React.PropTypes.object, |
|
548 |
maxDate: React.PropTypes.object |
4f929e
|
549 |
}, |
1c8ac8
|
550 |
getInitialState: function() { |
294242
|
551 |
var viewModes = { |
LC |
552 |
'days': { |
|
553 |
daysDisplayed: true, |
|
554 |
monthsDisplayed: false, |
|
555 |
yearsDisplayed: false |
|
556 |
}, |
|
557 |
'months': { |
|
558 |
daysDisplayed: false, |
|
559 |
monthsDisplayed: true, |
|
560 |
yearsDisplayed: false |
|
561 |
}, |
|
562 |
'years': { |
|
563 |
daysDisplayed: false, |
|
564 |
monthsDisplayed: false, |
|
565 |
yearsDisplayed: true |
|
566 |
} |
4f929e
|
567 |
}; |
294242
|
568 |
return viewModes[this.props.viewMode] || viewModes[Object.keys(viewModes)[this.props.viewMode]] || viewModes['days']; |
4f929e
|
569 |
}, |
1c8ac8
|
570 |
showMonths: function() { |
LC |
571 |
return this.setState({ |
|
572 |
daysDisplayed: false, |
|
573 |
monthsDisplayed: true |
|
574 |
}); |
|
575 |
}, |
|
576 |
showYears: function() { |
|
577 |
return this.setState({ |
|
578 |
monthsDisplayed: false, |
|
579 |
yearsDisplayed: true |
|
580 |
}); |
|
581 |
}, |
|
582 |
setViewYear: function(e) { |
|
583 |
this.props.setViewYear(e.target.innerHTML); |
|
584 |
return this.setState({ |
|
585 |
yearsDisplayed: false, |
|
586 |
monthsDisplayed: true |
|
587 |
}); |
|
588 |
}, |
|
589 |
setViewMonth: function(e) { |
|
590 |
this.props.setViewMonth(e.target.innerHTML); |
|
591 |
return this.setState({ |
|
592 |
monthsDisplayed: false, |
|
593 |
daysDisplayed: true |
|
594 |
}); |
|
595 |
}, |
4f929e
|
596 |
renderDays: function() { |
1c8ac8
|
597 |
if (this.state.daysDisplayed) { |
LC |
598 |
return ( |
|
599 |
React.createElement(DateTimePickerDays, { |
|
600 |
addMonth: this.props.addMonth, |
|
601 |
subtractMonth: this.props.subtractMonth, |
|
602 |
setSelectedDate: this.props.setSelectedDate, |
|
603 |
viewDate: this.props.viewDate, |
|
604 |
selectedDate: this.props.selectedDate, |
|
605 |
showToday: this.props.showToday, |
|
606 |
daysOfWeekDisabled: this.props.daysOfWeekDisabled, |
b4ea2f
|
607 |
showMonths: this.showMonths, |
LC |
608 |
minDate: this.props.minDate, |
|
609 |
maxDate: this.props.maxDate} |
1c8ac8
|
610 |
) |
LC |
611 |
); |
|
612 |
} else { |
|
613 |
return null; |
4f929e
|
614 |
} |
1c8ac8
|
615 |
}, |
LC |
616 |
renderMonths: function() { |
|
617 |
if (this.state.monthsDisplayed) { |
|
618 |
return ( |
|
619 |
React.createElement(DateTimePickerMonths, { |
|
620 |
subtractYear: this.props.subtractYear, |
|
621 |
addYear: this.props.addYear, |
|
622 |
viewDate: this.props.viewDate, |
|
623 |
selectedDate: this.props.selectedDate, |
|
624 |
showYears: this.showYears, |
|
625 |
setViewMonth: this.setViewMonth} |
|
626 |
) |
|
627 |
); |
|
628 |
} else { |
|
629 |
return null; |
|
630 |
} |
|
631 |
}, |
|
632 |
renderYears: function() { |
|
633 |
if (this.state.yearsDisplayed) { |
|
634 |
return ( |
|
635 |
React.createElement(DateTimePickerYears, { |
|
636 |
viewDate: this.props.viewDate, |
|
637 |
selectedDate: this.props.selectedDate, |
|
638 |
setViewYear: this.setViewYear, |
|
639 |
addDecade: this.props.addDecade, |
|
640 |
subtractDecade: this.props.subtractDecade} |
|
641 |
) |
|
642 |
); |
|
643 |
} else { |
|
644 |
return null; |
|
645 |
} |
4f929e
|
646 |
}, |
LC |
647 |
render: function() { |
|
648 |
return ( |
1c8ac8
|
649 |
React.createElement("div", {className: "datepicker"}, |
LC |
650 |
this.renderDays(), |
4f929e
|
651 |
|
1c8ac8
|
652 |
this.renderMonths(), |
4f929e
|
653 |
|
1c8ac8
|
654 |
this.renderYears() |
LC |
655 |
) |
4f929e
|
656 |
); |
LC |
657 |
} |
|
658 |
}); |
|
659 |
|
1c8ac8
|
660 |
module.exports = DateTimePickerDate; |
LC |
661 |
|
|
662 |
|
|
663 |
/***/ }, |
c7776a
|
664 |
/* 5 */ |
1c8ac8
|
665 |
/***/ function(module, exports, __webpack_require__) { |
LC |
666 |
|
c7776a
|
667 |
var DateTimePickerDays, React, moment; |
1c8ac8
|
668 |
|
ddac85
|
669 |
React = __webpack_require__(2); |
1c8ac8
|
670 |
|
c7776a
|
671 |
moment = __webpack_require__(6); |
1c8ac8
|
672 |
|
c7776a
|
673 |
DateTimePickerDays = React.createClass({displayName: "DateTimePickerDays", |
M |
674 |
propTypes: { |
|
675 |
subtractMonth: React.PropTypes.func.isRequired, |
|
676 |
addMonth: React.PropTypes.func.isRequired, |
|
677 |
viewDate: React.PropTypes.object.isRequired, |
|
678 |
selectedDate: React.PropTypes.object.isRequired, |
|
679 |
showToday: React.PropTypes.bool, |
|
680 |
daysOfWeekDisabled: React.PropTypes.array, |
|
681 |
setSelectedDate: React.PropTypes.func.isRequired, |
|
682 |
showMonths: React.PropTypes.func.isRequired, |
|
683 |
minDate: React.PropTypes.object, |
|
684 |
maxDate: React.PropTypes.object |
|
685 |
}, |
|
686 |
getDefaultProps: function() { |
|
687 |
return { |
|
688 |
showToday: true |
|
689 |
}; |
|
690 |
}, |
|
691 |
renderDays: function() { |
|
692 |
var cells, classes, days, html, i, month, nextMonth, prevMonth, minDate, maxDate, row, year, _i, _len, _ref; |
|
693 |
year = this.props.viewDate.year(); |
|
694 |
month = this.props.viewDate.month(); |
|
695 |
prevMonth = this.props.viewDate.clone().subtract(1, "months"); |
|
696 |
days = prevMonth.daysInMonth(); |
|
697 |
prevMonth.date(days).startOf('week'); |
|
698 |
nextMonth = moment(prevMonth).clone().add(42, "d"); |
|
699 |
minDate = this.props.minDate ? this.props.minDate.clone().subtract(1, 'days') : this.props.minDate; |
|
700 |
maxDate = this.props.maxDate ? this.props.maxDate.clone() : this.props.maxDate; |
|
701 |
html = []; |
|
702 |
cells = []; |
|
703 |
while (prevMonth.isBefore(nextMonth)) { |
|
704 |
classes = 'day'; |
|
705 |
if (prevMonth.year() < year || (prevMonth.year() === year && prevMonth.month() < month)) { |
|
706 |
classes += " old"; |
|
707 |
} else if (prevMonth.year() > year || (prevMonth.year() === year && prevMonth.month() > month)) { |
|
708 |
classes += " new"; |
|
709 |
} |
|
710 |
if (prevMonth.isSame(moment({ |
|
711 |
y: this.props.selectedDate.year(), |
|
712 |
M: this.props.selectedDate.month(), |
|
713 |
d: this.props.selectedDate.date() |
|
714 |
}))) { |
|
715 |
classes += " active"; |
|
716 |
} |
|
717 |
if (this.props.showToday) { |
|
718 |
if (prevMonth.isSame(moment(), 'day')) { |
|
719 |
classes += " today"; |
|
720 |
} |
|
721 |
} |
|
722 |
if ((minDate && prevMonth.isBefore(minDate)) || (maxDate && prevMonth.isAfter(maxDate))) { |
|
723 |
classes += " disabled"; |
|
724 |
} |
|
725 |
if (this.props.daysOfWeekDisabled) { |
|
726 |
_ref = this.props.daysOfWeekDisabled; |
|
727 |
for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
|
728 |
i = _ref[_i]; |
|
729 |
if (prevMonth.day() === this.props.daysOfWeekDisabled[i]) { |
|
730 |
classes += " disabled"; |
|
731 |
break; |
|
732 |
} |
|
733 |
} |
|
734 |
} |
|
735 |
cells.push(React.createElement("td", {key: prevMonth.month() + '-' + prevMonth.date(), className: classes, onClick: this.props.setSelectedDate}, prevMonth.date())); |
|
736 |
if (prevMonth.weekday() === moment().endOf('week').weekday()) { |
|
737 |
row = React.createElement("tr", {key: prevMonth.month() + '-' + prevMonth.date()}, cells); |
|
738 |
html.push(row); |
|
739 |
cells = []; |
|
740 |
} |
|
741 |
prevMonth.add(1, "d"); |
|
742 |
} |
|
743 |
return html; |
|
744 |
}, |
|
745 |
render: function() { |
|
746 |
return ( |
|
747 |
React.createElement("div", {className: "datepicker-days", style: {display: 'block'}}, |
|
748 |
React.createElement("table", {className: "table-condensed"}, |
|
749 |
React.createElement("thead", null, |
|
750 |
React.createElement("tr", null, |
|
751 |
React.createElement("th", {className: "prev", onClick: this.props.subtractMonth}, "‹"), |
1c8ac8
|
752 |
|
c7776a
|
753 |
React.createElement("th", {className: "switch", colSpan: "5", onClick: this.props.showMonths}, moment.months()[this.props.viewDate.month()], " ", this.props.viewDate.year()), |
972424
|
754 |
|
c7776a
|
755 |
React.createElement("th", {className: "next", onClick: this.props.addMonth}, "›") |
M |
756 |
), |
|
757 |
|
|
758 |
React.createElement("tr", null, |
|
759 |
React.createElement("th", {className: "dow"}, "Su"), |
|
760 |
|
|
761 |
React.createElement("th", {className: "dow"}, "Mo"), |
|
762 |
|
|
763 |
React.createElement("th", {className: "dow"}, "Tu"), |
|
764 |
|
|
765 |
React.createElement("th", {className: "dow"}, "We"), |
|
766 |
|
|
767 |
React.createElement("th", {className: "dow"}, "Th"), |
|
768 |
|
|
769 |
React.createElement("th", {className: "dow"}, "Fr"), |
|
770 |
|
|
771 |
React.createElement("th", {className: "dow"}, "Sa") |
|
772 |
) |
|
773 |
), |
|
774 |
|
|
775 |
React.createElement("tbody", null, |
|
776 |
this.renderDays() |
|
777 |
) |
|
778 |
) |
|
779 |
) |
|
780 |
); |
|
781 |
} |
|
782 |
}); |
|
783 |
|
|
784 |
module.exports = DateTimePickerDays; |
|
785 |
|
|
786 |
|
|
787 |
/***/ }, |
|
788 |
/* 6 */ |
|
789 |
/***/ function(module, exports) { |
|
790 |
|
|
791 |
module.exports = __WEBPACK_EXTERNAL_MODULE_6__; |
|
792 |
|
|
793 |
/***/ }, |
|
794 |
/* 7 */ |
|
795 |
/***/ function(module, exports, __webpack_require__) { |
|
796 |
|
|
797 |
var DateTimePickerMonths, React, moment; |
|
798 |
|
|
799 |
React = __webpack_require__(2); |
|
800 |
|
|
801 |
moment = __webpack_require__(6); |
|
802 |
|
|
803 |
DateTimePickerMonths = React.createClass({displayName: "DateTimePickerMonths", |
|
804 |
propTypes: { |
|
805 |
subtractYear: React.PropTypes.func.isRequired, |
|
806 |
addYear: React.PropTypes.func.isRequired, |
|
807 |
viewDate: React.PropTypes.object.isRequired, |
|
808 |
selectedDate: React.PropTypes.object.isRequired, |
|
809 |
showYears: React.PropTypes.func.isRequired, |
|
810 |
setViewMonth: React.PropTypes.func.isRequired |
|
811 |
}, |
|
812 |
renderMonths: function() { |
|
813 |
var classes, i, month, months, monthsShort; |
|
814 |
month = this.props.selectedDate.month(); |
|
815 |
monthsShort = moment.monthsShort(); |
|
816 |
i = 0; |
|
817 |
months = []; |
|
818 |
while (i < 12) { |
|
819 |
classes = "month"; |
|
820 |
if( i === month && this.props.viewDate.year() === this.props.selectedDate.year() ) |
|
821 |
classes += " active"; |
|
822 |
|
|
823 |
months.push(React.createElement("span", {key: i, className: classes, onClick: this.props.setViewMonth}, monthsShort[i])); |
|
824 |
i++; |
|
825 |
} |
|
826 |
return months; |
|
827 |
}, |
|
828 |
render: function() { |
|
829 |
return ( |
|
830 |
React.createElement("div", {className: "datepicker-months", style: {display: 'block'}}, |
|
831 |
React.createElement("table", {className: "table-condensed"}, |
|
832 |
React.createElement("thead", null, |
|
833 |
React.createElement("tr", null, |
|
834 |
React.createElement("th", {className: "prev", onClick: this.props.subtractYear}, "‹"), |
|
835 |
|
|
836 |
React.createElement("th", {className: "switch", colSpan: "5", onClick: this.props.showYears}, this.props.viewDate.year()), |
|
837 |
|
|
838 |
React.createElement("th", {className: "next", onClick: this.props.addYear}, "›") |
|
839 |
) |
|
840 |
), |
|
841 |
|
|
842 |
React.createElement("tbody", null, |
|
843 |
React.createElement("tr", null, |
|
844 |
React.createElement("td", {colSpan: "7"}, this.renderMonths()) |
|
845 |
) |
|
846 |
) |
|
847 |
) |
|
848 |
) |
|
849 |
); |
|
850 |
} |
|
851 |
}); |
|
852 |
|
|
853 |
module.exports = DateTimePickerMonths; |
|
854 |
|
|
855 |
|
|
856 |
/***/ }, |
|
857 |
/* 8 */ |
|
858 |
/***/ function(module, exports, __webpack_require__) { |
|
859 |
|
|
860 |
var DateTimePickerYears, React; |
|
861 |
|
|
862 |
React = __webpack_require__(2); |
|
863 |
|
|
864 |
DateTimePickerYears = React.createClass({displayName: "DateTimePickerYears", |
|
865 |
propTypes: { |
|
866 |
subtractDecade: React.PropTypes.func.isRequired, |
|
867 |
addDecade: React.PropTypes.func.isRequired, |
|
868 |
viewDate: React.PropTypes.object.isRequired, |
|
869 |
selectedDate: React.PropTypes.object.isRequired, |
|
870 |
setViewYear: React.PropTypes.func.isRequired |
|
871 |
}, |
|
872 |
renderYears: function() { |
|
873 |
var classes, i, year, years; |
|
874 |
years = []; |
|
875 |
year = parseInt(this.props.viewDate.year() / 10, 10) * 10; |
|
876 |
year--; |
|
877 |
i = -1; |
|
878 |
while (i < 11) { |
|
879 |
classes = 'year'; |
|
880 |
if( i === -1 | i === 10 ) |
|
881 |
classes += ' old'; |
|
882 |
if( this.props.selectedDate.year() === year ) |
|
883 |
classes += ' active'; |
|
884 |
|
|
885 |
years.push(React.createElement("span", {key: year, className: classes, onClick: this.props.setViewYear}, year)); |
|
886 |
year++; |
|
887 |
i++; |
|
888 |
} |
|
889 |
return years; |
|
890 |
}, |
|
891 |
render: function() { |
|
892 |
var year; |
|
893 |
year = parseInt(this.props.viewDate.year() / 10, 10) * 10; |
|
894 |
return ( |
|
895 |
React.createElement("div", {className: "datepicker-years", style: {display: "block"}}, |
|
896 |
React.createElement("table", {className: "table-condensed"}, |
|
897 |
React.createElement("thead", null, |
|
898 |
React.createElement("tr", null, |
|
899 |
React.createElement("th", {className: "prev", onClick: this.props.subtractDecade}, "‹"), |
|
900 |
|
|
901 |
React.createElement("th", {className: "switch", colSpan: "5"}, year, " - ", year+9), |
|
902 |
|
|
903 |
React.createElement("th", {className: "next", onClick: this.props.addDecade}, "›") |
|
904 |
) |
|
905 |
), |
|
906 |
|
|
907 |
React.createElement("tbody", null, |
|
908 |
React.createElement("tr", null, |
|
909 |
React.createElement("td", {colSpan: "7"}, this.renderYears()) |
|
910 |
) |
|
911 |
) |
|
912 |
) |
|
913 |
) |
|
914 |
); |
|
915 |
} |
|
916 |
}); |
|
917 |
|
|
918 |
module.exports = DateTimePickerYears; |
|
919 |
|
|
920 |
|
|
921 |
/***/ }, |
|
922 |
/* 9 */ |
|
923 |
/***/ function(module, exports, __webpack_require__) { |
|
924 |
|
|
925 |
var DateTimePickerHours, DateTimePickerMinutes, DateTimePickerTime, React; |
|
926 |
|
|
927 |
React = __webpack_require__(2); |
|
928 |
|
|
929 |
DateTimePickerMinutes = __webpack_require__(10); |
|
930 |
|
|
931 |
DateTimePickerHours = __webpack_require__(12); |
|
932 |
|
|
933 |
var Constants = __webpack_require__(11); |
1c8ac8
|
934 |
|
LC |
935 |
DateTimePickerTime = React.createClass({displayName: "DateTimePickerTime", |
|
936 |
propTypes: { |
|
937 |
setSelectedHour: React.PropTypes.func.isRequired, |
|
938 |
setSelectedMinute: React.PropTypes.func.isRequired, |
|
939 |
subtractHour: React.PropTypes.func.isRequired, |
|
940 |
addHour: React.PropTypes.func.isRequired, |
|
941 |
subtractMinute: React.PropTypes.func.isRequired, |
|
942 |
addMinute: React.PropTypes.func.isRequired, |
|
943 |
viewDate: React.PropTypes.object.isRequired, |
|
944 |
selectedDate: React.PropTypes.object.isRequired, |
972424
|
945 |
togglePeriod: React.PropTypes.func.isRequired, |
LC |
946 |
mode: React.PropTypes.oneOf([Constants.MODE_DATE, Constants.MODE_DATETIME, Constants.MODE_TIME]) |
1c8ac8
|
947 |
}, |
LC |
948 |
getInitialState: function() { |
|
949 |
return { |
|
950 |
minutesDisplayed: false, |
|
951 |
hoursDisplayed: false |
|
952 |
}; |
972424
|
953 |
}, |
LC |
954 |
goBack: function() { |
|
955 |
return this.setState({ |
|
956 |
minutesDisplayed: false, |
|
957 |
hoursDisplayed: false |
|
958 |
}); |
1c8ac8
|
959 |
}, |
LC |
960 |
showMinutes: function() { |
|
961 |
return this.setState({ |
|
962 |
minutesDisplayed: true |
|
963 |
}); |
|
964 |
}, |
|
965 |
showHours: function() { |
|
966 |
return this.setState({ |
|
967 |
hoursDisplayed: true |
|
968 |
}); |
|
969 |
}, |
|
970 |
renderMinutes: function() { |
|
971 |
if (this.state.minutesDisplayed) { |
972424
|
972 |
return React.createElement(DateTimePickerMinutes, React.__spread({}, this.props, {onSwitch: this.goBack})); |
1c8ac8
|
973 |
} else { |
LC |
974 |
return null; |
|
975 |
} |
|
976 |
}, |
|
977 |
renderHours: function() { |
|
978 |
if (this.state.hoursDisplayed) { |
972424
|
979 |
return React.createElement(DateTimePickerHours, React.__spread({}, this.props, {onSwitch: this.goBack})); |
1c8ac8
|
980 |
} else { |
LC |
981 |
return null; |
|
982 |
} |
|
983 |
}, |
|
984 |
renderPicker: function() { |
|
985 |
if (!this.state.minutesDisplayed && !this.state.hoursDisplayed) { |
|
986 |
return ( |
|
987 |
React.createElement("div", {className: "timepicker-picker"}, |
|
988 |
React.createElement("table", {className: "table-condensed"}, |
|
989 |
React.createElement("tbody", null, |
|
990 |
React.createElement("tr", null, |
c7776a
|
991 |
React.createElement("td", null, React.createElement("a", {className: "btn", onClick: this.props.addHour}, "▲")), |
1c8ac8
|
992 |
|
LC |
993 |
React.createElement("td", {className: "separator"}), |
|
994 |
|
c7776a
|
995 |
React.createElement("td", null, React.createElement("a", {className: "btn", onClick: this.props.addMinute}, "▲")), |
1c8ac8
|
996 |
|
LC |
997 |
React.createElement("td", {className: "separator"}) |
|
998 |
), |
|
999 |
|
|
1000 |
React.createElement("tr", null, |
|
1001 |
React.createElement("td", null, React.createElement("span", {className: "timepicker-hour", onClick: this.showHours}, this.props.selectedDate.format('h'))), |
|
1002 |
|
|
1003 |
React.createElement("td", {className: "separator"}, ":"), |
|
1004 |
|
|
1005 |
React.createElement("td", null, React.createElement("span", {className: "timepicker-minute", onClick: this.showMinutes}, this.props.selectedDate.format('mm'))), |
|
1006 |
|
|
1007 |
React.createElement("td", {className: "separator"}), |
|
1008 |
|
|
1009 |
React.createElement("td", null, React.createElement("button", {className: "btn btn-primary", onClick: this.props.togglePeriod, type: "button"}, this.props.selectedDate.format('A'))) |
|
1010 |
), |
|
1011 |
|
|
1012 |
React.createElement("tr", null, |
c7776a
|
1013 |
React.createElement("td", null, React.createElement("a", {className: "btn", onClick: this.props.subtractHour}, "▼")), |
1c8ac8
|
1014 |
|
LC |
1015 |
React.createElement("td", {className: "separator"}), |
|
1016 |
|
c7776a
|
1017 |
React.createElement("td", null, React.createElement("a", {className: "btn", onClick: this.props.subtractMinute}, "▼")), |
1c8ac8
|
1018 |
|
LC |
1019 |
React.createElement("td", {className: "separator"}) |
|
1020 |
) |
|
1021 |
) |
|
1022 |
) |
|
1023 |
) |
|
1024 |
); |
|
1025 |
} else { |
|
1026 |
return ''; |
|
1027 |
} |
|
1028 |
}, |
|
1029 |
render: function() { |
|
1030 |
return ( |
|
1031 |
React.createElement("div", {className: "timepicker"}, |
|
1032 |
this.renderPicker(), |
|
1033 |
|
|
1034 |
this.renderHours(), |
|
1035 |
|
|
1036 |
this.renderMinutes() |
|
1037 |
) |
|
1038 |
); |
|
1039 |
} |
|
1040 |
}); |
|
1041 |
|
|
1042 |
module.exports = DateTimePickerTime; |
4f929e
|
1043 |
|
LC |
1044 |
|
|
1045 |
/***/ }, |
972424
|
1046 |
/* 10 */ |
LC |
1047 |
/***/ function(module, exports, __webpack_require__) { |
|
1048 |
|
|
1049 |
var DateTimePickerMinutes, React; |
|
1050 |
|
|
1051 |
React = __webpack_require__(2); |
c7776a
|
1052 |
|
M |
1053 |
var Constants = __webpack_require__(11); |
|
1054 |
|
972424
|
1055 |
DateTimePickerMinutes = React.createClass({displayName: "DateTimePickerMinutes", |
LC |
1056 |
propTypes: { |
|
1057 |
setSelectedMinute: React.PropTypes.func.isRequired, |
|
1058 |
onSwitch: React.PropTypes.func.isRequired |
|
1059 |
}, |
|
1060 |
renderSwitchButton: function() { |
|
1061 |
return this.props.mode === Constants.MODE_TIME ? |
|
1062 |
( |
|
1063 |
React.createElement("ul", {className: "list-unstyled"}, |
|
1064 |
React.createElement("li", null, |
c7776a
|
1065 |
React.createElement("span", {className: "btn picker-switch", style: {width:'100%'}, onClick: this.props.onSwitch}, "Time") |
972424
|
1066 |
) |
LC |
1067 |
) |
|
1068 |
) : |
|
1069 |
null; |
|
1070 |
}, |
|
1071 |
render: function() { |
|
1072 |
return ( |
|
1073 |
React.createElement("div", {className: "timepicker-minutes", "data-action": "selectMinute", style: {display: 'block'}}, |
|
1074 |
this.renderSwitchButton(), |
|
1075 |
React.createElement("table", {className: "table-condensed"}, |
|
1076 |
React.createElement("tbody", null, |
|
1077 |
React.createElement("tr", null, |
|
1078 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "00"), |
|
1079 |
|
|
1080 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "05"), |
|
1081 |
|
|
1082 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "10"), |
|
1083 |
|
|
1084 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "15") |
|
1085 |
), |
|
1086 |
|
|
1087 |
React.createElement("tr", null, |
|
1088 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "20"), |
|
1089 |
|
|
1090 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "25"), |
|
1091 |
|
|
1092 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "30"), |
|
1093 |
|
|
1094 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "35") |
|
1095 |
), |
|
1096 |
|
|
1097 |
React.createElement("tr", null, |
|
1098 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "40"), |
|
1099 |
|
|
1100 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "45"), |
|
1101 |
|
|
1102 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "50"), |
|
1103 |
|
|
1104 |
React.createElement("td", {className: "minute", onClick: this.props.setSelectedMinute}, "55") |
|
1105 |
) |
|
1106 |
) |
|
1107 |
) |
|
1108 |
) |
|
1109 |
); |
|
1110 |
} |
|
1111 |
}); |
|
1112 |
|
|
1113 |
module.exports = DateTimePickerMinutes; |
|
1114 |
|
|
1115 |
|
|
1116 |
/***/ }, |
c7776a
|
1117 |
/* 11 */ |
M |
1118 |
/***/ function(module, exports) { |
|
1119 |
|
|
1120 |
module.exports = { |
|
1121 |
MODE_DATE: 'date', |
|
1122 |
MODE_DATETIME: 'datetime', |
|
1123 |
MODE_TIME: 'time' |
|
1124 |
}; |
|
1125 |
|
|
1126 |
/***/ }, |
|
1127 |
/* 12 */ |
972424
|
1128 |
/***/ function(module, exports, __webpack_require__) { |
LC |
1129 |
|
|
1130 |
var DateTimePickerHours, React; |
|
1131 |
|
|
1132 |
React = __webpack_require__(2); |
c7776a
|
1133 |
|
M |
1134 |
var Constants = __webpack_require__(11); |
972424
|
1135 |
|
LC |
1136 |
DateTimePickerHours = React.createClass({displayName: "DateTimePickerHours", |
|
1137 |
propTypes: { |
|
1138 |
setSelectedHour: React.PropTypes.func.isRequired, |
|
1139 |
onSwitch: React.PropTypes.func.isRequired |
|
1140 |
}, |
|
1141 |
renderSwitchButton: function() { |
|
1142 |
return this.props.mode === Constants.MODE_TIME ? |
|
1143 |
( |
|
1144 |
React.createElement("ul", {className: "list-unstyled"}, |
|
1145 |
React.createElement("li", null, |
c7776a
|
1146 |
React.createElement("span", {className: "btn picker-switch", style: {width:'100%'}, onClick: this.props.onSwitch}, "Sw") |
972424
|
1147 |
) |
LC |
1148 |
) |
|
1149 |
) : |
|
1150 |
null; |
|
1151 |
}, |
|
1152 |
render: function() { |
|
1153 |
return ( |
|
1154 |
React.createElement("div", {className: "timepicker-hours", "data-action": "selectHour", style: {display: 'block'}}, |
|
1155 |
this.renderSwitchButton(), |
|
1156 |
React.createElement("table", {className: "table-condensed"}, |
|
1157 |
React.createElement("tbody", null, |
|
1158 |
React.createElement("tr", null, |
|
1159 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "01"), |
|
1160 |
|
|
1161 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "02"), |
|
1162 |
|
|
1163 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "03"), |
|
1164 |
|
|
1165 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "04") |
|
1166 |
), |
|
1167 |
|
|
1168 |
React.createElement("tr", null, |
|
1169 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "05"), |
|
1170 |
|
|
1171 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "06"), |
|
1172 |
|
|
1173 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "07"), |
|
1174 |
|
|
1175 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "08") |
|
1176 |
), |
|
1177 |
|
|
1178 |
React.createElement("tr", null, |
|
1179 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "09"), |
|
1180 |
|
|
1181 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "10"), |
|
1182 |
|
|
1183 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "11"), |
|
1184 |
|
|
1185 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "12") |
|
1186 |
), |
|
1187 |
|
|
1188 |
React.createElement("tr", null, |
|
1189 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "13"), |
|
1190 |
|
|
1191 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "14"), |
|
1192 |
|
|
1193 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "15"), |
|
1194 |
|
|
1195 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "16") |
|
1196 |
), |
|
1197 |
|
|
1198 |
React.createElement("tr", null, |
|
1199 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "17"), |
|
1200 |
|
|
1201 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "18"), |
|
1202 |
|
|
1203 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "19"), |
|
1204 |
|
|
1205 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "20") |
|
1206 |
), |
|
1207 |
|
|
1208 |
React.createElement("tr", null, |
|
1209 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "21"), |
|
1210 |
|
|
1211 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "22"), |
|
1212 |
|
|
1213 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "23"), |
|
1214 |
|
|
1215 |
React.createElement("td", {className: "hour", onClick: this.props.setSelectedHour}, "24") |
|
1216 |
) |
|
1217 |
) |
|
1218 |
) |
|
1219 |
) |
|
1220 |
); |
|
1221 |
} |
|
1222 |
}); |
|
1223 |
|
|
1224 |
module.exports = DateTimePickerHours; |
|
1225 |
|
|
1226 |
|
4f929e
|
1227 |
/***/ } |
LC |
1228 |
/******/ ]) |
|
1229 |
}); |
e44fda
|
1230 |
; |