@seafile/seafile-calendar 0.0.30-beta.2 → 0.0.30-beta.3

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/assets/index.css +1177 -0
  2. package/dist/rc-calendar.css +1179 -0
  3. package/dist/rc-calendar.css.map +1 -0
  4. package/dist/rc-calendar.js +7500 -0
  5. package/dist/rc-calendar.js.map +1 -0
  6. package/dist/rc-calendar.min.css +1179 -0
  7. package/dist/rc-calendar.min.css.map +1 -0
  8. package/dist/rc-calendar.min.js +1 -0
  9. package/es/Calendar.js +454 -0
  10. package/es/FullCalendar.js +182 -0
  11. package/es/MonthCalendar.js +135 -0
  12. package/es/Picker.js +245 -0
  13. package/es/RangeCalendar.js +876 -0
  14. package/es/calendar/CalendarFooter.js +93 -0
  15. package/es/calendar/CalendarHeader.js +257 -0
  16. package/es/calendar/CalendarRightPanel.js +135 -0
  17. package/es/calendar/OkButton.js +22 -0
  18. package/es/calendar/TimePickerButton.js +28 -0
  19. package/es/calendar/TodayButton.js +28 -0
  20. package/es/date/DateConstants.js +19 -0
  21. package/es/date/DateInput.js +444 -0
  22. package/es/date/DateTBody.js +280 -0
  23. package/es/date/DateTHead.js +86 -0
  24. package/es/date/DateTable.js +32 -0
  25. package/es/decade/DecadePanel.js +181 -0
  26. package/es/full-calendar/CalendarHeader.js +180 -0
  27. package/es/index.js +3 -0
  28. package/es/locale/ar_EG.js +27 -0
  29. package/es/locale/bg_BG.js +27 -0
  30. package/es/locale/ca_ES.js +27 -0
  31. package/es/locale/cs_CZ.js +27 -0
  32. package/es/locale/da_DK.js +27 -0
  33. package/es/locale/de_DE.js +27 -0
  34. package/es/locale/el_GR.js +27 -0
  35. package/es/locale/en_GB.js +27 -0
  36. package/es/locale/en_US.js +28 -0
  37. package/es/locale/es_ES.js +27 -0
  38. package/es/locale/et_EE.js +27 -0
  39. package/es/locale/fa_IR.js +27 -0
  40. package/es/locale/fi_FI.js +27 -0
  41. package/es/locale/fr_BE.js +27 -0
  42. package/es/locale/fr_FR.js +27 -0
  43. package/es/locale/he_IL.js +28 -0
  44. package/es/locale/hi_IN.js +28 -0
  45. package/es/locale/hr_HR.js +28 -0
  46. package/es/locale/hu_HU.js +27 -0
  47. package/es/locale/id_ID.js +28 -0
  48. package/es/locale/is_IS.js +27 -0
  49. package/es/locale/it_IT.js +27 -0
  50. package/es/locale/ja_JP.js +26 -0
  51. package/es/locale/kn_IN.js +28 -0
  52. package/es/locale/ko_KR.js +27 -0
  53. package/es/locale/ku_IQ.js +27 -0
  54. package/es/locale/lv_LV.js +27 -0
  55. package/es/locale/mm_MM.js +28 -0
  56. package/es/locale/mn_MN.js +28 -0
  57. package/es/locale/ms_MY.js +27 -0
  58. package/es/locale/nb_NO.js +27 -0
  59. package/es/locale/nl_BE.js +27 -0
  60. package/es/locale/nl_NL.js +27 -0
  61. package/es/locale/pl_PL.js +27 -0
  62. package/es/locale/pt_BR.js +27 -0
  63. package/es/locale/pt_PT.js +27 -0
  64. package/es/locale/ro_RO.js +28 -0
  65. package/es/locale/ru_RU.js +27 -0
  66. package/es/locale/sk_SK.js +27 -0
  67. package/es/locale/sl_SI.js +27 -0
  68. package/es/locale/sr_RS.js +27 -0
  69. package/es/locale/sv_SE.js +27 -0
  70. package/es/locale/ta_IN.js +28 -0
  71. package/es/locale/th_TH.js +27 -0
  72. package/es/locale/tr_TR.js +27 -0
  73. package/es/locale/ug_CN.js +26 -0
  74. package/es/locale/uk_UA.js +27 -0
  75. package/es/locale/vi_VN.js +28 -0
  76. package/es/locale/zh_CN.js +27 -0
  77. package/es/locale/zh_TW.js +26 -0
  78. package/es/mixin/CalendarMixin.js +123 -0
  79. package/es/mixin/CommonMixin.js +85 -0
  80. package/es/month/MonthPanel.js +154 -0
  81. package/es/month/MonthTable.js +156 -0
  82. package/es/picker/placements.js +35 -0
  83. package/es/range-calendar/CalendarPart.js +151 -0
  84. package/es/util/dayjs.js +17 -0
  85. package/es/util/index.js +272 -0
  86. package/es/util/toTime.js +21 -0
  87. package/es/year/YearPanel.js +194 -0
  88. package/lib/Calendar.js +517 -0
  89. package/lib/FullCalendar.js +221 -0
  90. package/lib/MonthCalendar.js +172 -0
  91. package/lib/Picker.js +282 -0
  92. package/lib/RangeCalendar.js +925 -0
  93. package/lib/calendar/CalendarFooter.js +134 -0
  94. package/lib/calendar/CalendarHeader.js +290 -0
  95. package/lib/calendar/CalendarRightPanel.js +160 -0
  96. package/lib/calendar/OkButton.js +32 -0
  97. package/lib/calendar/TimePickerButton.js +41 -0
  98. package/lib/calendar/TodayButton.js +39 -0
  99. package/lib/date/DateConstants.js +23 -0
  100. package/lib/date/DateInput.js +476 -0
  101. package/lib/date/DateTBody.js +307 -0
  102. package/lib/date/DateTHead.js +106 -0
  103. package/lib/date/DateTable.js +54 -0
  104. package/lib/decade/DecadePanel.js +207 -0
  105. package/lib/full-calendar/CalendarHeader.js +201 -0
  106. package/lib/index.js +12 -0
  107. package/lib/locale/ar_EG.js +31 -0
  108. package/lib/locale/bg_BG.js +31 -0
  109. package/lib/locale/ca_ES.js +31 -0
  110. package/lib/locale/cs_CZ.js +31 -0
  111. package/lib/locale/da_DK.js +31 -0
  112. package/lib/locale/de_DE.js +31 -0
  113. package/lib/locale/el_GR.js +31 -0
  114. package/lib/locale/en_GB.js +31 -0
  115. package/lib/locale/en_US.js +32 -0
  116. package/lib/locale/es_ES.js +31 -0
  117. package/lib/locale/et_EE.js +31 -0
  118. package/lib/locale/fa_IR.js +31 -0
  119. package/lib/locale/fi_FI.js +31 -0
  120. package/lib/locale/fr_BE.js +31 -0
  121. package/lib/locale/fr_FR.js +31 -0
  122. package/lib/locale/he_IL.js +32 -0
  123. package/lib/locale/hi_IN.js +32 -0
  124. package/lib/locale/hr_HR.js +32 -0
  125. package/lib/locale/hu_HU.js +31 -0
  126. package/lib/locale/id_ID.js +32 -0
  127. package/lib/locale/is_IS.js +31 -0
  128. package/lib/locale/it_IT.js +31 -0
  129. package/lib/locale/ja_JP.js +30 -0
  130. package/lib/locale/kn_IN.js +32 -0
  131. package/lib/locale/ko_KR.js +31 -0
  132. package/lib/locale/ku_IQ.js +31 -0
  133. package/lib/locale/lv_LV.js +31 -0
  134. package/lib/locale/mm_MM.js +32 -0
  135. package/lib/locale/mn_MN.js +32 -0
  136. package/lib/locale/ms_MY.js +31 -0
  137. package/lib/locale/nb_NO.js +31 -0
  138. package/lib/locale/nl_BE.js +31 -0
  139. package/lib/locale/nl_NL.js +31 -0
  140. package/lib/locale/pl_PL.js +31 -0
  141. package/lib/locale/pt_BR.js +31 -0
  142. package/lib/locale/pt_PT.js +31 -0
  143. package/lib/locale/ro_RO.js +32 -0
  144. package/lib/locale/ru_RU.js +31 -0
  145. package/lib/locale/sk_SK.js +31 -0
  146. package/lib/locale/sl_SI.js +31 -0
  147. package/lib/locale/sr_RS.js +31 -0
  148. package/lib/locale/sv_SE.js +31 -0
  149. package/lib/locale/ta_IN.js +32 -0
  150. package/lib/locale/th_TH.js +31 -0
  151. package/lib/locale/tr_TR.js +31 -0
  152. package/lib/locale/ug_CN.js +30 -0
  153. package/lib/locale/uk_UA.js +31 -0
  154. package/lib/locale/vi_VN.js +32 -0
  155. package/lib/locale/zh_CN.js +31 -0
  156. package/lib/locale/zh_TW.js +30 -0
  157. package/lib/mixin/CalendarMixin.js +153 -0
  158. package/lib/mixin/CommonMixin.js +106 -0
  159. package/lib/month/MonthPanel.js +179 -0
  160. package/lib/month/MonthTable.js +181 -0
  161. package/lib/picker/placements.js +39 -0
  162. package/lib/range-calendar/CalendarPart.js +184 -0
  163. package/lib/util/dayjs.js +46 -0
  164. package/lib/util/index.js +307 -0
  165. package/lib/util/toTime.js +28 -0
  166. package/lib/year/YearPanel.js +219 -0
  167. package/package.json +2 -1
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: 'Danas',
3
+ now: 'Sada',
4
+ backToToday: 'Vrati se na danas',
5
+ ok: 'U redu',
6
+ clear: 'Obriši',
7
+ month: 'Mesec',
8
+ year: 'Godina',
9
+ timeSelect: 'Izaberi vreme',
10
+ dateSelect: 'Izaberi datum',
11
+ monthSelect: 'Izaberi mesec',
12
+ yearSelect: 'Izaberi godinu',
13
+ decadeSelect: 'Izaberi deceniju',
14
+ yearFormat: 'YYYY',
15
+ dateFormat: 'DD.MM.YYYY',
16
+ dayFormat: 'D',
17
+ dateTimeFormat: 'DD.MM.YYYY HH:mm:ss',
18
+ monthBeforeYear: true,
19
+ previousMonth: 'Prethodni mesec (PageUp)',
20
+ nextMonth: 'Sledeći mesec (PageDown)',
21
+ previousYear: 'Prethodna godina (Control + left)',
22
+ nextYear: 'Sledeća godina (Control + right)',
23
+ previousDecade: 'Prethodna decenija',
24
+ nextDecade: 'Sledeća decenija',
25
+ previousCentury: 'Prethodni vek',
26
+ nextCentury: 'Sledeći vek'
27
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: 'I dag',
3
+ now: 'Nu',
4
+ backToToday: 'Till idag',
5
+ ok: 'Ok',
6
+ clear: 'Avbryt',
7
+ month: 'Månad',
8
+ year: 'År',
9
+ timeSelect: 'Välj tidpunkt',
10
+ dateSelect: 'Välj datum',
11
+ monthSelect: 'Välj månad',
12
+ yearSelect: 'Välj år',
13
+ decadeSelect: 'Välj årtionde',
14
+ yearFormat: 'YYYY',
15
+ dateFormat: 'YYYY-MM-DD',
16
+ dayFormat: 'D',
17
+ dateTimeFormat: 'YYYY-MM-DD H:mm:ss',
18
+ monthBeforeYear: true,
19
+ previousMonth: 'Förra månaden (PageUp)',
20
+ nextMonth: 'Nästa månad (PageDown)',
21
+ previousYear: 'Föreg år (Control + left)',
22
+ nextYear: 'Nästa år (Control + right)',
23
+ previousDecade: 'Föreg årtionde',
24
+ nextDecade: 'Nästa årtionde',
25
+ previousCentury: 'Föreg århundrade',
26
+ nextCentury: 'Nästa århundrade'
27
+ };
@@ -0,0 +1,28 @@
1
+ export default {
2
+ today: 'இன்று',
3
+ now: 'இப்போது',
4
+ backToToday: 'இன்றுக்கு திரும்பு',
5
+ ok: 'சரி',
6
+ clear: 'அழி',
7
+ month: 'மாதம்',
8
+ year: 'வருடம்',
9
+ timeSelect: 'நேரத்தைத் தேர்ந்தெடு',
10
+ dateSelect: 'தேதியைத் தேர்ந்தெடு',
11
+ weekSelect: 'வாரத்தைத் தேர்வுசெய்க',
12
+ monthSelect: 'மாதத்தைத் தேர்வுசெய்க',
13
+ yearSelect: 'வருடத்தைத் தேர்வுசெய்க',
14
+ decadeSelect: 'தசாப்தத்தைத் தேர்வுசெய்க',
15
+ yearFormat: 'YYYY',
16
+ dateFormat: 'M/D/YYYY',
17
+ dayFormat: 'D',
18
+ dateTimeFormat: 'M/D/YYYY HH:mm:ss',
19
+ monthBeforeYear: true,
20
+ previousMonth: 'முந்தைய மாதம் (PageUp)',
21
+ nextMonth: 'அடுத்த மாதம் (PageDown)',
22
+ previousYear: 'முந்தைய வருடம் (Control + left)',
23
+ nextYear: 'அடுத்த வருடம் (Control + right)',
24
+ previousDecade: 'முந்தைய தசாப்தம்',
25
+ nextDecade: 'அடுத்த தசாப்தம்',
26
+ previousCentury: 'முந்தைய நூற்றாண்டு',
27
+ nextCentury: 'அடுத்த நூற்றாண்டு'
28
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: 'วันนี้',
3
+ now: 'ตอนนี้',
4
+ backToToday: 'กลับไปยังวันนี้',
5
+ ok: 'ตกลง',
6
+ clear: 'ลบล้าง',
7
+ month: 'เดือน',
8
+ year: 'ปี',
9
+ timeSelect: 'เลือกเวลา',
10
+ dateSelect: 'เลือกวัน',
11
+ monthSelect: 'เลือกเดือน',
12
+ yearSelect: 'เลือกปี',
13
+ decadeSelect: 'เลือกทศวรรษ',
14
+ yearFormat: 'YYYY',
15
+ dateFormat: 'D/M/YYYY',
16
+ dayFormat: 'D',
17
+ dateTimeFormat: 'D/M/YYYY HH:mm:ss',
18
+ monthBeforeYear: true,
19
+ previousMonth: 'เดือนก่อนหน้า (PageUp)',
20
+ nextMonth: 'เดือนถัดไป (PageDown)',
21
+ previousYear: 'ปีก่อนหน้า (Control + left)',
22
+ nextYear: 'ปีถัดไป (Control + right)',
23
+ previousDecade: 'ทศวรรษก่อนหน้า',
24
+ nextDecade: 'ทศวรรษถัดไป',
25
+ previousCentury: 'ศตวรรษก่อนหน้า',
26
+ nextCentury: 'ศตวรรษถัดไป'
27
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: 'Bugün',
3
+ now: 'Şimdi',
4
+ backToToday: 'Bugüne Geri Dön',
5
+ ok: 'tamam',
6
+ clear: 'Temizle',
7
+ month: 'Ay',
8
+ year: 'Yıl',
9
+ timeSelect: 'Zaman Seç',
10
+ dateSelect: 'Tarih Seç',
11
+ monthSelect: 'Ay Seç',
12
+ yearSelect: 'Yıl Seç',
13
+ decadeSelect: 'On Yıl Seç',
14
+ yearFormat: 'YYYY',
15
+ dateFormat: 'M/D/YYYY',
16
+ dayFormat: 'D',
17
+ dateTimeFormat: 'M/D/YYYY HH:mm:ss',
18
+ monthBeforeYear: true,
19
+ previousMonth: 'Önceki Ay (PageUp)',
20
+ nextMonth: 'Sonraki Ay (PageDown)',
21
+ previousYear: 'Önceki Yıl (Control + Sol)',
22
+ nextYear: 'Sonraki Yıl (Control + Sağ)',
23
+ previousDecade: 'Önceki On Yıl',
24
+ nextDecade: 'Sonraki On Yıl',
25
+ previousCentury: 'Önceki Yüzyıl',
26
+ nextCentury: 'Sonraki Yüzyıl'
27
+ };
@@ -0,0 +1,26 @@
1
+ export default {
2
+ today: 'بۈگۈن',
3
+ now: 'ھازىر',
4
+ backToToday: 'بۈگۈنگە قايتىش',
5
+ ok: 'مۇقىملاشتۇرۇش',
6
+ timeSelect: 'ۋاقىت تاللاش',
7
+ dateSelect: 'كۈن تاللاش',
8
+ clear: 'تازىلاش',
9
+ month: 'ئاي',
10
+ year: 'يىل',
11
+ previousMonth: 'ئالدىنقى ئاي(ئالدىنقى بەت )',
12
+ nextMonth: 'كېلەركى ئاي (كېلەركى بەت)',
13
+ monthSelect: 'ئاي تاللاش',
14
+ yearSelect: 'يىل تاللاش',
15
+ decadeSelect: 'يىللارنى تاللاش',
16
+ yearFormat: 'YYYY-يىلى',
17
+ dayFormat: 'D-كۈنى',
18
+ dateFormat: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
19
+ dateTimeFormat: 'YYYY-يىلىM—ئاينىڭD-كۈنى، HH:mm:ss',
20
+ previousYear: 'ئالدىنقى يىلى (Controlبىلەن يۆنىلىش كونۇپكىسى)',
21
+ nextYear: 'كېلەركى يىلى (Controlبىلەن يۆنىلىش كونۇپكىسى)',
22
+ previousDecade: 'ئالدىنقى يىللار',
23
+ nextDecade: 'كېيىنكى يىللار',
24
+ previousCentury: 'ئالدىنقى ئەسىر',
25
+ nextCentury: 'كېيىنكى ئەسىر'
26
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: 'Сьогодні',
3
+ now: 'Зараз',
4
+ backToToday: 'Поточна дата',
5
+ ok: 'Ok',
6
+ clear: 'Очистити',
7
+ month: 'Місяць',
8
+ year: 'Рік',
9
+ timeSelect: 'Обрати час',
10
+ dateSelect: 'Обрати дату',
11
+ monthSelect: 'Обрати місяць',
12
+ yearSelect: 'Обрати рік',
13
+ decadeSelect: 'Обрати десятиріччя',
14
+ yearFormat: 'YYYY',
15
+ dateFormat: 'D-M-YYYY',
16
+ dayFormat: 'D',
17
+ dateTimeFormat: 'D-M-YYYY HH:mm:ss',
18
+ monthBeforeYear: true,
19
+ previousMonth: 'Попередній місяць (PageUp)',
20
+ nextMonth: 'Наступний місяць (PageDown)',
21
+ previousYear: 'Попередній рік (Control + left)',
22
+ nextYear: 'Наступний рік (Control + right)',
23
+ previousDecade: 'Попереднє десятиріччя',
24
+ nextDecade: 'Наступне десятиріччя',
25
+ previousCentury: 'Попереднє століття',
26
+ nextCentury: 'Наступне століття'
27
+ };
@@ -0,0 +1,28 @@
1
+ export default {
2
+ today: 'Hôm nay',
3
+ now: 'Bây giờ',
4
+ backToToday: 'Trở về hôm nay',
5
+ ok: 'Ok',
6
+ clear: 'Xóa',
7
+ month: 'Tháng',
8
+ year: 'Năm',
9
+ timeSelect: 'Chọn thời gian',
10
+ dateSelect: 'Chọn ngày',
11
+ weekSelect: 'Chọn tuần',
12
+ monthSelect: 'Chọn tháng',
13
+ yearSelect: 'Chọn năm',
14
+ decadeSelect: 'Chọn thập kỷ',
15
+ yearFormat: 'YYYY',
16
+ dateFormat: 'D/M/YYYY',
17
+ dayFormat: 'D',
18
+ dateTimeFormat: 'D/M/YYYY HH:mm:ss',
19
+ monthBeforeYear: true,
20
+ previousMonth: 'Tháng trước (PageUp)',
21
+ nextMonth: 'Tháng sau (PageDown)',
22
+ previousYear: 'Năm trước (Control + left)',
23
+ nextYear: 'Năm sau (Control + right)',
24
+ previousDecade: 'Thập kỷ trước',
25
+ nextDecade: 'Thập kỷ sau',
26
+ previousCentury: 'Thế kỷ trước',
27
+ nextCentury: 'Thế kỷ sau'
28
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ today: '今天',
3
+ now: '此刻',
4
+ backToToday: '返回今天',
5
+ ok: '确定',
6
+ timeSelect: '选择时间',
7
+ dateSelect: '选择日期',
8
+ weekSelect: '选择周',
9
+ clear: '清除',
10
+ month: '月',
11
+ year: '年',
12
+ previousMonth: '上个月 (翻页上键)',
13
+ nextMonth: '下个月 (翻页下键)',
14
+ monthSelect: '选择月份',
15
+ yearSelect: '选择年份',
16
+ decadeSelect: '选择年代',
17
+ yearFormat: 'YYYY年',
18
+ dayFormat: 'D日',
19
+ dateFormat: 'YYYY年M月D日',
20
+ dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
21
+ previousYear: '上一年 (Control键加左方向键)',
22
+ nextYear: '下一年 (Control键加右方向键)',
23
+ previousDecade: '上一年代',
24
+ nextDecade: '下一年代',
25
+ previousCentury: '上一世纪',
26
+ nextCentury: '下一世纪'
27
+ };
@@ -0,0 +1,26 @@
1
+ export default {
2
+ today: '今天',
3
+ now: '此刻',
4
+ backToToday: '返回今天',
5
+ ok: '確定',
6
+ timeSelect: '選擇時間',
7
+ dateSelect: '選擇日期',
8
+ clear: '清除',
9
+ month: '月',
10
+ year: '年',
11
+ previousMonth: '上個月 (翻頁上鍵)',
12
+ nextMonth: '下個月 (翻頁下鍵)',
13
+ monthSelect: '選擇月份',
14
+ yearSelect: '選擇年份',
15
+ decadeSelect: '選擇年代',
16
+ yearFormat: 'YYYY年',
17
+ dayFormat: 'D日',
18
+ dateFormat: 'YYYY年M月D日',
19
+ dateTimeFormat: 'YYYY年M月D日 HH時mm分ss秒',
20
+ previousYear: '上一年 (Control鍵加左方向鍵)',
21
+ nextYear: '下一年 (Control鍵加右方向鍵)',
22
+ previousDecade: '上一年代',
23
+ nextDecade: '下一年代',
24
+ previousCentury: '上一世紀',
25
+ nextCentury: '下一世紀'
26
+ };
@@ -0,0 +1,123 @@
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 classnames from 'classnames';
7
+ import dayjs from 'dayjs';
8
+ import { isAllowedDate, getTodayTime } from '../util/index';
9
+
10
+ function noop() {}
11
+
12
+ export function getNowByCurrentStateValue(value) {
13
+ var ret = void 0;
14
+ if (value) {
15
+ ret = getTodayTime(value);
16
+ } else {
17
+ ret = dayjs();
18
+ }
19
+ return ret;
20
+ }
21
+
22
+ export var calendarMixinPropTypes = {
23
+ value: PropTypes.object,
24
+ defaultValue: PropTypes.object,
25
+ onKeyDown: PropTypes.func
26
+ };
27
+
28
+ export var calendarMixinDefaultProps = {
29
+ onKeyDown: noop
30
+ };
31
+
32
+ export var calendarMixinWrapper = function calendarMixinWrapper(ComposeComponent) {
33
+ var _class, _temp2;
34
+
35
+ return _temp2 = _class = function (_ComposeComponent) {
36
+ _inherits(_class, _ComposeComponent);
37
+
38
+ function _class() {
39
+ var _temp, _this, _ret;
40
+
41
+ _classCallCheck(this, _class);
42
+
43
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
44
+ args[_key] = arguments[_key];
45
+ }
46
+
47
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.onSelect = function (value, cause) {
48
+ if (value) {
49
+ _this.setValue(value);
50
+ }
51
+ _this.setSelectedValue(value, cause);
52
+ }, _this.renderRoot = function (newProps) {
53
+ var _className;
54
+
55
+ var props = _this.props;
56
+ var prefixCls = props.prefixCls;
57
+
58
+ var className = (_className = {}, _className[prefixCls] = 1, _className[prefixCls + '-hidden'] = !props.visible, _className[props.className] = !!props.className, _className[newProps.className] = !!newProps.className, _className);
59
+
60
+ return React.createElement(
61
+ 'div',
62
+ {
63
+ ref: _this.saveRoot,
64
+ className: '' + classnames(className),
65
+ style: _this.props.style,
66
+ tabIndex: '0',
67
+ onKeyDown: _this.onKeyDown,
68
+ onBlur: _this.onBlur
69
+ },
70
+ newProps.children
71
+ );
72
+ }, _this.setSelectedValue = function (selectedValue, cause) {
73
+ // if (this.isAllowedDate(selectedValue)) {
74
+ if (!('selectedValue' in _this.props)) {
75
+ _this.setState({
76
+ selectedValue: selectedValue
77
+ });
78
+ }
79
+ if (_this.props.onSelect) {
80
+ _this.props.onSelect(selectedValue, cause);
81
+ }
82
+ // }
83
+ }, _this.setValue = function (value) {
84
+ var originalValue = _this.state.value;
85
+ if (!('value' in _this.props)) {
86
+ _this.setState({
87
+ value: value
88
+ });
89
+ }
90
+ if (originalValue && value && !originalValue.isSame(value) || !originalValue && value || originalValue && !value) {
91
+ _this.props.onChange(value);
92
+ }
93
+ }, _this.isAllowedDate = function (value) {
94
+ var disabledDate = _this.props.disabledDate;
95
+ var disabledTime = _this.props.disabledTime;
96
+ return isAllowedDate(value, disabledDate, disabledTime);
97
+ }, _temp), _possibleConstructorReturn(_this, _ret);
98
+ }
99
+
100
+ _class.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
101
+ // Use origin function if provided
102
+ if (ComposeComponent.getDerivedStateFromProps) {
103
+ return ComposeComponent.getDerivedStateFromProps(nextProps, prevState);
104
+ }
105
+
106
+ var value = nextProps.value,
107
+ selectedValue = nextProps.selectedValue;
108
+
109
+ var newState = {};
110
+
111
+ if ('value' in nextProps) {
112
+ newState.value = value || nextProps.defaultValue || getNowByCurrentStateValue(prevState.value);
113
+ }
114
+ if ('selectedValue' in nextProps) {
115
+ newState.selectedValue = selectedValue;
116
+ }
117
+
118
+ return newState;
119
+ };
120
+
121
+ return _class;
122
+ }(ComposeComponent), _class.displayName = 'CalendarMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _temp2;
123
+ };
@@ -0,0 +1,85 @@
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 PropTypes from 'prop-types';
5
+ import enUs from '../locale/en_US';
6
+
7
+ function noop() {}
8
+
9
+ export var propType = {
10
+ className: PropTypes.string,
11
+ locale: PropTypes.object,
12
+ style: PropTypes.object,
13
+ visible: PropTypes.bool,
14
+ onSelect: PropTypes.func,
15
+ prefixCls: PropTypes.string,
16
+ onChange: PropTypes.func,
17
+ onOk: PropTypes.func
18
+ };
19
+
20
+ export var defaultProp = {
21
+ locale: enUs,
22
+ style: {},
23
+ visible: true,
24
+ prefixCls: 'rc-calendar',
25
+ className: '',
26
+ onSelect: noop,
27
+ onChange: noop,
28
+ onClear: noop,
29
+ renderFooter: function renderFooter() {
30
+ return null;
31
+ },
32
+ renderSidebar: function renderSidebar() {
33
+ return null;
34
+ }
35
+ };
36
+
37
+ export var commonMixinWrapper = function commonMixinWrapper(ComposeComponent) {
38
+ var _class, _temp2;
39
+
40
+ return _temp2 = _class = function (_ComposeComponent) {
41
+ _inherits(_class, _ComposeComponent);
42
+
43
+ function _class() {
44
+ var _temp, _this, _ret;
45
+
46
+ _classCallCheck(this, _class);
47
+
48
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
49
+ args[_key] = arguments[_key];
50
+ }
51
+
52
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.getFormat = function () {
53
+ var format = _this.props.format;
54
+ var _this$props = _this.props,
55
+ locale = _this$props.locale,
56
+ timePicker = _this$props.timePicker;
57
+
58
+ if (!format) {
59
+ if (timePicker) {
60
+ format = locale.dateTimeFormat;
61
+ } else {
62
+ format = locale.dateFormat;
63
+ }
64
+ }
65
+ return format;
66
+ }, _this.focus = function () {
67
+ if (_this.focusElement) {
68
+ _this.focusElement.focus();
69
+ } else if (_this.rootInstance) {
70
+ _this.rootInstance.focus();
71
+ }
72
+ }, _this.saveFocusElement = function (focusElement) {
73
+ _this.focusElement = focusElement;
74
+ }, _this.saveRoot = function (root) {
75
+ _this.rootInstance = root;
76
+ }, _temp), _possibleConstructorReturn(_this, _ret);
77
+ }
78
+
79
+ _class.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
80
+ return this.props.visible || nextProps.visible;
81
+ };
82
+
83
+ return _class;
84
+ }(ComposeComponent), _class.displayName = 'CommonMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _class.getDerivedStateFromProps = ComposeComponent.getDerivedStateFromProps, _temp2;
85
+ };
@@ -0,0 +1,154 @@
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;