@jetbrains/ring-ui-built 7.0.115 → 8.0.0-beta.2
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/table.js +2 -2
- package/components/_helpers/table2.js +3 -0
- package/components/data-list/data-list.d.ts +4 -4
- package/components/data-list/data-list.js +2 -2
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/item.d.ts +1 -1
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +1 -1
- package/components/date-picker/date-picker.js +1 -1
- package/components/date-picker/date-popup.js +1 -1
- package/components/date-picker/month.d.ts +0 -2
- package/components/date-picker/month.js +16 -17
- package/components/date-picker/months.js +42 -33
- package/components/date-picker/years.js +60 -52
- package/components/global/intersection-observer-context.d.ts +26 -0
- package/components/global/intersection-observer-context.js +140 -0
- package/components/{table → legacy-table}/cell.js +1 -1
- package/components/{table → legacy-table}/header-cell.js +3 -3
- package/components/{table → legacy-table}/header.js +1 -1
- package/components/{table → legacy-table}/row-with-focus-sensor.js +1 -1
- package/components/{table → legacy-table}/row.js +1 -1
- package/components/{table → legacy-table}/selection.d.ts +2 -2
- package/components/{table → legacy-table}/selection.js +1 -1
- package/components/{table → legacy-table}/simple-table.js +1 -1
- package/components/{table → legacy-table}/smart-table.js +1 -1
- package/components/legacy-table/table.d.ts +109 -0
- package/components/legacy-table/table.js +369 -0
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/style.css +1 -1
- package/components/table/default-item-renderer.d.ts +25 -0
- package/components/table/default-item-renderer.js +241 -0
- package/components/table/table-base.d.ts +24 -0
- package/components/table/table-base.js +311 -0
- package/components/table/table-component.d.ts +53 -0
- package/components/table/table-component.js +316 -0
- package/components/table/table-const.d.ts +8 -0
- package/components/table/table-const.js +11 -0
- package/components/table/table-virtualize.d.ts +32 -0
- package/components/table/table-virtualize.js +330 -0
- package/components/table/table.d.ts +221 -104
- package/components/table/table.js +18 -362
- package/package.json +1 -1
- /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.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.d.ts +0 -0
- /package/components/{table → legacy-table}/selection-adapter.js +0 -0
- /package/components/{table → legacy-table}/selection-shortcuts-hoc.d.ts +0 -0
- /package/components/{table → legacy-table}/selection-shortcuts-hoc.js +0 -0
- /package/components/{table → legacy-table}/simple-table.d.ts +0 -0
- /package/components/{table → legacy-table}/smart-table.d.ts +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var styles = {"table":"ring-table-table","headerRow":"ring-table-headerRow","headerCell":"ring-table-headerCell","spacerRow":"ring-table-spacerRow","spacerCell":"ring-table-spacerCell","row":"ring-table-row","clickableRow":"ring-table-clickableRow","selectedRow":"ring-table-selectedRow","cell":"ring-table-cell","headerButton":"ring-table-headerButton","deleteColumnButton":"ring-table-deleteColumnButton"};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { styles as s };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var style = {"row":"ring-table-row","dragHandle":"ring-table-dragHandle","tableWrapper":"ring-table-tableWrapper","table":"ring-table-table","userSelectNone":"ring-table-userSelectNone","headerCell":"ring-table-headerCell ring-global-font-smaller-lower ring-global-font-smaller ring-global-font-lower ring-global-font","headerCellSorted":"ring-table-headerCellSorted","headerCellSortable":"ring-table-headerCellSortable","sorter":"ring-table-sorter","sortedUp":"ring-table-sortedUp","icon":"ring-table-icon","caption":"ring-table-caption","tableHead":"ring-table-tableHead","subHeaderSticky":"ring-table-subHeaderSticky","disabledHover":"ring-table-disabledHover","rowSelected":"ring-table-rowSelected","rowFocused":"ring-table-rowFocused","cell":"ring-table-cell ring-global-ellipsis","loadingOverlay":"ring-table-loadingOverlay","wideFirstColumn":"ring-table-wideFirstColumn","cellUnlimited":"ring-table-cellUnlimited","cellRight":"ring-table-cellRight","metaColumn":"ring-table-metaColumn","headerMetaColumn":"ring-table-headerMetaColumn","visibleDragHandle":"ring-table-visibleDragHandle","rowCollapseExpandButton":"ring-table-rowCollapseExpandButton","draggingRow":"ring-table-draggingRow","draggingTable":"ring-table-draggingTable","tableMessage":"ring-table-tableMessage"};
|
|
2
|
+
|
|
3
|
+
export { style as s };
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Component } from 'react';
|
|
5
5
|
import { type FocusSensorOuterProps } from '../global/focus-sensor-hoc';
|
|
6
|
-
import { type SelectionShortcutsAddProps, type SelectionShortcutsOuterProps } from '../table/selection-shortcuts-hoc';
|
|
7
|
-
import { type DisableHoverAddProps } from '../table/disable-hover-hoc';
|
|
8
|
-
import { type SelectionItem } from '../table/selection';
|
|
6
|
+
import { type SelectionShortcutsAddProps, type SelectionShortcutsOuterProps } from '../legacy-table/selection-shortcuts-hoc';
|
|
7
|
+
import { type DisableHoverAddProps } from '../legacy-table/disable-hover-hoc';
|
|
8
|
+
import { type SelectionItem } from '../legacy-table/selection';
|
|
9
9
|
import { type FormattedItem, moreLessButtonStates } from './item';
|
|
10
10
|
export interface DataListBaseProps<T extends SelectionItem> {
|
|
11
11
|
data: readonly T[];
|
|
@@ -20,7 +20,7 @@ export interface DataListBaseProps<T extends SelectionItem> {
|
|
|
20
20
|
type FocusableProps<T extends SelectionItem> = DataListBaseProps<T> & DisableHoverAddProps & FocusSensorOuterProps<HTMLDivElement> & SelectionShortcutsAddProps<T>;
|
|
21
21
|
export type DataListContainerProps<T extends SelectionItem> = DataListBaseProps<T> & FocusSensorOuterProps<HTMLDivElement> & SelectionShortcutsOuterProps<T>;
|
|
22
22
|
export default class DataListContainer<T extends SelectionItem> extends Component<DataListContainerProps<T>> {
|
|
23
|
-
DataList: import("react").ComponentClass<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>, any>;
|
|
23
|
+
DataList: import("react").ComponentClass<import("../legacy-table/disable-hover-hoc").DisableHoverProps<import("../legacy-table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>, any>;
|
|
24
24
|
render(): import("react").JSX.Element;
|
|
25
25
|
}
|
|
26
26
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component, PureComponent } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
4
|
-
import selectionShortcutsHOC from '../table/selection-shortcuts-hoc.js';
|
|
5
|
-
import disableHoverHOC from '../table/disable-hover-hoc.js';
|
|
4
|
+
import selectionShortcutsHOC from '../legacy-table/selection-shortcuts-hoc.js';
|
|
5
|
+
import disableHoverHOC from '../legacy-table/disable-hover-hoc.js';
|
|
6
6
|
import getUID from '../global/get-uid.js';
|
|
7
7
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
|
8
8
|
import Loader from '../loader/loader.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PureComponent, type ReactNode } from 'react';
|
|
2
|
-
import { type SelectionItem } from '../table/selection';
|
|
2
|
+
import { type SelectionItem } from '../legacy-table/selection';
|
|
3
3
|
import type Selection from './selection';
|
|
4
4
|
export declare enum moreLessButtonStates {
|
|
5
5
|
UNUSED = 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import TableSelection, { type CloneWithConfig, type SelectionItem, type TableSelectionConfig } from '../table/selection';
|
|
1
|
+
import TableSelection, { type CloneWithConfig, type SelectionItem, type TableSelectionConfig } from '../legacy-table/selection';
|
|
2
2
|
interface DataListSelectionConfig<T extends SelectionItem> extends TableSelectionConfig<T> {
|
|
3
3
|
partialSelected?: Set<T> | undefined;
|
|
4
4
|
}
|
|
@@ -72,7 +72,7 @@ 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
78
|
import '../global/use-event-callback.js';
|
|
@@ -50,7 +50,7 @@ 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
56
|
import '../global/use-event-callback.js';
|
|
@@ -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;
|
|
@@ -5,7 +5,7 @@ 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];
|
|
@@ -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';
|
|
@@ -44,16 +44,16 @@ const scheduleScroll = scheduleRAF();
|
|
|
44
44
|
*
|
|
45
45
|
* To avoid an unpainted gap at the viewport boundary, the next month must be reported
|
|
46
46
|
* as visible slightly before it actually enters the viewport. We achieve this by
|
|
47
|
-
* extending the IntersectionObserver
|
|
47
|
+
* extending the IntersectionObserver rootMargin.
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const intersectionObserverRootMargin = units.cellSize * 2;
|
|
50
50
|
function Months(props) {
|
|
51
|
-
const $ = c(
|
|
52
|
-
if ($[0] !== "
|
|
53
|
-
for (let $i = 0; $i <
|
|
51
|
+
const $ = c(12);
|
|
52
|
+
if ($[0] !== "3a35ff495c6e9b775eb682d77f791841d2ec4d5f8b99fec4a5000c17ec4e2117") {
|
|
53
|
+
for (let $i = 0; $i < 12; $i += 1) {
|
|
54
54
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
55
55
|
}
|
|
56
|
-
$[0] = "
|
|
56
|
+
$[0] = "3a35ff495c6e9b775eb682d77f791841d2ec4d5f8b99fec4a5000c17ec4e2117";
|
|
57
57
|
}
|
|
58
58
|
const {
|
|
59
59
|
scrollDate,
|
|
@@ -64,46 +64,55 @@ function Months(props) {
|
|
|
64
64
|
containerRef,
|
|
65
65
|
items
|
|
66
66
|
} = useScrollBehavior(scrollDate, setScrollDate, locale, "monthsScroll", scrollArith, scheduleScroll);
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
if ($[1] !==
|
|
70
|
-
let
|
|
71
|
-
if ($[
|
|
72
|
-
|
|
67
|
+
const t0 = useIntersectionObserverHandle(containerRef, intersectionObserverRootMargin);
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[1] !== items || $[2] !== props) {
|
|
70
|
+
let t2;
|
|
71
|
+
if ($[4] !== props) {
|
|
72
|
+
t2 = month => /*#__PURE__*/createElement(Month, {
|
|
73
73
|
...props,
|
|
74
74
|
month: month,
|
|
75
|
-
key: +month
|
|
76
|
-
intersectionObserverHandle: intersectionObserverHandle
|
|
75
|
+
key: +month
|
|
77
76
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[7] = t1;
|
|
77
|
+
$[4] = props;
|
|
78
|
+
$[5] = t2;
|
|
81
79
|
} else {
|
|
82
|
-
|
|
80
|
+
t2 = $[5];
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
$[1] =
|
|
86
|
-
$[2] =
|
|
87
|
-
$[3] =
|
|
88
|
-
$[4] = t0;
|
|
82
|
+
t1 = items.map(t2);
|
|
83
|
+
$[1] = items;
|
|
84
|
+
$[2] = props;
|
|
85
|
+
$[3] = t1;
|
|
89
86
|
} else {
|
|
90
|
-
|
|
87
|
+
t1 = $[3];
|
|
91
88
|
}
|
|
92
|
-
let
|
|
93
|
-
if ($[
|
|
94
|
-
|
|
89
|
+
let t2;
|
|
90
|
+
if ($[6] !== containerRef || $[7] !== t1) {
|
|
91
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
95
92
|
className: styles.months,
|
|
96
93
|
ref: containerRef,
|
|
97
94
|
"data-test": "ring-date-popup--months",
|
|
98
|
-
children:
|
|
95
|
+
children: t1
|
|
96
|
+
});
|
|
97
|
+
$[6] = containerRef;
|
|
98
|
+
$[7] = t1;
|
|
99
|
+
$[8] = t2;
|
|
100
|
+
} else {
|
|
101
|
+
t2 = $[8];
|
|
102
|
+
}
|
|
103
|
+
let t3;
|
|
104
|
+
if ($[9] !== t0 || $[10] !== t2) {
|
|
105
|
+
t3 = /*#__PURE__*/jsx(IntersectionObserverContext.Provider, {
|
|
106
|
+
value: t0,
|
|
107
|
+
children: t2
|
|
99
108
|
});
|
|
100
|
-
$[8] = containerRef;
|
|
101
109
|
$[9] = t0;
|
|
102
|
-
$[10] =
|
|
110
|
+
$[10] = t2;
|
|
111
|
+
$[11] = t3;
|
|
103
112
|
} else {
|
|
104
|
-
|
|
113
|
+
t3 = $[11];
|
|
105
114
|
}
|
|
106
|
-
return
|
|
115
|
+
return t3;
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
export { Months as default };
|
|
@@ -13,7 +13,7 @@ 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';
|
|
@@ -35,14 +35,14 @@ const scheduleScroll = scheduleRAF();
|
|
|
35
35
|
/**
|
|
36
36
|
* Reduces "empty" years during fast scrolling.
|
|
37
37
|
*/
|
|
38
|
-
const
|
|
38
|
+
const intersectionObserverRootMargin = units.calHeight / 2;
|
|
39
39
|
function Years(t0) {
|
|
40
|
-
const $ = c(
|
|
41
|
-
if ($[0] !== "
|
|
42
|
-
for (let $i = 0; $i <
|
|
40
|
+
const $ = c(25);
|
|
41
|
+
if ($[0] !== "7e95fee5be468c0469f1cdfc188c2b13e855e290b93af773b0ec1e248249baca") {
|
|
42
|
+
for (let $i = 0; $i < 25; $i += 1) {
|
|
43
43
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
44
44
|
}
|
|
45
|
-
$[0] = "
|
|
45
|
+
$[0] = "7e95fee5be468c0469f1cdfc188c2b13e855e290b93af773b0ec1e248249baca";
|
|
46
46
|
}
|
|
47
47
|
const {
|
|
48
48
|
scrollDate,
|
|
@@ -153,81 +153,89 @@ function Years(t0) {
|
|
|
153
153
|
containerRef,
|
|
154
154
|
items
|
|
155
155
|
} = useScrollBehavior(localScrollDate, syncCalendarScrollDate, undefined, "yearsScroll", scrollArith, scheduleScroll);
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
if ($[12] !== handleYearClick || $[13] !==
|
|
159
|
-
let
|
|
160
|
-
if ($[
|
|
161
|
-
|
|
156
|
+
const t7 = useIntersectionObserverHandle(containerRef, intersectionObserverRootMargin);
|
|
157
|
+
let t8;
|
|
158
|
+
if ($[12] !== handleYearClick || $[13] !== items || $[14] !== localScrollDate.date) {
|
|
159
|
+
let t9;
|
|
160
|
+
if ($[16] !== handleYearClick || $[17] !== localScrollDate.date) {
|
|
161
|
+
t9 = year_0 => /*#__PURE__*/jsx(Year, {
|
|
162
162
|
year: year_0,
|
|
163
163
|
scrollDate: localScrollDate.date,
|
|
164
|
-
handleYearClick: handleYearClick
|
|
165
|
-
intersectionObserverHandle: intersectionObserverHandle
|
|
164
|
+
handleYearClick: handleYearClick
|
|
166
165
|
}, +year_0);
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[20] = t8;
|
|
166
|
+
$[16] = handleYearClick;
|
|
167
|
+
$[17] = localScrollDate.date;
|
|
168
|
+
$[18] = t9;
|
|
171
169
|
} else {
|
|
172
|
-
|
|
170
|
+
t9 = $[18];
|
|
173
171
|
}
|
|
174
|
-
|
|
172
|
+
t8 = items.map(t9);
|
|
175
173
|
$[12] = handleYearClick;
|
|
176
|
-
$[13] =
|
|
177
|
-
$[14] =
|
|
178
|
-
$[15] =
|
|
179
|
-
$[16] = t7;
|
|
174
|
+
$[13] = items;
|
|
175
|
+
$[14] = localScrollDate.date;
|
|
176
|
+
$[15] = t8;
|
|
180
177
|
} else {
|
|
181
|
-
|
|
178
|
+
t8 = $[15];
|
|
182
179
|
}
|
|
183
|
-
let
|
|
184
|
-
if ($[
|
|
185
|
-
|
|
180
|
+
let t9;
|
|
181
|
+
if ($[19] !== containerRef || $[20] !== t8) {
|
|
182
|
+
t9 = /*#__PURE__*/jsx("div", {
|
|
186
183
|
className: styles.years,
|
|
187
184
|
ref: containerRef,
|
|
188
185
|
"data-test": "ring-date-popup--years",
|
|
189
|
-
children:
|
|
186
|
+
children: t8
|
|
187
|
+
});
|
|
188
|
+
$[19] = containerRef;
|
|
189
|
+
$[20] = t8;
|
|
190
|
+
$[21] = t9;
|
|
191
|
+
} else {
|
|
192
|
+
t9 = $[21];
|
|
193
|
+
}
|
|
194
|
+
let t10;
|
|
195
|
+
if ($[22] !== t7 || $[23] !== t9) {
|
|
196
|
+
t10 = /*#__PURE__*/jsx(IntersectionObserverContext.Provider, {
|
|
197
|
+
value: t7,
|
|
198
|
+
children: t9
|
|
190
199
|
});
|
|
191
|
-
$[21] = containerRef;
|
|
192
200
|
$[22] = t7;
|
|
193
|
-
$[23] =
|
|
201
|
+
$[23] = t9;
|
|
202
|
+
$[24] = t10;
|
|
194
203
|
} else {
|
|
195
|
-
|
|
204
|
+
t10 = $[24];
|
|
196
205
|
}
|
|
197
|
-
return
|
|
206
|
+
return t10;
|
|
198
207
|
}
|
|
199
208
|
function Year(t0) {
|
|
200
209
|
const $ = c(24);
|
|
201
|
-
if ($[0] !== "
|
|
210
|
+
if ($[0] !== "7e95fee5be468c0469f1cdfc188c2b13e855e290b93af773b0ec1e248249baca") {
|
|
202
211
|
for (let $i = 0; $i < 24; $i += 1) {
|
|
203
212
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
204
213
|
}
|
|
205
|
-
$[0] = "
|
|
214
|
+
$[0] = "7e95fee5be468c0469f1cdfc188c2b13e855e290b93af773b0ec1e248249baca";
|
|
206
215
|
}
|
|
207
216
|
const {
|
|
208
217
|
year,
|
|
209
218
|
scrollDate,
|
|
210
|
-
handleYearClick
|
|
211
|
-
intersectionObserverHandle
|
|
219
|
+
handleYearClick
|
|
212
220
|
} = t0;
|
|
213
221
|
const buttonRef = useRef(null);
|
|
214
|
-
const
|
|
222
|
+
const isIntersecting = useIsIntersecting(buttonRef);
|
|
215
223
|
const t1 = +year;
|
|
216
|
-
const t2 = !
|
|
224
|
+
const t2 = !isIntersecting;
|
|
217
225
|
let t3;
|
|
218
|
-
if ($[1] !==
|
|
219
|
-
t3 =
|
|
220
|
-
$[1] =
|
|
221
|
-
$[2] =
|
|
226
|
+
if ($[1] !== isIntersecting || $[2] !== scrollDate || $[3] !== year) {
|
|
227
|
+
t3 = isIntersecting && isSameYear(year, scrollDate) && styles.currentYear;
|
|
228
|
+
$[1] = isIntersecting;
|
|
229
|
+
$[2] = scrollDate;
|
|
222
230
|
$[3] = year;
|
|
223
231
|
$[4] = t3;
|
|
224
232
|
} else {
|
|
225
233
|
t3 = $[4];
|
|
226
234
|
}
|
|
227
235
|
let t4;
|
|
228
|
-
if ($[5] !==
|
|
229
|
-
t4 =
|
|
230
|
-
$[5] =
|
|
236
|
+
if ($[5] !== isIntersecting || $[6] !== year) {
|
|
237
|
+
t4 = isIntersecting && isThisYear(year) && styles.today;
|
|
238
|
+
$[5] = isIntersecting;
|
|
231
239
|
$[6] = year;
|
|
232
240
|
$[7] = t4;
|
|
233
241
|
} else {
|
|
@@ -243,19 +251,19 @@ function Year(t0) {
|
|
|
243
251
|
t5 = $[10];
|
|
244
252
|
}
|
|
245
253
|
let t6;
|
|
246
|
-
if ($[11] !== handleYearClick || $[12] !==
|
|
247
|
-
t6 =
|
|
254
|
+
if ($[11] !== handleYearClick || $[12] !== isIntersecting || $[13] !== year) {
|
|
255
|
+
t6 = isIntersecting ? () => handleYearClick(year) : undefined;
|
|
248
256
|
$[11] = handleYearClick;
|
|
249
|
-
$[12] =
|
|
257
|
+
$[12] = isIntersecting;
|
|
250
258
|
$[13] = year;
|
|
251
259
|
$[14] = t6;
|
|
252
260
|
} else {
|
|
253
261
|
t6 = $[14];
|
|
254
262
|
}
|
|
255
263
|
let t7;
|
|
256
|
-
if ($[15] !==
|
|
257
|
-
t7 =
|
|
258
|
-
$[15] =
|
|
264
|
+
if ($[15] !== isIntersecting || $[16] !== year) {
|
|
265
|
+
t7 = isIntersecting ? format(year, "yyyy") : "\xA0";
|
|
266
|
+
$[15] = isIntersecting;
|
|
259
267
|
$[16] = year;
|
|
260
268
|
$[17] = t7;
|
|
261
269
|
} else {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Usage:
|
|
4
|
+
*
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <IntersectionObserverContext.Provider value={useIntersectionObserverHandle()}>
|
|
7
|
+
* <YourComponent />
|
|
8
|
+
* </IntersectionObserverContext.Provider>
|
|
9
|
+
*
|
|
10
|
+
* function YourComponent() {
|
|
11
|
+
* // Contains the current isIntersecting value
|
|
12
|
+
* const isIntersecting = useIsIntersecting(elementRef);
|
|
13
|
+
* // Or, to get updates instead:
|
|
14
|
+
* useIsIntersectingListener(elementRef, newIsIntersecting => {
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const IntersectionObserverContext: import("react").Context<IntersectionObserverHandle | null>;
|
|
21
|
+
export declare function useIntersectionObserverHandle(rootRef?: RefObject<HTMLElement | null>, rootMargin?: number, scrollMargin?: number): IntersectionObserverHandle | null;
|
|
22
|
+
export interface IntersectionObserverHandle {
|
|
23
|
+
observe(element: Element, setIsIntersecting: (isIntersecting: boolean) => void): () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useIsIntersecting(elementRef: RefObject<Element | null>): boolean;
|
|
26
|
+
export declare function useIsIntersectingListener(elementRef: RefObject<Element | null>, onChange: (isIntersecting: boolean) => void): void;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { useState, useEffect, createContext, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Usage:
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <IntersectionObserverContext.Provider value={useIntersectionObserverHandle()}>
|
|
9
|
+
* <YourComponent />
|
|
10
|
+
* </IntersectionObserverContext.Provider>
|
|
11
|
+
*
|
|
12
|
+
* function YourComponent() {
|
|
13
|
+
* // Contains the current isIntersecting value
|
|
14
|
+
* const isIntersecting = useIsIntersecting(elementRef);
|
|
15
|
+
* // Or, to get updates instead:
|
|
16
|
+
* useIsIntersectingListener(elementRef, newIsIntersecting => {
|
|
17
|
+
* // ...
|
|
18
|
+
* })
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
const IntersectionObserverContext = /*#__PURE__*/createContext(null);
|
|
23
|
+
function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin) {
|
|
24
|
+
const $ = c(6);
|
|
25
|
+
if ($[0] !== "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429") {
|
|
26
|
+
for (let $i = 0; $i < 6; $i += 1) {
|
|
27
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
28
|
+
}
|
|
29
|
+
$[0] = "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429";
|
|
30
|
+
}
|
|
31
|
+
const [handle, setHandle] = useState(null);
|
|
32
|
+
let t0;
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[1] !== rootMargin || $[2] !== rootRef || $[3] !== scrollMargin) {
|
|
35
|
+
t0 = () => {
|
|
36
|
+
const root = rootRef?.current;
|
|
37
|
+
const elementToOnChange = new Map();
|
|
38
|
+
const observer = new IntersectionObserver(entries => {
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
const onChange = elementToOnChange.get(entry.target);
|
|
41
|
+
onChange?.(entry.isIntersecting);
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
root,
|
|
45
|
+
rootMargin: rootMargin != null ? `${rootMargin}px` : undefined,
|
|
46
|
+
scrollMargin: scrollMargin != null ? `${scrollMargin}px` : undefined
|
|
47
|
+
});
|
|
48
|
+
setHandle({
|
|
49
|
+
observe(element, onChange_0) {
|
|
50
|
+
elementToOnChange.set(element, onChange_0);
|
|
51
|
+
observer.observe(element);
|
|
52
|
+
return () => {
|
|
53
|
+
elementToOnChange.delete(element);
|
|
54
|
+
observer.unobserve(element);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return () => {
|
|
59
|
+
observer.disconnect();
|
|
60
|
+
setHandle(null);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
t1 = [rootRef, rootMargin, scrollMargin];
|
|
64
|
+
$[1] = rootMargin;
|
|
65
|
+
$[2] = rootRef;
|
|
66
|
+
$[3] = scrollMargin;
|
|
67
|
+
$[4] = t0;
|
|
68
|
+
$[5] = t1;
|
|
69
|
+
} else {
|
|
70
|
+
t0 = $[4];
|
|
71
|
+
t1 = $[5];
|
|
72
|
+
}
|
|
73
|
+
useEffect(t0, t1);
|
|
74
|
+
return handle;
|
|
75
|
+
}
|
|
76
|
+
function useIsIntersecting(elementRef) {
|
|
77
|
+
const $ = c(5);
|
|
78
|
+
if ($[0] !== "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429") {
|
|
79
|
+
for (let $i = 0; $i < 5; $i += 1) {
|
|
80
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
81
|
+
}
|
|
82
|
+
$[0] = "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429";
|
|
83
|
+
}
|
|
84
|
+
const handle = useContext(IntersectionObserverContext);
|
|
85
|
+
const [isIntersecting, setIsIntersecting] = useState(false);
|
|
86
|
+
let t0;
|
|
87
|
+
let t1;
|
|
88
|
+
if ($[1] !== elementRef || $[2] !== handle) {
|
|
89
|
+
t0 = () => {
|
|
90
|
+
const element = elementRef.current;
|
|
91
|
+
if (!element || !handle) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
return handle.observe(element, setIsIntersecting);
|
|
95
|
+
};
|
|
96
|
+
t1 = [handle, elementRef, setIsIntersecting];
|
|
97
|
+
$[1] = elementRef;
|
|
98
|
+
$[2] = handle;
|
|
99
|
+
$[3] = t0;
|
|
100
|
+
$[4] = t1;
|
|
101
|
+
} else {
|
|
102
|
+
t0 = $[3];
|
|
103
|
+
t1 = $[4];
|
|
104
|
+
}
|
|
105
|
+
useEffect(t0, t1);
|
|
106
|
+
return isIntersecting;
|
|
107
|
+
}
|
|
108
|
+
function useIsIntersectingListener(elementRef, onChange) {
|
|
109
|
+
const $ = c(6);
|
|
110
|
+
if ($[0] !== "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429") {
|
|
111
|
+
for (let $i = 0; $i < 6; $i += 1) {
|
|
112
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
113
|
+
}
|
|
114
|
+
$[0] = "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429";
|
|
115
|
+
}
|
|
116
|
+
const handle = useContext(IntersectionObserverContext);
|
|
117
|
+
let t0;
|
|
118
|
+
let t1;
|
|
119
|
+
if ($[1] !== elementRef || $[2] !== handle || $[3] !== onChange) {
|
|
120
|
+
t0 = () => {
|
|
121
|
+
const element = elementRef.current;
|
|
122
|
+
if (!element || !handle) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
return handle.observe(element, onChange);
|
|
126
|
+
};
|
|
127
|
+
t1 = [handle, elementRef, onChange];
|
|
128
|
+
$[1] = elementRef;
|
|
129
|
+
$[2] = handle;
|
|
130
|
+
$[3] = onChange;
|
|
131
|
+
$[4] = t0;
|
|
132
|
+
$[5] = t1;
|
|
133
|
+
} else {
|
|
134
|
+
t0 = $[4];
|
|
135
|
+
t1 = $[5];
|
|
136
|
+
}
|
|
137
|
+
useEffect(t0, t1);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { IntersectionObserverContext, useIntersectionObserverHandle, useIsIntersecting, useIsIntersectingListener };
|