@jetbrains/ring-ui-built 7.0.115 → 8.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/_helpers/anchor.js +1 -1
- package/components/_helpers/avatar-info.js +1 -1
- package/components/_helpers/icon-svg.js +1 -1
- package/components/_helpers/legacy-table.js +3 -0
- package/components/_helpers/tab-link.js +1 -1
- package/components/_helpers/table.js +2 -2
- package/components/_helpers/theme.js +49 -37
- package/components/alert/alert.js +1 -1
- package/components/alert-service/alert-service.js +1 -1
- package/components/auth/auth-core.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.js +1 -1
- package/components/auth/storage.js +1 -1
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +2 -2
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/fallback-avatar.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.js +1 -1
- package/components/button/button.js +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard.js +1 -1
- package/components/collapse/collapse-content.js +5 -5
- package/components/collapse/collapse-control.js +5 -5
- package/components/collapse/collapse.js +4 -4
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +2 -2
- package/components/contenteditable/contenteditable.js +1 -1
- package/components/control-help/control-help.js +1 -1
- package/components/control-label/control-label.js +1 -1
- package/components/data-list/data-list.d.ts +4 -4
- package/components/data-list/data-list.js +3 -3
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +1 -1
- package/components/data-list/item.d.ts +1 -1
- package/components/data-list/item.js +1 -1
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +2 -2
- package/components/data-list/title.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-picker.js +2 -3
- package/components/date-picker/date-popup.js +2 -3
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.d.ts +0 -2
- package/components/date-picker/month.js +17 -18
- package/components/date-picker/months.js +43 -35
- package/components/date-picker/use-intersection-observer.js +1 -1
- package/components/date-picker/use-scroll-behavior.js +45 -44
- package/components/date-picker/weekdays.js +1 -1
- package/components/date-picker/years.js +61 -54
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +3 -3
- package/components/dropdown/anchor.js +1 -1
- package/components/dropdown/dropdown.js +1 -1
- package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
- package/components/dropdown-menu/dropdown-menu.js +62 -57
- package/components/editable-heading/editable-heading.d.ts +1 -2
- package/components/editable-heading/editable-heading.js +13 -12
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +1 -1
- package/components/expand/collapsible-group.d.ts +5 -1
- package/components/expand/collapsible-group.js +15 -14
- package/components/footer/footer.js +1 -1
- package/components/global/create-stateful-context.js +11 -11
- package/components/global/intersection-observer-context.d.ts +26 -0
- package/components/global/intersection-observer-context.js +140 -0
- package/components/global/rerender-hoc.d.ts +4 -2
- package/components/global/rerender-hoc.js +10 -24
- package/components/{table/selection.d.ts → global/table-selection.d.ts} +15 -15
- package/components/{table/selection.js → global/table-selection.js} +4 -4
- package/components/global/theme.d.ts +4 -3
- package/components/global/theme.js +1 -1
- package/components/header/header-icon.js +1 -1
- package/components/header/header.js +1 -1
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -1
- package/components/header/profile.js +1 -1
- package/components/header/services.js +1 -1
- package/components/header/smart-profile.js +1 -1
- package/components/header/smart-services.js +1 -1
- package/components/heading/heading.js +1 -1
- package/components/i18n/i18n-context.js +4 -4
- package/components/icon/icon-svg.js +1 -1
- package/components/icon/icon.js +1 -1
- package/components/icon/index.js +1 -1
- package/components/input/input.js +1 -1
- package/components/island/adaptive-island-hoc.js +3 -3
- package/components/island/content.d.ts +7 -2
- package/components/island/content.js +27 -18
- package/components/island/header.js +1 -1
- package/components/island/island.js +1 -1
- package/components/{table → legacy-table}/cell.js +1 -1
- package/components/{table → legacy-table}/header-cell.js +4 -4
- package/components/{table → legacy-table}/header.js +2 -2
- package/components/{table → legacy-table}/multitable.d.ts +1 -1
- package/components/{table → legacy-table}/row-with-focus-sensor.js +2 -2
- package/components/{table → legacy-table}/row.js +4 -4
- package/components/legacy-table/selection-adapter.d.ts +6 -0
- package/components/{table → legacy-table}/selection-shortcuts-hoc.d.ts +5 -5
- package/components/{table → legacy-table}/simple-table.d.ts +2 -2
- package/components/{table → legacy-table}/simple-table.js +4 -4
- package/components/{table → legacy-table}/smart-table.d.ts +5 -5
- package/components/{table → legacy-table}/smart-table.js +5 -5
- package/components/legacy-table/table.d.ts +109 -0
- package/components/legacy-table/table.js +369 -0
- package/components/list/list-item.js +1 -1
- package/components/list/list-users-groups-source.js +1 -1
- package/components/list/list.js +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.js +2 -2
- package/components/message/message.js +1 -1
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +1 -1
- package/components/popup/popup.js +1 -1
- package/components/popup/popup.target.d.ts +3 -2
- package/components/popup/popup.target.js +32 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/query-assist/query-assist-suggestions.js +1 -1
- package/components/query-assist/query-assist.d.ts +3 -1
- package/components/query-assist/query-assist.js +2 -2
- package/components/radio/radio-item.d.ts +3 -3
- package/components/radio/radio-item.js +32 -18
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +2 -2
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/chevron-button.js +1 -1
- package/components/select/select-filter.js +1 -1
- package/components/select/select-popup.js +1 -1
- package/components/select/select.d.ts +3 -1
- package/components/select/select.js +1 -1
- package/components/slider/slider.js +100 -96
- package/components/storage/storage-local.js +1 -1
- package/components/storage/storage.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +3 -3
- package/components/tab-trap/tab-trap.js +83 -80
- package/components/table/default-item-renderer.d.ts +36 -0
- package/components/table/default-item-renderer.js +182 -0
- package/components/table/table-component.d.ts +80 -0
- package/components/table/table-component.js +290 -0
- package/components/table/table-const.d.ts +8 -0
- package/components/table/table-const.js +11 -0
- package/components/table/table-primitives.d.ts +28 -0
- package/components/table/table-primitives.js +323 -0
- package/components/table/table-row-focus.d.ts +4 -0
- package/components/table/table-row-focus.js +41 -0
- package/components/table/table-virtualize.d.ts +32 -0
- package/components/table/table-virtualize.js +329 -0
- package/components/table/table.d.ts +206 -104
- package/components/table/table.js +19 -362
- package/components/tabs/collapsible-more.js +1 -1
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.js +1 -1
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tabs/tab-link.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.d.ts +3 -1
- package/components/tags-input/tags-input.js +1 -1
- package/components/tags-list/tags-list.js +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.js +2 -2
- package/components/upload/upload.d.ts +4 -3
- package/components/upload/upload.js +7 -29
- package/components/user-agreement/service.js +2 -2
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +1 -1
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.js +1 -1
- package/package.json +6 -6
- package/components/global/use-event-callback.d.ts +0 -1
- package/components/global/use-event-callback.js +0 -44
- package/components/table/selection-adapter.d.ts +0 -6
- /package/components/{table → legacy-table}/cell.d.ts +0 -0
- /package/components/{table → legacy-table}/disable-hover-hoc.d.ts +0 -0
- /package/components/{table → legacy-table}/disable-hover-hoc.js +0 -0
- /package/components/{table → legacy-table}/header-cell.d.ts +0 -0
- /package/components/{table → legacy-table}/header.d.ts +0 -0
- /package/components/{table → legacy-table}/multitable.js +0 -0
- /package/components/{table → legacy-table}/row-with-focus-sensor.d.ts +0 -0
- /package/components/{table → legacy-table}/row.d.ts +0 -0
- /package/components/{table → legacy-table}/selection-adapter.js +0 -0
- /package/components/{table → legacy-table}/selection-shortcuts-hoc.js +0 -0
|
@@ -13,7 +13,7 @@ import '../icon/icon.js';
|
|
|
13
13
|
import 'util-deprecate';
|
|
14
14
|
import '../icon/icon.constants.js';
|
|
15
15
|
import '../_helpers/icon-svg.js';
|
|
16
|
-
import 'react
|
|
16
|
+
import 'react/compiler-runtime';
|
|
17
17
|
import '../global/memoize.js';
|
|
18
18
|
import '../control-help/control-help.js';
|
|
19
19
|
import '../global/data-tests.js';
|
|
@@ -14,7 +14,7 @@ import 'util-deprecate';
|
|
|
14
14
|
import '../icon/icon.js';
|
|
15
15
|
import '../icon/icon.constants.js';
|
|
16
16
|
import '../_helpers/icon-svg.js';
|
|
17
|
-
import 'react
|
|
17
|
+
import 'react/compiler-runtime';
|
|
18
18
|
import '../global/memoize.js';
|
|
19
19
|
import '../link/clickable-link.js';
|
|
20
20
|
import '../_helpers/button.classes.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { format } from 'date-fns/format';
|
|
@@ -72,10 +72,9 @@ import 'date-fns/getDate';
|
|
|
72
72
|
import 'date-fns/isToday';
|
|
73
73
|
import './consts.js';
|
|
74
74
|
import 'date-fns/add';
|
|
75
|
-
import '
|
|
75
|
+
import '../global/intersection-observer-context.js';
|
|
76
76
|
import './scroll-arith.js';
|
|
77
77
|
import './use-scroll-behavior.js';
|
|
78
|
-
import '../global/use-event-callback.js';
|
|
79
78
|
import './years.js';
|
|
80
79
|
import 'date-fns/addYears';
|
|
81
80
|
import 'date-fns/getYear';
|
|
@@ -24,7 +24,7 @@ import 'util-deprecate';
|
|
|
24
24
|
import '../icon/icon.js';
|
|
25
25
|
import '../icon/icon.constants.js';
|
|
26
26
|
import '../_helpers/icon-svg.js';
|
|
27
|
-
import 'react
|
|
27
|
+
import 'react/compiler-runtime';
|
|
28
28
|
import '../link/clickable-link.js';
|
|
29
29
|
import '../global/controls-height.js';
|
|
30
30
|
import '../global/configuration.js';
|
|
@@ -50,10 +50,9 @@ import 'date-fns/isToday';
|
|
|
50
50
|
import 'date-fns/add';
|
|
51
51
|
import '../global/sniffer.js';
|
|
52
52
|
import 'sniffr';
|
|
53
|
-
import '
|
|
53
|
+
import '../global/intersection-observer-context.js';
|
|
54
54
|
import './scroll-arith.js';
|
|
55
55
|
import './use-scroll-behavior.js';
|
|
56
|
-
import '../global/use-event-callback.js';
|
|
57
56
|
import '../global/schedule-raf.js';
|
|
58
57
|
import 'date-fns/addYears';
|
|
59
58
|
import 'date-fns/getYear';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type Locale } from 'date-fns';
|
|
2
2
|
import { type MonthsProps } from './consts';
|
|
3
|
-
import { type IntersectionObserverHandle } from './use-intersection-observer';
|
|
4
3
|
export interface MonthProps extends MonthsProps {
|
|
5
4
|
month: Date;
|
|
6
|
-
intersectionObserverHandle: IntersectionObserverHandle | null;
|
|
7
5
|
}
|
|
8
6
|
export default function Month(props: MonthProps): import("react").JSX.Element;
|
|
9
7
|
export declare function getMonthHeight(monthStart: Date | number, locale: Locale | undefined): number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { format } from 'date-fns/format';
|
|
3
3
|
import { getDay } from 'date-fns/getDay';
|
|
4
4
|
import { getDaysInMonth, setDate } from 'date-fns';
|
|
5
5
|
import { useRef, createElement } from 'react';
|
|
6
6
|
import Day from './day.js';
|
|
7
7
|
import units, { getWeekStartsOn, WEEK } from './consts.js';
|
|
8
|
-
import {
|
|
8
|
+
import { useIsIntersecting } from '../global/intersection-observer-context.js';
|
|
9
9
|
import { s as styles } from '../_helpers/date-picker.js';
|
|
10
10
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
11
|
import 'core-js/modules/es.array.includes.js';
|
|
@@ -23,34 +23,33 @@ import 'sniffr';
|
|
|
23
23
|
|
|
24
24
|
function Month(props) {
|
|
25
25
|
const $ = c(13);
|
|
26
|
-
if ($[0] !== "
|
|
26
|
+
if ($[0] !== "f69b6ec913368865656f465501e81a8f3fab6df87b3d741c6b878c75ad08c0c9") {
|
|
27
27
|
for (let $i = 0; $i < 13; $i += 1) {
|
|
28
28
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
29
29
|
}
|
|
30
|
-
$[0] = "
|
|
30
|
+
$[0] = "f69b6ec913368865656f465501e81a8f3fab6df87b3d741c6b878c75ad08c0c9";
|
|
31
31
|
}
|
|
32
32
|
const {
|
|
33
33
|
month,
|
|
34
|
-
locale
|
|
35
|
-
intersectionObserverHandle
|
|
34
|
+
locale
|
|
36
35
|
} = props;
|
|
37
36
|
const containerRef = useRef(null);
|
|
38
|
-
const
|
|
37
|
+
const isIntersecting = useIsIntersecting(containerRef);
|
|
39
38
|
let t0;
|
|
40
|
-
if ($[1] !==
|
|
41
|
-
t0 =
|
|
39
|
+
if ($[1] !== isIntersecting || $[2] !== locale || $[3] !== month) {
|
|
40
|
+
t0 = isIntersecting ? {} : {
|
|
42
41
|
height: getMonthHeight(month, locale)
|
|
43
42
|
};
|
|
44
|
-
$[1] =
|
|
45
|
-
$[2] =
|
|
46
|
-
$[3] =
|
|
43
|
+
$[1] = isIntersecting;
|
|
44
|
+
$[2] = locale;
|
|
45
|
+
$[3] = month;
|
|
47
46
|
$[4] = t0;
|
|
48
47
|
} else {
|
|
49
48
|
t0 = $[4];
|
|
50
49
|
}
|
|
51
50
|
let t1;
|
|
52
|
-
if ($[5] !==
|
|
53
|
-
t1 =
|
|
51
|
+
if ($[5] !== isIntersecting || $[6] !== locale || $[7] !== month || $[8] !== props) {
|
|
52
|
+
t1 = isIntersecting && /*#__PURE__*/jsxs(Fragment, {
|
|
54
53
|
children: [/*#__PURE__*/jsx("span", {
|
|
55
54
|
className: styles.monthTitle,
|
|
56
55
|
children: format(month, "LLLL", {
|
|
@@ -72,10 +71,10 @@ function Month(props) {
|
|
|
72
71
|
key: i_0
|
|
73
72
|
}))]
|
|
74
73
|
});
|
|
75
|
-
$[5] =
|
|
76
|
-
$[6] =
|
|
77
|
-
$[7] =
|
|
78
|
-
$[8] =
|
|
74
|
+
$[5] = isIntersecting;
|
|
75
|
+
$[6] = locale;
|
|
76
|
+
$[7] = month;
|
|
77
|
+
$[8] = props;
|
|
79
78
|
$[9] = t1;
|
|
80
79
|
} else {
|
|
81
80
|
t1 = $[9];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { addMonths } from 'date-fns/addMonths';
|
|
3
3
|
import { startOfMonth } from 'date-fns/startOfMonth';
|
|
4
4
|
import Month, { getMonthHeight } from './month.js';
|
|
@@ -6,7 +6,7 @@ import units from './consts.js';
|
|
|
6
6
|
import { ScrollArith } from './scroll-arith.js';
|
|
7
7
|
import { useScrollBehavior } from './use-scroll-behavior.js';
|
|
8
8
|
import scheduleRAF from '../global/schedule-raf.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useIntersectionObserverHandle, IntersectionObserverContext } from '../global/intersection-observer-context.js';
|
|
10
10
|
import { s as styles } from '../_helpers/date-picker.js';
|
|
11
11
|
import { createElement } from 'react';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -26,7 +26,6 @@ import 'date-fns/startOfDay';
|
|
|
26
26
|
import 'date-fns/add';
|
|
27
27
|
import '../global/sniffer.js';
|
|
28
28
|
import 'sniffr';
|
|
29
|
-
import '../global/use-event-callback.js';
|
|
30
29
|
|
|
31
30
|
function getMonthHeightWithMargin(date, locale) {
|
|
32
31
|
return units.unit * 2 + getMonthHeight(date, locale);
|
|
@@ -44,16 +43,16 @@ const scheduleScroll = scheduleRAF();
|
|
|
44
43
|
*
|
|
45
44
|
* To avoid an unpainted gap at the viewport boundary, the next month must be reported
|
|
46
45
|
* as visible slightly before it actually enters the viewport. We achieve this by
|
|
47
|
-
* extending the IntersectionObserver
|
|
46
|
+
* extending the IntersectionObserver rootMargin.
|
|
48
47
|
*/
|
|
49
|
-
const
|
|
48
|
+
const intersectionObserverRootMargin = units.cellSize * 2;
|
|
50
49
|
function Months(props) {
|
|
51
|
-
const $ = c(
|
|
52
|
-
if ($[0] !== "
|
|
53
|
-
for (let $i = 0; $i <
|
|
50
|
+
const $ = c(12);
|
|
51
|
+
if ($[0] !== "b514d0ab3a898922fd1a8992e74c2054d3bf131f57e16e7ad928f67f5c608db9") {
|
|
52
|
+
for (let $i = 0; $i < 12; $i += 1) {
|
|
54
53
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
55
54
|
}
|
|
56
|
-
$[0] = "
|
|
55
|
+
$[0] = "b514d0ab3a898922fd1a8992e74c2054d3bf131f57e16e7ad928f67f5c608db9";
|
|
57
56
|
}
|
|
58
57
|
const {
|
|
59
58
|
scrollDate,
|
|
@@ -64,46 +63,55 @@ function Months(props) {
|
|
|
64
63
|
containerRef,
|
|
65
64
|
items
|
|
66
65
|
} = useScrollBehavior(scrollDate, setScrollDate, locale, "monthsScroll", scrollArith, scheduleScroll);
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
if ($[1] !==
|
|
70
|
-
let
|
|
71
|
-
if ($[
|
|
72
|
-
|
|
66
|
+
const t0 = useIntersectionObserverHandle(containerRef, intersectionObserverRootMargin);
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[1] !== items || $[2] !== props) {
|
|
69
|
+
let t2;
|
|
70
|
+
if ($[4] !== props) {
|
|
71
|
+
t2 = month => /*#__PURE__*/createElement(Month, {
|
|
73
72
|
...props,
|
|
74
73
|
month: month,
|
|
75
|
-
key: +month
|
|
76
|
-
intersectionObserverHandle: intersectionObserverHandle
|
|
74
|
+
key: +month
|
|
77
75
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[7] = t1;
|
|
76
|
+
$[4] = props;
|
|
77
|
+
$[5] = t2;
|
|
81
78
|
} else {
|
|
82
|
-
|
|
79
|
+
t2 = $[5];
|
|
83
80
|
}
|
|
84
|
-
|
|
85
|
-
$[1] =
|
|
86
|
-
$[2] =
|
|
87
|
-
$[3] =
|
|
88
|
-
$[4] = t0;
|
|
81
|
+
t1 = items.map(t2);
|
|
82
|
+
$[1] = items;
|
|
83
|
+
$[2] = props;
|
|
84
|
+
$[3] = t1;
|
|
89
85
|
} else {
|
|
90
|
-
|
|
86
|
+
t1 = $[3];
|
|
91
87
|
}
|
|
92
|
-
let
|
|
93
|
-
if ($[
|
|
94
|
-
|
|
88
|
+
let t2;
|
|
89
|
+
if ($[6] !== containerRef || $[7] !== t1) {
|
|
90
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
95
91
|
className: styles.months,
|
|
96
92
|
ref: containerRef,
|
|
97
93
|
"data-test": "ring-date-popup--months",
|
|
98
|
-
children:
|
|
94
|
+
children: t1
|
|
95
|
+
});
|
|
96
|
+
$[6] = containerRef;
|
|
97
|
+
$[7] = t1;
|
|
98
|
+
$[8] = t2;
|
|
99
|
+
} else {
|
|
100
|
+
t2 = $[8];
|
|
101
|
+
}
|
|
102
|
+
let t3;
|
|
103
|
+
if ($[9] !== t0 || $[10] !== t2) {
|
|
104
|
+
t3 = /*#__PURE__*/jsx(IntersectionObserverContext, {
|
|
105
|
+
value: t0,
|
|
106
|
+
children: t2
|
|
99
107
|
});
|
|
100
|
-
$[8] = containerRef;
|
|
101
108
|
$[9] = t0;
|
|
102
|
-
$[10] =
|
|
109
|
+
$[10] = t2;
|
|
110
|
+
$[11] = t3;
|
|
103
111
|
} else {
|
|
104
|
-
|
|
112
|
+
t3 = $[11];
|
|
105
113
|
}
|
|
106
|
-
return
|
|
114
|
+
return t3;
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
export { Months as default };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { c } from 'react
|
|
2
|
-
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useState, useRef, useEffectEvent, useEffect, useLayoutEffect } from 'react';
|
|
3
3
|
import units, { isSafariOnIPhone, scrollerReRenderDelayIPhone } from './consts.js';
|
|
4
|
-
import useEventCallback from '../global/use-event-callback.js';
|
|
5
4
|
import 'date-fns/add';
|
|
6
5
|
import 'date-fns';
|
|
7
6
|
import '../global/sniffer.js';
|
|
8
7
|
import 'sniffr';
|
|
9
8
|
|
|
10
9
|
function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDateSource, arith, scheduleScroll) {
|
|
11
|
-
const $ = c(
|
|
12
|
-
if ($[0] !== "
|
|
13
|
-
for (let $i = 0; $i <
|
|
10
|
+
const $ = c(38);
|
|
11
|
+
if ($[0] !== "a3a62d0eaf68edc8b0ddbd21981a78487012d4433139cd433e355b8f989ab2de") {
|
|
12
|
+
for (let $i = 0; $i < 38; $i += 1) {
|
|
14
13
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
15
14
|
}
|
|
16
|
-
$[0] = "
|
|
15
|
+
$[0] = "a3a62d0eaf68edc8b0ddbd21981a78487012d4433139cd433e355b8f989ab2de";
|
|
17
16
|
}
|
|
18
17
|
let t0;
|
|
19
18
|
if ($[1] !== arith || $[2] !== scrollDate.date) {
|
|
@@ -60,7 +59,7 @@ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDate
|
|
|
60
59
|
} else {
|
|
61
60
|
t2 = $[12];
|
|
62
61
|
}
|
|
63
|
-
const syncSelfState =
|
|
62
|
+
const syncSelfState = useEffectEvent(t2);
|
|
64
63
|
const didMountRef = useRef(false);
|
|
65
64
|
let t3;
|
|
66
65
|
if ($[13] !== scrollDate.date || $[14] !== scrollDate.source || $[15] !== selfScrollDateSource || $[16] !== syncSelfState) {
|
|
@@ -87,19 +86,18 @@ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDate
|
|
|
87
86
|
t3 = $[17];
|
|
88
87
|
}
|
|
89
88
|
let t4;
|
|
90
|
-
if ($[18] !== scrollDate || $[19] !== selfScrollDateSource
|
|
91
|
-
t4 = [scrollDate, selfScrollDateSource
|
|
89
|
+
if ($[18] !== scrollDate || $[19] !== selfScrollDateSource) {
|
|
90
|
+
t4 = [scrollDate, selfScrollDateSource];
|
|
92
91
|
$[18] = scrollDate;
|
|
93
92
|
$[19] = selfScrollDateSource;
|
|
94
|
-
$[20] =
|
|
95
|
-
$[21] = t4;
|
|
93
|
+
$[20] = t4;
|
|
96
94
|
} else {
|
|
97
|
-
t4 = $[
|
|
95
|
+
t4 = $[20];
|
|
98
96
|
}
|
|
99
97
|
useEffect(t3, t4);
|
|
100
98
|
const ignoreNextScrollEventRef = useRef(true);
|
|
101
99
|
let t5;
|
|
102
|
-
if ($[
|
|
100
|
+
if ($[21] !== scrollTop) {
|
|
103
101
|
t5 = function setContainerScrollFromState() {
|
|
104
102
|
const container_0 = containerRef.current;
|
|
105
103
|
if (!container_0) {
|
|
@@ -108,24 +106,24 @@ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDate
|
|
|
108
106
|
ignoreNextScrollEventRef.current = true;
|
|
109
107
|
container_0.scrollTop = scrollTop;
|
|
110
108
|
};
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
109
|
+
$[21] = scrollTop;
|
|
110
|
+
$[22] = t5;
|
|
113
111
|
} else {
|
|
114
|
-
t5 = $[
|
|
112
|
+
t5 = $[22];
|
|
115
113
|
}
|
|
116
114
|
let t6;
|
|
117
|
-
if ($[
|
|
115
|
+
if ($[23] !== items || $[24] !== scrollTop) {
|
|
118
116
|
t6 = [items, scrollTop];
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
117
|
+
$[23] = items;
|
|
118
|
+
$[24] = scrollTop;
|
|
119
|
+
$[25] = t6;
|
|
122
120
|
} else {
|
|
123
|
-
t6 = $[
|
|
121
|
+
t6 = $[25];
|
|
124
122
|
}
|
|
125
123
|
useLayoutEffect(t5, t6);
|
|
126
124
|
const updateStateTimerRef = useRef(null);
|
|
127
125
|
let t7;
|
|
128
|
-
if ($[
|
|
126
|
+
if ($[26] !== arith || $[27] !== items || $[28] !== locale || $[29] !== onContainerScroll || $[30] !== scheduleScroll || $[31] !== selfScrollDateSource) {
|
|
129
127
|
t7 = () => {
|
|
130
128
|
scheduleScroll(() => {
|
|
131
129
|
if (updateStateTimerRef.current != null) {
|
|
@@ -164,20 +162,19 @@ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDate
|
|
|
164
162
|
}
|
|
165
163
|
});
|
|
166
164
|
};
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
165
|
+
$[26] = arith;
|
|
166
|
+
$[27] = items;
|
|
167
|
+
$[28] = locale;
|
|
168
|
+
$[29] = onContainerScroll;
|
|
169
|
+
$[30] = scheduleScroll;
|
|
170
|
+
$[31] = selfScrollDateSource;
|
|
171
|
+
$[32] = t7;
|
|
174
172
|
} else {
|
|
175
|
-
t7 = $[
|
|
173
|
+
t7 = $[32];
|
|
176
174
|
}
|
|
177
|
-
const handleScroll =
|
|
175
|
+
const handleScroll = useEffectEvent(t7);
|
|
178
176
|
let t8;
|
|
179
|
-
|
|
180
|
-
if ($[34] !== handleScroll) {
|
|
177
|
+
if ($[33] !== handleScroll) {
|
|
181
178
|
t8 = () => {
|
|
182
179
|
const container_2 = containerRef.current;
|
|
183
180
|
if (!container_2) {
|
|
@@ -192,25 +189,29 @@ function useScrollBehavior(scrollDate, onContainerScroll, locale, selfScrollDate
|
|
|
192
189
|
}
|
|
193
190
|
};
|
|
194
191
|
};
|
|
195
|
-
|
|
196
|
-
$[34] =
|
|
197
|
-
|
|
198
|
-
$[
|
|
192
|
+
$[33] = handleScroll;
|
|
193
|
+
$[34] = t8;
|
|
194
|
+
} else {
|
|
195
|
+
t8 = $[34];
|
|
196
|
+
}
|
|
197
|
+
let t9;
|
|
198
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
199
|
+
t9 = [];
|
|
200
|
+
$[35] = t9;
|
|
199
201
|
} else {
|
|
200
|
-
|
|
201
|
-
t9 = $[36];
|
|
202
|
+
t9 = $[35];
|
|
202
203
|
}
|
|
203
204
|
useEffect(t8, t9);
|
|
204
205
|
let t10;
|
|
205
|
-
if ($[
|
|
206
|
+
if ($[36] !== items) {
|
|
206
207
|
t10 = {
|
|
207
208
|
containerRef,
|
|
208
209
|
items
|
|
209
210
|
};
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
211
|
+
$[36] = items;
|
|
212
|
+
$[37] = t10;
|
|
212
213
|
} else {
|
|
213
|
-
t10 = $[
|
|
214
|
+
t10 = $[37];
|
|
214
215
|
}
|
|
215
216
|
return t10;
|
|
216
217
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { addYears } from 'date-fns/addYears';
|
|
@@ -13,14 +13,13 @@ import { ScrollArith } from './scroll-arith.js';
|
|
|
13
13
|
import { useScrollBehavior } from './use-scroll-behavior.js';
|
|
14
14
|
import { animateDate } from './animate-date.js';
|
|
15
15
|
import scheduleRAF from '../global/schedule-raf.js';
|
|
16
|
-
import {
|
|
16
|
+
import { useIntersectionObserverHandle, IntersectionObserverContext, useIsIntersecting } from '../global/intersection-observer-context.js';
|
|
17
17
|
import { s as styles } from '../_helpers/date-picker.js';
|
|
18
18
|
import { jsx } from 'react/jsx-runtime';
|
|
19
19
|
import 'date-fns/add';
|
|
20
20
|
import 'date-fns';
|
|
21
21
|
import '../global/sniffer.js';
|
|
22
22
|
import 'sniffr';
|
|
23
|
-
import '../global/use-event-callback.js';
|
|
24
23
|
|
|
25
24
|
const {
|
|
26
25
|
yearHeight
|
|
@@ -35,14 +34,14 @@ const scheduleScroll = scheduleRAF();
|
|
|
35
34
|
/**
|
|
36
35
|
* Reduces "empty" years during fast scrolling.
|
|
37
36
|
*/
|
|
38
|
-
const
|
|
37
|
+
const intersectionObserverRootMargin = units.calHeight / 2;
|
|
39
38
|
function Years(t0) {
|
|
40
|
-
const $ = c(
|
|
41
|
-
if ($[0] !== "
|
|
42
|
-
for (let $i = 0; $i <
|
|
39
|
+
const $ = c(25);
|
|
40
|
+
if ($[0] !== "d83f39ae52d8a31382391108984551694ebcf0097c6e55663ca967ea74179702") {
|
|
41
|
+
for (let $i = 0; $i < 25; $i += 1) {
|
|
43
42
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
44
43
|
}
|
|
45
|
-
$[0] = "
|
|
44
|
+
$[0] = "d83f39ae52d8a31382391108984551694ebcf0097c6e55663ca967ea74179702";
|
|
46
45
|
}
|
|
47
46
|
const {
|
|
48
47
|
scrollDate,
|
|
@@ -153,81 +152,89 @@ function Years(t0) {
|
|
|
153
152
|
containerRef,
|
|
154
153
|
items
|
|
155
154
|
} = useScrollBehavior(localScrollDate, syncCalendarScrollDate, undefined, "yearsScroll", scrollArith, scheduleScroll);
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
if ($[12] !== handleYearClick || $[13] !==
|
|
159
|
-
let
|
|
160
|
-
if ($[
|
|
161
|
-
|
|
155
|
+
const t7 = useIntersectionObserverHandle(containerRef, intersectionObserverRootMargin);
|
|
156
|
+
let t8;
|
|
157
|
+
if ($[12] !== handleYearClick || $[13] !== items || $[14] !== localScrollDate.date) {
|
|
158
|
+
let t9;
|
|
159
|
+
if ($[16] !== handleYearClick || $[17] !== localScrollDate.date) {
|
|
160
|
+
t9 = year_0 => /*#__PURE__*/jsx(Year, {
|
|
162
161
|
year: year_0,
|
|
163
162
|
scrollDate: localScrollDate.date,
|
|
164
|
-
handleYearClick: handleYearClick
|
|
165
|
-
intersectionObserverHandle: intersectionObserverHandle
|
|
163
|
+
handleYearClick: handleYearClick
|
|
166
164
|
}, +year_0);
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[20] = t8;
|
|
165
|
+
$[16] = handleYearClick;
|
|
166
|
+
$[17] = localScrollDate.date;
|
|
167
|
+
$[18] = t9;
|
|
171
168
|
} else {
|
|
172
|
-
|
|
169
|
+
t9 = $[18];
|
|
173
170
|
}
|
|
174
|
-
|
|
171
|
+
t8 = items.map(t9);
|
|
175
172
|
$[12] = handleYearClick;
|
|
176
|
-
$[13] =
|
|
177
|
-
$[14] =
|
|
178
|
-
$[15] =
|
|
179
|
-
$[16] = t7;
|
|
173
|
+
$[13] = items;
|
|
174
|
+
$[14] = localScrollDate.date;
|
|
175
|
+
$[15] = t8;
|
|
180
176
|
} else {
|
|
181
|
-
|
|
177
|
+
t8 = $[15];
|
|
182
178
|
}
|
|
183
|
-
let
|
|
184
|
-
if ($[
|
|
185
|
-
|
|
179
|
+
let t9;
|
|
180
|
+
if ($[19] !== containerRef || $[20] !== t8) {
|
|
181
|
+
t9 = /*#__PURE__*/jsx("div", {
|
|
186
182
|
className: styles.years,
|
|
187
183
|
ref: containerRef,
|
|
188
184
|
"data-test": "ring-date-popup--years",
|
|
189
|
-
children:
|
|
185
|
+
children: t8
|
|
186
|
+
});
|
|
187
|
+
$[19] = containerRef;
|
|
188
|
+
$[20] = t8;
|
|
189
|
+
$[21] = t9;
|
|
190
|
+
} else {
|
|
191
|
+
t9 = $[21];
|
|
192
|
+
}
|
|
193
|
+
let t10;
|
|
194
|
+
if ($[22] !== t7 || $[23] !== t9) {
|
|
195
|
+
t10 = /*#__PURE__*/jsx(IntersectionObserverContext, {
|
|
196
|
+
value: t7,
|
|
197
|
+
children: t9
|
|
190
198
|
});
|
|
191
|
-
$[21] = containerRef;
|
|
192
199
|
$[22] = t7;
|
|
193
|
-
$[23] =
|
|
200
|
+
$[23] = t9;
|
|
201
|
+
$[24] = t10;
|
|
194
202
|
} else {
|
|
195
|
-
|
|
203
|
+
t10 = $[24];
|
|
196
204
|
}
|
|
197
|
-
return
|
|
205
|
+
return t10;
|
|
198
206
|
}
|
|
199
207
|
function Year(t0) {
|
|
200
208
|
const $ = c(24);
|
|
201
|
-
if ($[0] !== "
|
|
209
|
+
if ($[0] !== "d83f39ae52d8a31382391108984551694ebcf0097c6e55663ca967ea74179702") {
|
|
202
210
|
for (let $i = 0; $i < 24; $i += 1) {
|
|
203
211
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
204
212
|
}
|
|
205
|
-
$[0] = "
|
|
213
|
+
$[0] = "d83f39ae52d8a31382391108984551694ebcf0097c6e55663ca967ea74179702";
|
|
206
214
|
}
|
|
207
215
|
const {
|
|
208
216
|
year,
|
|
209
217
|
scrollDate,
|
|
210
|
-
handleYearClick
|
|
211
|
-
intersectionObserverHandle
|
|
218
|
+
handleYearClick
|
|
212
219
|
} = t0;
|
|
213
220
|
const buttonRef = useRef(null);
|
|
214
|
-
const
|
|
221
|
+
const isIntersecting = useIsIntersecting(buttonRef);
|
|
215
222
|
const t1 = +year;
|
|
216
|
-
const t2 = !
|
|
223
|
+
const t2 = !isIntersecting;
|
|
217
224
|
let t3;
|
|
218
|
-
if ($[1] !==
|
|
219
|
-
t3 =
|
|
220
|
-
$[1] =
|
|
221
|
-
$[2] =
|
|
225
|
+
if ($[1] !== isIntersecting || $[2] !== scrollDate || $[3] !== year) {
|
|
226
|
+
t3 = isIntersecting && isSameYear(year, scrollDate) && styles.currentYear;
|
|
227
|
+
$[1] = isIntersecting;
|
|
228
|
+
$[2] = scrollDate;
|
|
222
229
|
$[3] = year;
|
|
223
230
|
$[4] = t3;
|
|
224
231
|
} else {
|
|
225
232
|
t3 = $[4];
|
|
226
233
|
}
|
|
227
234
|
let t4;
|
|
228
|
-
if ($[5] !==
|
|
229
|
-
t4 =
|
|
230
|
-
$[5] =
|
|
235
|
+
if ($[5] !== isIntersecting || $[6] !== year) {
|
|
236
|
+
t4 = isIntersecting && isThisYear(year) && styles.today;
|
|
237
|
+
$[5] = isIntersecting;
|
|
231
238
|
$[6] = year;
|
|
232
239
|
$[7] = t4;
|
|
233
240
|
} else {
|
|
@@ -243,19 +250,19 @@ function Year(t0) {
|
|
|
243
250
|
t5 = $[10];
|
|
244
251
|
}
|
|
245
252
|
let t6;
|
|
246
|
-
if ($[11] !== handleYearClick || $[12] !==
|
|
247
|
-
t6 =
|
|
253
|
+
if ($[11] !== handleYearClick || $[12] !== isIntersecting || $[13] !== year) {
|
|
254
|
+
t6 = isIntersecting ? () => handleYearClick(year) : undefined;
|
|
248
255
|
$[11] = handleYearClick;
|
|
249
|
-
$[12] =
|
|
256
|
+
$[12] = isIntersecting;
|
|
250
257
|
$[13] = year;
|
|
251
258
|
$[14] = t6;
|
|
252
259
|
} else {
|
|
253
260
|
t6 = $[14];
|
|
254
261
|
}
|
|
255
262
|
let t7;
|
|
256
|
-
if ($[15] !==
|
|
257
|
-
t7 =
|
|
258
|
-
$[15] =
|
|
263
|
+
if ($[15] !== isIntersecting || $[16] !== year) {
|
|
264
|
+
t7 = isIntersecting ? format(year, "yyyy") : "\xA0";
|
|
265
|
+
$[15] = isIntersecting;
|
|
259
266
|
$[16] = year;
|
|
260
267
|
$[17] = t7;
|
|
261
268
|
} else {
|