@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,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 moment from 'moment';
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.add(3, 'months');
34
- break;
35
- case KeyCode.UP:
36
- value = stateValue.clone();
37
- value.add(-3, 'months');
38
- break;
39
- case KeyCode.LEFT:
40
- value = stateValue.clone();
41
- if (ctrlKey) {
42
- value.add(-1, 'years');
43
- } else {
44
- value.add(-1, 'months');
45
- }
46
- break;
47
- case KeyCode.RIGHT:
48
- value = stateValue.clone();
49
- if (ctrlKey) {
50
- value.add(1, 'years');
51
- } else {
52
- 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 || moment(),
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,245 +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
- props.onChange(value);
163
- };
164
-
165
- this.onKeyDown = function (event) {
166
- if (!_this2.state.open && (event.keyCode === KeyCode.DOWN || event.keyCode === KeyCode.ENTER)) {
167
- _this2.open();
168
- event.preventDefault();
169
- }
170
- };
171
-
172
- this.onCalendarOk = function () {
173
- _this2.close(_this2.focus);
174
- };
175
-
176
- this.onCalendarClear = function () {
177
- _this2.close(_this2.focus);
178
- };
179
-
180
- this.onCalendarBlur = function () {
181
- _this2.setOpen(false);
182
- };
183
-
184
- this.onVisibleChange = function (open) {
185
- _this2.setOpen(open);
186
- };
187
-
188
- this.getCalendarElement = function () {
189
- var props = _this2.props;
190
- var state = _this2.state;
191
- var calendarProps = props.calendar.props;
192
- var value = state.value;
193
-
194
- var defaultValue = value;
195
- var extraProps = {
196
- ref: _this2.saveCalendarRef,
197
- defaultValue: defaultValue || calendarProps.defaultValue,
198
- selectedValue: value,
199
- onKeyDown: _this2.onCalendarKeyDown,
200
- onOk: createChainedFunction(calendarProps.onOk, _this2.onCalendarOk),
201
- onSelect: createChainedFunction(calendarProps.onSelect, _this2.onCalendarSelect),
202
- onClear: createChainedFunction(calendarProps.onClear, _this2.onCalendarClear),
203
- onBlur: createChainedFunction(calendarProps.onBlur, _this2.onCalendarBlur)
204
- };
205
-
206
- return React.cloneElement(props.calendar, extraProps);
207
- };
208
-
209
- this.setOpen = function (open, callback) {
210
- var onOpenChange = _this2.props.onOpenChange;
211
-
212
- if (_this2.state.open !== open) {
213
- if (!('open' in _this2.props)) {
214
- _this2.setState({
215
- open: open
216
- }, callback);
217
- }
218
- onOpenChange(open);
219
- }
220
- };
221
-
222
- this.open = function (callback) {
223
- _this2.setOpen(true, callback);
224
- };
225
-
226
- this.close = function (callback) {
227
- _this2.setOpen(false, callback);
228
- };
229
-
230
- this.focus = function () {
231
- if (!_this2.state.open) {
232
- ReactDOM.findDOMNode(_this2).focus();
233
- }
234
- };
235
-
236
- this.focusCalendar = function () {
237
- if (_this2.state.open && !!_this2.calendarInstance) {
238
- _this2.calendarInstance.focus();
239
- }
240
- };
241
- };
242
-
243
- polyfill(Picker);
244
-
245
- export default Picker;