@seafile/seafile-calendar 0.0.15 → 0.0.16

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 (159) hide show
  1. package/index.d.ts +10 -10
  2. package/package.json +2 -2
  3. package/assets/index.css +0 -1186
  4. package/es/Calendar.js +0 -430
  5. package/es/FullCalendar.js +0 -182
  6. package/es/MonthCalendar.js +0 -135
  7. package/es/Picker.js +0 -245
  8. package/es/RangeCalendar.js +0 -876
  9. package/es/calendar/CalendarFooter.js +0 -93
  10. package/es/calendar/CalendarHeader.js +0 -257
  11. package/es/calendar/CalendarRightPanel.js +0 -124
  12. package/es/calendar/OkButton.js +0 -22
  13. package/es/calendar/TimePickerButton.js +0 -28
  14. package/es/calendar/TodayButton.js +0 -28
  15. package/es/date/DateConstants.js +0 -4
  16. package/es/date/DateInput.js +0 -233
  17. package/es/date/DateTBody.js +0 -275
  18. package/es/date/DateTHead.js +0 -81
  19. package/es/date/DateTable.js +0 -32
  20. package/es/decade/DecadePanel.js +0 -181
  21. package/es/full-calendar/CalendarHeader.js +0 -180
  22. package/es/index.js +0 -3
  23. package/es/locale/ar_EG.js +0 -27
  24. package/es/locale/bg_BG.js +0 -27
  25. package/es/locale/ca_ES.js +0 -27
  26. package/es/locale/cs_CZ.js +0 -27
  27. package/es/locale/da_DK.js +0 -27
  28. package/es/locale/de_DE.js +0 -27
  29. package/es/locale/el_GR.js +0 -27
  30. package/es/locale/en_GB.js +0 -27
  31. package/es/locale/en_US.js +0 -28
  32. package/es/locale/es_ES.js +0 -27
  33. package/es/locale/et_EE.js +0 -27
  34. package/es/locale/fa_IR.js +0 -27
  35. package/es/locale/fi_FI.js +0 -27
  36. package/es/locale/fr_BE.js +0 -27
  37. package/es/locale/fr_FR.js +0 -27
  38. package/es/locale/he_IL.js +0 -28
  39. package/es/locale/hi_IN.js +0 -28
  40. package/es/locale/hr_HR.js +0 -28
  41. package/es/locale/hu_HU.js +0 -27
  42. package/es/locale/id_ID.js +0 -28
  43. package/es/locale/is_IS.js +0 -27
  44. package/es/locale/it_IT.js +0 -27
  45. package/es/locale/ja_JP.js +0 -26
  46. package/es/locale/kn_IN.js +0 -28
  47. package/es/locale/ko_KR.js +0 -27
  48. package/es/locale/ku_IQ.js +0 -27
  49. package/es/locale/lv_LV.js +0 -27
  50. package/es/locale/mm_MM.js +0 -28
  51. package/es/locale/mn_MN.js +0 -28
  52. package/es/locale/ms_MY.js +0 -27
  53. package/es/locale/nb_NO.js +0 -27
  54. package/es/locale/nl_BE.js +0 -27
  55. package/es/locale/nl_NL.js +0 -27
  56. package/es/locale/pl_PL.js +0 -27
  57. package/es/locale/pt_BR.js +0 -27
  58. package/es/locale/pt_PT.js +0 -27
  59. package/es/locale/ro_RO.js +0 -28
  60. package/es/locale/ru_RU.js +0 -27
  61. package/es/locale/sk_SK.js +0 -27
  62. package/es/locale/sl_SI.js +0 -27
  63. package/es/locale/sr_RS.js +0 -27
  64. package/es/locale/sv_SE.js +0 -27
  65. package/es/locale/ta_IN.js +0 -28
  66. package/es/locale/th_TH.js +0 -27
  67. package/es/locale/tr_TR.js +0 -27
  68. package/es/locale/ug_CN.js +0 -26
  69. package/es/locale/uk_UA.js +0 -27
  70. package/es/locale/vi_VN.js +0 -28
  71. package/es/locale/zh_CN.js +0 -27
  72. package/es/locale/zh_TW.js +0 -26
  73. package/es/mixin/CalendarMixin.js +0 -123
  74. package/es/mixin/CommonMixin.js +0 -85
  75. package/es/month/MonthPanel.js +0 -154
  76. package/es/month/MonthTable.js +0 -156
  77. package/es/picker/placements.js +0 -35
  78. package/es/range-calendar/CalendarPart.js +0 -151
  79. package/es/util/index.js +0 -102
  80. package/es/util/toTime.js +0 -21
  81. package/es/year/YearPanel.js +0 -202
  82. package/lib/Calendar.js +0 -483
  83. package/lib/FullCalendar.js +0 -221
  84. package/lib/MonthCalendar.js +0 -172
  85. package/lib/Picker.js +0 -282
  86. package/lib/RangeCalendar.js +0 -925
  87. package/lib/calendar/CalendarFooter.js +0 -134
  88. package/lib/calendar/CalendarHeader.js +0 -290
  89. package/lib/calendar/CalendarRightPanel.js +0 -148
  90. package/lib/calendar/OkButton.js +0 -32
  91. package/lib/calendar/TimePickerButton.js +0 -41
  92. package/lib/calendar/TodayButton.js +0 -39
  93. package/lib/date/DateConstants.js +0 -8
  94. package/lib/date/DateInput.js +0 -265
  95. package/lib/date/DateTBody.js +0 -302
  96. package/lib/date/DateTHead.js +0 -104
  97. package/lib/date/DateTable.js +0 -54
  98. package/lib/decade/DecadePanel.js +0 -207
  99. package/lib/full-calendar/CalendarHeader.js +0 -201
  100. package/lib/index.js +0 -12
  101. package/lib/locale/ar_EG.js +0 -31
  102. package/lib/locale/bg_BG.js +0 -31
  103. package/lib/locale/ca_ES.js +0 -31
  104. package/lib/locale/cs_CZ.js +0 -31
  105. package/lib/locale/da_DK.js +0 -31
  106. package/lib/locale/de_DE.js +0 -31
  107. package/lib/locale/el_GR.js +0 -31
  108. package/lib/locale/en_GB.js +0 -31
  109. package/lib/locale/en_US.js +0 -32
  110. package/lib/locale/es_ES.js +0 -31
  111. package/lib/locale/et_EE.js +0 -31
  112. package/lib/locale/fa_IR.js +0 -31
  113. package/lib/locale/fi_FI.js +0 -31
  114. package/lib/locale/fr_BE.js +0 -31
  115. package/lib/locale/fr_FR.js +0 -31
  116. package/lib/locale/he_IL.js +0 -32
  117. package/lib/locale/hi_IN.js +0 -32
  118. package/lib/locale/hr_HR.js +0 -32
  119. package/lib/locale/hu_HU.js +0 -31
  120. package/lib/locale/id_ID.js +0 -32
  121. package/lib/locale/is_IS.js +0 -31
  122. package/lib/locale/it_IT.js +0 -31
  123. package/lib/locale/ja_JP.js +0 -30
  124. package/lib/locale/kn_IN.js +0 -32
  125. package/lib/locale/ko_KR.js +0 -31
  126. package/lib/locale/ku_IQ.js +0 -31
  127. package/lib/locale/lv_LV.js +0 -31
  128. package/lib/locale/mm_MM.js +0 -32
  129. package/lib/locale/mn_MN.js +0 -32
  130. package/lib/locale/ms_MY.js +0 -31
  131. package/lib/locale/nb_NO.js +0 -31
  132. package/lib/locale/nl_BE.js +0 -31
  133. package/lib/locale/nl_NL.js +0 -31
  134. package/lib/locale/pl_PL.js +0 -31
  135. package/lib/locale/pt_BR.js +0 -31
  136. package/lib/locale/pt_PT.js +0 -31
  137. package/lib/locale/ro_RO.js +0 -32
  138. package/lib/locale/ru_RU.js +0 -31
  139. package/lib/locale/sk_SK.js +0 -31
  140. package/lib/locale/sl_SI.js +0 -31
  141. package/lib/locale/sr_RS.js +0 -31
  142. package/lib/locale/sv_SE.js +0 -31
  143. package/lib/locale/ta_IN.js +0 -32
  144. package/lib/locale/th_TH.js +0 -31
  145. package/lib/locale/tr_TR.js +0 -31
  146. package/lib/locale/ug_CN.js +0 -30
  147. package/lib/locale/uk_UA.js +0 -31
  148. package/lib/locale/vi_VN.js +0 -32
  149. package/lib/locale/zh_CN.js +0 -31
  150. package/lib/locale/zh_TW.js +0 -30
  151. package/lib/mixin/CalendarMixin.js +0 -153
  152. package/lib/mixin/CommonMixin.js +0 -106
  153. package/lib/month/MonthPanel.js +0 -179
  154. package/lib/month/MonthTable.js +0 -181
  155. package/lib/picker/placements.js +0 -39
  156. package/lib/range-calendar/CalendarPart.js +0 -184
  157. package/lib/util/index.js +0 -124
  158. package/lib/util/toTime.js +0 -28
  159. package/lib/year/YearPanel.js +0 -227
@@ -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.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.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.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.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.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/index.js DELETED
@@ -1,102 +0,0 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import moment from 'moment';
3
-
4
- var defaultDisabledTime = {
5
- disabledHours: function disabledHours() {
6
- return [];
7
- },
8
- disabledMinutes: function disabledMinutes() {
9
- return [];
10
- },
11
- disabledSeconds: function disabledSeconds() {
12
- return [];
13
- }
14
- };
15
-
16
- export function getTodayTime(value) {
17
- var today = moment();
18
- today.locale(value.locale()).utcOffset(value.utcOffset());
19
- return today;
20
- }
21
-
22
- export function getTitleString(value) {
23
- return value.format('LL');
24
- }
25
-
26
- export function getTodayTimeStr(value) {
27
- var today = getTodayTime(value);
28
- return getTitleString(today);
29
- }
30
-
31
- export function getMonthName(month) {
32
- var locale = month.locale();
33
- var localeData = month.localeData();
34
- return localeData[locale === 'zh-cn' ? 'months' : 'monthsShort'](month);
35
- }
36
-
37
- export function syncTime(from, to) {
38
- if (!moment.isMoment(from) || !moment.isMoment(to)) return;
39
- to.hour(from.hour());
40
- to.minute(from.minute());
41
- to.second(from.second());
42
- to.millisecond(from.millisecond());
43
- }
44
-
45
- export function getTimeConfig(value, disabledTime) {
46
- var disabledTimeConfig = disabledTime ? disabledTime(value) : {};
47
- disabledTimeConfig = _extends({}, defaultDisabledTime, disabledTimeConfig);
48
- return disabledTimeConfig;
49
- }
50
-
51
- export function isTimeValidByConfig(value, disabledTimeConfig) {
52
- var invalidTime = false;
53
- if (value) {
54
- var hour = value.hour();
55
- var minutes = value.minute();
56
- var seconds = value.second();
57
- var disabledHours = disabledTimeConfig.disabledHours();
58
- if (disabledHours.indexOf(hour) === -1) {
59
- var disabledMinutes = disabledTimeConfig.disabledMinutes(hour);
60
- if (disabledMinutes.indexOf(minutes) === -1) {
61
- var disabledSeconds = disabledTimeConfig.disabledSeconds(hour, minutes);
62
- invalidTime = disabledSeconds.indexOf(seconds) !== -1;
63
- } else {
64
- invalidTime = true;
65
- }
66
- } else {
67
- invalidTime = true;
68
- }
69
- }
70
- return !invalidTime;
71
- }
72
-
73
- export function isTimeValid(value, disabledTime) {
74
- var disabledTimeConfig = getTimeConfig(value, disabledTime);
75
- return isTimeValidByConfig(value, disabledTimeConfig);
76
- }
77
-
78
- export function isAllowedDate(value, disabledDate, disabledTime) {
79
- if (disabledDate) {
80
- if (disabledDate(value)) {
81
- return false;
82
- }
83
- }
84
- if (disabledTime) {
85
- if (!isTimeValid(value, disabledTime)) {
86
- return false;
87
- }
88
- }
89
- return true;
90
- }
91
-
92
- export function formatDate(value, format) {
93
- if (!value) {
94
- return '';
95
- }
96
-
97
- if (Array.isArray(format)) {
98
- format = format[0];
99
- }
100
-
101
- return value.format(format);
102
- }
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
- }