@skbkontur/react-ui 4.16.0 → 4.17.0-datepicker.0

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 (174) hide show
  1. package/CHANGELOG.md +23 -149
  2. package/LICENSE +21 -21
  3. package/cjs/components/Calendar/Calendar.d.ts +62 -3
  4. package/cjs/components/Calendar/Calendar.js +122 -37
  5. package/cjs/components/Calendar/Calendar.js.map +1 -1
  6. package/cjs/components/Calendar/Calendar.md +112 -0
  7. package/cjs/components/Calendar/Calendar.styles.js +1 -1
  8. package/cjs/components/Calendar/Calendar.styles.js.map +1 -1
  9. package/cjs/components/Calendar/CalendarContext.d.ts +17 -0
  10. package/cjs/components/Calendar/CalendarContext.js +27 -0
  11. package/cjs/components/Calendar/CalendarContext.js.map +1 -0
  12. package/cjs/components/Calendar/CalendarDateShape.d.ts +2 -2
  13. package/cjs/components/Calendar/CalendarDateShape.js +1 -1
  14. package/cjs/components/Calendar/CalendarDateShape.js.map +1 -1
  15. package/cjs/components/Calendar/CalendarUtils.d.ts +9 -0
  16. package/cjs/components/Calendar/CalendarUtils.js +13 -3
  17. package/cjs/components/Calendar/CalendarUtils.js.map +1 -1
  18. package/cjs/components/Calendar/DayCellView.d.ts +27 -12
  19. package/cjs/components/Calendar/DayCellView.js +116 -25
  20. package/cjs/components/Calendar/DayCellView.js.map +1 -1
  21. package/cjs/components/Calendar/DayCellView.styles.d.ts +5 -0
  22. package/cjs/components/Calendar/DayCellView.styles.js +46 -12
  23. package/cjs/components/Calendar/DayCellView.styles.js.map +1 -1
  24. package/cjs/components/Calendar/Month.d.ts +1 -10
  25. package/cjs/components/Calendar/Month.js +15 -76
  26. package/cjs/components/Calendar/Month.js.map +1 -1
  27. package/cjs/components/Calendar/MonthView.d.ts +0 -3
  28. package/cjs/components/Calendar/MonthView.js +15 -6
  29. package/cjs/components/Calendar/MonthView.js.map +1 -1
  30. package/cjs/components/Calendar/MonthView.styles.js +1 -1
  31. package/cjs/components/Calendar/MonthView.styles.js.map +1 -1
  32. package/cjs/components/Calendar/MonthViewModel.js +4 -3
  33. package/cjs/components/Calendar/MonthViewModel.js.map +1 -1
  34. package/cjs/components/Calendar/config.js +6 -3
  35. package/cjs/components/Calendar/config.js.map +1 -1
  36. package/cjs/components/Calendar/index.d.ts +1 -0
  37. package/cjs/components/Calendar/index.js.map +1 -1
  38. package/cjs/components/DatePicker/DatePicker.d.ts +3 -1
  39. package/cjs/components/DatePicker/DatePicker.js +9 -2
  40. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  41. package/cjs/components/DatePicker/DatePicker.md +24 -1
  42. package/cjs/components/DatePicker/DatePickerHelpers.js +2 -1
  43. package/cjs/components/DatePicker/DatePickerHelpers.js.map +1 -1
  44. package/cjs/components/Gapped/Gapped.md +43 -43
  45. package/cjs/components/Hint/Hint.js +2 -1
  46. package/cjs/components/Hint/Hint.js.map +1 -1
  47. package/cjs/components/Kebab/Kebab.js +1 -1
  48. package/cjs/components/Kebab/Kebab.js.map +1 -1
  49. package/cjs/components/Paging/Paging.js +1 -1
  50. package/cjs/components/Paging/Paging.js.map +1 -1
  51. package/cjs/components/Paging/Paging.styles.js +2 -1
  52. package/cjs/components/Paging/Paging.styles.js.map +1 -1
  53. package/cjs/components/RadioGroup/RadioGroup.md +43 -43
  54. package/cjs/components/Token/Token.md +112 -112
  55. package/cjs/hooks/usePrevious.d.ts +1 -0
  56. package/cjs/hooks/usePrevious.js +9 -0
  57. package/cjs/hooks/usePrevious.js.map +1 -0
  58. package/cjs/internal/DateSelect/locale/locales/en.js +2 -1
  59. package/cjs/internal/DateSelect/locale/locales/en.js.map +1 -1
  60. package/cjs/internal/DateSelect/locale/locales/ru.js +2 -1
  61. package/cjs/internal/DateSelect/locale/locales/ru.js.map +1 -1
  62. package/cjs/internal/DateSelect/locale/types.d.ts +1 -0
  63. package/cjs/internal/NativeDateInput/utils.js +3 -2
  64. package/cjs/internal/NativeDateInput/utils.js.map +1 -1
  65. package/cjs/internal/ThemeShowcase/ThemeShowcase.md +13 -13
  66. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  67. package/cjs/internal/themes/DefaultTheme.d.ts +3 -0
  68. package/cjs/internal/themes/DefaultTheme.js +10 -3
  69. package/cjs/internal/themes/DefaultTheme.js.map +1 -1
  70. package/cjs/internal/themes/Theme2022.d.ts +4 -0
  71. package/cjs/internal/themes/Theme2022.js +11 -2
  72. package/cjs/internal/themes/Theme2022.js.map +1 -1
  73. package/cjs/internal/themes/Theme2022Dark.d.ts +5 -0
  74. package/cjs/internal/themes/Theme2022Dark.js +6 -1
  75. package/cjs/internal/themes/Theme2022Dark.js.map +1 -1
  76. package/cjs/lib/date/InternalDate.d.ts +2 -0
  77. package/cjs/lib/date/InternalDate.js +8 -1
  78. package/cjs/lib/date/InternalDate.js.map +1 -1
  79. package/cjs/lib/date/InternalDateTransformer.d.ts +2 -0
  80. package/cjs/lib/date/InternalDateTransformer.js +15 -0
  81. package/cjs/lib/date/InternalDateTransformer.js.map +1 -1
  82. package/cjs/lib/date/InternalDateValidator.js +2 -1
  83. package/cjs/lib/date/InternalDateValidator.js.map +1 -1
  84. package/cjs/lib/locale/constants.d.ts +3 -0
  85. package/cjs/lib/locale/constants.js +6 -2
  86. package/cjs/lib/locale/constants.js.map +1 -1
  87. package/components/Calendar/Calendar/Calendar.js +86 -65
  88. package/components/Calendar/Calendar/Calendar.js.map +1 -1
  89. package/components/Calendar/Calendar.d.ts +62 -3
  90. package/components/Calendar/Calendar.md +112 -0
  91. package/components/Calendar/Calendar.styles/Calendar.styles.js +1 -1
  92. package/components/Calendar/Calendar.styles/Calendar.styles.js.map +1 -1
  93. package/components/Calendar/CalendarContext/CalendarContext.js +13 -0
  94. package/components/Calendar/CalendarContext/CalendarContext.js.map +1 -0
  95. package/components/Calendar/CalendarContext/package.json +6 -0
  96. package/components/Calendar/CalendarContext.d.ts +17 -0
  97. package/components/Calendar/CalendarDateShape/CalendarDateShape.js +1 -1
  98. package/components/Calendar/CalendarDateShape/CalendarDateShape.js.map +1 -1
  99. package/components/Calendar/CalendarDateShape.d.ts +2 -2
  100. package/components/Calendar/CalendarUtils/CalendarUtils.js +7 -0
  101. package/components/Calendar/CalendarUtils/CalendarUtils.js.map +1 -1
  102. package/components/Calendar/CalendarUtils.d.ts +9 -0
  103. package/components/Calendar/DayCellView/DayCellView.js +95 -32
  104. package/components/Calendar/DayCellView/DayCellView.js.map +1 -1
  105. package/components/Calendar/DayCellView.d.ts +27 -12
  106. package/components/Calendar/DayCellView.styles/DayCellView.styles.js +22 -7
  107. package/components/Calendar/DayCellView.styles/DayCellView.styles.js.map +1 -1
  108. package/components/Calendar/DayCellView.styles.d.ts +5 -0
  109. package/components/Calendar/Month/Month.js +11 -77
  110. package/components/Calendar/Month/Month.js.map +1 -1
  111. package/components/Calendar/Month.d.ts +1 -10
  112. package/components/Calendar/MonthView/MonthView.js +17 -2
  113. package/components/Calendar/MonthView/MonthView.js.map +1 -1
  114. package/components/Calendar/MonthView.d.ts +0 -3
  115. package/components/Calendar/MonthView.styles/MonthView.styles.js +1 -1
  116. package/components/Calendar/MonthView.styles/MonthView.styles.js.map +1 -1
  117. package/components/Calendar/MonthViewModel/MonthViewModel.js +4 -3
  118. package/components/Calendar/MonthViewModel/MonthViewModel.js.map +1 -1
  119. package/components/Calendar/config/config.js +4 -3
  120. package/components/Calendar/config/config.js.map +1 -1
  121. package/components/Calendar/index/index.js +2 -1
  122. package/components/Calendar/index/index.js.map +1 -1
  123. package/components/Calendar/index.d.ts +1 -0
  124. package/components/DatePicker/DatePicker/DatePicker.js +7 -2
  125. package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
  126. package/components/DatePicker/DatePicker.d.ts +3 -1
  127. package/components/DatePicker/DatePicker.md +24 -1
  128. package/components/DatePicker/DatePickerHelpers/DatePickerHelpers.js +2 -1
  129. package/components/DatePicker/DatePickerHelpers/DatePickerHelpers.js.map +1 -1
  130. package/components/Gapped/Gapped.md +43 -43
  131. package/components/Hint/Hint/Hint.js +2 -1
  132. package/components/Hint/Hint/Hint.js.map +1 -1
  133. package/components/Kebab/Kebab/Kebab.js +1 -1
  134. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  135. package/components/Paging/Paging/Paging.js +1 -1
  136. package/components/Paging/Paging/Paging.js.map +1 -1
  137. package/components/Paging/Paging.styles/Paging.styles.js +1 -1
  138. package/components/Paging/Paging.styles/Paging.styles.js.map +1 -1
  139. package/components/RadioGroup/RadioGroup.md +43 -43
  140. package/components/Token/Token.md +112 -112
  141. package/hooks/usePrevious/package.json +6 -0
  142. package/hooks/usePrevious/usePrevious.js +8 -0
  143. package/hooks/usePrevious/usePrevious.js.map +1 -0
  144. package/hooks/usePrevious.d.ts +1 -0
  145. package/internal/DateSelect/locale/locales/en/en.js +2 -1
  146. package/internal/DateSelect/locale/locales/en/en.js.map +1 -1
  147. package/internal/DateSelect/locale/locales/ru/ru.js +2 -1
  148. package/internal/DateSelect/locale/locales/ru/ru.js.map +1 -1
  149. package/internal/DateSelect/locale/types.d.ts +1 -0
  150. package/internal/NativeDateInput/utils/utils.js +2 -1
  151. package/internal/NativeDateInput/utils/utils.js.map +1 -1
  152. package/internal/ThemeShowcase/ThemeShowcase.md +13 -13
  153. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  154. package/internal/themes/DefaultTheme/DefaultTheme.js +13 -1
  155. package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
  156. package/internal/themes/DefaultTheme.d.ts +3 -0
  157. package/internal/themes/Theme2022/Theme2022.js +11 -3
  158. package/internal/themes/Theme2022/Theme2022.js.map +1 -1
  159. package/internal/themes/Theme2022.d.ts +4 -0
  160. package/internal/themes/Theme2022Dark/Theme2022Dark.js +9 -4
  161. package/internal/themes/Theme2022Dark/Theme2022Dark.js.map +1 -1
  162. package/internal/themes/Theme2022Dark.d.ts +5 -0
  163. package/lib/date/InternalDate/InternalDate.js +7 -1
  164. package/lib/date/InternalDate/InternalDate.js.map +1 -1
  165. package/lib/date/InternalDate.d.ts +2 -0
  166. package/lib/date/InternalDateTransformer/InternalDateTransformer.js +19 -0
  167. package/lib/date/InternalDateTransformer/InternalDateTransformer.js.map +1 -1
  168. package/lib/date/InternalDateTransformer.d.ts +2 -0
  169. package/lib/date/InternalDateValidator/InternalDateValidator.js +6 -1
  170. package/lib/date/InternalDateValidator/InternalDateValidator.js.map +1 -1
  171. package/lib/locale/constants/constants.js +4 -1
  172. package/lib/locale/constants/constants.js.map +1 -1
  173. package/lib/locale/constants.d.ts +3 -0
  174. package/package.json +2 -5
package/CHANGELOG.md CHANGED
@@ -3,188 +3,62 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [4.16.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.10...@skbkontur/react-ui@4.16.0) (2023-09-21)
7
-
8
- **Note:** Version bump only for package @skbkontur/react-ui
9
-
10
-
11
-
12
-
13
-
14
- # [4.16.0-next.10](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.9...@skbkontur/react-ui@4.16.0-next.10) (2023-09-21)
6
+ # [4.17.0-next.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0...@skbkontur/react-ui@4.17.0-next.0) (2023-09-23)
15
7
 
16
8
 
17
9
  ### Bug Fixes
18
10
 
19
- * **Button:** now disabled state don't fire bubbling on click ([#3262](https://github.com/skbkontur/retail-ui/issues/3262)) ([79a46a6](https://github.com/skbkontur/retail-ui/commit/79a46a6cc06971b36fc7bff0855b9daaf3bd2750))
20
- * Kontur field in rootNode decorator ([#3261](https://github.com/skbkontur/retail-ui/issues/3261)) ([5169967](https://github.com/skbkontur/retail-ui/commit/5169967f9772468a9b90aa59c38f9d1c2837152c))
21
- * **Button:** remove outline in disabled state for colored use buttons ([#3244](https://github.com/skbkontur/retail-ui/issues/3244)) ([bd50313](https://github.com/skbkontur/retail-ui/commit/bd503130fff703396ea2e475f1f5998e710dcf98))
22
- * **ComboBox:** extend getItems type ([#3260](https://github.com/skbkontur/retail-ui/issues/3260)) ([1da0591](https://github.com/skbkontur/retail-ui/commit/1da0591dc2ef91de8c124258da7b167dc6a9fc6c))
23
- * **Link:** add transition on underline ([#3254](https://github.com/skbkontur/retail-ui/issues/3254)) ([6b9d106](https://github.com/skbkontur/retail-ui/commit/6b9d106369b963e9da6fbc54effb562f4e3467b1))
24
- * **Toggle:** disable animations for `THEME_2022` ([#3256](https://github.com/skbkontur/retail-ui/issues/3256)) ([cdc9513](https://github.com/skbkontur/retail-ui/commit/cdc95137ce1a46d2720b67435c7c622919068440))
11
+ * **Button:** update disabled and hover styles ([#3272](https://github.com/skbkontur/retail-ui/issues/3272)) ([5653505](https://github.com/skbkontur/retail-ui/commit/56535052fb0b4edea30636b6b66cd0bd5fe8af63))
12
+ * **Paging:** disable forward button when current page is last ([#3273](https://github.com/skbkontur/retail-ui/issues/3273)) ([9b3a0b7](https://github.com/skbkontur/retail-ui/commit/9b3a0b74cafaa7753a62da43a8edaef30eae617c))
25
13
 
26
14
 
27
15
  ### Features
28
16
 
29
- * **Autocomplete,ComboBox,Dropdown,Select:** forward size to MenuItems ([#3265](https://github.com/skbkontur/retail-ui/issues/3265)) ([c0732e5](https://github.com/skbkontur/retail-ui/commit/c0732e51124140e7c1f4a9f7c970e92ca6ddc17a))
30
- * **MenuHeader,MenuItem:** add prop size ([#3252](https://github.com/skbkontur/retail-ui/issues/3252)) ([e0e981a](https://github.com/skbkontur/retail-ui/commit/e0e981ad61389b04d9cc0ca885ee64c19de389b6))
17
+ * **Kebab/Hint/Toast:** remove Pin and update style ([#3274](https://github.com/skbkontur/retail-ui/issues/3274)) ([b248448](https://github.com/skbkontur/retail-ui/commit/b248448241ae75eeaf70d2137c6e8aca779c3edf))
31
18
 
32
19
 
33
20
 
34
21
 
35
22
 
36
- # [4.16.0-next.9](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.8...@skbkontur/react-ui@4.16.0-next.9) (2023-08-31)
37
-
38
- **Note:** Version bump only for package @skbkontur/react-ui
39
-
40
-
41
-
42
-
43
-
44
- # [4.16.0-next.8](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.7...@skbkontur/react-ui@4.16.0-next.8) (2023-08-28)
45
-
46
- **Note:** Version bump only for package @skbkontur/react-ui
47
-
48
-
49
-
50
-
51
-
52
- # [4.16.0-next.7](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.7...@skbkontur/react-ui@4.16.0-next.7) (2023-08-28)
53
-
54
-
55
- ### Bug Fixes
56
-
57
- * **Autocomplete,Select,ComboBox:** add missing horizontal paddings on mobile ([#3207](https://github.com/skbkontur/retail-ui/issues/3207)) ([15be732](https://github.com/skbkontur/retail-ui/commit/15be73264ae957d5015539217dd76bacef494e25))
58
- * **Button:** add color to border when `use=text` ([#3216](https://github.com/skbkontur/retail-ui/issues/3216)) ([01a10da](https://github.com/skbkontur/retail-ui/commit/01a10dac6325874581195aaa366ebf8b81bb1cb3))
59
- * **Button:** add events onClickCapture, onMouseDown and onMouseUp ([#3249](https://github.com/skbkontur/retail-ui/issues/3249)) ([a5b3809](https://github.com/skbkontur/retail-ui/commit/a5b38093371568ac391363349e243075baf107c8))
60
- * **Button:** repair `btnLink*` theme vars in THEME_2022 ([#3250](https://github.com/skbkontur/retail-ui/issues/3250)) ([5c6673c](https://github.com/skbkontur/retail-ui/commit/5c6673c2710d6d09050690c1f779d7eafaa13b72))
61
- * **Calendar:** add accessible descriptions ([#3232](https://github.com/skbkontur/retail-ui/issues/3232)) ([b2b0d78](https://github.com/skbkontur/retail-ui/commit/b2b0d78f2d39daaa45e973034de6a533a7e701a3))
62
- * **Calendar:** return customization of current day border in theme 2022 ([#3186](https://github.com/skbkontur/retail-ui/issues/3186)) ([1595e1d](https://github.com/skbkontur/retail-ui/commit/1595e1df80d72d42116f9604b44565733ce4895f))
63
- * **DateInput:** remove unnecessary focus half-border ([#3221](https://github.com/skbkontur/retail-ui/issues/3221)) ([4613c66](https://github.com/skbkontur/retail-ui/commit/4613c662675e69401fcfcdfb93fa7c8b33125cca))
64
- * **DateInput:** set native selection background ([#3222](https://github.com/skbkontur/retail-ui/issues/3222)) ([e3e4935](https://github.com/skbkontur/retail-ui/commit/e3e493523d2efd1d5b0826609180d7b16da5bba0))
65
- * **Dropdown:** use default button styles ([#3242](https://github.com/skbkontur/retail-ui/issues/3242)) ([ec7aa2f](https://github.com/skbkontur/retail-ui/commit/ec7aa2fcea2230a6f95420544034c610e01291a5))
66
- * **DropdownMenu,TooltipMenu,Kebab:** add preventIconsOffset prop ([beb6f90](https://github.com/skbkontur/retail-ui/commit/beb6f900f0e4c7c4b9e79d86f8b0066ae75b400d))
67
- * **Modal:** remove excessive top padding on footer ([#3236](https://github.com/skbkontur/retail-ui/issues/3236)) ([473cb0f](https://github.com/skbkontur/retail-ui/commit/473cb0fe20c5e1f6d904230367600bba37308f1f))
68
- * handle npm@8.5.0 publish breaking change ([80c5917](https://github.com/skbkontur/retail-ui/commit/80c5917afcdd9787e631c8bb0e64adc472593b2c))
69
- * **FileUploaderFile:** wrap component in forwardRef ([#3238](https://github.com/skbkontur/retail-ui/issues/3238)) ([8dd42d6](https://github.com/skbkontur/retail-ui/commit/8dd42d6adb442e43f617e76458cc04eaadc30ff2))
70
- * **InputLikeText:** use debounce to control async content selection ([#3218](https://github.com/skbkontur/retail-ui/issues/3218)) ([39c07d4](https://github.com/skbkontur/retail-ui/commit/39c07d43ee0e70aad99451f9a22dbbe7e276f123))
71
- * **Select:** add max-width on mobile ([#3210](https://github.com/skbkontur/retail-ui/issues/3210)) ([54f612c](https://github.com/skbkontur/retail-ui/commit/54f612c26a793607d435a0f45b680d1f6235664b))
72
- * **Tabs:** add prop size ([#3198](https://github.com/skbkontur/retail-ui/issues/3198)) ([69b2299](https://github.com/skbkontur/retail-ui/commit/69b2299e75606c6ee6f381af3591bdfec17e45a7))
73
-
23
+ # [4.16.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.10...@skbkontur/react-ui@4.16.0) (2023-09-21)
74
24
 
75
25
  ### Features
76
26
 
27
+ * **Autocomplete,ComboBox,Dropdown,Select:** forward size to MenuItems ([#3265](https://github.com/skbkontur/retail-ui/issues/3265)) ([c0732e5](https://github.com/skbkontur/retail-ui/commit/c0732e51124140e7c1f4a9f7c970e92ca6ddc17a))
28
+ * **MenuHeader,MenuItem:** add prop size ([#3252](https://github.com/skbkontur/retail-ui/issues/3252)) ([e0e981a](https://github.com/skbkontur/retail-ui/commit/e0e981ad61389b04d9cc0ca885ee64c19de389b6))
77
29
  * add aria-label to all appropriate components ([#3223](https://github.com/skbkontur/retail-ui/issues/3223)) ([5603ef6](https://github.com/skbkontur/retail-ui/commit/5603ef6eedec2786a68bb86a8b1131b609aea25c))
78
30
  * **Checkbox:** add prop size ([#3230](https://github.com/skbkontur/retail-ui/issues/3230)) ([032279a](https://github.com/skbkontur/retail-ui/commit/032279af4673995bbae5f82da0e050ef9da9b53c))
79
31
  * **Radio:** add prop size ([#3246](https://github.com/skbkontur/retail-ui/issues/3246)) ([ee270c9](https://github.com/skbkontur/retail-ui/commit/ee270c913d3c7502c27062af8a658e7ab9734098))
80
32
  * **Textarea:** add prop size ([#3243](https://github.com/skbkontur/retail-ui/issues/3243)) ([b8c309d](https://github.com/skbkontur/retail-ui/commit/b8c309dfbb6b4ec4a9c3336789a25bd756b2c6cc))
81
- * refactor and unify menus ([#3234](https://github.com/skbkontur/retail-ui/issues/3234)) ([b19ac8f](https://github.com/skbkontur/retail-ui/commit/b19ac8fcb580384177acbfd2da7ea23b00c8ffdc))
82
33
  * **Toggle:** add prop size ([#3233](https://github.com/skbkontur/retail-ui/issues/3233)) ([db76d09](https://github.com/skbkontur/retail-ui/commit/db76d091d6b8d94b25a1710adf9606a09b07c67b))
83
- * add animations for hover and active states ([#3219](https://github.com/skbkontur/retail-ui/issues/3219)) ([51a6165](https://github.com/skbkontur/retail-ui/commit/51a61652aa8398dbc500cf500af480f883e97857))
84
- * improve a11y of dropdown lists ([#3194](https://github.com/skbkontur/retail-ui/issues/3194)) ([c25f090](https://github.com/skbkontur/retail-ui/commit/c25f090f25a9e1078cbe882417f4b2c96559d5ec))
85
-
86
-
87
- ### Reverts
88
-
89
- * Revert "ci: publish via yarn" ([ad5e4ef](https://github.com/skbkontur/retail-ui/commit/ad5e4efb3f70cc86a5f6228973c9ddfdcd803b75))
90
-
91
-
92
-
93
-
94
-
95
- # [4.16.0-next.6](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.5...@skbkontur/react-ui@4.16.0-next.6) (2023-08-15)
96
-
97
-
98
- ### Bug Fixes
99
-
100
- * **Calendar:** add accessible descriptions ([#3232](https://github.com/skbkontur/retail-ui/issues/3232)) ([b2b0d78](https://github.com/skbkontur/retail-ui/commit/b2b0d78f2d39daaa45e973034de6a533a7e701a3))
101
-
102
-
103
-
104
-
105
-
106
- # [4.16.0-next.5](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.6...@skbkontur/react-ui@4.16.0-next.5) (2023-08-11)
34
+ * **Tabs:** add prop size ([#3198](https://github.com/skbkontur/retail-ui/issues/3198)) ([69b2299](https://github.com/skbkontur/retail-ui/commit/69b2299e75606c6ee6f381af3591bdfec17e45a7))
35
+ * **InternalMenu:** replace with Menu ([#3234](https://github.com/skbkontur/retail-ui/issues/3234)) ([b19ac8f](https://github.com/skbkontur/retail-ui/commit/b19ac8fcb580384177acbfd2da7ea23b00c8ffdc))
36
+ * **Menu:** improve a11y of dropdown lists ([#3194](https://github.com/skbkontur/retail-ui/issues/3194)) ([c25f090](https://github.com/skbkontur/retail-ui/commit/c25f090f25a9e1078cbe882417f4b2c96559d5ec))
37
+ * **all:** add animations for hover and active states ([#3219](https://github.com/skbkontur/retail-ui/issues/3219)) ([51a6165](https://github.com/skbkontur/retail-ui/commit/51a61652aa8398dbc500cf500af480f883e97857))
107
38
 
108
39
 
109
40
  ### Bug Fixes
110
41
 
111
- * handle npm@8.5.0 publish breaking change ([80c5917](https://github.com/skbkontur/retail-ui/commit/80c5917afcdd9787e631c8bb0e64adc472593b2c))
112
- * **Autocomplete,Select,ComboBox:** add missing horizontal paddings on mobile ([#3207](https://github.com/skbkontur/retail-ui/issues/3207)) ([15be732](https://github.com/skbkontur/retail-ui/commit/15be73264ae957d5015539217dd76bacef494e25))
42
+ * **Button:** disabled state doesn't bubble click ([#3262](https://github.com/skbkontur/retail-ui/issues/3262)) ([79a46a6](https://github.com/skbkontur/retail-ui/commit/79a46a6cc06971b36fc7bff0855b9daaf3bd2750))
43
+ * **Button:** remove outline in disabled state for colored use buttons ([#3244](https://github.com/skbkontur/retail-ui/issues/3244)) ([bd50313](https://github.com/skbkontur/retail-ui/commit/bd503130fff703396ea2e475f1f5998e710dcf98))
44
+ * **ComboBox:** extend getItems type ([#3260](https://github.com/skbkontur/retail-ui/issues/3260)) ([1da0591](https://github.com/skbkontur/retail-ui/commit/1da0591dc2ef91de8c124258da7b167dc6a9fc6c))
45
+ * **Link:** add transition on underline ([#3254](https://github.com/skbkontur/retail-ui/issues/3254)) ([6b9d106](https://github.com/skbkontur/retail-ui/commit/6b9d106369b963e9da6fbc54effb562f4e3467b1))
46
+ * **Toggle:** disable animations for `THEME_2022` ([#3256](https://github.com/skbkontur/retail-ui/issues/3256)) ([cdc9513](https://github.com/skbkontur/retail-ui/commit/cdc95137ce1a46d2720b67435c7c622919068440))
47
+ * **Autocomplete,Select,ComboBox:** add missing horizontal paddings for Menu on mobile ([#3207](https://github.com/skbkontur/retail-ui/issues/3207)) ([15be732](https://github.com/skbkontur/retail-ui/commit/15be73264ae957d5015539217dd76bacef494e25))
113
48
  * **Button:** add color to border when `use=text` ([#3216](https://github.com/skbkontur/retail-ui/issues/3216)) ([01a10da](https://github.com/skbkontur/retail-ui/commit/01a10dac6325874581195aaa366ebf8b81bb1cb3))
49
+ * **Button:** add events onClickCapture, onMouseDown and onMouseUp ([#3249](https://github.com/skbkontur/retail-ui/issues/3249)) ([a5b3809](https://github.com/skbkontur/retail-ui/commit/a5b38093371568ac391363349e243075baf107c8))
50
+ * **Button:** repair `btnLink*` theme vars in THEME_2022 ([#3250](https://github.com/skbkontur/retail-ui/issues/3250)) ([5c6673c](https://github.com/skbkontur/retail-ui/commit/5c6673c2710d6d09050690c1f779d7eafaa13b72))
51
+ * **Calendar:** add accessible descriptions ([#3232](https://github.com/skbkontur/retail-ui/issues/3232)) ([b2b0d78](https://github.com/skbkontur/retail-ui/commit/b2b0d78f2d39daaa45e973034de6a533a7e701a3))
114
52
  * **Calendar:** return customization of current day border in theme 2022 ([#3186](https://github.com/skbkontur/retail-ui/issues/3186)) ([1595e1d](https://github.com/skbkontur/retail-ui/commit/1595e1df80d72d42116f9604b44565733ce4895f))
115
53
  * **DateInput:** remove unnecessary focus half-border ([#3221](https://github.com/skbkontur/retail-ui/issues/3221)) ([4613c66](https://github.com/skbkontur/retail-ui/commit/4613c662675e69401fcfcdfb93fa7c8b33125cca))
116
54
  * **DateInput:** set native selection background ([#3222](https://github.com/skbkontur/retail-ui/issues/3222)) ([e3e4935](https://github.com/skbkontur/retail-ui/commit/e3e493523d2efd1d5b0826609180d7b16da5bba0))
55
+ * **Dropdown:** use default button styles ([#3242](https://github.com/skbkontur/retail-ui/issues/3242)) ([ec7aa2f](https://github.com/skbkontur/retail-ui/commit/ec7aa2fcea2230a6f95420544034c610e01291a5))
117
56
  * **DropdownMenu,TooltipMenu,Kebab:** add preventIconsOffset prop ([beb6f90](https://github.com/skbkontur/retail-ui/commit/beb6f900f0e4c7c4b9e79d86f8b0066ae75b400d))
57
+ * **Modal:** remove excessive top padding on footer ([#3236](https://github.com/skbkontur/retail-ui/issues/3236)) ([473cb0f](https://github.com/skbkontur/retail-ui/commit/473cb0fe20c5e1f6d904230367600bba37308f1f))
58
+ * handle npm@8.5.0 publish breaking change ([80c5917](https://github.com/skbkontur/retail-ui/commit/80c5917afcdd9787e631c8bb0e64adc472593b2c))
118
59
  * **FileUploaderFile:** wrap component in forwardRef ([#3238](https://github.com/skbkontur/retail-ui/issues/3238)) ([8dd42d6](https://github.com/skbkontur/retail-ui/commit/8dd42d6adb442e43f617e76458cc04eaadc30ff2))
119
60
  * **InputLikeText:** use debounce to control async content selection ([#3218](https://github.com/skbkontur/retail-ui/issues/3218)) ([39c07d4](https://github.com/skbkontur/retail-ui/commit/39c07d43ee0e70aad99451f9a22dbbe7e276f123))
120
61
  * **Select:** add max-width on mobile ([#3210](https://github.com/skbkontur/retail-ui/issues/3210)) ([54f612c](https://github.com/skbkontur/retail-ui/commit/54f612c26a793607d435a0f45b680d1f6235664b))
121
- * **Tabs:** add prop size ([#3198](https://github.com/skbkontur/retail-ui/issues/3198)) ([69b2299](https://github.com/skbkontur/retail-ui/commit/69b2299e75606c6ee6f381af3591bdfec17e45a7))
122
-
123
-
124
- ### Features
125
-
126
- * refactor and unify menus ([#3234](https://github.com/skbkontur/retail-ui/issues/3234)) ([b19ac8f](https://github.com/skbkontur/retail-ui/commit/b19ac8fcb580384177acbfd2da7ea23b00c8ffdc))
127
- * **Checkbox:** add prop size ([#3230](https://github.com/skbkontur/retail-ui/issues/3230)) ([032279a](https://github.com/skbkontur/retail-ui/commit/032279af4673995bbae5f82da0e050ef9da9b53c))
128
- * **Toggle:** add prop size ([#3233](https://github.com/skbkontur/retail-ui/issues/3233)) ([db76d09](https://github.com/skbkontur/retail-ui/commit/db76d091d6b8d94b25a1710adf9606a09b07c67b))
129
- * add animations for hover and active states ([#3219](https://github.com/skbkontur/retail-ui/issues/3219)) ([51a6165](https://github.com/skbkontur/retail-ui/commit/51a61652aa8398dbc500cf500af480f883e97857))
130
- * improve a11y of dropdown lists ([#3194](https://github.com/skbkontur/retail-ui/issues/3194)) ([c25f090](https://github.com/skbkontur/retail-ui/commit/c25f090f25a9e1078cbe882417f4b2c96559d5ec))
131
-
132
-
133
-
134
-
135
-
136
- # [4.16.0-next.4](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.16.0-next.3...@skbkontur/react-ui@4.16.0-next.4) (2023-07-24)
137
-
138
- **Note:** Version bump only for package @skbkontur/react-ui
139
-
140
-
141
-
142
-
143
-
144
- # [4.16.0-next.3](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.3...@skbkontur/react-ui@4.16.0-next.3) (2023-07-21)
145
-
146
-
147
- ### Bug Fixes
148
-
149
- * **Calendar:** return customization of current day border in theme 2022 ([#3186](https://github.com/skbkontur/retail-ui/issues/3186)) ([1595e1d](https://github.com/skbkontur/retail-ui/commit/1595e1df80d72d42116f9604b44565733ce4895f))
150
- * **DropdownMenu,TooltipMenu,Kebab:** add preventIconsOffset prop ([beb6f90](https://github.com/skbkontur/retail-ui/commit/beb6f900f0e4c7c4b9e79d86f8b0066ae75b400d))
151
-
152
-
153
- ### Features
154
-
155
- * improve a11y of dropdown lists ([#3194](https://github.com/skbkontur/retail-ui/issues/3194)) ([c25f090](https://github.com/skbkontur/retail-ui/commit/c25f090f25a9e1078cbe882417f4b2c96559d5ec))
156
-
157
-
158
-
159
-
160
-
161
- # [4.16.0-next.2](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.2...@skbkontur/react-ui@4.16.0-next.2) (2023-07-17)
162
-
163
-
164
- ### Bug Fixes
165
-
166
- * **Calendar:** return customization of current day border in theme 2022 ([#3186](https://github.com/skbkontur/retail-ui/issues/3186)) ([1595e1d](https://github.com/skbkontur/retail-ui/commit/1595e1df80d72d42116f9604b44565733ce4895f))
167
- * **DropdownMenu,TooltipMenu,Kebab:** add preventIconsOffset prop ([beb6f90](https://github.com/skbkontur/retail-ui/commit/beb6f900f0e4c7c4b9e79d86f8b0066ae75b400d))
168
-
169
-
170
-
171
-
172
-
173
- # [4.16.0-next.1](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.1...@skbkontur/react-ui@4.16.0-next.1) (2023-07-04)
174
-
175
-
176
- ### Bug Fixes
177
-
178
- * **Calendar:** return customization of current day border in theme 2022 ([#3186](https://github.com/skbkontur/retail-ui/issues/3186)) ([1595e1d](https://github.com/skbkontur/retail-ui/commit/1595e1df80d72d42116f9604b44565733ce4895f))
179
- * **DropdownMenu,TooltipMenu,Kebab:** add preventIconsOffset prop ([beb6f90](https://github.com/skbkontur/retail-ui/commit/beb6f900f0e4c7c4b9e79d86f8b0066ae75b400d))
180
-
181
-
182
-
183
-
184
-
185
- # [4.16.0-next.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@4.15.0...@skbkontur/react-ui@4.16.0-next.0) (2023-06-13)
186
-
187
- **Note:** Version bump only for package @skbkontur/react-ui
188
62
 
189
63
 
190
64
 
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 SKB Kontur
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2017 SKB Kontur
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -3,6 +3,7 @@ import { CommonProps } from '../../internal/CommonWrapper';
3
3
  import { Nullable, Range } from '../../typings/utility-types';
4
4
  import { MonthViewModel } from './MonthViewModel';
5
5
  import { CalendarDateShape } from './CalendarDateShape';
6
+ import { DayProps } from './DayCellView';
6
7
  export interface CalendarProps extends CommonProps {
7
8
  /**
8
9
  * Вызывается при изменении `value`
@@ -28,6 +29,18 @@ export interface CalendarProps extends CommonProps {
28
29
  * Дата задаётся в формате `dd.mm.yyyy`
29
30
  */
30
31
  minDate?: string;
32
+ /**
33
+ * Задаёт начальную дату периода
34
+ *
35
+ * Дата задаётся в формате `dd.mm.yyyy`
36
+ */
37
+ periodStartDate?: string;
38
+ /**
39
+ * Задаёт конечную дату периода
40
+ *
41
+ * Дата задаётся в формате `dd.mm.yyyy`
42
+ */
43
+ periodEndDate?: string;
31
44
  /**
32
45
  * Функция для определения праздничных дней
33
46
  * @default (_day, isWeekend) => isWeekend
@@ -45,13 +58,57 @@ export interface CalendarProps extends CommonProps {
45
58
  * Позволяет задать начальный год
46
59
  */
47
60
  initialYear?: number;
61
+ /**
62
+ * Метод отрисовки ячеки даты в календаре
63
+ *
64
+ * @default undefined
65
+ *
66
+ * @param date - дата в формате `dd.mm.yyyy`
67
+ * @param defaultProps - дефолтные пропы `DayProps`
68
+ * @param RenderDefault - дефолтный комопнент для рендера ячейки
69
+ *
70
+ * @returns {ReactNode} возвращает компонент, который отрисовывает контент числа месяца
71
+ */
72
+ renderDay?: (date: string, defaultProps: DayProps, RenderDefault: React.FunctionComponent<DayProps>) => React.ReactNode;
73
+ /**
74
+ * Вызывается для каждого залипшего месяца. Залипшим считается месяц, оставшийся сверху после:
75
+ * <br />
76
+ * - ручного скролинга
77
+ * <br />
78
+ * - ручной смены месяца или года
79
+ * <br />
80
+ * - автоскролинга при обновлении `value`
81
+ *
82
+ * @type ({ month: number; year: number; }) => void
83
+ * @default undefined
84
+ *
85
+ * @param monthInfo
86
+ * @param monthInfo.month - 1-12
87
+ * @param monthInfo.year
88
+ */
89
+ onStuckMonth?: (monthInfo: CalendarMonthInfo) => void;
90
+ /**
91
+ * Вызывается при ручной смене месяца или года
92
+ *
93
+ * @type ({ month: number; year: number; }) => void
94
+ * @default undefined
95
+ *
96
+ * @param monthInfo
97
+ * @param monthInfo.month - 1-12
98
+ * @param monthInfo.year
99
+ */
100
+ onMonthSelect?: (monthInfo: CalendarMonthInfo) => void;
48
101
  }
49
102
  export interface CalendarState {
50
103
  scrollPosition: number;
51
104
  months: MonthViewModel[];
52
- today: CalendarDateShape;
53
105
  scrollDirection: number;
54
106
  scrollTarget: number;
107
+ hoveredDate: CalendarDateShape | null;
108
+ }
109
+ export interface CalendarMonthInfo {
110
+ month: number;
111
+ year: number;
55
112
  }
56
113
  export declare const CalendarDataTids: {
57
114
  readonly root: "Calendar__root";
@@ -84,13 +141,13 @@ export declare class Calendar extends React.Component<CalendarProps, CalendarSta
84
141
  * @public
85
142
  */
86
143
  scrollToMonth: (month: number, year: number) => Promise<void>;
144
+ private debouncedStuckMonth;
87
145
  private renderMain;
88
146
  private refRoot;
89
147
  private renderMonth;
90
- private isHoliday;
91
- private handleDateChange;
92
148
  private getDateInNativeFormat;
93
149
  private getMonthPositions;
150
+ private getVisibleMonths;
94
151
  private handleMonthYearChange;
95
152
  private executeAnimations;
96
153
  private handleTouchStart;
@@ -101,5 +158,7 @@ export declare class Calendar extends React.Component<CalendarProps, CalendarSta
101
158
  private scrollToNearestWeek;
102
159
  private scrollTo;
103
160
  private scrollAmount;
161
+ private handleMouseHits;
162
+ private handleClick;
104
163
  }
105
164
  export {};
@@ -2,9 +2,9 @@
2
2
  var _normalizeWheel2 = _interopRequireDefault(require("normalize-wheel"));
3
3
  var _lodash = _interopRequireDefault(require("lodash.throttle"));
4
4
  var _shallowequal = _interopRequireDefault(require("shallowequal"));
5
+ var _lodash2 = _interopRequireDefault(require("lodash.debounce"));
5
6
 
6
7
  var _InternalDate = require("../../lib/date/InternalDate");
7
- var _InternalDateTransformer = require("../../lib/date/InternalDateTransformer");
8
8
  var _rootNode = require("../../lib/rootNode");
9
9
  var _Emotion = require("../../lib/theming/Emotion");
10
10
  var _CommonWrapper = require("../../internal/CommonWrapper");
@@ -22,7 +22,72 @@ var CalendarScrollEvents = _interopRequireWildcard(require("./CalendarScrollEven
22
22
  var _Month = require("./Month");
23
23
  var _Calendar = require("./Calendar.styles");
24
24
  var _CalendarDateShape = require("./CalendarDateShape");
25
- var CalendarUtils = _interopRequireWildcard(require("./CalendarUtils"));var _class, _class2, _temp;function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
25
+ var CalendarUtils = _interopRequireWildcard(require("./CalendarUtils"));
26
+ var _CalendarContext = require("./CalendarContext");var _class, _class2, _temp;function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
26
91
 
27
92
 
28
93
 
@@ -276,20 +341,41 @@ Calendar = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
276
341
  }case 22:case "end":return _context.stop();}}}, _callee);}));return function (_x, _x2) {return _ref.apply(this, arguments);};}();_this.
277
342
 
278
343
 
344
+ debouncedStuckMonth = _this.props.onStuckMonth && (0, _lodash2.default)(_this.props.onStuckMonth, 100);_this.
345
+
279
346
  renderMain = function () {
280
- var positions = _this.getMonthPositions();
347
+ var monthsForRender = _this.getVisibleMonths(_this.state);
281
348
  var wrapperStyle = { height: (0, _config.themeConfig)(_this.theme).WRAPPER_HEIGHT };
282
349
 
283
350
  var props = _this.getProps();
284
351
 
352
+ var context = (0, _CalendarContext.getDefaultizedCalendarContext)({
353
+ hoveredDate: _this.state.hoveredDate,
354
+ value: _this.getDateInNativeFormat(props.value),
355
+ minDate: _this.getDateInNativeFormat(props.minDate),
356
+ maxDate: _this.getDateInNativeFormat(props.maxDate),
357
+ periodEndDate: _this.getDateInNativeFormat(props.periodEndDate),
358
+ periodStartDate: _this.getDateInNativeFormat(props.periodStartDate),
359
+ isHoliday: props.isHoliday,
360
+ renderDay: props.renderDay,
361
+ today: CalendarUtils.getTodayDate(),
362
+ onStuckMonth: _this.debouncedStuckMonth });
363
+
364
+
285
365
  return /*#__PURE__*/(
286
366
  _react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: _this.setRootNode }, props), /*#__PURE__*/
287
- _react.default.createElement("div", { ref: _this.refRoot, "data-tid": CalendarDataTids.root, className: (0, _Emotion.cx)(_Calendar.styles.root(_this.theme)) }, /*#__PURE__*/
288
- _react.default.createElement("div", { style: wrapperStyle, className: _Calendar.styles.wrapper() },
289
- _this.state.months.
290
- map(function (x, i) {return [positions[i], x];}).
291
- filter(function (_ref2) {var top = _ref2[0],month = _ref2[1];return CalendarUtils.isMonthVisible(top, month, _this.theme);}).
292
- map(_this.renderMonth, (0, _assertThisInitialized2.default)(_this))), /*#__PURE__*/
367
+ _react.default.createElement("div", {
368
+ ref: _this.refRoot,
369
+ "data-tid": CalendarDataTids.root,
370
+ className: (0, _Emotion.cx)(_Calendar.styles.root(_this.theme)),
371
+ onMouseOver: _this.handleMouseHits,
372
+ onMouseOut: _this.handleMouseHits,
373
+ onClick: _this.handleClick }, /*#__PURE__*/
374
+
375
+ _react.default.createElement("div", { style: wrapperStyle, className: _Calendar.styles.wrapper() }, /*#__PURE__*/
376
+ _react.default.createElement(_CalendarContext.CalendarContext.Provider, { value: context },
377
+ monthsForRender.map(_this.renderMonth, (0, _assertThisInitialized2.default)(_this)))), /*#__PURE__*/
378
+
293
379
 
294
380
  _react.default.createElement("div", { className: _Calendar.styles.separator(_this.theme) }))));
295
381
 
@@ -336,27 +422,6 @@ Calendar = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
336
422
 
337
423
 
338
424
 
339
-
340
-
341
- isHoliday = function (_ref3) {var date = _ref3.date,month = _ref3.month,year = _ref3.year,isWeekend = _ref3.isWeekend;
342
- var dateString = _InternalDateTransformer.InternalDateTransformer.dateToInternalString({ date: date, month: month + 1, year: year });
343
-
344
- return _this.getProps().isHoliday(dateString, isWeekend);
345
- };_this.
346
-
347
- handleDateChange = function (dateShape) {
348
- var value = _InternalDateTransformer.InternalDateTransformer.dateToInternalString({
349
- date: dateShape.date,
350
- month: dateShape.month + 1,
351
- year: dateShape.year });
352
-
353
-
354
- if (_this.props.onValueChange) {
355
- _this.props.onValueChange(value);
356
- }
357
- };_this.
358
-
359
-
360
425
 
361
426
 
362
427
 
@@ -373,10 +438,12 @@ Calendar = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
373
438
 
374
439
  handleMonthYearChange = function (month, year) {
375
440
  _this.scrollToMonth(month, year);
441
+
442
+ _this.props.onMonthSelect == null ? void 0 : _this.props.onMonthSelect({ month: CalendarUtils.getMonthInHumanFormat(month), year: year });
376
443
  };_this.
377
444
 
378
445
  executeAnimations = function (pixelY) {
379
- _this.setState(function (_ref4) {var months = _ref4.months,scrollPosition = _ref4.scrollPosition;
446
+ _this.setState(function (_ref2) {var months = _ref2.months,scrollPosition = _ref2.scrollPosition;
380
447
  var targetPosition = CalendarUtils.calculateScrollPosition(
381
448
  months,
382
449
  scrollPosition,
@@ -437,12 +504,12 @@ Calendar = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
437
504
  scrollToNearestWeek = function () {
438
505
  var _this$state = _this.state,scrollTarget = _this$state.scrollTarget,scrollDirection = _this$state.scrollDirection;
439
506
 
440
- var trasholdHeight = (0, _config.themeConfig)(_this.theme).MONTH_TITLE_OFFSET_HEIGHT + (0, _config.themeConfig)(_this.theme).DAY_SIZE;
507
+ var thresholdHeight = (0, _config.themeConfig)(_this.theme).MONTH_TITLE_OFFSET_HEIGHT + (0, _config.themeConfig)(_this.theme).DAY_HEIGHT;
441
508
 
442
- if (scrollTarget < trasholdHeight) {
509
+ if (scrollTarget < thresholdHeight) {
443
510
  var targetPosition = 0;
444
511
  if (scrollDirection < 0) {
445
- targetPosition = trasholdHeight;
512
+ targetPosition = thresholdHeight;
446
513
  }
447
514
 
448
515
  _this.setState({ scrollTarget: targetPosition }, function () {
@@ -464,13 +531,31 @@ Calendar = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
464
531
  return _this.animation.animate(
465
532
  scrollAmmount,
466
533
  function (deltaY) {
467
- _this.setState(function (_ref5) {var scrollPosition = _ref5.scrollPosition;return {
534
+ _this.setState(function (_ref3) {var scrollPosition = _ref3.scrollPosition;return {
468
535
  scrollPosition: scrollPosition + deltaY };});
469
536
 
470
537
  },
471
538
  onEnd);
472
539
 
473
- };var _this$getProps = _this.getProps(),_minDate = _this$getProps.minDate,_maxDate = _this$getProps.maxDate,_value = _this$getProps.value;var minDateShape = _this.getDateInNativeFormat(_minDate);var maxDateShape = _this.getDateInNativeFormat(_maxDate);var _dateShape = _this.getDateInNativeFormat(_value);var today = CalendarUtils.getTodayDate();var initialDate = CalendarUtils.getInitialDate({ today: today, date: _dateShape, minDate: minDateShape, maxDate: maxDateShape });var initialMonth = (_CalendarUtils$getMon = CalendarUtils.getMonthInNativeFormat(_this.props.initialMonth)) != null ? _CalendarUtils$getMon : initialDate.month;var initialYear = (_this$props$initialYe = _this.props.initialYear) != null ? _this$props$initialYe : initialDate.year;_this.state = { scrollPosition: 0, months: CalendarUtils.getMonths(initialMonth, initialYear), today: today, scrollDirection: 1, scrollTarget: 0 };return _this;}var _proto = Calendar.prototype;_proto.componentDidUpdate = function componentDidUpdate(prevProps) {var value = this.props.value;if (value && !(0, _shallowequal.default)(value, prevProps.value)) {var _date = new _InternalDate.InternalDate().parseValue(value).getComponentsLikeNumber();this.scrollToMonth(_date.month - 1, _date.year);}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.animation.inProgress()) {this.animation.cancel();}};_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});} /**
540
+ };_this.
541
+
542
+ handleMouseHits = function (e) {
543
+ if (CalendarUtils.hasDayElement(e)) {
544
+ var hoveredDate = _this.getDateInNativeFormat(e.target.dataset.date);
545
+ if (e.type === 'mouseover' && hoveredDate) {
546
+ _this.setState({ hoveredDate: hoveredDate });
547
+ }
548
+ if (e.type === 'mouseout') {
549
+ _this.setState({ hoveredDate: null });
550
+ }
551
+ }
552
+ };_this.
553
+
554
+ handleClick = function (e) {
555
+ if (CalendarUtils.hasDayElement(e)) {
556
+ _this.props.onValueChange == null ? void 0 : _this.props.onValueChange(e.target.dataset.date);
557
+ }
558
+ };var _this$getProps = _this.getProps(),_minDate = _this$getProps.minDate,_maxDate = _this$getProps.maxDate,value = _this$getProps.value;var minDateShape = _this.getDateInNativeFormat(_minDate);var maxDateShape = _this.getDateInNativeFormat(_maxDate);var dateShape = _this.getDateInNativeFormat(value);var today = CalendarUtils.getTodayDate();var initialDate = CalendarUtils.getInitialDate({ today: today, date: dateShape, minDate: minDateShape, maxDate: maxDateShape });var initialMonth = (_CalendarUtils$getMon = CalendarUtils.getMonthInNativeFormat(_this.props.initialMonth)) != null ? _CalendarUtils$getMon : initialDate.month;var initialYear = (_this$props$initialYe = _this.props.initialYear) != null ? _this$props$initialYe : initialDate.year;_this.state = { scrollPosition: 0, months: CalendarUtils.getMonths(initialMonth, initialYear), scrollDirection: 1, scrollTarget: 0, hoveredDate: null };return _this;}var _proto = Calendar.prototype;_proto.componentDidUpdate = function componentDidUpdate(prevProps) {var value = this.props.value;if (value && !(0, _shallowequal.default)(value, prevProps.value)) {var _date = new _InternalDate.InternalDate().parseValue(value).getComponentsLikeNumber();this.scrollToMonth(_date.month - 1, _date.year);}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.animation.inProgress()) {this.animation.cancel();}};_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});} /**
474
559
  * Прокручивает календарь до переданной даты
475
560
  * @public
476
- */;_proto.renderMonth = function renderMonth(_ref6) {var top = _ref6[0],month = _ref6[1];var date = this.getDateInNativeFormat(this.props.value);var minDate = this.getDateInNativeFormat(this.props.minDate);var maxDate = this.getDateInNativeFormat(this.props.maxDate);return /*#__PURE__*/_react.default.createElement(_Month.Month, { key: month.month + '-' + month.year, top: top, month: month, maxDate: maxDate, minDate: minDate, today: this.state.today, value: date, onDateClick: this.handleDateChange, onMonthYearChange: this.handleMonthYearChange, isHoliday: this.isHoliday });};_proto.getDateInNativeFormat = function getDateInNativeFormat(date) {return new _InternalDate.InternalDate().parseValue(date).toNativeFormat();};_proto.getMonthPositions = function getMonthPositions() {var _this$state2 = this.state,scrollPosition = _this$state2.scrollPosition,months = _this$state2.months;var positions = [scrollPosition - months[0].getHeight(this.theme)];for (var i = 1; i < months.length; i++) {var position = positions[i - 1] + months[i - 1].getHeight(this.theme);positions.push(position);}return positions;};return Calendar;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Calendar', _class2.defaultProps = { minDate: _class2.formatDate(_constants.MIN_DATE, _constants.MIN_MONTH, _constants.MIN_YEAR), maxDate: _class2.formatDate(_constants.MAX_DATE, _constants.MAX_MONTH, _constants.MAX_YEAR), isHoliday: function isHoliday(_day, isWeekend) {return isWeekend;} }, _temp)) || _class;exports.Calendar = Calendar;
561
+ */;_proto.renderMonth = function renderMonth(_ref4) {var top = _ref4[0],month = _ref4[1];return /*#__PURE__*/_react.default.createElement(_Month.Month, { key: month.month + '-' + month.year, top: top, month: month, onMonthYearChange: this.handleMonthYearChange });};_proto.getDateInNativeFormat = function getDateInNativeFormat(date) {return new _InternalDate.InternalDate().parseValue(date).toNativeFormat();};_proto.getMonthPositions = function getMonthPositions(months, scrollPosition) {var positions = [scrollPosition - months[0].getHeight(this.theme)];for (var i = 1; i < months.length; i++) {var position = positions[i - 1] + months[i - 1].getHeight(this.theme);positions.push(position);}return positions;};_proto.getVisibleMonths = function getVisibleMonths(state) {var _this3 = this;var months = state.months,scrollPosition = state.scrollPosition;var positions = this.getMonthPositions(months, scrollPosition);return months.map(function (x, i) {return [positions[i], x];}).filter(function (_ref5) {var top = _ref5[0],month = _ref5[1];return CalendarUtils.isMonthVisible(top, month, _this3.theme);});};return Calendar;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Calendar', _class2.defaultProps = { minDate: _class2.formatDate(_constants.MIN_DATE, _constants.MIN_MONTH, _constants.MIN_YEAR), maxDate: _class2.formatDate(_constants.MAX_DATE, _constants.MAX_MONTH, _constants.MAX_YEAR), isHoliday: function isHoliday(_day, isWeekend) {return isWeekend;} }, _temp)) || _class;exports.Calendar = Calendar;