@seafile/seafile-calendar 0.0.12 → 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 (163) hide show
  1. package/README.md +6 -0
  2. package/dist/rc-calendar.js +63 -35
  3. package/dist/rc-calendar.js.map +1 -1
  4. package/dist/rc-calendar.min.js +1 -1
  5. package/index.d.ts +12 -11
  6. package/package.json +2 -2
  7. package/assets/index.css +0 -1186
  8. package/es/Calendar.js +0 -424
  9. package/es/FullCalendar.js +0 -182
  10. package/es/MonthCalendar.js +0 -135
  11. package/es/Picker.js +0 -245
  12. package/es/RangeCalendar.js +0 -876
  13. package/es/calendar/CalendarFooter.js +0 -93
  14. package/es/calendar/CalendarHeader.js +0 -257
  15. package/es/calendar/CalendarRightPanel.js +0 -108
  16. package/es/calendar/OkButton.js +0 -22
  17. package/es/calendar/TimePickerButton.js +0 -28
  18. package/es/calendar/TodayButton.js +0 -28
  19. package/es/date/DateConstants.js +0 -4
  20. package/es/date/DateInput.js +0 -233
  21. package/es/date/DateTBody.js +0 -275
  22. package/es/date/DateTHead.js +0 -81
  23. package/es/date/DateTable.js +0 -32
  24. package/es/decade/DecadePanel.js +0 -181
  25. package/es/full-calendar/CalendarHeader.js +0 -180
  26. package/es/index.js +0 -3
  27. package/es/locale/ar_EG.js +0 -27
  28. package/es/locale/bg_BG.js +0 -27
  29. package/es/locale/ca_ES.js +0 -27
  30. package/es/locale/cs_CZ.js +0 -27
  31. package/es/locale/da_DK.js +0 -27
  32. package/es/locale/de_DE.js +0 -27
  33. package/es/locale/el_GR.js +0 -27
  34. package/es/locale/en_GB.js +0 -27
  35. package/es/locale/en_US.js +0 -28
  36. package/es/locale/es_ES.js +0 -27
  37. package/es/locale/et_EE.js +0 -27
  38. package/es/locale/fa_IR.js +0 -27
  39. package/es/locale/fi_FI.js +0 -27
  40. package/es/locale/fr_BE.js +0 -27
  41. package/es/locale/fr_FR.js +0 -27
  42. package/es/locale/he_IL.js +0 -28
  43. package/es/locale/hi_IN.js +0 -28
  44. package/es/locale/hr_HR.js +0 -28
  45. package/es/locale/hu_HU.js +0 -27
  46. package/es/locale/id_ID.js +0 -28
  47. package/es/locale/is_IS.js +0 -27
  48. package/es/locale/it_IT.js +0 -27
  49. package/es/locale/ja_JP.js +0 -26
  50. package/es/locale/kn_IN.js +0 -28
  51. package/es/locale/ko_KR.js +0 -27
  52. package/es/locale/ku_IQ.js +0 -27
  53. package/es/locale/lv_LV.js +0 -27
  54. package/es/locale/mm_MM.js +0 -28
  55. package/es/locale/mn_MN.js +0 -28
  56. package/es/locale/ms_MY.js +0 -27
  57. package/es/locale/nb_NO.js +0 -27
  58. package/es/locale/nl_BE.js +0 -27
  59. package/es/locale/nl_NL.js +0 -27
  60. package/es/locale/pl_PL.js +0 -27
  61. package/es/locale/pt_BR.js +0 -27
  62. package/es/locale/pt_PT.js +0 -27
  63. package/es/locale/ro_RO.js +0 -28
  64. package/es/locale/ru_RU.js +0 -27
  65. package/es/locale/sk_SK.js +0 -27
  66. package/es/locale/sl_SI.js +0 -27
  67. package/es/locale/sr_RS.js +0 -27
  68. package/es/locale/sv_SE.js +0 -27
  69. package/es/locale/ta_IN.js +0 -28
  70. package/es/locale/th_TH.js +0 -27
  71. package/es/locale/tr_TR.js +0 -27
  72. package/es/locale/ug_CN.js +0 -26
  73. package/es/locale/uk_UA.js +0 -27
  74. package/es/locale/vi_VN.js +0 -28
  75. package/es/locale/zh_CN.js +0 -27
  76. package/es/locale/zh_TW.js +0 -26
  77. package/es/mixin/CalendarMixin.js +0 -123
  78. package/es/mixin/CommonMixin.js +0 -85
  79. package/es/month/MonthPanel.js +0 -154
  80. package/es/month/MonthTable.js +0 -156
  81. package/es/picker/placements.js +0 -35
  82. package/es/range-calendar/CalendarPart.js +0 -151
  83. package/es/util/index.js +0 -102
  84. package/es/util/toTime.js +0 -21
  85. package/es/year/YearPanel.js +0 -202
  86. package/lib/Calendar.js +0 -477
  87. package/lib/FullCalendar.js +0 -221
  88. package/lib/MonthCalendar.js +0 -172
  89. package/lib/Picker.js +0 -282
  90. package/lib/RangeCalendar.js +0 -925
  91. package/lib/calendar/CalendarFooter.js +0 -134
  92. package/lib/calendar/CalendarHeader.js +0 -290
  93. package/lib/calendar/CalendarRightPanel.js +0 -132
  94. package/lib/calendar/OkButton.js +0 -32
  95. package/lib/calendar/TimePickerButton.js +0 -41
  96. package/lib/calendar/TodayButton.js +0 -39
  97. package/lib/date/DateConstants.js +0 -8
  98. package/lib/date/DateInput.js +0 -265
  99. package/lib/date/DateTBody.js +0 -302
  100. package/lib/date/DateTHead.js +0 -104
  101. package/lib/date/DateTable.js +0 -54
  102. package/lib/decade/DecadePanel.js +0 -207
  103. package/lib/full-calendar/CalendarHeader.js +0 -201
  104. package/lib/index.js +0 -12
  105. package/lib/locale/ar_EG.js +0 -31
  106. package/lib/locale/bg_BG.js +0 -31
  107. package/lib/locale/ca_ES.js +0 -31
  108. package/lib/locale/cs_CZ.js +0 -31
  109. package/lib/locale/da_DK.js +0 -31
  110. package/lib/locale/de_DE.js +0 -31
  111. package/lib/locale/el_GR.js +0 -31
  112. package/lib/locale/en_GB.js +0 -31
  113. package/lib/locale/en_US.js +0 -32
  114. package/lib/locale/es_ES.js +0 -31
  115. package/lib/locale/et_EE.js +0 -31
  116. package/lib/locale/fa_IR.js +0 -31
  117. package/lib/locale/fi_FI.js +0 -31
  118. package/lib/locale/fr_BE.js +0 -31
  119. package/lib/locale/fr_FR.js +0 -31
  120. package/lib/locale/he_IL.js +0 -32
  121. package/lib/locale/hi_IN.js +0 -32
  122. package/lib/locale/hr_HR.js +0 -32
  123. package/lib/locale/hu_HU.js +0 -31
  124. package/lib/locale/id_ID.js +0 -32
  125. package/lib/locale/is_IS.js +0 -31
  126. package/lib/locale/it_IT.js +0 -31
  127. package/lib/locale/ja_JP.js +0 -30
  128. package/lib/locale/kn_IN.js +0 -32
  129. package/lib/locale/ko_KR.js +0 -31
  130. package/lib/locale/ku_IQ.js +0 -31
  131. package/lib/locale/lv_LV.js +0 -31
  132. package/lib/locale/mm_MM.js +0 -32
  133. package/lib/locale/mn_MN.js +0 -32
  134. package/lib/locale/ms_MY.js +0 -31
  135. package/lib/locale/nb_NO.js +0 -31
  136. package/lib/locale/nl_BE.js +0 -31
  137. package/lib/locale/nl_NL.js +0 -31
  138. package/lib/locale/pl_PL.js +0 -31
  139. package/lib/locale/pt_BR.js +0 -31
  140. package/lib/locale/pt_PT.js +0 -31
  141. package/lib/locale/ro_RO.js +0 -32
  142. package/lib/locale/ru_RU.js +0 -31
  143. package/lib/locale/sk_SK.js +0 -31
  144. package/lib/locale/sl_SI.js +0 -31
  145. package/lib/locale/sr_RS.js +0 -31
  146. package/lib/locale/sv_SE.js +0 -31
  147. package/lib/locale/ta_IN.js +0 -32
  148. package/lib/locale/th_TH.js +0 -31
  149. package/lib/locale/tr_TR.js +0 -31
  150. package/lib/locale/ug_CN.js +0 -30
  151. package/lib/locale/uk_UA.js +0 -31
  152. package/lib/locale/vi_VN.js +0 -32
  153. package/lib/locale/zh_CN.js +0 -31
  154. package/lib/locale/zh_TW.js +0 -30
  155. package/lib/mixin/CalendarMixin.js +0 -153
  156. package/lib/mixin/CommonMixin.js +0 -106
  157. package/lib/month/MonthPanel.js +0 -179
  158. package/lib/month/MonthTable.js +0 -181
  159. package/lib/picker/placements.js +0 -39
  160. package/lib/range-calendar/CalendarPart.js +0 -184
  161. package/lib/util/index.js +0 -124
  162. package/lib/util/toTime.js +0 -28
  163. package/lib/year/YearPanel.js +0 -227
@@ -1,227 +0,0 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
6
-
7
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
8
-
9
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
10
-
11
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
12
-
13
- var _inherits2 = require('babel-runtime/helpers/inherits');
14
-
15
- var _inherits3 = _interopRequireDefault(_inherits2);
16
-
17
- var _react = require('react');
18
-
19
- var _react2 = _interopRequireDefault(_react);
20
-
21
- var _propTypes = require('prop-types');
22
-
23
- var _propTypes2 = _interopRequireDefault(_propTypes);
24
-
25
- var _classnames = require('classnames');
26
-
27
- var _classnames2 = _interopRequireDefault(_classnames);
28
-
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
30
-
31
- var ROW = 4;
32
- var COL = 3;
33
-
34
- function goYear(direction) {
35
- var value = this.state.value.clone();
36
- value.add(direction, 'year');
37
- this.setState({
38
- value: value
39
- });
40
- }
41
-
42
- function chooseYear(year) {
43
- var value = this.state.value.clone();
44
- value.year(year);
45
- value.month(this.state.value.month());
46
- this.setState({
47
- value: value
48
- });
49
- this.props.onSelect(value);
50
- }
51
-
52
- var YearPanel = function (_React$Component) {
53
- (0, _inherits3['default'])(YearPanel, _React$Component);
54
-
55
- function YearPanel(props) {
56
- (0, _classCallCheck3['default'])(this, YearPanel);
57
-
58
- var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));
59
-
60
- _this.prefixCls = props.rootPrefixCls + '-year-panel';
61
- _this.state = {
62
- value: props.value || props.defaultValue
63
- };
64
- _this.nextDecade = goYear.bind(_this, 10);
65
- _this.previousDecade = goYear.bind(_this, -10);
66
- return _this;
67
- }
68
-
69
- YearPanel.prototype.years = function years() {
70
- var value = this.state.value;
71
- var currentYear = value.year();
72
- var startYear = parseInt(currentYear / 10, 10) * 10;
73
- var previousYear = startYear - 1;
74
- var years = [];
75
- var index = 0;
76
- for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
77
- years[rowIndex] = [];
78
- for (var colIndex = 0; colIndex < COL; colIndex++) {
79
- var year = previousYear + index;
80
- var content = String(year);
81
- years[rowIndex][colIndex] = {
82
- content: content,
83
- year: year,
84
- title: content
85
- };
86
- index++;
87
- }
88
- }
89
- return years;
90
- };
91
-
92
- YearPanel.prototype.render = function render() {
93
- var _this2 = this;
94
-
95
- var props = this.props;
96
- var value = this.state.value;
97
- var locale = props.locale,
98
- renderFooter = props.renderFooter;
99
-
100
- var years = this.years();
101
- var currentYear = value.year();
102
- var startYear = parseInt(currentYear / 10, 10) * 10;
103
- var endYear = startYear + 9;
104
- var prefixCls = this.prefixCls;
105
-
106
- var yeasEls = years.map(function (row, index) {
107
- var tds = row.map(function (yearData) {
108
- var _classNameMap;
109
-
110
- var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-selected-cell'] = yearData.year === currentYear, _classNameMap[prefixCls + '-last-decade-cell'] = yearData.year < startYear, _classNameMap[prefixCls + '-next-decade-cell'] = yearData.year > endYear, _classNameMap);
111
- var clickHandler = void 0;
112
- if (yearData.year < startYear) {
113
- clickHandler = _this2.previousDecade;
114
- } else if (yearData.year > endYear) {
115
- clickHandler = _this2.nextDecade;
116
- } else {
117
- clickHandler = chooseYear.bind(_this2, yearData.year);
118
- }
119
- return _react2['default'].createElement(
120
- 'td',
121
- {
122
- role: 'gridcell',
123
- title: yearData.title,
124
- key: yearData.content,
125
- onClick: clickHandler,
126
- className: (0, _classnames2['default'])(classNameMap)
127
- },
128
- _react2['default'].createElement(
129
- 'a',
130
- {
131
- className: prefixCls + '-year'
132
- },
133
- yearData.content
134
- )
135
- );
136
- });
137
- return _react2['default'].createElement(
138
- 'tr',
139
- { key: index, role: 'row' },
140
- tds
141
- );
142
- });
143
-
144
- var footer = renderFooter && renderFooter('year');
145
-
146
- return _react2['default'].createElement(
147
- 'div',
148
- { className: this.prefixCls },
149
- _react2['default'].createElement(
150
- 'div',
151
- null,
152
- _react2['default'].createElement(
153
- 'div',
154
- { className: prefixCls + '-header' },
155
- _react2['default'].createElement('a', {
156
- className: prefixCls + '-prev-decade-btn',
157
- role: 'button',
158
- onClick: this.previousDecade,
159
- title: locale.previousDecade
160
- }),
161
- _react2['default'].createElement(
162
- 'a',
163
- {
164
- className: prefixCls + '-decade-select',
165
- role: 'button',
166
- onClick: props.onDecadePanelShow,
167
- title: locale.decadeSelect
168
- },
169
- _react2['default'].createElement(
170
- 'span',
171
- { className: prefixCls + '-decade-select-content' },
172
- startYear,
173
- '-',
174
- endYear
175
- ),
176
- _react2['default'].createElement(
177
- 'span',
178
- { className: prefixCls + '-decade-select-arrow' },
179
- 'x'
180
- )
181
- ),
182
- _react2['default'].createElement('a', {
183
- className: prefixCls + '-next-decade-btn',
184
- role: 'button',
185
- onClick: this.nextDecade,
186
- title: locale.nextDecade
187
- })
188
- ),
189
- _react2['default'].createElement(
190
- 'div',
191
- { className: prefixCls + '-body' },
192
- _react2['default'].createElement(
193
- 'table',
194
- { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
195
- _react2['default'].createElement(
196
- 'tbody',
197
- { className: prefixCls + '-tbody' },
198
- yeasEls
199
- )
200
- )
201
- ),
202
- footer && _react2['default'].createElement(
203
- 'div',
204
- { className: prefixCls + '-footer' },
205
- footer
206
- )
207
- )
208
- );
209
- };
210
-
211
- return YearPanel;
212
- }(_react2['default'].Component);
213
-
214
- exports['default'] = YearPanel;
215
-
216
-
217
- YearPanel.propTypes = {
218
- rootPrefixCls: _propTypes2['default'].string,
219
- value: _propTypes2['default'].object,
220
- defaultValue: _propTypes2['default'].object,
221
- renderFooter: _propTypes2['default'].func
222
- };
223
-
224
- YearPanel.defaultProps = {
225
- onSelect: function onSelect() {}
226
- };
227
- module.exports = exports['default'];