@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,154 +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 { polyfill } from 'react-lifecycles-compat';
7
- import MonthTable from './MonthTable';
8
-
9
- function goYear(direction) {
10
- this.props.changeYear(direction);
11
- }
12
-
13
- function noop() {}
14
-
15
- var MonthPanel = function (_React$Component) {
16
- _inherits(MonthPanel, _React$Component);
17
-
18
- function MonthPanel(props) {
19
- _classCallCheck(this, MonthPanel);
20
-
21
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
22
-
23
- _this.setAndSelectValue = function (value) {
24
- _this.setValue(value);
25
- _this.props.onSelect(value);
26
- };
27
-
28
- _this.setValue = function (value) {
29
- if ('value' in _this.props) {
30
- _this.setState({
31
- value: value
32
- });
33
- }
34
- };
35
-
36
- _this.nextYear = goYear.bind(_this, 1);
37
- _this.previousYear = goYear.bind(_this, -1);
38
- _this.prefixCls = props.rootPrefixCls + '-month-panel';
39
-
40
- _this.state = {
41
- value: props.value || props.defaultValue
42
- };
43
- return _this;
44
- }
45
-
46
- MonthPanel.getDerivedStateFromProps = function getDerivedStateFromProps(props) {
47
- var newState = {};
48
-
49
- if ('value' in props) {
50
- newState = {
51
- value: props.value
52
- };
53
- }
54
-
55
- return newState;
56
- };
57
-
58
- MonthPanel.prototype.render = function render() {
59
- var props = this.props;
60
- var value = this.state.value;
61
- var locale = props.locale,
62
- cellRender = props.cellRender,
63
- contentRender = props.contentRender,
64
- renderFooter = props.renderFooter;
65
-
66
- var year = value.year();
67
- var prefixCls = this.prefixCls;
68
-
69
- var footer = renderFooter && renderFooter('month');
70
-
71
- return React.createElement(
72
- 'div',
73
- { className: prefixCls, style: props.style },
74
- React.createElement(
75
- 'div',
76
- null,
77
- React.createElement(
78
- 'div',
79
- { className: prefixCls + '-header' },
80
- React.createElement('a', {
81
- className: prefixCls + '-prev-year-btn',
82
- role: 'button',
83
- onClick: this.previousYear,
84
- title: locale.previousYear
85
- }),
86
- React.createElement(
87
- 'a',
88
- {
89
- className: prefixCls + '-year-select',
90
- role: 'button',
91
- onClick: props.onYearPanelShow,
92
- title: locale.yearSelect
93
- },
94
- React.createElement(
95
- 'span',
96
- { className: prefixCls + '-year-select-content' },
97
- year
98
- ),
99
- React.createElement(
100
- 'span',
101
- { className: prefixCls + '-year-select-arrow' },
102
- 'x'
103
- )
104
- ),
105
- React.createElement('a', {
106
- className: prefixCls + '-next-year-btn',
107
- role: 'button',
108
- onClick: this.nextYear,
109
- title: locale.nextYear
110
- })
111
- ),
112
- React.createElement(
113
- 'div',
114
- { className: prefixCls + '-body' },
115
- React.createElement(MonthTable, {
116
- disabledDate: props.disabledDate,
117
- onSelect: this.setAndSelectValue,
118
- locale: locale,
119
- value: value,
120
- cellRender: cellRender,
121
- contentRender: contentRender,
122
- prefixCls: prefixCls
123
- })
124
- ),
125
- footer && React.createElement(
126
- 'div',
127
- { className: prefixCls + '-footer' },
128
- footer
129
- )
130
- )
131
- );
132
- };
133
-
134
- return MonthPanel;
135
- }(React.Component);
136
-
137
- MonthPanel.propTypes = {
138
- onChange: PropTypes.func,
139
- disabledDate: PropTypes.func,
140
- onSelect: PropTypes.func,
141
- renderFooter: PropTypes.func,
142
- rootPrefixCls: PropTypes.string,
143
- value: PropTypes.object,
144
- defaultValue: PropTypes.object
145
- };
146
- MonthPanel.defaultProps = {
147
- onChange: noop,
148
- onSelect: noop
149
- };
150
-
151
-
152
- polyfill(MonthPanel);
153
-
154
- export default MonthPanel;
@@ -1,156 +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, { Component } from 'react';
5
- import PropTypes from 'prop-types';
6
- import classnames from 'classnames';
7
- import { getTodayTime, getMonthName } from '../util/index';
8
-
9
- var ROW = 4;
10
- var COL = 3;
11
-
12
- function chooseMonth(month) {
13
- var next = this.state.value.clone();
14
- next = next.month(month);
15
- this.setAndSelectValue(next);
16
- }
17
-
18
- function noop() {}
19
-
20
- var MonthTable = function (_Component) {
21
- _inherits(MonthTable, _Component);
22
-
23
- function MonthTable(props) {
24
- _classCallCheck(this, MonthTable);
25
-
26
- var _this = _possibleConstructorReturn(this, _Component.call(this, props));
27
-
28
- _this.state = {
29
- value: props.value
30
- };
31
- return _this;
32
- }
33
-
34
- MonthTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
35
- if ('value' in nextProps) {
36
- this.setState({
37
- value: nextProps.value
38
- });
39
- }
40
- };
41
-
42
- MonthTable.prototype.setAndSelectValue = function setAndSelectValue(value) {
43
- this.setState({
44
- value: value
45
- });
46
- this.props.onSelect(value);
47
- };
48
-
49
- MonthTable.prototype.months = function months() {
50
- var value = this.state.value;
51
- var current = value.clone();
52
- var months = [];
53
- var index = 0;
54
- for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
55
- months[rowIndex] = [];
56
- for (var colIndex = 0; colIndex < COL; colIndex++) {
57
- current = current.month(index);
58
- var content = getMonthName(current);
59
- months[rowIndex][colIndex] = {
60
- value: index,
61
- content: content,
62
- title: content
63
- };
64
- index++;
65
- }
66
- }
67
- return months;
68
- };
69
-
70
- MonthTable.prototype.render = function render() {
71
- var _this2 = this;
72
-
73
- var props = this.props;
74
- var value = this.state.value;
75
- var today = getTodayTime(value);
76
- var months = this.months();
77
- var currentMonth = value.month();
78
- var prefixCls = props.prefixCls,
79
- locale = props.locale,
80
- contentRender = props.contentRender,
81
- cellRender = props.cellRender;
82
-
83
- var monthsEls = months.map(function (month, index) {
84
- var tds = month.map(function (monthData) {
85
- var _classNameMap;
86
-
87
- var disabled = false;
88
- if (props.disabledDate) {
89
- var testValue = value.clone();
90
- testValue = testValue.month(monthData.value);
91
- disabled = props.disabledDate(testValue);
92
- }
93
- var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-cell-disabled'] = disabled, _classNameMap[prefixCls + '-selected-cell'] = monthData.value === currentMonth, _classNameMap[prefixCls + '-current-cell'] = today.year() === value.year() && monthData.value === today.month(), _classNameMap);
94
- var cellEl = void 0;
95
- if (cellRender) {
96
- var currentValue = value.clone();
97
- currentValue = currentValue.month(monthData.value);
98
- cellEl = cellRender(currentValue, locale);
99
- } else {
100
- var content = void 0;
101
- if (contentRender) {
102
- var _currentValue = value.clone();
103
- _currentValue = _currentValue.month(monthData.value);
104
- content = contentRender(_currentValue, locale);
105
- } else {
106
- content = monthData.content;
107
- }
108
- cellEl = React.createElement(
109
- 'a',
110
- { className: prefixCls + '-month' },
111
- content
112
- );
113
- }
114
- return React.createElement(
115
- 'td',
116
- {
117
- role: 'gridcell',
118
- key: monthData.value,
119
- onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value),
120
- title: monthData.title,
121
- className: classnames(classNameMap)
122
- },
123
- cellEl
124
- );
125
- });
126
- return React.createElement(
127
- 'tr',
128
- { key: index, role: 'row' },
129
- tds
130
- );
131
- });
132
-
133
- return React.createElement(
134
- 'table',
135
- { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
136
- React.createElement(
137
- 'tbody',
138
- { className: prefixCls + '-tbody' },
139
- monthsEls
140
- )
141
- );
142
- };
143
-
144
- return MonthTable;
145
- }(Component);
146
-
147
- MonthTable.defaultProps = {
148
- onSelect: noop
149
- };
150
- MonthTable.propTypes = {
151
- onSelect: PropTypes.func,
152
- cellRender: PropTypes.func,
153
- prefixCls: PropTypes.string,
154
- value: PropTypes.object
155
- };
156
- export default MonthTable;
@@ -1,35 +0,0 @@
1
- var autoAdjustOverflow = {
2
- adjustX: 1,
3
- adjustY: 1
4
- };
5
-
6
- var targetOffset = [0, 0];
7
-
8
- var placements = {
9
- bottomLeft: {
10
- points: ['tl', 'tl'],
11
- overflow: autoAdjustOverflow,
12
- offset: [0, -3],
13
- targetOffset: targetOffset
14
- },
15
- bottomRight: {
16
- points: ['tr', 'tr'],
17
- overflow: autoAdjustOverflow,
18
- offset: [0, -3],
19
- targetOffset: targetOffset
20
- },
21
- topRight: {
22
- points: ['br', 'br'],
23
- overflow: autoAdjustOverflow,
24
- offset: [0, 3],
25
- targetOffset: targetOffset
26
- },
27
- topLeft: {
28
- points: ['bl', 'bl'],
29
- overflow: autoAdjustOverflow,
30
- offset: [0, 3],
31
- targetOffset: targetOffset
32
- }
33
- };
34
-
35
- export default placements;
@@ -1,151 +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 PropTypes from 'prop-types';
7
- import CalendarHeader from '../calendar/CalendarHeader';
8
- import DateTable from '../date/DateTable';
9
- import DateInput from '../date/DateInput';
10
- import { getTimeConfig } from '../util/index';
11
-
12
- var CalendarPart = function (_React$Component) {
13
- _inherits(CalendarPart, _React$Component);
14
-
15
- function CalendarPart() {
16
- _classCallCheck(this, CalendarPart);
17
-
18
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
19
- }
20
-
21
- CalendarPart.prototype.render = function render() {
22
- var props = this.props;
23
- var prefixCls = props.prefixCls,
24
- value = props.value,
25
- hoverValue = props.hoverValue,
26
- selectedValue = props.selectedValue,
27
- mode = props.mode,
28
- direction = props.direction,
29
- locale = props.locale,
30
- format = props.format,
31
- placeholder = props.placeholder,
32
- disabledDate = props.disabledDate,
33
- timePicker = props.timePicker,
34
- disabledTime = props.disabledTime,
35
- timePickerDisabledTime = props.timePickerDisabledTime,
36
- showTimePicker = props.showTimePicker,
37
- onInputChange = props.onInputChange,
38
- onInputSelect = props.onInputSelect,
39
- enablePrev = props.enablePrev,
40
- enableNext = props.enableNext,
41
- clearIcon = props.clearIcon,
42
- showClear = props.showClear,
43
- inputMode = props.inputMode;
44
-
45
- var shouldShowTimePicker = showTimePicker && timePicker;
46
- var disabledTimeConfig = shouldShowTimePicker && disabledTime ? getTimeConfig(selectedValue, disabledTime) : null;
47
- var rangeClassName = prefixCls + '-range';
48
- var newProps = {
49
- locale: locale,
50
- value: value,
51
- prefixCls: prefixCls,
52
- showTimePicker: showTimePicker
53
- };
54
- var index = direction === 'left' ? 0 : 1;
55
- var timePickerEle = shouldShowTimePicker && React.cloneElement(timePicker, _extends({
56
- showHour: true,
57
- showMinute: true,
58
- showSecond: true
59
- }, timePicker.props, disabledTimeConfig, timePickerDisabledTime, {
60
- onChange: onInputChange,
61
- defaultOpenValue: value,
62
- value: selectedValue[index]
63
- }));
64
-
65
- var dateInputElement = props.showDateInput && React.createElement(DateInput, {
66
- format: format,
67
- locale: locale,
68
- prefixCls: prefixCls,
69
- timePicker: timePicker,
70
- disabledDate: disabledDate,
71
- placeholder: placeholder,
72
- disabledTime: disabledTime,
73
- value: value,
74
- showClear: showClear || false,
75
- selectedValue: selectedValue[index],
76
- onChange: onInputChange,
77
- onSelect: onInputSelect,
78
- clearIcon: clearIcon,
79
- inputMode: inputMode
80
- });
81
-
82
- return React.createElement(
83
- 'div',
84
- {
85
- className: rangeClassName + '-part ' + rangeClassName + '-' + direction
86
- },
87
- dateInputElement,
88
- React.createElement(
89
- 'div',
90
- { style: { outline: 'none' } },
91
- React.createElement(CalendarHeader, _extends({}, newProps, {
92
- mode: mode,
93
- enableNext: enableNext,
94
- enablePrev: enablePrev,
95
- onValueChange: props.onValueChange,
96
- onPanelChange: props.onPanelChange,
97
- disabledMonth: props.disabledMonth
98
- })),
99
- showTimePicker ? React.createElement(
100
- 'div',
101
- { className: prefixCls + '-time-picker' },
102
- React.createElement(
103
- 'div',
104
- { className: prefixCls + '-time-picker-panel' },
105
- timePickerEle
106
- )
107
- ) : null,
108
- React.createElement(
109
- 'div',
110
- { className: prefixCls + '-body' },
111
- React.createElement(DateTable, _extends({}, newProps, {
112
- hoverValue: hoverValue,
113
- selectedValue: selectedValue,
114
- dateRender: props.dateRender,
115
- onSelect: props.onSelect,
116
- onDayHover: props.onDayHover,
117
- disabledDate: disabledDate,
118
- showWeekNumber: props.showWeekNumber
119
- }))
120
- )
121
- )
122
- );
123
- };
124
-
125
- return CalendarPart;
126
- }(React.Component);
127
-
128
- CalendarPart.propTypes = {
129
- prefixCls: PropTypes.string,
130
- value: PropTypes.any,
131
- hoverValue: PropTypes.any,
132
- selectedValue: PropTypes.any,
133
- direction: PropTypes.any,
134
- locale: PropTypes.any,
135
- showDateInput: PropTypes.bool,
136
- showTimePicker: PropTypes.bool,
137
- format: PropTypes.any,
138
- placeholder: PropTypes.any,
139
- disabledDate: PropTypes.any,
140
- timePicker: PropTypes.any,
141
- disabledTime: PropTypes.any,
142
- onInputChange: PropTypes.func,
143
- onInputSelect: PropTypes.func,
144
- timePickerDisabledTime: PropTypes.object,
145
- enableNext: PropTypes.any,
146
- enablePrev: PropTypes.any,
147
- clearIcon: PropTypes.node,
148
- dateRender: PropTypes.func,
149
- inputMode: PropTypes.string
150
- };
151
- export default CalendarPart;
package/es/util/dayjs.js DELETED
@@ -1,17 +0,0 @@
1
- import dayjs from 'dayjs';
2
- import localeData from 'dayjs/plugin/localeData';
3
- import weekOfYear from 'dayjs/plugin/weekOfYear';
4
- import utc from 'dayjs/plugin/utc';
5
- import advancedFormat from 'dayjs/plugin/advancedFormat';
6
- import customParseFormat from 'dayjs/plugin/customParseFormat';
7
- import badMutable from 'dayjs/plugin/badMutable';
8
- import 'dayjs/locale/zh-cn';
9
- import 'dayjs/locale/en-gb';
10
-
11
- dayjs.extend(localeData);
12
- dayjs.extend(weekOfYear);
13
- dayjs.extend(utc);
14
- dayjs.extend(advancedFormat);
15
- dayjs.extend(customParseFormat);
16
- dayjs.extend(badMutable);
17
- export default dayjs;
package/es/util/index.js DELETED
@@ -1,105 +0,0 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import dayjs from 'dayjs';
3
- import utc from 'dayjs/plugin/utc';
4
-
5
- dayjs.extend(utc);
6
-
7
- var defaultDisabledTime = {
8
- disabledHours: function disabledHours() {
9
- return [];
10
- },
11
- disabledMinutes: function disabledMinutes() {
12
- return [];
13
- },
14
- disabledSeconds: function disabledSeconds() {
15
- return [];
16
- }
17
- };
18
-
19
- export function getTodayTime(value) {
20
- var today = dayjs();
21
- today = today.locale(value.locale()).utcOffset(value.utcOffset());
22
- return today;
23
- }
24
-
25
- export function getTitleString(value) {
26
- return value.format('LL');
27
- }
28
-
29
- export function getTodayTimeStr(value) {
30
- var today = getTodayTime(value);
31
- return getTitleString(today);
32
- }
33
-
34
- export function getMonthName(month) {
35
- var locale = month.locale();
36
- var localeData = month.localeData();
37
- return localeData[locale === 'zh-cn' ? 'months' : 'monthsShort'](month);
38
- }
39
-
40
- export function syncTime(from, to) {
41
- if (!dayjs.isDayjs(from) || !dayjs.isDayjs(to)) return;
42
- to = to.hour(from.hour());
43
- to = to.minute(from.minute());
44
- to = to.second(from.second());
45
- to = to.millisecond(from.millisecond());
46
- }
47
-
48
- export function getTimeConfig(value, disabledTime) {
49
- var disabledTimeConfig = disabledTime ? disabledTime(value) : {};
50
- disabledTimeConfig = _extends({}, defaultDisabledTime, disabledTimeConfig);
51
- return disabledTimeConfig;
52
- }
53
-
54
- export function isTimeValidByConfig(value, disabledTimeConfig) {
55
- var invalidTime = false;
56
- if (value) {
57
- var hour = value.hour();
58
- var minutes = value.minute();
59
- var seconds = value.second();
60
- var disabledHours = disabledTimeConfig.disabledHours();
61
- if (disabledHours.indexOf(hour) === -1) {
62
- var disabledMinutes = disabledTimeConfig.disabledMinutes(hour);
63
- if (disabledMinutes.indexOf(minutes) === -1) {
64
- var disabledSeconds = disabledTimeConfig.disabledSeconds(hour, minutes);
65
- invalidTime = disabledSeconds.indexOf(seconds) !== -1;
66
- } else {
67
- invalidTime = true;
68
- }
69
- } else {
70
- invalidTime = true;
71
- }
72
- }
73
- return !invalidTime;
74
- }
75
-
76
- export function isTimeValid(value, disabledTime) {
77
- var disabledTimeConfig = getTimeConfig(value, disabledTime);
78
- return isTimeValidByConfig(value, disabledTimeConfig);
79
- }
80
-
81
- export function isAllowedDate(value, disabledDate, disabledTime) {
82
- if (disabledDate) {
83
- if (disabledDate(value)) {
84
- return false;
85
- }
86
- }
87
- if (disabledTime) {
88
- if (!isTimeValid(value, disabledTime)) {
89
- return false;
90
- }
91
- }
92
- return true;
93
- }
94
-
95
- export function formatDate(value, format) {
96
- if (!value) {
97
- return '';
98
- }
99
-
100
- if (Array.isArray(format)) {
101
- format = format[0];
102
- }
103
-
104
- return value.format(format);
105
- }
package/es/util/toTime.js DELETED
@@ -1,21 +0,0 @@
1
- export function goStartMonth(time) {
2
- return time.clone().startOf('month');
3
- }
4
-
5
- export function goEndMonth(time) {
6
- return time.clone().endOf('month');
7
- }
8
-
9
- export function goTime(time, direction, unit) {
10
- return time.clone().add(direction, unit);
11
- }
12
-
13
- export function includesTime() {
14
- var timeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15
- var time = arguments[1];
16
- var unit = arguments[2];
17
-
18
- return timeList.some(function (t) {
19
- return t.isSame(time, unit);
20
- });
21
- }