@seafile/seafile-calendar 0.0.29 → 0.0.30-beta.2

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.
Files changed (167) hide show
  1. package/package.json +1 -1
  2. package/assets/index.css +0 -1177
  3. package/dist/rc-calendar.css +0 -1179
  4. package/dist/rc-calendar.css.map +0 -1
  5. package/dist/rc-calendar.js +0 -7076
  6. package/dist/rc-calendar.js.map +0 -1
  7. package/dist/rc-calendar.min.css +0 -1179
  8. package/dist/rc-calendar.min.css.map +0 -1
  9. package/dist/rc-calendar.min.js +0 -1
  10. package/es/Calendar.js +0 -441
  11. package/es/FullCalendar.js +0 -182
  12. package/es/MonthCalendar.js +0 -135
  13. package/es/Picker.js +0 -245
  14. package/es/RangeCalendar.js +0 -876
  15. package/es/calendar/CalendarFooter.js +0 -93
  16. package/es/calendar/CalendarHeader.js +0 -257
  17. package/es/calendar/CalendarRightPanel.js +0 -121
  18. package/es/calendar/OkButton.js +0 -22
  19. package/es/calendar/TimePickerButton.js +0 -28
  20. package/es/calendar/TodayButton.js +0 -28
  21. package/es/date/DateConstants.js +0 -19
  22. package/es/date/DateInput.js +0 -233
  23. package/es/date/DateTBody.js +0 -280
  24. package/es/date/DateTHead.js +0 -85
  25. package/es/date/DateTable.js +0 -32
  26. package/es/decade/DecadePanel.js +0 -181
  27. package/es/full-calendar/CalendarHeader.js +0 -180
  28. package/es/index.js +0 -3
  29. package/es/locale/ar_EG.js +0 -27
  30. package/es/locale/bg_BG.js +0 -27
  31. package/es/locale/ca_ES.js +0 -27
  32. package/es/locale/cs_CZ.js +0 -27
  33. package/es/locale/da_DK.js +0 -27
  34. package/es/locale/de_DE.js +0 -27
  35. package/es/locale/el_GR.js +0 -27
  36. package/es/locale/en_GB.js +0 -27
  37. package/es/locale/en_US.js +0 -28
  38. package/es/locale/es_ES.js +0 -27
  39. package/es/locale/et_EE.js +0 -27
  40. package/es/locale/fa_IR.js +0 -27
  41. package/es/locale/fi_FI.js +0 -27
  42. package/es/locale/fr_BE.js +0 -27
  43. package/es/locale/fr_FR.js +0 -27
  44. package/es/locale/he_IL.js +0 -28
  45. package/es/locale/hi_IN.js +0 -28
  46. package/es/locale/hr_HR.js +0 -28
  47. package/es/locale/hu_HU.js +0 -27
  48. package/es/locale/id_ID.js +0 -28
  49. package/es/locale/is_IS.js +0 -27
  50. package/es/locale/it_IT.js +0 -27
  51. package/es/locale/ja_JP.js +0 -26
  52. package/es/locale/kn_IN.js +0 -28
  53. package/es/locale/ko_KR.js +0 -27
  54. package/es/locale/ku_IQ.js +0 -27
  55. package/es/locale/lv_LV.js +0 -27
  56. package/es/locale/mm_MM.js +0 -28
  57. package/es/locale/mn_MN.js +0 -28
  58. package/es/locale/ms_MY.js +0 -27
  59. package/es/locale/nb_NO.js +0 -27
  60. package/es/locale/nl_BE.js +0 -27
  61. package/es/locale/nl_NL.js +0 -27
  62. package/es/locale/pl_PL.js +0 -27
  63. package/es/locale/pt_BR.js +0 -27
  64. package/es/locale/pt_PT.js +0 -27
  65. package/es/locale/ro_RO.js +0 -28
  66. package/es/locale/ru_RU.js +0 -27
  67. package/es/locale/sk_SK.js +0 -27
  68. package/es/locale/sl_SI.js +0 -27
  69. package/es/locale/sr_RS.js +0 -27
  70. package/es/locale/sv_SE.js +0 -27
  71. package/es/locale/ta_IN.js +0 -28
  72. package/es/locale/th_TH.js +0 -27
  73. package/es/locale/tr_TR.js +0 -27
  74. package/es/locale/ug_CN.js +0 -26
  75. package/es/locale/uk_UA.js +0 -27
  76. package/es/locale/vi_VN.js +0 -28
  77. package/es/locale/zh_CN.js +0 -27
  78. package/es/locale/zh_TW.js +0 -26
  79. package/es/mixin/CalendarMixin.js +0 -123
  80. package/es/mixin/CommonMixin.js +0 -85
  81. package/es/month/MonthPanel.js +0 -154
  82. package/es/month/MonthTable.js +0 -156
  83. package/es/picker/placements.js +0 -35
  84. package/es/range-calendar/CalendarPart.js +0 -151
  85. package/es/util/dayjs.js +0 -17
  86. package/es/util/index.js +0 -105
  87. package/es/util/toTime.js +0 -21
  88. package/es/year/YearPanel.js +0 -194
  89. package/lib/Calendar.js +0 -504
  90. package/lib/FullCalendar.js +0 -221
  91. package/lib/MonthCalendar.js +0 -172
  92. package/lib/Picker.js +0 -282
  93. package/lib/RangeCalendar.js +0 -925
  94. package/lib/calendar/CalendarFooter.js +0 -134
  95. package/lib/calendar/CalendarHeader.js +0 -290
  96. package/lib/calendar/CalendarRightPanel.js +0 -145
  97. package/lib/calendar/OkButton.js +0 -32
  98. package/lib/calendar/TimePickerButton.js +0 -41
  99. package/lib/calendar/TodayButton.js +0 -39
  100. package/lib/date/DateConstants.js +0 -23
  101. package/lib/date/DateInput.js +0 -265
  102. package/lib/date/DateTBody.js +0 -307
  103. package/lib/date/DateTHead.js +0 -105
  104. package/lib/date/DateTable.js +0 -54
  105. package/lib/decade/DecadePanel.js +0 -207
  106. package/lib/full-calendar/CalendarHeader.js +0 -201
  107. package/lib/index.js +0 -12
  108. package/lib/locale/ar_EG.js +0 -31
  109. package/lib/locale/bg_BG.js +0 -31
  110. package/lib/locale/ca_ES.js +0 -31
  111. package/lib/locale/cs_CZ.js +0 -31
  112. package/lib/locale/da_DK.js +0 -31
  113. package/lib/locale/de_DE.js +0 -31
  114. package/lib/locale/el_GR.js +0 -31
  115. package/lib/locale/en_GB.js +0 -31
  116. package/lib/locale/en_US.js +0 -32
  117. package/lib/locale/es_ES.js +0 -31
  118. package/lib/locale/et_EE.js +0 -31
  119. package/lib/locale/fa_IR.js +0 -31
  120. package/lib/locale/fi_FI.js +0 -31
  121. package/lib/locale/fr_BE.js +0 -31
  122. package/lib/locale/fr_FR.js +0 -31
  123. package/lib/locale/he_IL.js +0 -32
  124. package/lib/locale/hi_IN.js +0 -32
  125. package/lib/locale/hr_HR.js +0 -32
  126. package/lib/locale/hu_HU.js +0 -31
  127. package/lib/locale/id_ID.js +0 -32
  128. package/lib/locale/is_IS.js +0 -31
  129. package/lib/locale/it_IT.js +0 -31
  130. package/lib/locale/ja_JP.js +0 -30
  131. package/lib/locale/kn_IN.js +0 -32
  132. package/lib/locale/ko_KR.js +0 -31
  133. package/lib/locale/ku_IQ.js +0 -31
  134. package/lib/locale/lv_LV.js +0 -31
  135. package/lib/locale/mm_MM.js +0 -32
  136. package/lib/locale/mn_MN.js +0 -32
  137. package/lib/locale/ms_MY.js +0 -31
  138. package/lib/locale/nb_NO.js +0 -31
  139. package/lib/locale/nl_BE.js +0 -31
  140. package/lib/locale/nl_NL.js +0 -31
  141. package/lib/locale/pl_PL.js +0 -31
  142. package/lib/locale/pt_BR.js +0 -31
  143. package/lib/locale/pt_PT.js +0 -31
  144. package/lib/locale/ro_RO.js +0 -32
  145. package/lib/locale/ru_RU.js +0 -31
  146. package/lib/locale/sk_SK.js +0 -31
  147. package/lib/locale/sl_SI.js +0 -31
  148. package/lib/locale/sr_RS.js +0 -31
  149. package/lib/locale/sv_SE.js +0 -31
  150. package/lib/locale/ta_IN.js +0 -32
  151. package/lib/locale/th_TH.js +0 -31
  152. package/lib/locale/tr_TR.js +0 -31
  153. package/lib/locale/ug_CN.js +0 -30
  154. package/lib/locale/uk_UA.js +0 -31
  155. package/lib/locale/vi_VN.js +0 -32
  156. package/lib/locale/zh_CN.js +0 -31
  157. package/lib/locale/zh_TW.js +0 -30
  158. package/lib/mixin/CalendarMixin.js +0 -153
  159. package/lib/mixin/CommonMixin.js +0 -106
  160. package/lib/month/MonthPanel.js +0 -179
  161. package/lib/month/MonthTable.js +0 -181
  162. package/lib/picker/placements.js +0 -39
  163. package/lib/range-calendar/CalendarPart.js +0 -184
  164. package/lib/util/dayjs.js +0 -46
  165. package/lib/util/index.js +0 -130
  166. package/lib/util/toTime.js +0 -28
  167. package/lib/year/YearPanel.js +0 -219
@@ -1,93 +0,0 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4
- import _inherits from 'babel-runtime/helpers/inherits';
5
- import React from 'react';
6
- import ReactDOM from 'react-dom';
7
- import PropTypes from 'prop-types';
8
- import toFragment from 'rc-util/es/Children/mapSelf';
9
- import cx from 'classnames';
10
- import TodayButton from '../calendar/TodayButton';
11
- import OkButton from '../calendar/OkButton';
12
- import TimePickerButton from '../calendar/TimePickerButton';
13
-
14
- var CalendarFooter = function (_React$Component) {
15
- _inherits(CalendarFooter, _React$Component);
16
-
17
- function CalendarFooter() {
18
- _classCallCheck(this, CalendarFooter);
19
-
20
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
21
- }
22
-
23
- CalendarFooter.prototype.onSelect = function onSelect(value) {
24
- this.props.onSelect(value);
25
- };
26
-
27
- CalendarFooter.prototype.getRootDOMNode = function getRootDOMNode() {
28
- return ReactDOM.findDOMNode(this);
29
- };
30
-
31
- CalendarFooter.prototype.render = function render() {
32
- var props = this.props;
33
- var value = props.value,
34
- prefixCls = props.prefixCls,
35
- showOk = props.showOk,
36
- timePicker = props.timePicker,
37
- renderFooter = props.renderFooter,
38
- mode = props.mode;
39
-
40
- var footerEl = null;
41
- var extraFooter = renderFooter && renderFooter(mode);
42
- if (props.showToday || timePicker || extraFooter) {
43
- var _cx;
44
-
45
- var nowEl = void 0;
46
- if (props.showToday) {
47
- nowEl = React.createElement(TodayButton, _extends({}, props, { value: value }));
48
- }
49
- var okBtn = void 0;
50
- if (showOk === true || showOk !== false && !!props.timePicker) {
51
- okBtn = React.createElement(OkButton, props);
52
- }
53
- var timePickerBtn = void 0;
54
- if (!!props.timePicker) {
55
- timePickerBtn = React.createElement(TimePickerButton, props);
56
- }
57
-
58
- var footerBtn = void 0;
59
- if (nowEl || timePickerBtn || okBtn || extraFooter) {
60
- footerBtn = React.createElement(
61
- 'span',
62
- { className: prefixCls + '-footer-btn' },
63
- extraFooter,
64
- toFragment([nowEl, timePickerBtn, okBtn])
65
- );
66
- }
67
- var cls = cx(prefixCls + '-footer', (_cx = {}, _cx[prefixCls + '-footer-show-ok'] = okBtn, _cx));
68
- footerEl = React.createElement(
69
- 'div',
70
- { className: cls },
71
- footerBtn
72
- );
73
- }
74
- return footerEl;
75
- };
76
-
77
- return CalendarFooter;
78
- }(React.Component);
79
-
80
- CalendarFooter.propTypes = {
81
- prefixCls: PropTypes.string,
82
- showDateInput: PropTypes.bool,
83
- disabledTime: PropTypes.any,
84
- timePicker: PropTypes.element,
85
- selectedValue: PropTypes.any,
86
- showOk: PropTypes.bool,
87
- onSelect: PropTypes.func,
88
- value: PropTypes.object,
89
- renderFooter: PropTypes.func,
90
- defaultValue: PropTypes.object,
91
- mode: PropTypes.string
92
- };
93
- export default CalendarFooter;
@@ -1,257 +0,0 @@
1
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
2
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
3
- import _inherits from 'babel-runtime/helpers/inherits';
4
- import React from 'react';
5
- import PropTypes from 'prop-types';
6
- import toFragment from 'rc-util/es/Children/mapSelf';
7
- import MonthPanel from '../month/MonthPanel';
8
- import YearPanel from '../year/YearPanel';
9
- import DecadePanel from '../decade/DecadePanel';
10
-
11
- function goMonth(direction) {
12
- var next = this.props.value.clone();
13
- next = next.add(direction, 'months');
14
- this.props.onValueChange(next);
15
- }
16
-
17
- function goYear(direction) {
18
- var next = this.props.value.clone();
19
- next = next.add(direction, 'years');
20
- this.props.onValueChange(next);
21
- }
22
-
23
- function showIf(condition, el) {
24
- return condition ? el : null;
25
- }
26
-
27
- var CalendarHeader = function (_React$Component) {
28
- _inherits(CalendarHeader, _React$Component);
29
-
30
- function CalendarHeader(props) {
31
- _classCallCheck(this, CalendarHeader);
32
-
33
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
34
-
35
- _initialiseProps.call(_this);
36
-
37
- _this.nextMonth = goMonth.bind(_this, 1);
38
- _this.previousMonth = goMonth.bind(_this, -1);
39
- _this.nextYear = goYear.bind(_this, 1);
40
- _this.previousYear = goYear.bind(_this, -1);
41
-
42
- _this.state = { yearPanelReferer: null };
43
- return _this;
44
- }
45
-
46
- CalendarHeader.prototype.render = function render() {
47
- var _this2 = this;
48
-
49
- var props = this.props;
50
- var prefixCls = props.prefixCls,
51
- locale = props.locale,
52
- mode = props.mode,
53
- value = props.value,
54
- showTimePicker = props.showTimePicker,
55
- enableNext = props.enableNext,
56
- enablePrev = props.enablePrev,
57
- disabledMonth = props.disabledMonth,
58
- renderFooter = props.renderFooter;
59
-
60
-
61
- var panel = null;
62
- if (mode === 'month') {
63
- panel = React.createElement(MonthPanel, {
64
- locale: locale,
65
- value: value,
66
- rootPrefixCls: prefixCls,
67
- onSelect: this.onMonthSelect,
68
- onYearPanelShow: function onYearPanelShow() {
69
- return _this2.showYearPanel('month');
70
- },
71
- disabledDate: disabledMonth,
72
- cellRender: props.monthCellRender,
73
- contentRender: props.monthCellContentRender,
74
- renderFooter: renderFooter,
75
- changeYear: this.changeYear
76
- });
77
- }
78
- if (mode === 'year') {
79
- panel = React.createElement(YearPanel, {
80
- locale: locale,
81
- defaultValue: value,
82
- rootPrefixCls: prefixCls,
83
- onSelect: this.onYearSelect,
84
- onDecadePanelShow: this.showDecadePanel,
85
- renderFooter: renderFooter
86
- });
87
- }
88
- if (mode === 'decade') {
89
- panel = React.createElement(DecadePanel, {
90
- locale: locale,
91
- defaultValue: value,
92
- rootPrefixCls: prefixCls,
93
- onSelect: this.onDecadeSelect,
94
- renderFooter: renderFooter
95
- });
96
- }
97
-
98
- return React.createElement(
99
- 'div',
100
- { className: prefixCls + '-header' },
101
- React.createElement(
102
- 'div',
103
- { style: { position: 'relative' } },
104
- showIf(enablePrev && !showTimePicker, React.createElement('a', {
105
- className: prefixCls + '-prev-year-btn',
106
- role: 'button',
107
- onClick: this.previousYear,
108
- title: locale.previousYear
109
- })),
110
- showIf(enablePrev && !showTimePicker, React.createElement('a', {
111
- className: prefixCls + '-prev-month-btn',
112
- role: 'button',
113
- onClick: this.previousMonth,
114
- title: locale.previousMonth
115
- })),
116
- this.monthYearElement(showTimePicker),
117
- showIf(enableNext && !showTimePicker, React.createElement('a', {
118
- className: prefixCls + '-next-month-btn',
119
- onClick: this.nextMonth,
120
- title: locale.nextMonth
121
- })),
122
- showIf(enableNext && !showTimePicker, React.createElement('a', {
123
- className: prefixCls + '-next-year-btn',
124
- onClick: this.nextYear,
125
- title: locale.nextYear
126
- }))
127
- ),
128
- panel
129
- );
130
- };
131
-
132
- return CalendarHeader;
133
- }(React.Component);
134
-
135
- CalendarHeader.propTypes = {
136
- prefixCls: PropTypes.string,
137
- value: PropTypes.object,
138
- onValueChange: PropTypes.func,
139
- showTimePicker: PropTypes.bool,
140
- onPanelChange: PropTypes.func,
141
- locale: PropTypes.object,
142
- enablePrev: PropTypes.any,
143
- enableNext: PropTypes.any,
144
- disabledMonth: PropTypes.func,
145
- renderFooter: PropTypes.func,
146
- onMonthSelect: PropTypes.func
147
- };
148
- CalendarHeader.defaultProps = {
149
- enableNext: 1,
150
- enablePrev: 1,
151
- onPanelChange: function onPanelChange() {},
152
- onValueChange: function onValueChange() {}
153
- };
154
-
155
- var _initialiseProps = function _initialiseProps() {
156
- var _this3 = this;
157
-
158
- this.onMonthSelect = function (value) {
159
- _this3.props.onPanelChange(value, 'date');
160
- if (_this3.props.onMonthSelect) {
161
- _this3.props.onMonthSelect(value);
162
- } else {
163
- _this3.props.onValueChange(value);
164
- }
165
- };
166
-
167
- this.onYearSelect = function (value) {
168
- var referer = _this3.state.yearPanelReferer;
169
- _this3.setState({ yearPanelReferer: null });
170
- _this3.props.onPanelChange(value, referer);
171
- _this3.props.onValueChange(value);
172
- };
173
-
174
- this.onDecadeSelect = function (value) {
175
- _this3.props.onPanelChange(value, 'year');
176
- _this3.props.onValueChange(value);
177
- };
178
-
179
- this.changeYear = function (direction) {
180
- if (direction > 0) {
181
- _this3.nextYear();
182
- } else {
183
- _this3.previousYear();
184
- }
185
- };
186
-
187
- this.monthYearElement = function (showTimePicker) {
188
- var props = _this3.props;
189
- var prefixCls = props.prefixCls;
190
- var locale = props.locale;
191
- var value = props.value;
192
- var localeData = value.localeData();
193
- var monthBeforeYear = locale.monthBeforeYear;
194
- var selectClassName = prefixCls + '-' + (monthBeforeYear ? 'my-select' : 'ym-select');
195
- var timeClassName = showTimePicker ? ' ' + prefixCls + '-time-status' : '';
196
- var year = React.createElement(
197
- 'a',
198
- {
199
- className: prefixCls + '-year-select' + timeClassName,
200
- role: 'button',
201
- onClick: showTimePicker ? null : function () {
202
- return _this3.showYearPanel('date');
203
- },
204
- title: showTimePicker ? null : locale.yearSelect
205
- },
206
- value.format(locale.yearFormat)
207
- );
208
- var month = React.createElement(
209
- 'a',
210
- {
211
- className: prefixCls + '-month-select' + timeClassName,
212
- role: 'button',
213
- onClick: showTimePicker ? null : _this3.showMonthPanel,
214
- title: showTimePicker ? null : locale.monthSelect
215
- },
216
- locale.monthFormat ? value.format(locale.monthFormat) : localeData.monthsShort(value)
217
- );
218
- var day = void 0;
219
- if (showTimePicker) {
220
- day = React.createElement(
221
- 'a',
222
- {
223
- className: prefixCls + '-day-select' + timeClassName,
224
- role: 'button'
225
- },
226
- value.format(locale.dayFormat)
227
- );
228
- }
229
- var my = [];
230
- if (monthBeforeYear) {
231
- my = [month, day, year];
232
- } else {
233
- my = [year, month, day];
234
- }
235
- return React.createElement(
236
- 'span',
237
- { className: selectClassName },
238
- toFragment(my)
239
- );
240
- };
241
-
242
- this.showMonthPanel = function () {
243
- // null means that users' interaction doesn't change value
244
- _this3.props.onPanelChange(null, 'month');
245
- };
246
-
247
- this.showYearPanel = function (referer) {
248
- _this3.setState({ yearPanelReferer: referer });
249
- _this3.props.onPanelChange(null, 'year');
250
- };
251
-
252
- this.showDecadePanel = function () {
253
- _this3.props.onPanelChange(null, 'decade');
254
- };
255
- };
256
-
257
- export default CalendarHeader;
@@ -1,121 +0,0 @@
1
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
2
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
3
- import _inherits from 'babel-runtime/helpers/inherits';
4
- import React from 'react';
5
- import PropTypes from 'prop-types';
6
- import dayjs from 'dayjs';
7
-
8
- var CalendarRightPanel = function (_React$Component) {
9
- _inherits(CalendarRightPanel, _React$Component);
10
-
11
- function CalendarRightPanel(props) {
12
- _classCallCheck(this, CalendarRightPanel);
13
-
14
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
15
-
16
- _this.onSelect = function (value) {
17
- _this.setState({
18
- highlightTime: value
19
- });
20
- _this.props.onSelect(value);
21
- _this.props.onClickRightPanelTime();
22
- };
23
-
24
- _this.getTimes = function () {
25
- var times = [];
26
- for (var i = 0; i < 24; i++) {
27
- var str = (String(i) + ':00').padStart(5, '0');
28
- var str1 = (String(i) + ':30').padStart(5, '0');
29
- times.push(str);
30
- times.push(str1);
31
- }
32
- return times;
33
- };
34
-
35
- _this.scrollUp = function () {
36
- _this.timeRef.current.scrollBy(0, -200);
37
- };
38
-
39
- _this.scrollDown = function () {
40
- _this.timeRef.current.scrollBy(0, 200);
41
- };
42
-
43
- _this.state = {
44
- highlightTime: _this.props.value || null
45
- };
46
- _this.timeRef = React.createRef();
47
- _this.times = _this.getTimes();
48
- return _this;
49
- }
50
-
51
- CalendarRightPanel.prototype.componentDidMount = function componentDidMount() {
52
- var defaultMinutesTime = this.props.defaultMinutesTime;
53
-
54
- var showTimeIndex = this.times.findIndex(function (item) {
55
- return item >= defaultMinutesTime;
56
- });
57
- var scrollTimeIndex = showTimeIndex > -1 ? showTimeIndex - 1 : 16;
58
- this.timeRef.current.scrollTo(0, 34 * scrollTimeIndex);
59
- };
60
-
61
- CalendarRightPanel.prototype.render = function render() {
62
- var _this2 = this;
63
-
64
- var _props = this.props,
65
- value = _props.value,
66
- prefixCls = _props.prefixCls,
67
- locale = _props.locale;
68
-
69
- var selectedDate = value.format().slice(0, 10);
70
- var highlight = this.state.highlightTime;
71
- var highlightTime = highlight ? highlight.format().slice(11, 16) : null;
72
- var isZhcn = locale && locale.today === '今天';
73
- return React.createElement(
74
- 'div',
75
- { className: prefixCls + '-right-panel' },
76
- React.createElement(
77
- 'div',
78
- { className: prefixCls + '-right-panel-header', onClick: this.scrollUp },
79
- React.createElement('span', null)
80
- ),
81
- React.createElement(
82
- 'div',
83
- { className: prefixCls + '-right-panel-body', ref: this.timeRef },
84
- React.createElement(
85
- 'ul',
86
- null,
87
- this.times.map(function (time) {
88
- var current = dayjs(selectedDate + ' ' + time);
89
- current = isZhcn ? current.locale('zh-cn') : current.locale('en-gb');
90
- return React.createElement(
91
- 'li',
92
- {
93
- key: time,
94
- onClick: _this2.onSelect.bind(_this2, current),
95
- className: '' + (highlightTime === time ? prefixCls + '-selected-time' : '')
96
- },
97
- time
98
- );
99
- })
100
- )
101
- ),
102
- React.createElement(
103
- 'div',
104
- { className: prefixCls + '-right-panel-footer', onClick: this.scrollDown },
105
- React.createElement('span', null)
106
- )
107
- );
108
- };
109
-
110
- return CalendarRightPanel;
111
- }(React.Component);
112
-
113
- CalendarRightPanel.propTypes = {
114
- prefixCls: PropTypes.string,
115
- value: PropTypes.object,
116
- onSelect: PropTypes.func,
117
- onClickRightPanelTime: PropTypes.func,
118
- locale: PropTypes.object,
119
- defaultMinutesTime: PropTypes.string
120
- };
121
- export default CalendarRightPanel;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
-
3
- export default function OkButton(_ref) {
4
- var prefixCls = _ref.prefixCls,
5
- locale = _ref.locale,
6
- okDisabled = _ref.okDisabled,
7
- onOk = _ref.onOk;
8
-
9
- var className = prefixCls + "-ok-btn";
10
- if (okDisabled) {
11
- className += " " + prefixCls + "-ok-btn-disabled";
12
- }
13
- return React.createElement(
14
- "a",
15
- {
16
- className: className,
17
- role: "button",
18
- onClick: okDisabled ? null : onOk
19
- },
20
- locale.ok
21
- );
22
- }
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import classnames from 'classnames';
3
-
4
- export default function TimePickerButton(_ref) {
5
- var _classnames;
6
-
7
- var prefixCls = _ref.prefixCls,
8
- locale = _ref.locale,
9
- showTimePicker = _ref.showTimePicker,
10
- onOpenTimePicker = _ref.onOpenTimePicker,
11
- onCloseTimePicker = _ref.onCloseTimePicker,
12
- timePickerDisabled = _ref.timePickerDisabled;
13
-
14
- var className = classnames((_classnames = {}, _classnames[prefixCls + '-time-picker-btn'] = true, _classnames[prefixCls + '-time-picker-btn-disabled'] = timePickerDisabled, _classnames));
15
- var onClick = null;
16
- if (!timePickerDisabled) {
17
- onClick = showTimePicker ? onCloseTimePicker : onOpenTimePicker;
18
- }
19
- return React.createElement(
20
- 'a',
21
- {
22
- className: className,
23
- role: 'button',
24
- onClick: onClick
25
- },
26
- showTimePicker ? locale.dateSelect : locale.timeSelect
27
- );
28
- }
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { getTodayTimeStr, getTodayTime, isAllowedDate } from '../util/';
3
-
4
- export default function TodayButton(_ref) {
5
- var prefixCls = _ref.prefixCls,
6
- locale = _ref.locale,
7
- value = _ref.value,
8
- timePicker = _ref.timePicker,
9
- disabled = _ref.disabled,
10
- disabledDate = _ref.disabledDate,
11
- onToday = _ref.onToday,
12
- text = _ref.text;
13
-
14
- var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
15
- var disabledToday = disabledDate && !isAllowedDate(getTodayTime(value), disabledDate);
16
- var isDisabled = disabledToday || disabled;
17
- var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';
18
- return React.createElement(
19
- 'a',
20
- {
21
- className: prefixCls + '-today-btn ' + disabledTodayClass,
22
- role: 'button',
23
- onClick: isDisabled ? null : onToday,
24
- title: getTodayTimeStr(value)
25
- },
26
- localeNow
27
- );
28
- }
@@ -1,19 +0,0 @@
1
- var DATE_ROW_COLUMN_COUNT = {
2
- DATE_ROW_COUNT: 6,
3
- DATE_COL_COUNT: 7
4
- };
5
-
6
- var DAY_NAME_TO_INDEX = {
7
- Sunday: 0,
8
- Monday: 1,
9
- Tuesday: 2,
10
- Wednesday: 3,
11
- Thursday: 4,
12
- Friday: 5,
13
- Saturday: 6
14
- };
15
-
16
- export default {
17
- DATE_ROW_COLUMN_COUNT: DATE_ROW_COLUMN_COUNT,
18
- DAY_NAME_TO_INDEX: DAY_NAME_TO_INDEX
19
- };