diff options
Diffstat (limited to 'examples/disabled.js')
-rw-r--r-- | examples/disabled.js | 151 |
1 files changed, 75 insertions, 76 deletions
diff --git a/examples/disabled.js b/examples/disabled.js index 9e8e7c1..b7cd754 100644 --- a/examples/disabled.js +++ b/examples/disabled.js | |||
@@ -1,88 +1,87 @@ | |||
1 | webpackJsonp([1],{ | 1 | webpackJsonp([5],{ |
2 | |||
3 | /***/ 144: | ||
4 | /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
5 | |||
6 | "use strict"; | ||
7 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
8 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rc_time_picker_assets_index_less__ = __webpack_require__(29); | ||
9 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rc_time_picker_assets_index_less___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rc_time_picker_assets_index_less__); | ||
10 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(5); | ||
11 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); | ||
12 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_dom__ = __webpack_require__(8); | ||
13 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react_dom__); | ||
14 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment__ = __webpack_require__(18); | ||
15 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_moment__); | ||
16 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rc_time_picker__ = __webpack_require__(22); | ||
17 | /* eslint no-console:0 */ | ||
18 | |||
19 | |||
20 | |||
21 | |||
22 | |||
23 | |||
2 | 24 | ||
3 | /***/ 0: | ||
4 | /***/ (function(module, exports, __webpack_require__) { | ||
5 | 25 | ||
6 | module.exports = __webpack_require__(317); | ||
7 | 26 | ||
8 | 27 | ||
28 | var showSecond = true; | ||
29 | var str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | ||
30 | |||
31 | var now = __WEBPACK_IMPORTED_MODULE_3_moment___default()().hour(14).minute(30); | ||
32 | |||
33 | function generateOptions(length, excludedOptions) { | ||
34 | var arr = []; | ||
35 | for (var value = 0; value < length; value++) { | ||
36 | if (excludedOptions.indexOf(value) < 0) { | ||
37 | arr.push(value); | ||
38 | } | ||
39 | } | ||
40 | return arr; | ||
41 | } | ||
42 | |||
43 | function onChange(value) { | ||
44 | console.log(value && value.format(str)); | ||
45 | } | ||
46 | |||
47 | function disabledHours() { | ||
48 | return [0, 1, 2, 3, 4, 5, 6, 7, 8, 22, 23]; | ||
49 | } | ||
50 | |||
51 | function disabledMinutes(h) { | ||
52 | switch (h) { | ||
53 | case 9: | ||
54 | return generateOptions(60, [30]); | ||
55 | case 21: | ||
56 | return generateOptions(60, [0]); | ||
57 | default: | ||
58 | return generateOptions(60, [0, 30]); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | function disabledSeconds(h, m) { | ||
63 | return [h + m % 60]; | ||
64 | } | ||
65 | |||
66 | __WEBPACK_IMPORTED_MODULE_2_react_dom___default.a.render(__WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4_rc_time_picker__["a" /* default */], { | ||
67 | showSecond: showSecond, | ||
68 | defaultValue: now, | ||
69 | className: 'xxx', | ||
70 | onChange: onChange, | ||
71 | disabledHours: disabledHours, | ||
72 | disabledMinutes: disabledMinutes, | ||
73 | disabledSeconds: disabledSeconds | ||
74 | }), document.getElementById('__react-content')); | ||
75 | |||
9 | /***/ }), | 76 | /***/ }), |
10 | 77 | ||
11 | /***/ 317: | 78 | /***/ 326: |
12 | /***/ (function(module, exports, __webpack_require__) { | 79 | /***/ (function(module, exports, __webpack_require__) { |
13 | 80 | ||
14 | 'use strict'; | 81 | module.exports = __webpack_require__(144); |
15 | 82 | ||
16 | __webpack_require__(2); | ||
17 | |||
18 | var _react = __webpack_require__(3); | ||
19 | |||
20 | var _react2 = _interopRequireDefault(_react); | ||
21 | |||
22 | var _reactDom = __webpack_require__(38); | ||
23 | |||
24 | var _reactDom2 = _interopRequireDefault(_reactDom); | ||
25 | |||
26 | var _moment = __webpack_require__(184); | ||
27 | |||
28 | var _moment2 = _interopRequireDefault(_moment); | ||
29 | |||
30 | var _rcTimePicker = __webpack_require__(185); | ||
31 | |||
32 | var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker); | ||
33 | |||
34 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
35 | |||
36 | var showSecond = true; /* eslint no-console:0 */ | ||
37 | |||
38 | var str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | ||
39 | |||
40 | var now = (0, _moment2.default)().hour(14).minute(30); | ||
41 | |||
42 | function generateOptions(length, excludedOptions) { | ||
43 | var arr = []; | ||
44 | for (var value = 0; value < length; value++) { | ||
45 | if (excludedOptions.indexOf(value) < 0) { | ||
46 | arr.push(value); | ||
47 | } | ||
48 | } | ||
49 | return arr; | ||
50 | } | ||
51 | |||
52 | function onChange(value) { | ||
53 | console.log(value && value.format(str)); | ||
54 | } | ||
55 | |||
56 | function disabledHours() { | ||
57 | return [0, 1, 2, 3, 4, 5, 6, 7, 8, 22, 23]; | ||
58 | } | ||
59 | |||
60 | function disabledMinutes(h) { | ||
61 | switch (h) { | ||
62 | case 9: | ||
63 | return generateOptions(60, [30]); | ||
64 | case 21: | ||
65 | return generateOptions(60, [0]); | ||
66 | default: | ||
67 | return generateOptions(60, [0, 30]); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | function disabledSeconds(h, m) { | ||
72 | return [h + m % 60]; | ||
73 | } | ||
74 | |||
75 | _reactDom2.default.render(_react2.default.createElement(_rcTimePicker2.default, { | ||
76 | showSecond: showSecond, | ||
77 | defaultValue: now, | ||
78 | className: 'xxx', | ||
79 | onChange: onChange, | ||
80 | disabledHours: disabledHours, | ||
81 | disabledMinutes: disabledMinutes, | ||
82 | disabledSeconds: disabledSeconds | ||
83 | }), document.getElementById('__react-content')); | ||
84 | 83 | ||
85 | /***/ }) | 84 | /***/ }) |
86 | 85 | ||
87 | }); | 86 | },[326]); |
88 | //# sourceMappingURL=disabled.js.map \ No newline at end of file | 87 | //# sourceMappingURL=disabled.js.map \ No newline at end of file |