@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.
- package/CHANGELOG.md +23 -149
- package/LICENSE +21 -21
- package/cjs/components/Calendar/Calendar.d.ts +62 -3
- package/cjs/components/Calendar/Calendar.js +122 -37
- package/cjs/components/Calendar/Calendar.js.map +1 -1
- package/cjs/components/Calendar/Calendar.md +112 -0
- package/cjs/components/Calendar/Calendar.styles.js +1 -1
- package/cjs/components/Calendar/Calendar.styles.js.map +1 -1
- package/cjs/components/Calendar/CalendarContext.d.ts +17 -0
- package/cjs/components/Calendar/CalendarContext.js +27 -0
- package/cjs/components/Calendar/CalendarContext.js.map +1 -0
- package/cjs/components/Calendar/CalendarDateShape.d.ts +2 -2
- package/cjs/components/Calendar/CalendarDateShape.js +1 -1
- package/cjs/components/Calendar/CalendarDateShape.js.map +1 -1
- package/cjs/components/Calendar/CalendarUtils.d.ts +9 -0
- package/cjs/components/Calendar/CalendarUtils.js +13 -3
- package/cjs/components/Calendar/CalendarUtils.js.map +1 -1
- package/cjs/components/Calendar/DayCellView.d.ts +27 -12
- package/cjs/components/Calendar/DayCellView.js +116 -25
- package/cjs/components/Calendar/DayCellView.js.map +1 -1
- package/cjs/components/Calendar/DayCellView.styles.d.ts +5 -0
- package/cjs/components/Calendar/DayCellView.styles.js +46 -12
- package/cjs/components/Calendar/DayCellView.styles.js.map +1 -1
- package/cjs/components/Calendar/Month.d.ts +1 -10
- package/cjs/components/Calendar/Month.js +15 -76
- package/cjs/components/Calendar/Month.js.map +1 -1
- package/cjs/components/Calendar/MonthView.d.ts +0 -3
- package/cjs/components/Calendar/MonthView.js +15 -6
- package/cjs/components/Calendar/MonthView.js.map +1 -1
- package/cjs/components/Calendar/MonthView.styles.js +1 -1
- package/cjs/components/Calendar/MonthView.styles.js.map +1 -1
- package/cjs/components/Calendar/MonthViewModel.js +4 -3
- package/cjs/components/Calendar/MonthViewModel.js.map +1 -1
- package/cjs/components/Calendar/config.js +6 -3
- package/cjs/components/Calendar/config.js.map +1 -1
- package/cjs/components/Calendar/index.d.ts +1 -0
- package/cjs/components/Calendar/index.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.d.ts +3 -1
- package/cjs/components/DatePicker/DatePicker.js +9 -2
- package/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.md +24 -1
- package/cjs/components/DatePicker/DatePickerHelpers.js +2 -1
- package/cjs/components/DatePicker/DatePickerHelpers.js.map +1 -1
- package/cjs/components/Gapped/Gapped.md +43 -43
- package/cjs/components/Hint/Hint.js +2 -1
- package/cjs/components/Hint/Hint.js.map +1 -1
- package/cjs/components/Kebab/Kebab.js +1 -1
- package/cjs/components/Kebab/Kebab.js.map +1 -1
- package/cjs/components/Paging/Paging.js +1 -1
- package/cjs/components/Paging/Paging.js.map +1 -1
- package/cjs/components/Paging/Paging.styles.js +2 -1
- package/cjs/components/Paging/Paging.styles.js.map +1 -1
- package/cjs/components/RadioGroup/RadioGroup.md +43 -43
- package/cjs/components/Token/Token.md +112 -112
- package/cjs/hooks/usePrevious.d.ts +1 -0
- package/cjs/hooks/usePrevious.js +9 -0
- package/cjs/hooks/usePrevious.js.map +1 -0
- package/cjs/internal/DateSelect/locale/locales/en.js +2 -1
- package/cjs/internal/DateSelect/locale/locales/en.js.map +1 -1
- package/cjs/internal/DateSelect/locale/locales/ru.js +2 -1
- package/cjs/internal/DateSelect/locale/locales/ru.js.map +1 -1
- package/cjs/internal/DateSelect/locale/types.d.ts +1 -0
- package/cjs/internal/NativeDateInput/utils.js +3 -2
- package/cjs/internal/NativeDateInput/utils.js.map +1 -1
- package/cjs/internal/ThemeShowcase/ThemeShowcase.md +13 -13
- package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
- package/cjs/internal/themes/DefaultTheme.d.ts +3 -0
- package/cjs/internal/themes/DefaultTheme.js +10 -3
- package/cjs/internal/themes/DefaultTheme.js.map +1 -1
- package/cjs/internal/themes/Theme2022.d.ts +4 -0
- package/cjs/internal/themes/Theme2022.js +11 -2
- package/cjs/internal/themes/Theme2022.js.map +1 -1
- package/cjs/internal/themes/Theme2022Dark.d.ts +5 -0
- package/cjs/internal/themes/Theme2022Dark.js +6 -1
- package/cjs/internal/themes/Theme2022Dark.js.map +1 -1
- package/cjs/lib/date/InternalDate.d.ts +2 -0
- package/cjs/lib/date/InternalDate.js +8 -1
- package/cjs/lib/date/InternalDate.js.map +1 -1
- package/cjs/lib/date/InternalDateTransformer.d.ts +2 -0
- package/cjs/lib/date/InternalDateTransformer.js +15 -0
- package/cjs/lib/date/InternalDateTransformer.js.map +1 -1
- package/cjs/lib/date/InternalDateValidator.js +2 -1
- package/cjs/lib/date/InternalDateValidator.js.map +1 -1
- package/cjs/lib/locale/constants.d.ts +3 -0
- package/cjs/lib/locale/constants.js +6 -2
- package/cjs/lib/locale/constants.js.map +1 -1
- package/components/Calendar/Calendar/Calendar.js +86 -65
- package/components/Calendar/Calendar/Calendar.js.map +1 -1
- package/components/Calendar/Calendar.d.ts +62 -3
- package/components/Calendar/Calendar.md +112 -0
- package/components/Calendar/Calendar.styles/Calendar.styles.js +1 -1
- package/components/Calendar/Calendar.styles/Calendar.styles.js.map +1 -1
- package/components/Calendar/CalendarContext/CalendarContext.js +13 -0
- package/components/Calendar/CalendarContext/CalendarContext.js.map +1 -0
- package/components/Calendar/CalendarContext/package.json +6 -0
- package/components/Calendar/CalendarContext.d.ts +17 -0
- package/components/Calendar/CalendarDateShape/CalendarDateShape.js +1 -1
- package/components/Calendar/CalendarDateShape/CalendarDateShape.js.map +1 -1
- package/components/Calendar/CalendarDateShape.d.ts +2 -2
- package/components/Calendar/CalendarUtils/CalendarUtils.js +7 -0
- package/components/Calendar/CalendarUtils/CalendarUtils.js.map +1 -1
- package/components/Calendar/CalendarUtils.d.ts +9 -0
- package/components/Calendar/DayCellView/DayCellView.js +95 -32
- package/components/Calendar/DayCellView/DayCellView.js.map +1 -1
- package/components/Calendar/DayCellView.d.ts +27 -12
- package/components/Calendar/DayCellView.styles/DayCellView.styles.js +22 -7
- package/components/Calendar/DayCellView.styles/DayCellView.styles.js.map +1 -1
- package/components/Calendar/DayCellView.styles.d.ts +5 -0
- package/components/Calendar/Month/Month.js +11 -77
- package/components/Calendar/Month/Month.js.map +1 -1
- package/components/Calendar/Month.d.ts +1 -10
- package/components/Calendar/MonthView/MonthView.js +17 -2
- package/components/Calendar/MonthView/MonthView.js.map +1 -1
- package/components/Calendar/MonthView.d.ts +0 -3
- package/components/Calendar/MonthView.styles/MonthView.styles.js +1 -1
- package/components/Calendar/MonthView.styles/MonthView.styles.js.map +1 -1
- package/components/Calendar/MonthViewModel/MonthViewModel.js +4 -3
- package/components/Calendar/MonthViewModel/MonthViewModel.js.map +1 -1
- package/components/Calendar/config/config.js +4 -3
- package/components/Calendar/config/config.js.map +1 -1
- package/components/Calendar/index/index.js +2 -1
- package/components/Calendar/index/index.js.map +1 -1
- package/components/Calendar/index.d.ts +1 -0
- package/components/DatePicker/DatePicker/DatePicker.js +7 -2
- package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
- package/components/DatePicker/DatePicker.d.ts +3 -1
- package/components/DatePicker/DatePicker.md +24 -1
- package/components/DatePicker/DatePickerHelpers/DatePickerHelpers.js +2 -1
- package/components/DatePicker/DatePickerHelpers/DatePickerHelpers.js.map +1 -1
- package/components/Gapped/Gapped.md +43 -43
- package/components/Hint/Hint/Hint.js +2 -1
- package/components/Hint/Hint/Hint.js.map +1 -1
- package/components/Kebab/Kebab/Kebab.js +1 -1
- package/components/Kebab/Kebab/Kebab.js.map +1 -1
- package/components/Paging/Paging/Paging.js +1 -1
- package/components/Paging/Paging/Paging.js.map +1 -1
- package/components/Paging/Paging.styles/Paging.styles.js +1 -1
- package/components/Paging/Paging.styles/Paging.styles.js.map +1 -1
- package/components/RadioGroup/RadioGroup.md +43 -43
- package/components/Token/Token.md +112 -112
- package/hooks/usePrevious/package.json +6 -0
- package/hooks/usePrevious/usePrevious.js +8 -0
- package/hooks/usePrevious/usePrevious.js.map +1 -0
- package/hooks/usePrevious.d.ts +1 -0
- package/internal/DateSelect/locale/locales/en/en.js +2 -1
- package/internal/DateSelect/locale/locales/en/en.js.map +1 -1
- package/internal/DateSelect/locale/locales/ru/ru.js +2 -1
- package/internal/DateSelect/locale/locales/ru/ru.js.map +1 -1
- package/internal/DateSelect/locale/types.d.ts +1 -0
- package/internal/NativeDateInput/utils/utils.js +2 -1
- package/internal/NativeDateInput/utils/utils.js.map +1 -1
- package/internal/ThemeShowcase/ThemeShowcase.md +13 -13
- package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
- package/internal/themes/DefaultTheme/DefaultTheme.js +13 -1
- package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
- package/internal/themes/DefaultTheme.d.ts +3 -0
- package/internal/themes/Theme2022/Theme2022.js +11 -3
- package/internal/themes/Theme2022/Theme2022.js.map +1 -1
- package/internal/themes/Theme2022.d.ts +4 -0
- package/internal/themes/Theme2022Dark/Theme2022Dark.js +9 -4
- package/internal/themes/Theme2022Dark/Theme2022Dark.js.map +1 -1
- package/internal/themes/Theme2022Dark.d.ts +5 -0
- package/lib/date/InternalDate/InternalDate.js +7 -1
- package/lib/date/InternalDate/InternalDate.js.map +1 -1
- package/lib/date/InternalDate.d.ts +2 -0
- package/lib/date/InternalDateTransformer/InternalDateTransformer.js +19 -0
- package/lib/date/InternalDateTransformer/InternalDateTransformer.js.map +1 -1
- package/lib/date/InternalDateTransformer.d.ts +2 -0
- package/lib/date/InternalDateValidator/InternalDateValidator.js +6 -1
- package/lib/date/InternalDateValidator/InternalDateValidator.js.map +1 -1
- package/lib/locale/constants/constants.js +4 -1
- package/lib/locale/constants/constants.js.map +1 -1
- package/lib/locale/constants.d.ts +3 -0
- 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.
|
|
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:**
|
|
20
|
-
*
|
|
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
|
-
* **
|
|
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
|
|
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
|
|
84
|
-
*
|
|
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
|
-
*
|
|
112
|
-
* **
|
|
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"));
|
|
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
|
|
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", {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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 (
|
|
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
|
|
507
|
+
var thresholdHeight = (0, _config.themeConfig)(_this.theme).MONTH_TITLE_OFFSET_HEIGHT + (0, _config.themeConfig)(_this.theme).DAY_HEIGHT;
|
|
441
508
|
|
|
442
|
-
if (scrollTarget <
|
|
509
|
+
if (scrollTarget < thresholdHeight) {
|
|
443
510
|
var targetPosition = 0;
|
|
444
511
|
if (scrollDirection < 0) {
|
|
445
|
-
targetPosition =
|
|
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 (
|
|
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
|
-
};
|
|
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(
|
|
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;
|