@seafile/seafile-calendar 0.0.29-alpha14 → 0.0.29-alpha15

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 (160) hide show
  1. package/package.json +1 -1
  2. package/assets/index.css +0 -1177
  3. package/es/Calendar.js +0 -444
  4. package/es/FullCalendar.js +0 -182
  5. package/es/MonthCalendar.js +0 -135
  6. package/es/Picker.js +0 -246
  7. package/es/RangeCalendar.js +0 -876
  8. package/es/calendar/CalendarFooter.js +0 -93
  9. package/es/calendar/CalendarHeader.js +0 -257
  10. package/es/calendar/CalendarRightPanel.js +0 -135
  11. package/es/calendar/OkButton.js +0 -22
  12. package/es/calendar/TimePickerButton.js +0 -28
  13. package/es/calendar/TodayButton.js +0 -28
  14. package/es/date/DateConstants.js +0 -19
  15. package/es/date/DateInput.js +0 -249
  16. package/es/date/DateTBody.js +0 -280
  17. package/es/date/DateTHead.js +0 -86
  18. package/es/date/DateTable.js +0 -32
  19. package/es/decade/DecadePanel.js +0 -181
  20. package/es/full-calendar/CalendarHeader.js +0 -180
  21. package/es/index.js +0 -3
  22. package/es/locale/ar_EG.js +0 -27
  23. package/es/locale/bg_BG.js +0 -27
  24. package/es/locale/ca_ES.js +0 -27
  25. package/es/locale/cs_CZ.js +0 -27
  26. package/es/locale/da_DK.js +0 -27
  27. package/es/locale/de_DE.js +0 -27
  28. package/es/locale/el_GR.js +0 -27
  29. package/es/locale/en_GB.js +0 -27
  30. package/es/locale/en_US.js +0 -28
  31. package/es/locale/es_ES.js +0 -27
  32. package/es/locale/et_EE.js +0 -27
  33. package/es/locale/fa_IR.js +0 -27
  34. package/es/locale/fi_FI.js +0 -27
  35. package/es/locale/fr_BE.js +0 -27
  36. package/es/locale/fr_FR.js +0 -27
  37. package/es/locale/he_IL.js +0 -28
  38. package/es/locale/hi_IN.js +0 -28
  39. package/es/locale/hr_HR.js +0 -28
  40. package/es/locale/hu_HU.js +0 -27
  41. package/es/locale/id_ID.js +0 -28
  42. package/es/locale/is_IS.js +0 -27
  43. package/es/locale/it_IT.js +0 -27
  44. package/es/locale/ja_JP.js +0 -26
  45. package/es/locale/kn_IN.js +0 -28
  46. package/es/locale/ko_KR.js +0 -27
  47. package/es/locale/ku_IQ.js +0 -27
  48. package/es/locale/lv_LV.js +0 -27
  49. package/es/locale/mm_MM.js +0 -28
  50. package/es/locale/mn_MN.js +0 -28
  51. package/es/locale/ms_MY.js +0 -27
  52. package/es/locale/nb_NO.js +0 -27
  53. package/es/locale/nl_BE.js +0 -27
  54. package/es/locale/nl_NL.js +0 -27
  55. package/es/locale/pl_PL.js +0 -27
  56. package/es/locale/pt_BR.js +0 -27
  57. package/es/locale/pt_PT.js +0 -27
  58. package/es/locale/ro_RO.js +0 -28
  59. package/es/locale/ru_RU.js +0 -27
  60. package/es/locale/sk_SK.js +0 -27
  61. package/es/locale/sl_SI.js +0 -27
  62. package/es/locale/sr_RS.js +0 -27
  63. package/es/locale/sv_SE.js +0 -27
  64. package/es/locale/ta_IN.js +0 -28
  65. package/es/locale/th_TH.js +0 -27
  66. package/es/locale/tr_TR.js +0 -27
  67. package/es/locale/ug_CN.js +0 -26
  68. package/es/locale/uk_UA.js +0 -27
  69. package/es/locale/vi_VN.js +0 -28
  70. package/es/locale/zh_CN.js +0 -27
  71. package/es/locale/zh_TW.js +0 -26
  72. package/es/mixin/CalendarMixin.js +0 -123
  73. package/es/mixin/CommonMixin.js +0 -85
  74. package/es/month/MonthPanel.js +0 -154
  75. package/es/month/MonthTable.js +0 -156
  76. package/es/picker/placements.js +0 -35
  77. package/es/range-calendar/CalendarPart.js +0 -151
  78. package/es/util/dayjs.js +0 -17
  79. package/es/util/index.js +0 -564
  80. package/es/util/toTime.js +0 -21
  81. package/es/year/YearPanel.js +0 -194
  82. package/lib/Calendar.js +0 -507
  83. package/lib/FullCalendar.js +0 -221
  84. package/lib/MonthCalendar.js +0 -172
  85. package/lib/Picker.js +0 -283
  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 -160
  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 -23
  94. package/lib/date/DateInput.js +0 -281
  95. package/lib/date/DateTBody.js +0 -307
  96. package/lib/date/DateTHead.js +0 -106
  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/dayjs.js +0 -46
  158. package/lib/util/index.js +0 -601
  159. package/lib/util/toTime.js +0 -28
  160. package/lib/year/YearPanel.js +0 -219
@@ -1,135 +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 KeyCode from 'rc-util/es/KeyCode';
8
- import { polyfill } from 'react-lifecycles-compat';
9
- import CalendarHeader from './calendar/CalendarHeader';
10
- import CalendarFooter from './calendar/CalendarFooter';
11
- import { calendarMixinWrapper, calendarMixinPropTypes, calendarMixinDefaultProps } from './mixin/CalendarMixin';
12
- import { commonMixinWrapper, propType, defaultProp } from './mixin/CommonMixin';
13
- import dayjs from './util/dayjs';
14
-
15
- var MonthCalendar = function (_React$Component) {
16
- _inherits(MonthCalendar, _React$Component);
17
-
18
- function MonthCalendar(props) {
19
- _classCallCheck(this, MonthCalendar);
20
-
21
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
22
-
23
- _this.onKeyDown = function (event) {
24
- var keyCode = event.keyCode;
25
- var ctrlKey = event.ctrlKey || event.metaKey;
26
- var stateValue = _this.state.value;
27
- var disabledDate = _this.props.disabledDate;
28
-
29
- var value = stateValue;
30
- switch (keyCode) {
31
- case KeyCode.DOWN:
32
- value = stateValue.clone();
33
- value = value.add(3, 'months');
34
- break;
35
- case KeyCode.UP:
36
- value = stateValue.clone();
37
- value = value.add(-3, 'months');
38
- break;
39
- case KeyCode.LEFT:
40
- value = stateValue.clone();
41
- if (ctrlKey) {
42
- value = value.add(-1, 'years');
43
- } else {
44
- value = value.add(-1, 'months');
45
- }
46
- break;
47
- case KeyCode.RIGHT:
48
- value = stateValue.clone();
49
- if (ctrlKey) {
50
- value = value.add(1, 'years');
51
- } else {
52
- value = value.add(1, 'months');
53
- }
54
- break;
55
- case KeyCode.ENTER:
56
- if (!disabledDate || !disabledDate(stateValue)) {
57
- _this.onSelect(stateValue);
58
- }
59
- event.preventDefault();
60
- return 1;
61
- default:
62
- return undefined;
63
- }
64
- if (value !== stateValue) {
65
- _this.setValue(value);
66
- event.preventDefault();
67
- return 1;
68
- }
69
- };
70
-
71
- _this.handlePanelChange = function (_, mode) {
72
- if (mode !== 'date') {
73
- _this.setState({ mode: mode });
74
- }
75
- };
76
-
77
- _this.state = {
78
- mode: 'month',
79
- value: props.value || props.defaultValue || dayjs(),
80
- selectedValue: props.selectedValue || props.defaultSelectedValue
81
- };
82
- return _this;
83
- }
84
-
85
- MonthCalendar.prototype.render = function render() {
86
- var props = this.props,
87
- state = this.state;
88
- var mode = state.mode,
89
- value = state.value;
90
-
91
- var children = React.createElement(
92
- 'div',
93
- { className: props.prefixCls + '-month-calendar-content' },
94
- React.createElement(
95
- 'div',
96
- { className: props.prefixCls + '-month-header-wrap' },
97
- React.createElement(CalendarHeader, {
98
- prefixCls: props.prefixCls,
99
- mode: mode,
100
- value: value,
101
- locale: props.locale,
102
- disabledMonth: props.disabledDate,
103
- monthCellRender: props.monthCellRender,
104
- monthCellContentRender: props.monthCellContentRender,
105
- onMonthSelect: this.onSelect,
106
- onValueChange: this.setValue,
107
- onPanelChange: this.handlePanelChange
108
- })
109
- ),
110
- React.createElement(CalendarFooter, {
111
- prefixCls: props.prefixCls,
112
- renderFooter: props.renderFooter
113
- })
114
- );
115
- return this.renderRoot({
116
- className: props.prefixCls + '-month-calendar',
117
- children: children
118
- });
119
- };
120
-
121
- return MonthCalendar;
122
- }(React.Component);
123
-
124
- MonthCalendar.propTypes = _extends({}, calendarMixinPropTypes, propType, {
125
- monthCellRender: PropTypes.func,
126
- value: PropTypes.object,
127
- defaultValue: PropTypes.object,
128
- selectedValue: PropTypes.object,
129
- defaultSelectedValue: PropTypes.object,
130
- disabledDate: PropTypes.func
131
- });
132
- MonthCalendar.defaultProps = _extends({}, defaultProp, calendarMixinDefaultProps);
133
-
134
-
135
- export default polyfill(calendarMixinWrapper(commonMixinWrapper(MonthCalendar)));
package/es/Picker.js DELETED
@@ -1,246 +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 ReactDOM from 'react-dom';
6
- import PropTypes from 'prop-types';
7
- import { polyfill } from 'react-lifecycles-compat';
8
- import createChainedFunction from 'rc-util/es/createChainedFunction';
9
- import KeyCode from 'rc-util/es/KeyCode';
10
- import placements from './picker/placements';
11
- import Trigger from 'rc-trigger';
12
-
13
- function noop() {}
14
-
15
- function refFn(field, component) {
16
- this[field] = component;
17
- }
18
-
19
- var Picker = function (_React$Component) {
20
- _inherits(Picker, _React$Component);
21
-
22
- function Picker(props) {
23
- _classCallCheck(this, Picker);
24
-
25
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
26
-
27
- _initialiseProps.call(_this);
28
-
29
- var open = void 0;
30
- if ('open' in props) {
31
- open = props.open;
32
- } else {
33
- open = props.defaultOpen;
34
- }
35
- var value = props.value || props.defaultValue;
36
- _this.saveCalendarRef = refFn.bind(_this, 'calendarInstance');
37
-
38
- _this.state = {
39
- open: open,
40
- value: value
41
- };
42
- return _this;
43
- }
44
-
45
- Picker.prototype.componentDidUpdate = function componentDidUpdate(_, prevState) {
46
- if (!prevState.open && this.state.open) {
47
- // setTimeout is for making sure saveCalendarRef happen before focusCalendar
48
- this.focusTimeout = setTimeout(this.focusCalendar, 0, this);
49
- }
50
- };
51
-
52
- Picker.prototype.componentWillUnmount = function componentWillUnmount() {
53
- clearTimeout(this.focusTimeout);
54
- };
55
-
56
- Picker.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
57
- var newState = {};
58
- var value = nextProps.value,
59
- open = nextProps.open;
60
-
61
- if ('value' in nextProps) {
62
- newState.value = value;
63
- }
64
- if (open !== undefined) {
65
- newState.open = open;
66
- }
67
- return newState;
68
- };
69
-
70
- Picker.prototype.render = function render() {
71
- var props = this.props;
72
- var prefixCls = props.prefixCls,
73
- placement = props.placement,
74
- style = props.style,
75
- getCalendarContainer = props.getCalendarContainer,
76
- align = props.align,
77
- animation = props.animation,
78
- disabled = props.disabled,
79
- dropdownClassName = props.dropdownClassName,
80
- transitionName = props.transitionName,
81
- children = props.children;
82
-
83
- var state = this.state;
84
- return React.createElement(
85
- Trigger,
86
- {
87
- popup: this.getCalendarElement(),
88
- popupAlign: align,
89
- builtinPlacements: placements,
90
- popupPlacement: placement,
91
- action: disabled && !state.open ? [] : ['click'],
92
- destroyPopupOnHide: true,
93
- getPopupContainer: getCalendarContainer,
94
- popupStyle: style,
95
- popupAnimation: animation,
96
- popupTransitionName: transitionName,
97
- popupVisible: state.open,
98
- onPopupVisibleChange: this.onVisibleChange,
99
- prefixCls: prefixCls,
100
- popupClassName: dropdownClassName
101
- },
102
- React.cloneElement(children(state, props), { onKeyDown: this.onKeyDown })
103
- );
104
- };
105
-
106
- return Picker;
107
- }(React.Component);
108
-
109
- Picker.propTypes = {
110
- animation: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
111
- disabled: PropTypes.bool,
112
- transitionName: PropTypes.string,
113
- onChange: PropTypes.func,
114
- onOpenChange: PropTypes.func,
115
- children: PropTypes.func,
116
- getCalendarContainer: PropTypes.func,
117
- calendar: PropTypes.element,
118
- style: PropTypes.object,
119
- open: PropTypes.bool,
120
- defaultOpen: PropTypes.bool,
121
- prefixCls: PropTypes.string,
122
- placement: PropTypes.any,
123
- value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
124
- defaultValue: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
125
- align: PropTypes.object,
126
- dateRender: PropTypes.func,
127
- onBlur: PropTypes.func
128
- };
129
- Picker.defaultProps = {
130
- prefixCls: 'rc-calendar-picker',
131
- style: {},
132
- align: {},
133
- placement: 'bottomLeft',
134
- defaultOpen: false,
135
- onChange: noop,
136
- onOpenChange: noop,
137
- onBlur: noop
138
- };
139
-
140
- var _initialiseProps = function _initialiseProps() {
141
- var _this2 = this;
142
-
143
- this.onCalendarKeyDown = function (event) {
144
- if (event.keyCode === KeyCode.ESC) {
145
- event.stopPropagation();
146
- _this2.close(_this2.focus);
147
- }
148
- };
149
-
150
- this.onCalendarSelect = function (value) {
151
- var cause = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
152
-
153
- var props = _this2.props;
154
- if (!('value' in props)) {
155
- _this2.setState({
156
- value: value
157
- });
158
- }
159
- if (cause.source === 'keyboard' || cause.source === 'dateInputSelect' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') {
160
- _this2.close(_this2.focus);
161
- }
162
- console.log('onCalendarSelect', value, props.calendar.props.format[0]);
163
- props.onChange(value);
164
- };
165
-
166
- this.onKeyDown = function (event) {
167
- if (!_this2.state.open && (event.keyCode === KeyCode.DOWN || event.keyCode === KeyCode.ENTER)) {
168
- _this2.open();
169
- event.preventDefault();
170
- }
171
- };
172
-
173
- this.onCalendarOk = function () {
174
- _this2.close(_this2.focus);
175
- };
176
-
177
- this.onCalendarClear = function () {
178
- _this2.close(_this2.focus);
179
- };
180
-
181
- this.onCalendarBlur = function () {
182
- _this2.setOpen(false);
183
- };
184
-
185
- this.onVisibleChange = function (open) {
186
- _this2.setOpen(open);
187
- };
188
-
189
- this.getCalendarElement = function () {
190
- var props = _this2.props;
191
- var state = _this2.state;
192
- var calendarProps = props.calendar.props;
193
- var value = state.value;
194
-
195
- var defaultValue = value;
196
- var extraProps = {
197
- ref: _this2.saveCalendarRef,
198
- defaultValue: defaultValue || calendarProps.defaultValue,
199
- selectedValue: value,
200
- onKeyDown: _this2.onCalendarKeyDown,
201
- onOk: createChainedFunction(calendarProps.onOk, _this2.onCalendarOk),
202
- onSelect: createChainedFunction(calendarProps.onSelect, _this2.onCalendarSelect),
203
- onClear: createChainedFunction(calendarProps.onClear, _this2.onCalendarClear),
204
- onBlur: createChainedFunction(calendarProps.onBlur, _this2.onCalendarBlur)
205
- };
206
-
207
- return React.cloneElement(props.calendar, extraProps);
208
- };
209
-
210
- this.setOpen = function (open, callback) {
211
- var onOpenChange = _this2.props.onOpenChange;
212
-
213
- if (_this2.state.open !== open) {
214
- if (!('open' in _this2.props)) {
215
- _this2.setState({
216
- open: open
217
- }, callback);
218
- }
219
- onOpenChange(open);
220
- }
221
- };
222
-
223
- this.open = function (callback) {
224
- _this2.setOpen(true, callback);
225
- };
226
-
227
- this.close = function (callback) {
228
- _this2.setOpen(false, callback);
229
- };
230
-
231
- this.focus = function () {
232
- if (!_this2.state.open) {
233
- ReactDOM.findDOMNode(_this2).focus();
234
- }
235
- };
236
-
237
- this.focusCalendar = function () {
238
- if (_this2.state.open && !!_this2.calendarInstance) {
239
- _this2.calendarInstance.focus();
240
- }
241
- };
242
- };
243
-
244
- polyfill(Picker);
245
-
246
- export default Picker;