@jetbrains/ring-ui-built 7.0.107 → 7.0.108

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 (103) hide show
  1. package/components/_helpers/date-picker.js +1 -1
  2. package/components/_helpers/theme.js +15 -14
  3. package/components/alert-service/alert-service.d.ts +2 -2
  4. package/components/alert-service/alert-service.js +2 -2
  5. package/components/auth/auth-core.js +1 -0
  6. package/components/auth/auth.js +1 -0
  7. package/components/auth/iframe-flow.js +1 -0
  8. package/components/auth/token-validator.js +1 -0
  9. package/components/auth-dialog/auth-dialog.js +1 -0
  10. package/components/auth-dialog-service/auth-dialog-service.js +1 -0
  11. package/components/avatar/avatar.js +1 -0
  12. package/components/avatar-stack/avatar-stack.js +1 -0
  13. package/components/banner/banner.js +1 -0
  14. package/components/button-group/button-group.js +18 -1
  15. package/components/components/util-stories.js +3 -0
  16. package/components/confirm/confirm.js +1 -0
  17. package/components/confirm-service/confirm-service.js +1 -0
  18. package/components/data-list/data-list.js +1 -0
  19. package/components/data-list/selection.js +1 -0
  20. package/components/date-picker/animate-date.d.ts +1 -0
  21. package/components/date-picker/animate-date.js +39 -0
  22. package/components/date-picker/consts.d.ts +21 -4
  23. package/components/date-picker/consts.js +18 -1
  24. package/components/date-picker/date-picker.d.ts +48 -1
  25. package/components/date-picker/date-picker.js +44 -17
  26. package/components/date-picker/date-popup.d.ts +3 -9
  27. package/components/date-picker/date-popup.js +59 -72
  28. package/components/date-picker/day.js +24 -15
  29. package/components/date-picker/month-names.js +76 -72
  30. package/components/date-picker/month-slider.d.ts +5 -20
  31. package/components/date-picker/month-slider.js +129 -47
  32. package/components/date-picker/month.d.ts +4 -0
  33. package/components/date-picker/month.js +81 -76
  34. package/components/date-picker/months.js +75 -191
  35. package/components/date-picker/scroll-arith.d.ts +35 -0
  36. package/components/date-picker/scroll-arith.js +74 -0
  37. package/components/date-picker/use-intersection-observer.d.ts +6 -0
  38. package/components/date-picker/use-intersection-observer.js +93 -0
  39. package/components/date-picker/use-scroll-behavior.d.ts +8 -0
  40. package/components/date-picker/use-scroll-behavior.js +223 -0
  41. package/components/date-picker/weekdays.js +3 -0
  42. package/components/date-picker/years.d.ts +1 -18
  43. package/components/date-picker/years.js +259 -78
  44. package/components/dialog/dialog.js +1 -0
  45. package/components/dropdown-menu/dropdown-menu.js +1 -0
  46. package/components/editable-heading/editable-heading.js +1 -0
  47. package/components/error-bubble/error-bubble.js +1 -0
  48. package/components/footer/footer.d.ts +1 -1
  49. package/components/global/dom.d.ts +1 -1
  50. package/components/global/dom.js +1 -1
  51. package/components/header/header.js +1 -0
  52. package/components/header/profile.js +1 -0
  53. package/components/header/services.js +1 -0
  54. package/components/header/smart-profile.js +1 -0
  55. package/components/header/smart-services.js +1 -0
  56. package/components/heading/heading.d.ts +4 -4
  57. package/components/list/list-item.js +1 -0
  58. package/components/list/list-users-groups-source.js +1 -0
  59. package/components/list/list.js +1 -0
  60. package/components/login-dialog/login-dialog.js +1 -0
  61. package/components/login-dialog/service.js +1 -0
  62. package/components/message/message.js +1 -0
  63. package/components/old-browsers-message/old-browsers-message-stop.js +1 -0
  64. package/components/old-browsers-message/old-browsers-message.js +1 -0
  65. package/components/old-browsers-message/white-list.js +3 -2
  66. package/components/pager/pager.js +1 -0
  67. package/components/popup/popup.js +1 -0
  68. package/components/popup/position-css.js +1 -0
  69. package/components/popup/position.js +1 -0
  70. package/components/popup-menu/popup-menu.js +1 -0
  71. package/components/query-assist/query-assist-suggestions.js +1 -0
  72. package/components/query-assist/query-assist.js +1 -0
  73. package/components/select/select-filter.js +1 -0
  74. package/components/select/select-popup.js +1 -0
  75. package/components/select/select.js +1 -0
  76. package/components/shortcuts/core.js +1 -0
  77. package/components/shortcuts/shortcuts-hoc.js +1 -0
  78. package/components/shortcuts/shortcuts.js +1 -0
  79. package/components/slider/slider.js +1 -0
  80. package/components/style.css +1 -1
  81. package/components/table/disable-hover-hoc.js +1 -0
  82. package/components/table/multitable.js +1 -0
  83. package/components/table/row-with-focus-sensor.js +1 -0
  84. package/components/table/row.js +1 -0
  85. package/components/table/simple-table.js +1 -0
  86. package/components/table/smart-table.js +1 -0
  87. package/components/table/table.js +1 -0
  88. package/components/tabs/collapsible-more.js +1 -0
  89. package/components/tabs/collapsible-tabs.js +1 -0
  90. package/components/tabs/dumb-tabs.js +1 -0
  91. package/components/tabs/smart-tabs.js +1 -0
  92. package/components/tabs/tabs.js +1 -0
  93. package/components/tags-input/tags-input.js +1 -0
  94. package/components/tooltip/tooltip.js +1 -0
  95. package/components/user-agreement/service.js +1 -0
  96. package/components/user-agreement/user-agreement.js +1 -0
  97. package/components/user-card/card.js +1 -0
  98. package/components/user-card/smart-user-card-tooltip.js +1 -0
  99. package/components/user-card/tooltip.js +1 -0
  100. package/components/user-card/user-card.js +1 -0
  101. package/components/util-stories.d.ts +1 -0
  102. package/package.json +3 -3
  103. package/typings.d.ts +5 -0
@@ -0,0 +1,223 @@
1
+ import { c } from 'react-compiler-runtime';
2
+ import { useState, useRef, useEffect, useLayoutEffect } from 'react';
3
+ import units, { isSafariOnIPhone, scrollerReRenderDelayIPhone } from './consts.js';
4
+ import useEventCallback from '../global/use-event-callback.js';
5
+ import 'date-fns/add';
6
+ import '../global/sniffer.js';
7
+ import 'sniffr';
8
+
9
+ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDateSource, arith, scheduleScroll) {
10
+ const $ = c(39);
11
+ if ($[0] !== "5ce72fbec5594f0e31b7b5703cf53349d817d9722b565bfa743aaa359a97033d") {
12
+ for (let $i = 0; $i < 39; $i += 1) {
13
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
14
+ }
15
+ $[0] = "5ce72fbec5594f0e31b7b5703cf53349d817d9722b565bfa743aaa359a97033d";
16
+ }
17
+ let t0;
18
+ if ($[1] !== arith || $[2] !== scrollDate.date) {
19
+ t0 = () => arith.getItems(scrollDate.date);
20
+ $[1] = arith;
21
+ $[2] = scrollDate.date;
22
+ $[3] = t0;
23
+ } else {
24
+ t0 = $[3];
25
+ }
26
+ const [items, setItems] = useState(t0);
27
+ let t1;
28
+ if ($[4] !== arith || $[5] !== items || $[6] !== locale || $[7] !== scrollDate.date) {
29
+ t1 = () => arith.getScrollTop(items, scrollDate.date, locale);
30
+ $[4] = arith;
31
+ $[5] = items;
32
+ $[6] = locale;
33
+ $[7] = scrollDate.date;
34
+ $[8] = t1;
35
+ } else {
36
+ t1 = $[8];
37
+ }
38
+ const [scrollTop, setScrollTop] = useState(t1);
39
+ const containerRef = useRef(null);
40
+ let t2;
41
+ if ($[9] !== arith || $[10] !== items || $[11] !== locale) {
42
+ t2 = newScrollDate => {
43
+ const newScrollTopOnExistingItems = arith.getScrollTop(items, newScrollDate, locale);
44
+ if (isNearEdge(newScrollTopOnExistingItems, containerRef.current)) {
45
+ const {
46
+ newItems,
47
+ newScrollTop
48
+ } = arith.getItemsAndScrollTop(newScrollDate, locale);
49
+ setItems(newItems);
50
+ setScrollTop(newScrollTop);
51
+ } else {
52
+ setScrollTop(newScrollTopOnExistingItems);
53
+ }
54
+ };
55
+ $[9] = arith;
56
+ $[10] = items;
57
+ $[11] = locale;
58
+ $[12] = t2;
59
+ } else {
60
+ t2 = $[12];
61
+ }
62
+ const syncSelfState = useEventCallback(t2);
63
+ const didMountRef = useRef(false);
64
+ let t3;
65
+ if ($[13] !== scrollDate.date || $[14] !== scrollDate.source || $[15] !== selfScrollDateSource || $[16] !== syncSelfState) {
66
+ t3 = function onExternalScrollDateChange() {
67
+ if (!didMountRef.current) {
68
+ didMountRef.current = true;
69
+ return;
70
+ }
71
+ const container = containerRef.current;
72
+ if (!container) {
73
+ return;
74
+ }
75
+ if (scrollDate.source === selfScrollDateSource) {
76
+ return;
77
+ }
78
+ syncSelfState(scrollDate.date);
79
+ };
80
+ $[13] = scrollDate.date;
81
+ $[14] = scrollDate.source;
82
+ $[15] = selfScrollDateSource;
83
+ $[16] = syncSelfState;
84
+ $[17] = t3;
85
+ } else {
86
+ t3 = $[17];
87
+ }
88
+ let t4;
89
+ if ($[18] !== scrollDate || $[19] !== selfScrollDateSource || $[20] !== syncSelfState) {
90
+ t4 = [scrollDate, selfScrollDateSource, syncSelfState];
91
+ $[18] = scrollDate;
92
+ $[19] = selfScrollDateSource;
93
+ $[20] = syncSelfState;
94
+ $[21] = t4;
95
+ } else {
96
+ t4 = $[21];
97
+ }
98
+ useEffect(t3, t4);
99
+ const ignoreNextScrollEventRef = useRef(true);
100
+ let t5;
101
+ if ($[22] !== scrollTop) {
102
+ t5 = function setContainerScrollFromState() {
103
+ const container_0 = containerRef.current;
104
+ if (!container_0) {
105
+ return;
106
+ }
107
+ ignoreNextScrollEventRef.current = true;
108
+ container_0.scrollTop = scrollTop;
109
+ };
110
+ $[22] = scrollTop;
111
+ $[23] = t5;
112
+ } else {
113
+ t5 = $[23];
114
+ }
115
+ let t6;
116
+ if ($[24] !== items || $[25] !== scrollTop) {
117
+ t6 = [items, scrollTop];
118
+ $[24] = items;
119
+ $[25] = scrollTop;
120
+ $[26] = t6;
121
+ } else {
122
+ t6 = $[26];
123
+ }
124
+ useLayoutEffect(t5, t6);
125
+ const updateStateTimerRef = useRef(null);
126
+ let t7;
127
+ if ($[27] !== arith || $[28] !== items || $[29] !== locale || $[30] !== onContainerScroll || $[31] !== scheduleScroll || $[32] !== selfScrollDateSource) {
128
+ t7 = () => {
129
+ scheduleScroll(() => {
130
+ if (updateStateTimerRef.current != null) {
131
+ window.clearTimeout(updateStateTimerRef.current);
132
+ updateStateTimerRef.current = null;
133
+ }
134
+ const container_1 = containerRef.current;
135
+ if (!container_1) {
136
+ return;
137
+ }
138
+ if (ignoreNextScrollEventRef.current) {
139
+ ignoreNextScrollEventRef.current = false;
140
+ return;
141
+ }
142
+ const currentScrollTop = container_1.scrollTop;
143
+ const newScrollDate_0 = arith.getScrollDate(items, currentScrollTop, locale);
144
+ onContainerScroll({
145
+ date: newScrollDate_0,
146
+ source: selfScrollDateSource
147
+ });
148
+ if (isNearEdge(currentScrollTop, container_1)) {
149
+ const updateState = function updateState() {
150
+ const {
151
+ newItems: newItems_0,
152
+ newScrollTop: newScrollTop_0
153
+ } = arith.getItemsAndScrollTop(newScrollDate_0, locale);
154
+ setItems(newItems_0);
155
+ setScrollTop(newScrollTop_0);
156
+ updateStateTimerRef.current = null;
157
+ };
158
+ if (isSafariOnIPhone) {
159
+ updateStateTimerRef.current = window.setTimeout(updateState, scrollerReRenderDelayIPhone);
160
+ } else {
161
+ updateState();
162
+ }
163
+ }
164
+ });
165
+ };
166
+ $[27] = arith;
167
+ $[28] = items;
168
+ $[29] = locale;
169
+ $[30] = onContainerScroll;
170
+ $[31] = scheduleScroll;
171
+ $[32] = selfScrollDateSource;
172
+ $[33] = t7;
173
+ } else {
174
+ t7 = $[33];
175
+ }
176
+ const handleScroll = useEventCallback(t7);
177
+ let t8;
178
+ let t9;
179
+ if ($[34] !== handleScroll) {
180
+ t8 = () => {
181
+ const container_2 = containerRef.current;
182
+ if (!container_2) {
183
+ return;
184
+ }
185
+ container_2.addEventListener("scroll", handleScroll);
186
+ return () => {
187
+ container_2.removeEventListener("scroll", handleScroll);
188
+ if (updateStateTimerRef.current != null) {
189
+ window.clearTimeout(updateStateTimerRef.current);
190
+ updateStateTimerRef.current = null;
191
+ }
192
+ };
193
+ };
194
+ t9 = [handleScroll];
195
+ $[34] = handleScroll;
196
+ $[35] = t8;
197
+ $[36] = t9;
198
+ } else {
199
+ t8 = $[35];
200
+ t9 = $[36];
201
+ }
202
+ useEffect(t8, t9);
203
+ let t10;
204
+ if ($[37] !== items) {
205
+ t10 = {
206
+ containerRef,
207
+ items
208
+ };
209
+ $[37] = items;
210
+ $[38] = t10;
211
+ } else {
212
+ t10 = $[38];
213
+ }
214
+ return t10;
215
+ }
216
+ function isNearEdge(scrollTop, container) {
217
+ const scrollHeight = container.scrollHeight;
218
+ // eslint-disable-next-line no-magic-numbers
219
+ const scrollDistanceNearEdge = isSafariOnIPhone ? 5 : units.calHeight * 2;
220
+ return scrollTop <= scrollDistanceNearEdge || scrollHeight - units.calHeight - scrollTop <= scrollDistanceNearEdge;
221
+ }
222
+
223
+ export { useScrollBehavior };
@@ -1,3 +1,4 @@
1
+ import 'core-js/modules/es.array.includes.js';
1
2
  import { c } from 'react-compiler-runtime';
2
3
  import classNames from 'classnames';
3
4
  import { getDay } from 'date-fns/getDay';
@@ -8,6 +9,8 @@ import { shiftWeekArray, getWeekStartsOn, weekdays } from './consts.js';
8
9
  import { s as styles } from '../_helpers/date-picker.js';
9
10
  import { jsx } from 'react/jsx-runtime';
10
11
  import 'date-fns/add';
12
+ import '../global/sniffer.js';
13
+ import 'sniffr';
11
14
 
12
15
  function Weekdays(props) {
13
16
  const $ = c(9);
@@ -1,19 +1,2 @@
1
- import { PureComponent } from 'react';
2
1
  import { type CalendarProps } from './consts';
3
- interface YearsState {
4
- scrollDate: Date | null;
5
- }
6
- export default class Years extends PureComponent<CalendarProps> {
7
- state: {
8
- scrollDate: null;
9
- };
10
- componentDidMount(): void;
11
- componentDidUpdate(prevProps: CalendarProps, prevState: YearsState): void;
12
- componentWillUnmount(): void;
13
- stoppedScrolling?: boolean;
14
- setYear(date: number): void;
15
- componentRef: import("react").RefObject<HTMLDivElement | null>;
16
- handleWheel: (e: WheelEvent) => void;
17
- render(): import("react").JSX.Element;
18
- }
19
- export {};
2
+ export default function Years({ scrollDate, setScrollDate }: CalendarProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
- import { PureComponent, createRef } from 'react';
1
+ import { c } from 'react-compiler-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
2
3
  import classNames from 'classnames';
3
4
  import { addYears } from 'date-fns/addYears';
4
5
  import { getYear } from 'date-fns/getYear';
@@ -7,98 +8,278 @@ import { isSameYear } from 'date-fns/isSameYear';
7
8
  import { isThisYear } from 'date-fns/isThisYear';
8
9
  import { setYear } from 'date-fns/setYear';
9
10
  import { startOfYear } from 'date-fns/startOfYear';
10
- import { subYears } from 'date-fns/subYears';
11
- import linearFunction from '../global/linear-function.js';
12
- import units, { yearDuration, DOUBLE, HALF } from './consts.js';
11
+ import units, { yearsAnimationDuration, calendarSyncOnYearScrollUpdateDelay } from './consts.js';
12
+ import { ScrollArith } from './scroll-arith.js';
13
+ import { useScrollBehavior } from './use-scroll-behavior.js';
14
+ import { animateDate } from './animate-date.js';
15
+ import scheduleRAF from '../global/schedule-raf.js';
16
+ import { useIntersectionObserver, useVisibility } from './use-intersection-observer.js';
13
17
  import { s as styles } from '../_helpers/date-picker.js';
14
18
  import { jsx } from 'react/jsx-runtime';
15
19
  import 'date-fns/add';
20
+ import '../global/sniffer.js';
21
+ import 'sniffr';
22
+ import '../global/use-event-callback.js';
16
23
 
17
24
  const {
18
- yearHeight,
19
- calHeight
25
+ yearHeight
20
26
  } = units;
21
- let scrollTO;
22
- const YEARSBACK = 5;
23
- const scrollDelay = 100;
24
- class Years extends PureComponent {
25
- state = {
26
- scrollDate: null
27
- };
28
- componentDidMount() {
29
- if (this.componentRef.current) {
30
- this.componentRef.current.addEventListener('wheel', this.handleWheel);
27
+ const scrollArith = new ScrollArith({
28
+ itemsAround: 100,
29
+ floorToItem: startOfYear,
30
+ shiftItems: addYears,
31
+ getItemHeight: () => yearHeight
32
+ });
33
+ const scheduleScroll = scheduleRAF();
34
+ /**
35
+ * Reduces "empty" years during fast scrolling.
36
+ */
37
+ const intersectionObserverScrollMargin = units.calHeight / 2;
38
+ function Years(t0) {
39
+ const $ = c(24);
40
+ if ($[0] !== "aa5edf1b8146bb2f5048c50f376e591fc6fc5fcb5e70e35dc076528241c541c9") {
41
+ for (let $i = 0; $i < 24; $i += 1) {
42
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
31
43
  }
44
+ $[0] = "aa5edf1b8146bb2f5048c50f376e591fc6fc5fcb5e70e35dc076528241c541c9";
32
45
  }
33
- componentDidUpdate(prevProps, prevState) {
34
- this.stoppedScrolling = !!prevState.scrollDate && !this.state.scrollDate;
46
+ const {
47
+ scrollDate,
48
+ setScrollDate
49
+ } = t0;
50
+ const [localScrollDate, setLocalScrollDate] = useState(scrollDate);
51
+ const syncCleanupRef = useRef(null);
52
+ const animationCleanupRef = useRef(null);
53
+ let t1;
54
+ if ($[1] !== scrollDate.date || $[2] !== setScrollDate) {
55
+ t1 = newLocalScrollDate => {
56
+ syncCleanupRef.current?.();
57
+ animationCleanupRef.current?.();
58
+ let timerId = window.setTimeout(() => {
59
+ const newScrollDateWithPreservedMonthAndDay = setYear(scrollDate.date, getYear(newLocalScrollDate.date));
60
+ setScrollDate({
61
+ date: newScrollDateWithPreservedMonthAndDay,
62
+ source: "yearsScroll"
63
+ });
64
+ animationCleanupRef.current = animateDate(newLocalScrollDate.date, newScrollDateWithPreservedMonthAndDay, date => {
65
+ setLocalScrollDate({
66
+ date,
67
+ source: "other"
68
+ });
69
+ }, yearsAnimationDuration);
70
+ }, calendarSyncOnYearScrollUpdateDelay);
71
+ syncCleanupRef.current = () => {
72
+ if (timerId != null) {
73
+ window.clearTimeout(timerId);
74
+ timerId = null;
75
+ }
76
+ };
77
+ };
78
+ $[1] = scrollDate.date;
79
+ $[2] = setScrollDate;
80
+ $[3] = t1;
81
+ } else {
82
+ t1 = $[3];
35
83
  }
36
- componentWillUnmount() {
37
- if (this.componentRef.current) {
38
- this.componentRef.current.removeEventListener('wheel', this.handleWheel);
39
- }
84
+ const syncCalendarScrollDate = t1;
85
+ let t2;
86
+ let t3;
87
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
88
+ t2 = () => function cleanup() {
89
+ syncCleanupRef.current?.();
90
+ animationCleanupRef.current?.();
91
+ };
92
+ t3 = [];
93
+ $[4] = t2;
94
+ $[5] = t3;
95
+ } else {
96
+ t2 = $[4];
97
+ t3 = $[5];
40
98
  }
41
- stoppedScrolling;
42
- setYear(date) {
43
- if (scrollTO) {
44
- window.clearTimeout(scrollTO);
45
- scrollTO = null;
46
- }
47
- this.setState({
48
- scrollDate: null
49
- });
50
- this.props.onScroll(Number(setYear(this.props.scrollDate, getYear(date))));
99
+ useEffect(t2, t3);
100
+ let t4;
101
+ let t5;
102
+ if ($[6] !== scrollDate) {
103
+ t4 = function syncLocalScrollDate() {
104
+ if (scrollDate.source === "yearsScroll") {
105
+ return;
106
+ }
107
+ let timerId_0 = window.setTimeout(() => {
108
+ setLocalScrollDate(scrollDate);
109
+ timerId_0 = null;
110
+ });
111
+ return () => {
112
+ if (timerId_0 != null) {
113
+ window.clearTimeout(timerId_0);
114
+ timerId_0 = null;
115
+ }
116
+ };
117
+ };
118
+ t5 = [scrollDate, setLocalScrollDate];
119
+ $[6] = scrollDate;
120
+ $[7] = t4;
121
+ $[8] = t5;
122
+ } else {
123
+ t4 = $[7];
124
+ t5 = $[8];
51
125
  }
52
- componentRef = /*#__PURE__*/createRef();
53
- handleWheel = e => {
54
- const {
55
- scrollDate
56
- } = this.props;
57
- const date = this.state.scrollDate || scrollDate;
58
- e.preventDefault();
59
- const newScrollDate = linearFunction(0, Number(date), yearDuration / yearHeight).y(e.deltaY);
60
- this.setState({
61
- scrollDate: newScrollDate
62
- });
63
- if (scrollTO) {
64
- window.clearTimeout(scrollTO);
65
- }
66
- scrollTO = window.setTimeout(() => this.setYear(newScrollDate), scrollDelay);
67
- };
68
- render() {
69
- const {
70
- onScrollChange,
71
- scrollDate
72
- } = this.props;
73
- const date = this.state.scrollDate || scrollDate;
74
- const yearStart = startOfYear(date);
75
- let year = subYears(yearStart, YEARSBACK);
76
- const years = [year];
77
- for (let i = 0; i < YEARSBACK * DOUBLE; i++) {
78
- year = addYears(year, 1);
79
- years.push(year);
126
+ useEffect(t4, t5);
127
+ let t6;
128
+ if ($[9] !== localScrollDate.date || $[10] !== setScrollDate) {
129
+ t6 = year => {
130
+ const newScrollDate = setYear(localScrollDate.date, getYear(year));
131
+ setScrollDate({
132
+ date: newScrollDate,
133
+ source: "yearsScroll"
134
+ });
135
+ syncCleanupRef.current?.();
136
+ animationCleanupRef.current?.();
137
+ animationCleanupRef.current = animateDate(localScrollDate.date, newScrollDate, date_0 => {
138
+ setLocalScrollDate({
139
+ date: date_0,
140
+ source: "other"
141
+ });
142
+ }, yearsAnimationDuration);
143
+ };
144
+ $[9] = localScrollDate.date;
145
+ $[10] = setScrollDate;
146
+ $[11] = t6;
147
+ } else {
148
+ t6 = $[11];
149
+ }
150
+ const handleYearClick = t6;
151
+ const {
152
+ containerRef,
153
+ items
154
+ } = useScrollBehavior(localScrollDate, syncCalendarScrollDate, undefined, "yearsScroll", scrollArith, scheduleScroll);
155
+ const intersectionObserverHandle = useIntersectionObserver(containerRef, intersectionObserverScrollMargin);
156
+ let t7;
157
+ if ($[12] !== handleYearClick || $[13] !== intersectionObserverHandle || $[14] !== items || $[15] !== localScrollDate.date) {
158
+ let t8;
159
+ if ($[17] !== handleYearClick || $[18] !== intersectionObserverHandle || $[19] !== localScrollDate.date) {
160
+ t8 = year_0 => /*#__PURE__*/jsx(Year, {
161
+ year: year_0,
162
+ scrollDate: localScrollDate.date,
163
+ handleYearClick: handleYearClick,
164
+ intersectionObserverHandle: intersectionObserverHandle
165
+ }, +year_0);
166
+ $[17] = handleYearClick;
167
+ $[18] = intersectionObserverHandle;
168
+ $[19] = localScrollDate.date;
169
+ $[20] = t8;
170
+ } else {
171
+ t8 = $[20];
80
172
  }
81
- const pxToDate = linearFunction(0, Number(years[0]), yearDuration / yearHeight);
82
- return /*#__PURE__*/jsx("div", {
173
+ t7 = items.map(t8);
174
+ $[12] = handleYearClick;
175
+ $[13] = intersectionObserverHandle;
176
+ $[14] = items;
177
+ $[15] = localScrollDate.date;
178
+ $[16] = t7;
179
+ } else {
180
+ t7 = $[16];
181
+ }
182
+ let t8;
183
+ if ($[21] !== containerRef || $[22] !== t7) {
184
+ t8 = /*#__PURE__*/jsx("div", {
83
185
  className: styles.years,
84
- ref: this.componentRef,
85
- style: {
86
- transition: this.stoppedScrolling ? 'top .2s ease-out 0s' : 'none',
87
- top: Math.floor(calHeight * HALF - pxToDate.x(Number(date)))
88
- },
89
- children: years.map(item => /*#__PURE__*/jsx("button", {
90
- type: "button",
91
- className: classNames(styles.year, {
92
- [styles.currentYear]: isSameYear(item, date),
93
- [styles.today]: isThisYear(item)
94
- }),
95
- onClick: function handleClick() {
96
- onScrollChange(Number(setYear(scrollDate, getYear(item))));
97
- },
98
- children: format(item, 'yyyy')
99
- }, +item))
186
+ ref: containerRef,
187
+ "data-test": "ring-date-popup--years",
188
+ children: t7
100
189
  });
190
+ $[21] = containerRef;
191
+ $[22] = t7;
192
+ $[23] = t8;
193
+ } else {
194
+ t8 = $[23];
195
+ }
196
+ return t8;
197
+ }
198
+ function Year(t0) {
199
+ const $ = c(24);
200
+ if ($[0] !== "aa5edf1b8146bb2f5048c50f376e591fc6fc5fcb5e70e35dc076528241c541c9") {
201
+ for (let $i = 0; $i < 24; $i += 1) {
202
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
203
+ }
204
+ $[0] = "aa5edf1b8146bb2f5048c50f376e591fc6fc5fcb5e70e35dc076528241c541c9";
205
+ }
206
+ const {
207
+ year,
208
+ scrollDate,
209
+ handleYearClick,
210
+ intersectionObserverHandle
211
+ } = t0;
212
+ const buttonRef = useRef(null);
213
+ const visible = useVisibility(intersectionObserverHandle, buttonRef);
214
+ const t1 = +year;
215
+ const t2 = !visible;
216
+ let t3;
217
+ if ($[1] !== scrollDate || $[2] !== visible || $[3] !== year) {
218
+ t3 = visible && isSameYear(year, scrollDate) && styles.currentYear;
219
+ $[1] = scrollDate;
220
+ $[2] = visible;
221
+ $[3] = year;
222
+ $[4] = t3;
223
+ } else {
224
+ t3 = $[4];
225
+ }
226
+ let t4;
227
+ if ($[5] !== visible || $[6] !== year) {
228
+ t4 = visible && isThisYear(year) && styles.today;
229
+ $[5] = visible;
230
+ $[6] = year;
231
+ $[7] = t4;
232
+ } else {
233
+ t4 = $[7];
234
+ }
235
+ let t5;
236
+ if ($[8] !== t3 || $[9] !== t4) {
237
+ t5 = classNames(styles.year, t3, t4);
238
+ $[8] = t3;
239
+ $[9] = t4;
240
+ $[10] = t5;
241
+ } else {
242
+ t5 = $[10];
243
+ }
244
+ let t6;
245
+ if ($[11] !== handleYearClick || $[12] !== visible || $[13] !== year) {
246
+ t6 = visible ? () => handleYearClick(year) : undefined;
247
+ $[11] = handleYearClick;
248
+ $[12] = visible;
249
+ $[13] = year;
250
+ $[14] = t6;
251
+ } else {
252
+ t6 = $[14];
253
+ }
254
+ let t7;
255
+ if ($[15] !== visible || $[16] !== year) {
256
+ t7 = visible ? format(year, "yyyy") : "\xA0";
257
+ $[15] = visible;
258
+ $[16] = year;
259
+ $[17] = t7;
260
+ } else {
261
+ t7 = $[17];
262
+ }
263
+ let t8;
264
+ if ($[18] !== t1 || $[19] !== t2 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7) {
265
+ t8 = /*#__PURE__*/jsx("button", {
266
+ type: "button",
267
+ ref: buttonRef,
268
+ disabled: t2,
269
+ className: t5,
270
+ onClick: t6,
271
+ children: t7
272
+ }, t1);
273
+ $[18] = t1;
274
+ $[19] = t2;
275
+ $[20] = t5;
276
+ $[21] = t6;
277
+ $[22] = t7;
278
+ $[23] = t8;
279
+ } else {
280
+ t8 = $[23];
101
281
  }
282
+ return t8;
102
283
  }
103
284
 
104
285
  export { Years as default };
@@ -21,6 +21,7 @@ import '../island/content.js';
21
21
  import 'element-resize-detector';
22
22
  import '../global/schedule-raf.js';
23
23
  import '../shortcuts/core.js';
24
+ import 'core-js/modules/es.array.includes.js';
24
25
  import 'combokeys';
25
26
  import '../global/sniffer.js';
26
27
  import 'sniffr';
@@ -7,6 +7,7 @@ import getUID from '../global/get-uid.js';
7
7
  import { A as Anchor } from '../_helpers/anchor.js';
8
8
  import { isArray } from '../global/typescript-utils.js';
9
9
  import { jsx } from 'react/jsx-runtime';
10
+ import 'core-js/modules/es.array.includes.js';
10
11
  import 'classnames';
11
12
  import 'react-virtualized/dist/es/List';
12
13
  import 'react-virtualized/dist/es/AutoSizer';
@@ -29,6 +29,7 @@ import 'memoize-one';
29
29
  import '../control-label/control-label.js';
30
30
  import '../control-help/control-help.js';
31
31
  import '../shortcuts/core.js';
32
+ import 'core-js/modules/es.array.includes.js';
32
33
  import 'combokeys';
33
34
  import '../global/sniffer.js';
34
35
  import 'sniffr';
@@ -9,6 +9,7 @@ import '../global/schedule-raf.js';
9
9
  import '../global/dom.js';
10
10
  import '../shortcuts/shortcuts.js';
11
11
  import '../shortcuts/core.js';
12
+ import 'core-js/modules/es.array.includes.js';
12
13
  import 'combokeys';
13
14
  import '../global/sniffer.js';
14
15
  import 'sniffr';
@@ -24,5 +24,5 @@ export interface FooterProps {
24
24
  center?: FooterItems | null | undefined;
25
25
  right?: FooterItems | null | undefined;
26
26
  }
27
- declare const Footer: import("react").NamedExoticComponent<FooterProps>;
27
+ declare const Footer: import("react").MemoExoticComponent<({ floating, className, left, center, right }: FooterProps) => import("react").JSX.Element>;
28
28
  export default Footer;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { type SyntheticEvent } from 'react';
5
5
  import type { PropertiesHyphen } from 'csstype';
6
- export declare const getStyles: ((elt: Element, pseudoElt?: string | null) => CSSStyleDeclaration) & typeof getComputedStyle;
6
+ export declare const getStyles: typeof window.getComputedStyle;
7
7
  export declare function isMounted(node: Node | Range | null | undefined): boolean;
8
8
  export interface Rect {
9
9
  top: number;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name DOM
3
3
  */
4
- const getStyles = window.getComputedStyle.bind(window);
4
+ const getStyles = (...args) => window.getComputedStyle(...args);
5
5
  function isMounted(node) {
6
6
  if (node === document) {
7
7
  return true;