@react-pdf-kit/viewer 0.0.0-experimental.4 → 0.0.0-experimental.5
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/dist/{Combination-479e39c6.js → Combination-136ff99c.js} +184 -187
- package/dist/RPLayout.module-b4b23e29.js +14 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +15 -15
- package/dist/components/RPConfig.js +16 -6
- package/dist/components/RPController.js +21 -26
- package/dist/components/RPDropFileZone.js +35 -29
- package/dist/components/RPPages.js +351 -360
- package/dist/components/RPProvider.js +20 -24
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/LayoutWrapper.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +12 -13
- package/dist/components/layout/RPLayout.js +28 -28
- package/dist/components/layout/WrapperLayout.js +10 -11
- package/dist/components/layout/sidebar/RPSidebar.js +7 -8
- package/dist/components/layout/sidebar/Thumbnail.js +3 -4
- package/dist/components/layout/sidebar/Thumbnails.js +3 -4
- package/dist/components/layout/toolbar/DarkModeTool.js +4 -4
- package/dist/components/layout/toolbar/DocumentDialog.js +8 -9
- package/dist/components/layout/toolbar/DocumentProperties.js +6 -6
- package/dist/components/layout/toolbar/FileDownloadTool.js +9 -10
- package/dist/components/layout/toolbar/FileUploadTool.js +9 -10
- package/dist/components/layout/toolbar/FullScreenTool.js +6 -6
- package/dist/components/layout/toolbar/MenuItem.js +6 -6
- package/dist/components/layout/toolbar/MenuSeparator.js +6 -6
- package/dist/components/layout/toolbar/MostPageTool.js +9 -10
- package/dist/components/layout/toolbar/OtherTool.js +9 -10
- package/dist/components/layout/toolbar/Paginate.js +7 -8
- package/dist/components/layout/toolbar/PrintTool.js +9 -10
- package/dist/components/layout/toolbar/RPMenuItem.js +6 -6
- package/dist/components/layout/toolbar/RPMoreOptions.js +9 -10
- package/dist/components/layout/toolbar/RPToolbar.js +9 -12
- package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -10
- package/dist/components/layout/toolbar/RotateTool.js +9 -10
- package/dist/components/layout/toolbar/ScrollModeTool.js +6 -6
- package/dist/components/layout/toolbar/SearchCloseButton.js +4 -4
- package/dist/components/layout/toolbar/SearchResultNavigator.js +7 -10
- package/dist/components/layout/toolbar/SearchTool.js +11 -14
- package/dist/components/layout/toolbar/SelectionModeTool.js +6 -6
- package/dist/components/layout/toolbar/ThumbnailTool.js +7 -8
- package/dist/components/layout/toolbar/ToolbarCustom.js +3 -4
- package/dist/components/layout/toolbar/ToolbarDefault.js +9 -12
- package/dist/components/layout/toolbar/ToolbarLayout.js +9 -12
- package/dist/components/layout/toolbar/ViewModeTool.js +6 -6
- package/dist/components/layout/toolbar/ZoomTool.js +9 -10
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +8 -9
- package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +13 -15
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +7 -8
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +7 -8
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +13 -15
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +4 -4
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/LastPageTool.js +13 -15
- package/dist/components/layout/toolbar/tools/NextPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/PrintTool.js +7 -8
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +7 -8
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +7 -8
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +4 -4
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +7 -8
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +7 -8
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +19 -20
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +7 -8
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +9 -12
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +7 -8
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +6 -6
- package/dist/components/page/AnnotationLayer.js +65 -66
- package/dist/components/page/CanvasLayer.js +3 -4
- package/dist/components/page/CustomElement.js +3 -4
- package/dist/components/page/DualPage.js +5 -11
- package/dist/components/page/DualPageWithCover.js +5 -11
- package/dist/components/page/RPPage.js +6 -12
- package/dist/components/page/SinglePage.js +5 -11
- package/dist/components/page/TextHighlightLayer.js +178 -86
- package/dist/components/page/TextLayer.js +170 -125
- package/dist/components/ui/Checkbox.js +2 -2
- package/dist/components/ui/DropDown.js +6 -6
- package/dist/components/ui/LoadingIndicator.js +7 -8
- package/dist/components/ui/RPTooltip.js +411 -197
- package/dist/contexts/ConfigContext.js +5 -4
- package/dist/contexts/DimensionPagesContext.js +5 -6
- package/dist/contexts/DropFileZoneContext.js +4 -5
- package/dist/contexts/ElementPageContext.js +5 -6
- package/dist/contexts/FileInputContext.js +5 -6
- package/dist/contexts/HighlightContext.js +7 -10
- package/dist/contexts/LayoutDropFileZoneContext.js +11 -0
- package/dist/contexts/PagesRotateContext.js +5 -6
- package/dist/contexts/PaginationContext.js +5 -6
- package/dist/contexts/PrintContext.js +16 -17
- package/dist/contexts/RPDocumentContext.js +13 -14
- package/dist/contexts/RenderQueueProvider.js +5 -6
- package/dist/contexts/RotationContext.js +8 -9
- package/dist/contexts/SearchContext.js +5 -8
- package/dist/contexts/ThumbnailsContext.js +4 -5
- package/dist/contexts/ZoomContext.js +5 -6
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-61f59539.js +1198 -0
- package/dist/{index-ada501c4.js → index-655864a7.js} +1 -1
- package/dist/{index-113053cf.js → index-c0faa594.js} +2 -2
- package/dist/{index-23911b43.js → index-e3ee9457.js} +6 -6
- package/dist/main.js +15 -15
- package/dist/polyfills.js +8055 -0
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +2 -2
- package/dist/types/contexts/LayoutDropFileZoneContext.d.ts +9 -0
- package/dist/types/contexts/RPDocumentContext.d.ts +1 -1
- package/dist/types/contexts/RenderQueueProvider.d.ts +1 -1
- package/dist/types/contexts/RenderedPagesCache.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/dist/types/utils/annotations.d.ts +2 -2
- package/dist/types/utils/getThumbnailViewport.d.ts +2 -2
- package/dist/types/utils/highlight.d.ts +5 -5
- package/dist/types/utils/hooks/useDropFileZone.d.ts +5 -0
- package/dist/types/utils/hooks/useFlickerSelectText.d.ts +1 -0
- package/dist/types/utils/hooks/useHighlight.d.ts +1 -1
- package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
- package/dist/types/utils/hooks/useLoadWorker.d.ts +1 -5
- package/dist/types/utils/hooks/usePdfProperties.d.ts +1 -1
- package/dist/types/utils/hooks/useTextSelection.d.ts +3 -12
- package/dist/types/utils/link_service.d.ts +3 -2
- package/dist/types/utils/renderPage.d.ts +2 -2
- package/dist/types/utils/types.d.ts +8 -5
- package/dist/utils/highlight.js +158 -184
- package/dist/utils/hooks/useCopyText.js +22 -60
- package/dist/utils/hooks/useDropFileZone.js +12 -0
- package/dist/utils/hooks/useFileDownload.js +5 -6
- package/dist/utils/hooks/useFlickerSelectText.js +25 -0
- package/dist/utils/hooks/useHighlight.js +33 -35
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +70 -95
- package/dist/utils/hooks/useLoadWorker.js +14 -4
- package/dist/utils/hooks/usePageRotateContext.js +7 -8
- package/dist/utils/hooks/usePaginate.js +3 -4
- package/dist/utils/hooks/usePinch.js +10 -11
- package/dist/utils/hooks/usePresentPage.js +3 -4
- package/dist/utils/hooks/usePrint.js +55 -54
- package/dist/utils/hooks/useRotate.js +3 -4
- package/dist/utils/hooks/useScrollToPage.js +3 -4
- package/dist/utils/hooks/useSearch.js +15 -18
- package/dist/utils/hooks/useTextSelection.js +73 -2
- package/dist/utils/hooks/useThumbnail.js +17 -18
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -4
- package/dist/utils/link_service.js +19 -18
- package/dist/utils/renderPage.js +1 -1
- package/package.json +13 -4
- package/dist/RPLayout.module-7766e0b4.js +0 -14
- package/dist/contexts/TextSelectionContext.js +0 -191
- package/dist/index-535ad364.js +0 -983
- package/dist/index-d0f0aa9a.js +0 -1542
- package/dist/types/contexts/TextSelectionContext.d.ts +0 -14
- package/dist/types/utils/geometryCache.d.ts +0 -15
- package/dist/types/utils/glyphHitTest.d.ts +0 -12
- package/dist/types/utils/selectionUtils.d.ts +0 -30
- package/dist/utils/geometryCache.js +0 -32
- package/dist/utils/glyphHitTest.js +0 -29
- package/dist/utils/selectionUtils.js +0 -96
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsx as x, jsxs as _e, Fragment as
|
|
2
|
-
import { createElement as ue, PureComponent as
|
|
1
|
+
import { jsx as x, jsxs as _e, Fragment as st } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as ue, PureComponent as at, Component as lt, memo as ct, useRef as G, useMemo as we, useCallback as ae, useEffect as ne } from "react";
|
|
3
3
|
import { RPPage as Ce } from "./page/RPPage.js";
|
|
4
|
-
import { useVirtualReactWindow as
|
|
5
|
-
import { useVirtualScrollContext as
|
|
6
|
-
import { a as
|
|
7
|
-
import { useDocumentContext as
|
|
8
|
-
import { useViewModeContext as
|
|
9
|
-
import { useScrollModeContext as
|
|
10
|
-
import { SelectionMode as
|
|
11
|
-
import { useFullScreenContext as
|
|
4
|
+
import { useVirtualReactWindow as ut } from "../utils/hooks/useVirtualReactWindow.js";
|
|
5
|
+
import { useVirtualScrollContext as dt } from "../contexts/VirtualScrollContext.js";
|
|
6
|
+
import { a as ft, u as mt } from "../PaginationContext-9217cab4.js";
|
|
7
|
+
import { useDocumentContext as pt } from "../contexts/RPDocumentContext.js";
|
|
8
|
+
import { useViewModeContext as ht } from "../contexts/ViewModeContext.js";
|
|
9
|
+
import { useScrollModeContext as gt } from "../contexts/ScrollModeContext.js";
|
|
10
|
+
import { SelectionMode as vt, ViewMode as Se, ScrollMode as Ie, ErrorType as _t } from "../utils/types.js";
|
|
11
|
+
import { useFullScreenContext as wt } from "../contexts/FullScreenContext.js";
|
|
12
12
|
import { c as ce } from "../clsx-0c6e471a.js";
|
|
13
|
-
import { DualPage as
|
|
14
|
-
import { DualPageWithCover as
|
|
15
|
-
import { SinglePage as
|
|
16
|
-
import { useMousePressed as
|
|
17
|
-
import { useSelectionModeContext as
|
|
18
|
-
import { useGrabScroll as
|
|
19
|
-
import { usePinch as
|
|
20
|
-
import { useInitialStateContext as
|
|
21
|
-
import { useLayoutContainer as
|
|
22
|
-
import { useDebounce as
|
|
23
|
-
import { useLoaderContext as
|
|
24
|
-
import
|
|
25
|
-
import { usePresentPage as
|
|
26
|
-
import { getPageFromPosition as
|
|
27
|
-
import { useDocumentPasswordContext as
|
|
28
|
-
import { LayoutContainer as
|
|
29
|
-
import { LayoutWrapper as
|
|
30
|
-
import { useEventCallbackContext as
|
|
31
|
-
import { useCopyText as
|
|
32
|
-
import {
|
|
13
|
+
import { DualPage as Ct } from "./page/DualPage.js";
|
|
14
|
+
import { DualPageWithCover as St } from "./page/DualPageWithCover.js";
|
|
15
|
+
import { SinglePage as It } from "./page/SinglePage.js";
|
|
16
|
+
import { useMousePressed as Tt } from "../utils/hooks/useMousePressed.js";
|
|
17
|
+
import { useSelectionModeContext as Rt } from "../contexts/SelectionModeContext.js";
|
|
18
|
+
import { useGrabScroll as xt } from "../utils/hooks/useGrabScroll.js";
|
|
19
|
+
import { usePinch as yt } from "../utils/hooks/usePinch.js";
|
|
20
|
+
import { useInitialStateContext as bt } from "../contexts/InitialStateContext.js";
|
|
21
|
+
import { useLayoutContainer as zt } from "../contexts/LayoutContainerContext.js";
|
|
22
|
+
import { useDebounce as Lt } from "../utils/hooks/useDebounce.js";
|
|
23
|
+
import { useLoaderContext as Mt } from "../contexts/LoaderContext.js";
|
|
24
|
+
import Et from "./ui/PasswordModal.js";
|
|
25
|
+
import { usePresentPage as Ot } from "../utils/hooks/usePresentPage.js";
|
|
26
|
+
import { getPageFromPosition as Wt } from "../utils/calculatePage.js";
|
|
27
|
+
import { useDocumentPasswordContext as At } from "../contexts/DocumentPasswordContext.js";
|
|
28
|
+
import { LayoutContainer as Nt } from "./layout/LayoutContainer.js";
|
|
29
|
+
import { LayoutWrapper as Pt } from "./layout/LayoutWrapper.js";
|
|
30
|
+
import { useEventCallbackContext as Ft } from "../contexts/EventCallbackContext.js";
|
|
31
|
+
import { useCopyText as Dt } from "../utils/hooks/useCopyText.js";
|
|
32
|
+
import { useTextSelection as Ht } from "../utils/hooks/useTextSelection.js";
|
|
33
|
+
import { OutputScale as kt } from "pdfjs-dist";
|
|
34
|
+
import { approximateFraction as Ae } from "../utils/approximateFragtion.js";
|
|
33
35
|
import "./page/CanvasLayer.js";
|
|
34
36
|
import "../contexts/ZoomContext.js";
|
|
35
37
|
import "../utils/appConsole.js";
|
|
@@ -38,8 +40,6 @@ import "../utils/getZoomLevel.js";
|
|
|
38
40
|
import "../de_DE-a553b162.js";
|
|
39
41
|
import "../contexts/RotationContext.js";
|
|
40
42
|
import "../utils/hooks/useLoadPdf.js";
|
|
41
|
-
import "@pdf-viewer/pdfium";
|
|
42
|
-
import "@pdf-viewer/pdfium/compat";
|
|
43
43
|
import "../utils/getThumbnailViewport.js";
|
|
44
44
|
import "../contexts/ConfigContext.js";
|
|
45
45
|
import "../utils/hooks/usePdfProperties.js";
|
|
@@ -56,15 +56,11 @@ import "../contexts/DimensionPagesContext.js";
|
|
|
56
56
|
import "../contexts/SmoothScrollContext.js";
|
|
57
57
|
import "../utils/getScrollDistance.js";
|
|
58
58
|
import "./page/TextLayer.js";
|
|
59
|
-
import "../contexts/SearchContext.js";
|
|
60
|
-
import "../utils/hooks/useSearch.js";
|
|
61
59
|
import "../utils/highlight.js";
|
|
62
60
|
import "../utils/charators.js";
|
|
63
|
-
import "../
|
|
64
|
-
import "../utils/
|
|
61
|
+
import "../contexts/SearchContext.js";
|
|
62
|
+
import "../utils/hooks/useSearch.js";
|
|
65
63
|
import "../utils/getWordPositionInPage.js";
|
|
66
|
-
import "../contexts/TextSelectionContext.js";
|
|
67
|
-
import "../utils/glyphHitTest.js";
|
|
68
64
|
import "./page/AnnotationLayer.js";
|
|
69
65
|
import "../contexts/PrintContext.js";
|
|
70
66
|
import "../utils/hooks/usePrint.js";
|
|
@@ -90,7 +86,7 @@ import "./icons/LoaderIcon.js";
|
|
|
90
86
|
import "../utils/hooks/useFullScreen.js";
|
|
91
87
|
import "../contexts/LocalizationContext.js";
|
|
92
88
|
import "../utils/hooks/useLocalization.js";
|
|
93
|
-
import "../RPLayout.module-
|
|
89
|
+
import "../RPLayout.module-b4b23e29.js";
|
|
94
90
|
import "../contexts/ThemeContext.js";
|
|
95
91
|
import "../contexts/DarkModeContext.js";
|
|
96
92
|
import "../utils/hooks/useDarkMode.js";
|
|
@@ -110,46 +106,46 @@ function be() {
|
|
|
110
106
|
return be = Object.assign ? Object.assign.bind() : function(n) {
|
|
111
107
|
for (var e = 1; e < arguments.length; e++) {
|
|
112
108
|
var t = arguments[e];
|
|
113
|
-
for (var
|
|
114
|
-
({}).hasOwnProperty.call(t,
|
|
109
|
+
for (var r in t)
|
|
110
|
+
({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
115
111
|
}
|
|
116
112
|
return n;
|
|
117
113
|
}, be.apply(null, arguments);
|
|
118
114
|
}
|
|
119
|
-
function
|
|
115
|
+
function Ne(n) {
|
|
120
116
|
if (n === void 0)
|
|
121
117
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
122
118
|
return n;
|
|
123
119
|
}
|
|
124
120
|
function ze(n, e) {
|
|
125
|
-
return ze = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t,
|
|
126
|
-
return t.__proto__ =
|
|
121
|
+
return ze = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
|
|
122
|
+
return t.__proto__ = r, t;
|
|
127
123
|
}, ze(n, e);
|
|
128
124
|
}
|
|
129
|
-
function
|
|
125
|
+
function Ut(n, e) {
|
|
130
126
|
n.prototype = Object.create(e.prototype), n.prototype.constructor = n, ze(n, e);
|
|
131
127
|
}
|
|
132
|
-
var
|
|
128
|
+
var Pe = Number.isNaN || function(e) {
|
|
133
129
|
return typeof e == "number" && e !== e;
|
|
134
130
|
};
|
|
135
|
-
function
|
|
136
|
-
return !!(n === e ||
|
|
131
|
+
function Vt(n, e) {
|
|
132
|
+
return !!(n === e || Pe(n) && Pe(e));
|
|
137
133
|
}
|
|
138
|
-
function
|
|
134
|
+
function qt(n, e) {
|
|
139
135
|
if (n.length !== e.length)
|
|
140
136
|
return !1;
|
|
141
137
|
for (var t = 0; t < n.length; t++)
|
|
142
|
-
if (!
|
|
138
|
+
if (!Vt(n[t], e[t]))
|
|
143
139
|
return !1;
|
|
144
140
|
return !0;
|
|
145
141
|
}
|
|
146
142
|
function Te(n, e) {
|
|
147
|
-
e === void 0 && (e =
|
|
148
|
-
var t,
|
|
143
|
+
e === void 0 && (e = qt);
|
|
144
|
+
var t, r = [], s, l = !1;
|
|
149
145
|
function a() {
|
|
150
|
-
for (var c = [],
|
|
151
|
-
c[
|
|
152
|
-
return l && t === this && e(c,
|
|
146
|
+
for (var c = [], f = 0; f < arguments.length; f++)
|
|
147
|
+
c[f] = arguments[f];
|
|
148
|
+
return l && t === this && e(c, r) || (s = n.apply(this, c), l = !0, t = this, r = c), s;
|
|
153
149
|
}
|
|
154
150
|
return a;
|
|
155
151
|
}
|
|
@@ -157,15 +153,15 @@ function Fe(n, e) {
|
|
|
157
153
|
if (n == null)
|
|
158
154
|
return {};
|
|
159
155
|
var t = {};
|
|
160
|
-
for (var
|
|
161
|
-
if ({}.hasOwnProperty.call(n,
|
|
162
|
-
if (e.indexOf(
|
|
156
|
+
for (var r in n)
|
|
157
|
+
if ({}.hasOwnProperty.call(n, r)) {
|
|
158
|
+
if (e.indexOf(r) !== -1)
|
|
163
159
|
continue;
|
|
164
|
-
t[
|
|
160
|
+
t[r] = n[r];
|
|
165
161
|
}
|
|
166
162
|
return t;
|
|
167
163
|
}
|
|
168
|
-
var
|
|
164
|
+
var Gt = typeof performance == "object" && typeof performance.now == "function", De = Gt ? function() {
|
|
169
165
|
return performance.now();
|
|
170
166
|
} : function() {
|
|
171
167
|
return Date.now();
|
|
@@ -173,18 +169,18 @@ var Ut = typeof performance == "object" && typeof performance.now == "function",
|
|
|
173
169
|
function He(n) {
|
|
174
170
|
cancelAnimationFrame(n.id);
|
|
175
171
|
}
|
|
176
|
-
function
|
|
172
|
+
function $t(n, e) {
|
|
177
173
|
var t = De();
|
|
178
|
-
function
|
|
179
|
-
De() - t >= e ? n.call(null) : s.id = requestAnimationFrame(
|
|
174
|
+
function r() {
|
|
175
|
+
De() - t >= e ? n.call(null) : s.id = requestAnimationFrame(r);
|
|
180
176
|
}
|
|
181
177
|
var s = {
|
|
182
|
-
id: requestAnimationFrame(
|
|
178
|
+
id: requestAnimationFrame(r)
|
|
183
179
|
};
|
|
184
180
|
return s;
|
|
185
181
|
}
|
|
186
182
|
var Re = -1;
|
|
187
|
-
function
|
|
183
|
+
function jt(n) {
|
|
188
184
|
if (n === void 0 && (n = !1), Re === -1 || n) {
|
|
189
185
|
var e = document.createElement("div"), t = e.style;
|
|
190
186
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), Re = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
@@ -196,75 +192,75 @@ function ke(n) {
|
|
|
196
192
|
if (n === void 0 && (n = !1), se === null || n) {
|
|
197
193
|
var e = document.createElement("div"), t = e.style;
|
|
198
194
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
199
|
-
var
|
|
200
|
-
return s.width = "100px", s.height = "100px", e.appendChild(
|
|
195
|
+
var r = document.createElement("div"), s = r.style;
|
|
196
|
+
return s.width = "100px", s.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? se = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? se = "negative" : se = "positive-ascending"), document.body.removeChild(e), se;
|
|
201
197
|
}
|
|
202
198
|
return se;
|
|
203
199
|
}
|
|
204
|
-
var
|
|
200
|
+
var Bt = 150, Kt = function(e) {
|
|
205
201
|
var t = e.columnIndex;
|
|
206
202
|
e.data;
|
|
207
|
-
var
|
|
208
|
-
return
|
|
209
|
-
}, de = null,
|
|
210
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (de = /* @__PURE__ */ new WeakSet(),
|
|
211
|
-
function
|
|
212
|
-
var e, t = n.getColumnOffset,
|
|
203
|
+
var r = e.rowIndex;
|
|
204
|
+
return r + ":" + t;
|
|
205
|
+
}, de = null, fe = null, me = null;
|
|
206
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (de = /* @__PURE__ */ new WeakSet(), fe = /* @__PURE__ */ new WeakSet(), me = /* @__PURE__ */ new WeakSet());
|
|
207
|
+
function Zt(n) {
|
|
208
|
+
var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, s = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, f = n.getOffsetForColumnAndAlignment, g = n.getOffsetForRowAndAlignment, h = n.getRowHeight, _ = n.getRowOffset, i = n.getRowStartIndexForOffset, y = n.getRowStopIndexForStartIndex, w = n.initInstanceProps, S = n.shouldResetStyleCacheOnItemSizeChange, D = n.validateProps;
|
|
213
209
|
return e = /* @__PURE__ */ function(b) {
|
|
214
|
-
|
|
215
|
-
function I(
|
|
216
|
-
var
|
|
217
|
-
return
|
|
218
|
-
instance:
|
|
210
|
+
Ut(I, b);
|
|
211
|
+
function I(A) {
|
|
212
|
+
var o;
|
|
213
|
+
return o = b.call(this, A) || this, o._instanceProps = w(o.props, Ne(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
|
|
214
|
+
instance: Ne(o),
|
|
219
215
|
isScrolling: !1,
|
|
220
216
|
horizontalScrollDirection: "forward",
|
|
221
|
-
scrollLeft: typeof
|
|
222
|
-
scrollTop: typeof
|
|
217
|
+
scrollLeft: typeof o.props.initialScrollLeft == "number" ? o.props.initialScrollLeft : 0,
|
|
218
|
+
scrollTop: typeof o.props.initialScrollTop == "number" ? o.props.initialScrollTop : 0,
|
|
223
219
|
scrollUpdateWasRequested: !1,
|
|
224
220
|
verticalScrollDirection: "forward"
|
|
225
|
-
},
|
|
226
|
-
return
|
|
221
|
+
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Te(function(u, d, m, C, p, T, z, L) {
|
|
222
|
+
return o.props.onItemsRendered({
|
|
227
223
|
overscanColumnStartIndex: u,
|
|
228
224
|
overscanColumnStopIndex: d,
|
|
229
|
-
overscanRowStartIndex:
|
|
225
|
+
overscanRowStartIndex: m,
|
|
230
226
|
overscanRowStopIndex: C,
|
|
231
227
|
visibleColumnStartIndex: p,
|
|
232
228
|
visibleColumnStopIndex: T,
|
|
233
229
|
visibleRowStartIndex: z,
|
|
234
230
|
visibleRowStopIndex: L
|
|
235
231
|
});
|
|
236
|
-
}),
|
|
237
|
-
return
|
|
238
|
-
horizontalScrollDirection:
|
|
232
|
+
}), o._callOnScroll = void 0, o._callOnScroll = Te(function(u, d, m, C, p) {
|
|
233
|
+
return o.props.onScroll({
|
|
234
|
+
horizontalScrollDirection: m,
|
|
239
235
|
scrollLeft: u,
|
|
240
236
|
scrollTop: d,
|
|
241
237
|
verticalScrollDirection: C,
|
|
242
238
|
scrollUpdateWasRequested: p
|
|
243
239
|
});
|
|
244
|
-
}),
|
|
245
|
-
var
|
|
240
|
+
}), o._getItemStyle = void 0, o._getItemStyle = function(u, d) {
|
|
241
|
+
var m = o.props, C = m.columnWidth, p = m.direction, T = m.rowHeight, z = o._getItemStyleCache(S && C, S && p, S && T), L = u + ":" + d, M;
|
|
246
242
|
if (z.hasOwnProperty(L))
|
|
247
243
|
M = z[L];
|
|
248
244
|
else {
|
|
249
|
-
var E = t(
|
|
245
|
+
var E = t(o.props, d, o._instanceProps), R = p === "rtl";
|
|
250
246
|
z[L] = M = {
|
|
251
247
|
position: "absolute",
|
|
252
248
|
left: R ? void 0 : E,
|
|
253
249
|
right: R ? E : void 0,
|
|
254
|
-
top: _(
|
|
255
|
-
height: h(
|
|
256
|
-
width: l(
|
|
250
|
+
top: _(o.props, u, o._instanceProps),
|
|
251
|
+
height: h(o.props, u, o._instanceProps),
|
|
252
|
+
width: l(o.props, d, o._instanceProps)
|
|
257
253
|
};
|
|
258
254
|
}
|
|
259
255
|
return M;
|
|
260
|
-
},
|
|
256
|
+
}, o._getItemStyleCache = void 0, o._getItemStyleCache = Te(function(u, d, m) {
|
|
261
257
|
return {};
|
|
262
|
-
}),
|
|
263
|
-
var d = u.currentTarget,
|
|
264
|
-
|
|
258
|
+
}), o._onScroll = function(u) {
|
|
259
|
+
var d = u.currentTarget, m = d.clientHeight, C = d.clientWidth, p = d.scrollLeft, T = d.scrollTop, z = d.scrollHeight, L = d.scrollWidth;
|
|
260
|
+
o.setState(function(M) {
|
|
265
261
|
if (M.scrollLeft === p && M.scrollTop === T)
|
|
266
262
|
return null;
|
|
267
|
-
var E =
|
|
263
|
+
var E = o.props.direction, R = p;
|
|
268
264
|
if (E === "rtl")
|
|
269
265
|
switch (ke()) {
|
|
270
266
|
case "negative":
|
|
@@ -275,7 +271,7 @@ function jt(n) {
|
|
|
275
271
|
break;
|
|
276
272
|
}
|
|
277
273
|
R = Math.max(0, Math.min(R, L - C));
|
|
278
|
-
var F = Math.max(0, Math.min(T, z -
|
|
274
|
+
var F = Math.max(0, Math.min(T, z - m));
|
|
279
275
|
return {
|
|
280
276
|
isScrolling: !0,
|
|
281
277
|
horizontalScrollDirection: M.scrollLeft < p ? "forward" : "backward",
|
|
@@ -284,55 +280,55 @@ function jt(n) {
|
|
|
284
280
|
verticalScrollDirection: M.scrollTop < T ? "forward" : "backward",
|
|
285
281
|
scrollUpdateWasRequested: !1
|
|
286
282
|
};
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
var d =
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
},
|
|
294
|
-
|
|
283
|
+
}, o._resetIsScrollingDebounced);
|
|
284
|
+
}, o._outerRefSetter = function(u) {
|
|
285
|
+
var d = o.props.outerRef;
|
|
286
|
+
o._outerRef = u, typeof d == "function" ? d(u) : d != null && typeof d == "object" && d.hasOwnProperty("current") && (d.current = u);
|
|
287
|
+
}, o._resetIsScrollingDebounced = function() {
|
|
288
|
+
o._resetIsScrollingTimeoutId !== null && He(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = $t(o._resetIsScrolling, Bt);
|
|
289
|
+
}, o._resetIsScrolling = function() {
|
|
290
|
+
o._resetIsScrollingTimeoutId = null, o.setState({
|
|
295
291
|
isScrolling: !1
|
|
296
292
|
}, function() {
|
|
297
|
-
|
|
293
|
+
o._getItemStyleCache(-1);
|
|
298
294
|
});
|
|
299
|
-
},
|
|
295
|
+
}, o;
|
|
300
296
|
}
|
|
301
|
-
I.getDerivedStateFromProps = function(
|
|
302
|
-
return
|
|
297
|
+
I.getDerivedStateFromProps = function(o, u) {
|
|
298
|
+
return Jt(o, u), D(o), null;
|
|
303
299
|
};
|
|
304
300
|
var W = I.prototype;
|
|
305
|
-
return W.scrollTo = function(
|
|
306
|
-
var u =
|
|
307
|
-
u !== void 0 && (u = Math.max(0, u)), d !== void 0 && (d = Math.max(0, d)), this.setState(function(
|
|
308
|
-
return u === void 0 && (u =
|
|
309
|
-
horizontalScrollDirection:
|
|
301
|
+
return W.scrollTo = function(o) {
|
|
302
|
+
var u = o.scrollLeft, d = o.scrollTop;
|
|
303
|
+
u !== void 0 && (u = Math.max(0, u)), d !== void 0 && (d = Math.max(0, d)), this.setState(function(m) {
|
|
304
|
+
return u === void 0 && (u = m.scrollLeft), d === void 0 && (d = m.scrollTop), m.scrollLeft === u && m.scrollTop === d ? null : {
|
|
305
|
+
horizontalScrollDirection: m.scrollLeft < u ? "forward" : "backward",
|
|
310
306
|
scrollLeft: u,
|
|
311
307
|
scrollTop: d,
|
|
312
308
|
scrollUpdateWasRequested: !0,
|
|
313
|
-
verticalScrollDirection:
|
|
309
|
+
verticalScrollDirection: m.scrollTop < d ? "forward" : "backward"
|
|
314
310
|
};
|
|
315
311
|
}, this._resetIsScrollingDebounced);
|
|
316
|
-
}, W.scrollToItem = function(
|
|
317
|
-
var u =
|
|
318
|
-
|
|
319
|
-
var H = a(this.props, this._instanceProps),
|
|
312
|
+
}, W.scrollToItem = function(o) {
|
|
313
|
+
var u = o.align, d = u === void 0 ? "auto" : u, m = o.columnIndex, C = o.rowIndex, p = this.props, T = p.columnCount, z = p.height, L = p.rowCount, M = p.width, E = this.state, R = E.scrollLeft, F = E.scrollTop, P = jt();
|
|
314
|
+
m !== void 0 && (m = Math.max(0, Math.min(m, T - 1))), C !== void 0 && (C = Math.max(0, Math.min(C, L - 1)));
|
|
315
|
+
var H = a(this.props, this._instanceProps), N = c(this.props, this._instanceProps), k = N > M ? P : 0, Z = H > z ? P : 0;
|
|
320
316
|
this.scrollTo({
|
|
321
|
-
scrollLeft:
|
|
317
|
+
scrollLeft: m !== void 0 ? f(this.props, m, d, R, this._instanceProps, Z) : R,
|
|
322
318
|
scrollTop: C !== void 0 ? g(this.props, C, d, F, this._instanceProps, k) : F
|
|
323
319
|
});
|
|
324
320
|
}, W.componentDidMount = function() {
|
|
325
|
-
var
|
|
321
|
+
var o = this.props, u = o.initialScrollLeft, d = o.initialScrollTop;
|
|
326
322
|
if (this._outerRef != null) {
|
|
327
|
-
var
|
|
328
|
-
typeof u == "number" && (
|
|
323
|
+
var m = this._outerRef;
|
|
324
|
+
typeof u == "number" && (m.scrollLeft = u), typeof d == "number" && (m.scrollTop = d);
|
|
329
325
|
}
|
|
330
326
|
this._callPropsCallbacks();
|
|
331
327
|
}, W.componentDidUpdate = function() {
|
|
332
|
-
var
|
|
328
|
+
var o = this.props.direction, u = this.state, d = u.scrollLeft, m = u.scrollTop, C = u.scrollUpdateWasRequested;
|
|
333
329
|
if (C && this._outerRef != null) {
|
|
334
330
|
var p = this._outerRef;
|
|
335
|
-
if (
|
|
331
|
+
if (o === "rtl")
|
|
336
332
|
switch (ke()) {
|
|
337
333
|
case "negative":
|
|
338
334
|
p.scrollLeft = -d;
|
|
@@ -347,30 +343,30 @@ function jt(n) {
|
|
|
347
343
|
}
|
|
348
344
|
else
|
|
349
345
|
p.scrollLeft = Math.max(0, d);
|
|
350
|
-
p.scrollTop = Math.max(0,
|
|
346
|
+
p.scrollTop = Math.max(0, m);
|
|
351
347
|
}
|
|
352
348
|
this._callPropsCallbacks();
|
|
353
349
|
}, W.componentWillUnmount = function() {
|
|
354
350
|
this._resetIsScrollingTimeoutId !== null && He(this._resetIsScrollingTimeoutId);
|
|
355
351
|
}, W.render = function() {
|
|
356
|
-
var
|
|
357
|
-
if (
|
|
358
|
-
for (var
|
|
359
|
-
for (var
|
|
360
|
-
|
|
361
|
-
columnIndex:
|
|
352
|
+
var o = this.props, u = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, T = o.innerRef, z = o.innerElementType, L = o.innerTagName, M = o.itemData, E = o.itemKey, R = E === void 0 ? Kt : E, F = o.outerElementType, P = o.outerTagName, H = o.rowCount, N = o.style, k = o.useIsScrolling, Z = o.width, J = this.state.isScrolling, Q = this._getHorizontalRangeToRender(), ie = Q[0], j = Q[1], le = this._getVerticalRangeToRender(), X = le[0], Y = le[1], ee = [];
|
|
353
|
+
if (m > 0 && H)
|
|
354
|
+
for (var B = X; B <= Y; B++)
|
|
355
|
+
for (var K = ie; K <= j; K++)
|
|
356
|
+
ee.push(ue(u, {
|
|
357
|
+
columnIndex: K,
|
|
362
358
|
data: M,
|
|
363
359
|
isScrolling: k ? J : void 0,
|
|
364
360
|
key: R({
|
|
365
|
-
columnIndex:
|
|
361
|
+
columnIndex: K,
|
|
366
362
|
data: M,
|
|
367
|
-
rowIndex:
|
|
363
|
+
rowIndex: B
|
|
368
364
|
}),
|
|
369
|
-
rowIndex:
|
|
370
|
-
style: this._getItemStyle(
|
|
365
|
+
rowIndex: B,
|
|
366
|
+
style: this._getItemStyle(B, K)
|
|
371
367
|
}));
|
|
372
|
-
var
|
|
373
|
-
return ue(F ||
|
|
368
|
+
var pe = a(this.props, this._instanceProps), te = c(this.props, this._instanceProps);
|
|
369
|
+
return ue(F || P || "div", {
|
|
374
370
|
className: d,
|
|
375
371
|
onScroll: this._onScroll,
|
|
376
372
|
ref: this._outerRefSetter,
|
|
@@ -382,50 +378,50 @@ function jt(n) {
|
|
|
382
378
|
WebkitOverflowScrolling: "touch",
|
|
383
379
|
willChange: "transform",
|
|
384
380
|
direction: C
|
|
385
|
-
},
|
|
381
|
+
}, N)
|
|
386
382
|
}, ue(z || L || "div", {
|
|
387
|
-
children:
|
|
383
|
+
children: ee,
|
|
388
384
|
ref: T,
|
|
389
385
|
style: {
|
|
390
|
-
height:
|
|
386
|
+
height: pe,
|
|
391
387
|
pointerEvents: J ? "none" : void 0,
|
|
392
|
-
width:
|
|
388
|
+
width: te
|
|
393
389
|
}
|
|
394
390
|
}));
|
|
395
391
|
}, W._callPropsCallbacks = function() {
|
|
396
|
-
var
|
|
392
|
+
var o = this.props, u = o.columnCount, d = o.onItemsRendered, m = o.onScroll, C = o.rowCount;
|
|
397
393
|
if (typeof d == "function" && u > 0 && C > 0) {
|
|
398
|
-
var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(), R = E[0], F = E[1],
|
|
399
|
-
this._callOnItemsRendered(T, z, R, F, L, M,
|
|
394
|
+
var p = this._getHorizontalRangeToRender(), T = p[0], z = p[1], L = p[2], M = p[3], E = this._getVerticalRangeToRender(), R = E[0], F = E[1], P = E[2], H = E[3];
|
|
395
|
+
this._callOnItemsRendered(T, z, R, F, L, M, P, H);
|
|
400
396
|
}
|
|
401
|
-
if (typeof
|
|
402
|
-
var
|
|
403
|
-
this._callOnScroll(Z, J, k,
|
|
397
|
+
if (typeof m == "function") {
|
|
398
|
+
var N = this.state, k = N.horizontalScrollDirection, Z = N.scrollLeft, J = N.scrollTop, Q = N.scrollUpdateWasRequested, ie = N.verticalScrollDirection;
|
|
399
|
+
this._callOnScroll(Z, J, k, ie, Q);
|
|
404
400
|
}
|
|
405
401
|
}, W._getHorizontalRangeToRender = function() {
|
|
406
|
-
var
|
|
402
|
+
var o = this.props, u = o.columnCount, d = o.overscanColumnCount, m = o.overscanColumnsCount, C = o.overscanCount, p = o.rowCount, T = this.state, z = T.horizontalScrollDirection, L = T.isScrolling, M = T.scrollLeft, E = d || m || C || 1;
|
|
407
403
|
if (u === 0 || p === 0)
|
|
408
404
|
return [0, 0, 0, 0];
|
|
409
|
-
var R =
|
|
410
|
-
return [Math.max(0, R -
|
|
405
|
+
var R = r(this.props, M, this._instanceProps), F = s(this.props, R, M, this._instanceProps), P = !L || z === "backward" ? Math.max(1, E) : 1, H = !L || z === "forward" ? Math.max(1, E) : 1;
|
|
406
|
+
return [Math.max(0, R - P), Math.max(0, Math.min(u - 1, F + H)), R, F];
|
|
411
407
|
}, W._getVerticalRangeToRender = function() {
|
|
412
|
-
var
|
|
408
|
+
var o = this.props, u = o.columnCount, d = o.overscanCount, m = o.overscanRowCount, C = o.overscanRowsCount, p = o.rowCount, T = this.state, z = T.isScrolling, L = T.verticalScrollDirection, M = T.scrollTop, E = m || C || d || 1;
|
|
413
409
|
if (u === 0 || p === 0)
|
|
414
410
|
return [0, 0, 0, 0];
|
|
415
|
-
var R = i(this.props, M, this._instanceProps), F = y(this.props, R, M, this._instanceProps),
|
|
416
|
-
return [Math.max(0, R -
|
|
411
|
+
var R = i(this.props, M, this._instanceProps), F = y(this.props, R, M, this._instanceProps), P = !z || L === "backward" ? Math.max(1, E) : 1, H = !z || L === "forward" ? Math.max(1, E) : 1;
|
|
412
|
+
return [Math.max(0, R - P), Math.max(0, Math.min(p - 1, F + H)), R, F];
|
|
417
413
|
}, I;
|
|
418
|
-
}(
|
|
414
|
+
}(at), e.defaultProps = {
|
|
419
415
|
direction: "ltr",
|
|
420
416
|
itemData: void 0,
|
|
421
417
|
useIsScrolling: !1
|
|
422
418
|
}, e;
|
|
423
419
|
}
|
|
424
|
-
var
|
|
425
|
-
var
|
|
420
|
+
var Jt = function(e, t) {
|
|
421
|
+
var r = e.children, s = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, f = e.overscanColumnsCount, g = e.overscanCount, h = e.overscanRowsCount, _ = e.width, i = t.instance;
|
|
426
422
|
if (process.env.NODE_ENV !== "production") {
|
|
427
|
-
if (typeof g == "number" && de && !de.has(i) && (de.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof
|
|
428
|
-
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (
|
|
423
|
+
if (typeof g == "number" && de && !de.has(i) && (de.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof f == "number" || typeof h == "number") && fe && !fe.has(i) && (fe.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && me && !me.has(i) && (me.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
424
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
429
425
|
switch (s) {
|
|
430
426
|
case "ltr":
|
|
431
427
|
case "rtl":
|
|
@@ -439,59 +435,59 @@ var Bt = function(e, t) {
|
|
|
439
435
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (l === null ? "null" : typeof l) + '" was specified.'));
|
|
440
436
|
}
|
|
441
437
|
}, Ue = 50, Ke = function(e, t) {
|
|
442
|
-
var
|
|
443
|
-
if (a >=
|
|
444
|
-
var
|
|
445
|
-
c =
|
|
438
|
+
var r = e.rowCount, s = t.rowMetadataMap, l = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, c = 0;
|
|
439
|
+
if (a >= r && (a = r - 1), a >= 0) {
|
|
440
|
+
var f = s[a];
|
|
441
|
+
c = f.offset + f.size;
|
|
446
442
|
}
|
|
447
|
-
var g =
|
|
443
|
+
var g = r - a - 1, h = g * l;
|
|
448
444
|
return c + h;
|
|
449
445
|
}, Ze = function(e, t) {
|
|
450
|
-
var
|
|
451
|
-
if (a >=
|
|
452
|
-
var
|
|
453
|
-
c =
|
|
446
|
+
var r = e.columnCount, s = t.columnMetadataMap, l = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, c = 0;
|
|
447
|
+
if (a >= r && (a = r - 1), a >= 0) {
|
|
448
|
+
var f = s[a];
|
|
449
|
+
c = f.offset + f.size;
|
|
454
450
|
}
|
|
455
|
-
var g =
|
|
451
|
+
var g = r - a - 1, h = g * l;
|
|
456
452
|
return c + h;
|
|
457
|
-
}, $ = function(e, t,
|
|
453
|
+
}, $ = function(e, t, r, s) {
|
|
458
454
|
var l, a, c;
|
|
459
|
-
if (e === "column" ? (l = s.columnMetadataMap, a = t.columnWidth, c = s.lastMeasuredColumnIndex) : (l = s.rowMetadataMap, a = t.rowHeight, c = s.lastMeasuredRowIndex),
|
|
460
|
-
var
|
|
455
|
+
if (e === "column" ? (l = s.columnMetadataMap, a = t.columnWidth, c = s.lastMeasuredColumnIndex) : (l = s.rowMetadataMap, a = t.rowHeight, c = s.lastMeasuredRowIndex), r > c) {
|
|
456
|
+
var f = 0;
|
|
461
457
|
if (c >= 0) {
|
|
462
458
|
var g = l[c];
|
|
463
|
-
|
|
459
|
+
f = g.offset + g.size;
|
|
464
460
|
}
|
|
465
|
-
for (var h = c + 1; h <=
|
|
461
|
+
for (var h = c + 1; h <= r; h++) {
|
|
466
462
|
var _ = a(h);
|
|
467
463
|
l[h] = {
|
|
468
|
-
offset:
|
|
464
|
+
offset: f,
|
|
469
465
|
size: _
|
|
470
|
-
},
|
|
466
|
+
}, f += _;
|
|
471
467
|
}
|
|
472
|
-
e === "column" ? s.lastMeasuredColumnIndex =
|
|
468
|
+
e === "column" ? s.lastMeasuredColumnIndex = r : s.lastMeasuredRowIndex = r;
|
|
473
469
|
}
|
|
474
|
-
return l[
|
|
475
|
-
}, Ve = function(e, t,
|
|
470
|
+
return l[r];
|
|
471
|
+
}, Ve = function(e, t, r, s) {
|
|
476
472
|
var l, a;
|
|
477
|
-
e === "column" ? (l =
|
|
473
|
+
e === "column" ? (l = r.columnMetadataMap, a = r.lastMeasuredColumnIndex) : (l = r.rowMetadataMap, a = r.lastMeasuredRowIndex);
|
|
478
474
|
var c = a > 0 ? l[a].offset : 0;
|
|
479
|
-
return c >= s ? Je(e, t,
|
|
480
|
-
}, Je = function(e, t,
|
|
475
|
+
return c >= s ? Je(e, t, r, a, 0, s) : Qt(e, t, r, Math.max(0, a), s);
|
|
476
|
+
}, Je = function(e, t, r, s, l, a) {
|
|
481
477
|
for (; l <= s; ) {
|
|
482
|
-
var c = l + Math.floor((s - l) / 2),
|
|
483
|
-
if (
|
|
478
|
+
var c = l + Math.floor((s - l) / 2), f = $(e, t, c, r).offset;
|
|
479
|
+
if (f === a)
|
|
484
480
|
return c;
|
|
485
|
-
|
|
481
|
+
f < a ? l = c + 1 : f > a && (s = c - 1);
|
|
486
482
|
}
|
|
487
483
|
return l > 0 ? l - 1 : 0;
|
|
488
|
-
},
|
|
489
|
-
for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; s < a && $(e, t, s,
|
|
484
|
+
}, Qt = function(e, t, r, s, l) {
|
|
485
|
+
for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; s < a && $(e, t, s, r).offset < l; )
|
|
490
486
|
s += c, c *= 2;
|
|
491
|
-
return Je(e, t,
|
|
492
|
-
}, qe = function(e, t,
|
|
493
|
-
var
|
|
494
|
-
switch (s === "smart" && (l >= i -
|
|
487
|
+
return Je(e, t, r, Math.min(s, a - 1), Math.floor(s / 2), l);
|
|
488
|
+
}, qe = function(e, t, r, s, l, a, c) {
|
|
489
|
+
var f = e === "column" ? t.width : t.height, g = $(e, t, r, a), h = e === "column" ? Ze(t, a) : Ke(t, a), _ = Math.max(0, Math.min(h - f, g.offset)), i = Math.max(0, g.offset - f + c + g.size);
|
|
490
|
+
switch (s === "smart" && (l >= i - f && l <= _ + f ? s = "auto" : s = "center"), s) {
|
|
495
491
|
case "start":
|
|
496
492
|
return _;
|
|
497
493
|
case "end":
|
|
@@ -502,45 +498,45 @@ var Bt = function(e, t) {
|
|
|
502
498
|
default:
|
|
503
499
|
return l >= i && l <= _ ? l : i > _ || l < i ? i : _;
|
|
504
500
|
}
|
|
505
|
-
},
|
|
506
|
-
getColumnOffset: function(e, t,
|
|
507
|
-
return $("column", e, t,
|
|
501
|
+
}, Xt = /* @__PURE__ */ Zt({
|
|
502
|
+
getColumnOffset: function(e, t, r) {
|
|
503
|
+
return $("column", e, t, r).offset;
|
|
508
504
|
},
|
|
509
|
-
getColumnStartIndexForOffset: function(e, t,
|
|
510
|
-
return Ve("column", e,
|
|
505
|
+
getColumnStartIndexForOffset: function(e, t, r) {
|
|
506
|
+
return Ve("column", e, r, t);
|
|
511
507
|
},
|
|
512
|
-
getColumnStopIndexForStartIndex: function(e, t,
|
|
513
|
-
for (var l = e.columnCount, a = e.width, c = $("column", e, t, s),
|
|
508
|
+
getColumnStopIndexForStartIndex: function(e, t, r, s) {
|
|
509
|
+
for (var l = e.columnCount, a = e.width, c = $("column", e, t, s), f = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < f; )
|
|
514
510
|
h++, g += $("column", e, h, s).size;
|
|
515
511
|
return h;
|
|
516
512
|
},
|
|
517
|
-
getColumnWidth: function(e, t,
|
|
518
|
-
return
|
|
513
|
+
getColumnWidth: function(e, t, r) {
|
|
514
|
+
return r.columnMetadataMap[t].size;
|
|
519
515
|
},
|
|
520
516
|
getEstimatedTotalHeight: Ke,
|
|
521
517
|
getEstimatedTotalWidth: Ze,
|
|
522
|
-
getOffsetForColumnAndAlignment: function(e, t,
|
|
523
|
-
return qe("column", e, t,
|
|
518
|
+
getOffsetForColumnAndAlignment: function(e, t, r, s, l, a) {
|
|
519
|
+
return qe("column", e, t, r, s, l, a);
|
|
524
520
|
},
|
|
525
|
-
getOffsetForRowAndAlignment: function(e, t,
|
|
526
|
-
return qe("row", e, t,
|
|
521
|
+
getOffsetForRowAndAlignment: function(e, t, r, s, l, a) {
|
|
522
|
+
return qe("row", e, t, r, s, l, a);
|
|
527
523
|
},
|
|
528
|
-
getRowOffset: function(e, t,
|
|
529
|
-
return $("row", e, t,
|
|
524
|
+
getRowOffset: function(e, t, r) {
|
|
525
|
+
return $("row", e, t, r).offset;
|
|
530
526
|
},
|
|
531
|
-
getRowHeight: function(e, t,
|
|
532
|
-
return
|
|
527
|
+
getRowHeight: function(e, t, r) {
|
|
528
|
+
return r.rowMetadataMap[t].size;
|
|
533
529
|
},
|
|
534
|
-
getRowStartIndexForOffset: function(e, t,
|
|
535
|
-
return Ve("row", e,
|
|
530
|
+
getRowStartIndexForOffset: function(e, t, r) {
|
|
531
|
+
return Ve("row", e, r, t);
|
|
536
532
|
},
|
|
537
|
-
getRowStopIndexForStartIndex: function(e, t,
|
|
538
|
-
for (var l = e.rowCount, a = e.height, c = $("row", e, t, s),
|
|
533
|
+
getRowStopIndexForStartIndex: function(e, t, r, s) {
|
|
534
|
+
for (var l = e.rowCount, a = e.height, c = $("row", e, t, s), f = r + a, g = c.offset + c.size, h = t; h < l - 1 && g < f; )
|
|
539
535
|
h++, g += $("row", e, h, s).size;
|
|
540
536
|
return h;
|
|
541
537
|
},
|
|
542
538
|
initInstanceProps: function(e, t) {
|
|
543
|
-
var
|
|
539
|
+
var r = e, s = r.estimatedColumnWidth, l = r.estimatedRowHeight, a = {
|
|
544
540
|
columnMetadataMap: {},
|
|
545
541
|
estimatedColumnWidth: s || Ue,
|
|
546
542
|
estimatedRowHeight: l || Ue,
|
|
@@ -548,29 +544,29 @@ var Bt = function(e, t) {
|
|
|
548
544
|
lastMeasuredRowIndex: -1,
|
|
549
545
|
rowMetadataMap: {}
|
|
550
546
|
};
|
|
551
|
-
return t.resetAfterColumnIndex = function(c,
|
|
552
|
-
|
|
547
|
+
return t.resetAfterColumnIndex = function(c, f) {
|
|
548
|
+
f === void 0 && (f = !0), t.resetAfterIndices({
|
|
553
549
|
columnIndex: c,
|
|
554
|
-
shouldForceUpdate:
|
|
550
|
+
shouldForceUpdate: f
|
|
555
551
|
});
|
|
556
|
-
}, t.resetAfterRowIndex = function(c,
|
|
557
|
-
|
|
552
|
+
}, t.resetAfterRowIndex = function(c, f) {
|
|
553
|
+
f === void 0 && (f = !0), t.resetAfterIndices({
|
|
558
554
|
rowIndex: c,
|
|
559
|
-
shouldForceUpdate:
|
|
555
|
+
shouldForceUpdate: f
|
|
560
556
|
});
|
|
561
557
|
}, t.resetAfterIndices = function(c) {
|
|
562
|
-
var
|
|
563
|
-
typeof
|
|
558
|
+
var f = c.columnIndex, g = c.rowIndex, h = c.shouldForceUpdate, _ = h === void 0 ? !0 : h;
|
|
559
|
+
typeof f == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, f - 1)), typeof g == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, g - 1)), t._getItemStyleCache(-1), _ && t.forceUpdate();
|
|
564
560
|
}, a;
|
|
565
561
|
},
|
|
566
562
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
567
563
|
validateProps: function(e) {
|
|
568
|
-
var t = e.columnWidth,
|
|
564
|
+
var t = e.columnWidth, r = e.rowHeight;
|
|
569
565
|
if (process.env.NODE_ENV !== "production") {
|
|
570
566
|
if (typeof t != "function")
|
|
571
567
|
throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (t === null ? "null" : typeof t) + '" was specified.'));
|
|
572
|
-
if (typeof
|
|
573
|
-
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (
|
|
568
|
+
if (typeof r != "function")
|
|
569
|
+
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
574
570
|
}
|
|
575
571
|
}
|
|
576
572
|
});
|
|
@@ -579,15 +575,15 @@ function Ge(n, e) {
|
|
|
579
575
|
for (var t in n)
|
|
580
576
|
if (!(t in e))
|
|
581
577
|
return !0;
|
|
582
|
-
for (var
|
|
583
|
-
if (n[
|
|
578
|
+
for (var r in e)
|
|
579
|
+
if (n[r] !== e[r])
|
|
584
580
|
return !0;
|
|
585
581
|
return !1;
|
|
586
582
|
}
|
|
587
|
-
var
|
|
588
|
-
function
|
|
589
|
-
var t = n.style,
|
|
590
|
-
return !Ge(t, s) && !Ge(
|
|
583
|
+
var Yt = ["style"], er = ["style"];
|
|
584
|
+
function tr(n, e) {
|
|
585
|
+
var t = n.style, r = Fe(n, Yt), s = e.style, l = Fe(e, er);
|
|
586
|
+
return !Ge(t, s) && !Ge(r, l);
|
|
591
587
|
}
|
|
592
588
|
let V;
|
|
593
589
|
typeof window < "u" ? V = window : typeof self < "u" ? V = self : V = global;
|
|
@@ -599,19 +595,19 @@ ye == null || Be == null ? (Le = xe, Me = function(e) {
|
|
|
599
595
|
ye(e), xe(t);
|
|
600
596
|
}, Me = function(e) {
|
|
601
597
|
const t = Be(function() {
|
|
602
|
-
xe(
|
|
603
|
-
}),
|
|
598
|
+
xe(r), e();
|
|
599
|
+
}), r = je(function() {
|
|
604
600
|
ye(t), e();
|
|
605
601
|
}, $e);
|
|
606
|
-
return [t,
|
|
602
|
+
return [t, r];
|
|
607
603
|
});
|
|
608
|
-
function
|
|
609
|
-
let e, t,
|
|
610
|
-
const
|
|
611
|
-
if (!
|
|
604
|
+
function rr(n) {
|
|
605
|
+
let e, t, r, s, l, a, c;
|
|
606
|
+
const f = typeof document < "u" && document.attachEvent;
|
|
607
|
+
if (!f) {
|
|
612
608
|
a = function(b) {
|
|
613
|
-
const I = b.__resizeTriggers__, W = I.firstElementChild,
|
|
614
|
-
|
|
609
|
+
const I = b.__resizeTriggers__, W = I.firstElementChild, A = I.lastElementChild, o = W.firstElementChild;
|
|
610
|
+
A.scrollLeft = A.scrollWidth, A.scrollTop = A.scrollHeight, o.style.width = W.offsetWidth + 1 + "px", o.style.height = W.offsetHeight + 1 + "px", W.scrollLeft = W.scrollWidth, W.scrollTop = W.scrollHeight;
|
|
615
611
|
}, l = function(b) {
|
|
616
612
|
return b.offsetWidth !== b.__resizeLast__.width || b.offsetHeight !== b.__resizeLast__.height;
|
|
617
613
|
}, c = function(b) {
|
|
@@ -619,13 +615,13 @@ function Yt(n) {
|
|
|
619
615
|
return;
|
|
620
616
|
const I = this;
|
|
621
617
|
a(this), this.__resizeRAF__ && Le(this.__resizeRAF__), this.__resizeRAF__ = Me(function() {
|
|
622
|
-
l(I) && (I.__resizeLast__.width = I.offsetWidth, I.__resizeLast__.height = I.offsetHeight, I.__resizeListeners__.forEach(function(
|
|
623
|
-
|
|
618
|
+
l(I) && (I.__resizeLast__.width = I.offsetWidth, I.__resizeLast__.height = I.offsetHeight, I.__resizeListeners__.forEach(function(o) {
|
|
619
|
+
o.call(I, b);
|
|
624
620
|
}));
|
|
625
621
|
});
|
|
626
622
|
};
|
|
627
623
|
let i = !1, y = "";
|
|
628
|
-
|
|
624
|
+
r = "animationstart";
|
|
629
625
|
const w = "Webkit Moz O ms".split(" ");
|
|
630
626
|
let S = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), D = "";
|
|
631
627
|
{
|
|
@@ -633,7 +629,7 @@ function Yt(n) {
|
|
|
633
629
|
if (b.style.animationName !== void 0 && (i = !0), i === !1) {
|
|
634
630
|
for (let I = 0; I < w.length; I++)
|
|
635
631
|
if (b.style[w[I] + "AnimationName"] !== void 0) {
|
|
636
|
-
D = w[I], y = "-" + D.toLowerCase() + "-",
|
|
632
|
+
D = w[I], y = "-" + D.toLowerCase() + "-", r = S[I], i = !0;
|
|
637
633
|
break;
|
|
638
634
|
}
|
|
639
635
|
}
|
|
@@ -648,7 +644,7 @@ function Yt(n) {
|
|
|
648
644
|
};
|
|
649
645
|
return {
|
|
650
646
|
addResizeListener: function(i, y) {
|
|
651
|
-
if (
|
|
647
|
+
if (f)
|
|
652
648
|
i.attachEvent("onresize", y);
|
|
653
649
|
else {
|
|
654
650
|
if (!i.__resizeTriggers__) {
|
|
@@ -657,18 +653,18 @@ function Yt(n) {
|
|
|
657
653
|
const D = w.createElement("div");
|
|
658
654
|
D.className = "expand-trigger", D.appendChild(w.createElement("div"));
|
|
659
655
|
const b = w.createElement("div");
|
|
660
|
-
b.className = "contract-trigger", i.__resizeTriggers__.appendChild(D), i.__resizeTriggers__.appendChild(b), i.appendChild(i.__resizeTriggers__), a(i), i.addEventListener("scroll", c, !0),
|
|
656
|
+
b.className = "contract-trigger", i.__resizeTriggers__.appendChild(D), i.__resizeTriggers__.appendChild(b), i.appendChild(i.__resizeTriggers__), a(i), i.addEventListener("scroll", c, !0), r && (i.__resizeTriggers__.__animationListener__ = function(W) {
|
|
661
657
|
W.animationName === t && a(i);
|
|
662
|
-
}, i.__resizeTriggers__.addEventListener(
|
|
658
|
+
}, i.__resizeTriggers__.addEventListener(r, i.__resizeTriggers__.__animationListener__));
|
|
663
659
|
}
|
|
664
660
|
i.__resizeListeners__.push(y);
|
|
665
661
|
}
|
|
666
662
|
},
|
|
667
663
|
removeResizeListener: function(i, y) {
|
|
668
|
-
if (
|
|
664
|
+
if (f)
|
|
669
665
|
i.detachEvent("onresize", y);
|
|
670
666
|
else if (i.__resizeListeners__.splice(i.__resizeListeners__.indexOf(y), 1), !i.__resizeListeners__.length) {
|
|
671
|
-
i.removeEventListener("scroll", c, !0), i.__resizeTriggers__.__animationListener__ && (i.__resizeTriggers__.removeEventListener(
|
|
667
|
+
i.removeEventListener("scroll", c, !0), i.__resizeTriggers__.__animationListener__ && (i.__resizeTriggers__.removeEventListener(r, i.__resizeTriggers__.__animationListener__), i.__resizeTriggers__.__animationListener__ = null);
|
|
672
668
|
try {
|
|
673
669
|
i.__resizeTriggers__ = !i.removeChild(i.__resizeTriggers__);
|
|
674
670
|
} catch {
|
|
@@ -677,7 +673,7 @@ function Yt(n) {
|
|
|
677
673
|
}
|
|
678
674
|
};
|
|
679
675
|
}
|
|
680
|
-
class
|
|
676
|
+
class or extends lt {
|
|
681
677
|
constructor(...e) {
|
|
682
678
|
super(...e), this.state = {
|
|
683
679
|
height: this.props.defaultHeight || 0,
|
|
@@ -686,12 +682,12 @@ class er extends at {
|
|
|
686
682
|
this._timeoutId = null;
|
|
687
683
|
const {
|
|
688
684
|
disableHeight: t,
|
|
689
|
-
disableWidth:
|
|
685
|
+
disableWidth: r,
|
|
690
686
|
onResize: s
|
|
691
687
|
} = this.props;
|
|
692
688
|
if (this._parentNode) {
|
|
693
|
-
const l = window.getComputedStyle(this._parentNode) || {}, a = parseFloat(l.paddingLeft || "0"), c = parseFloat(l.paddingRight || "0"),
|
|
694
|
-
if (!t && this.state.height !== _ || !
|
|
689
|
+
const l = window.getComputedStyle(this._parentNode) || {}, a = parseFloat(l.paddingLeft || "0"), c = parseFloat(l.paddingRight || "0"), f = parseFloat(l.paddingTop || "0"), g = parseFloat(l.paddingBottom || "0"), h = this._parentNode.getBoundingClientRect(), _ = h.height - f - g, i = h.width - a - c;
|
|
690
|
+
if (!t && this.state.height !== _ || !r && this.state.width !== i) {
|
|
695
691
|
this.setState({
|
|
696
692
|
height: _,
|
|
697
693
|
width: i
|
|
@@ -722,10 +718,10 @@ class er extends at {
|
|
|
722
718
|
} = this.props, t = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
723
719
|
if (t != null && t.ownerDocument && t.ownerDocument.defaultView && t instanceof t.ownerDocument.defaultView.HTMLElement) {
|
|
724
720
|
this._parentNode = t;
|
|
725
|
-
const
|
|
726
|
-
|
|
721
|
+
const r = t.ownerDocument.defaultView.ResizeObserver;
|
|
722
|
+
r != null ? (this._resizeObserver = new r(() => {
|
|
727
723
|
this._timeoutId = setTimeout(this._onResize, 0);
|
|
728
|
-
}), this._resizeObserver.observe(t)) : (this._detectElementResize =
|
|
724
|
+
}), this._resizeObserver.observe(t)) : (this._detectElementResize = rr(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
|
|
729
725
|
}
|
|
730
726
|
}
|
|
731
727
|
componentWillUnmount() {
|
|
@@ -735,12 +731,12 @@ class er extends at {
|
|
|
735
731
|
const {
|
|
736
732
|
children: e,
|
|
737
733
|
defaultHeight: t,
|
|
738
|
-
defaultWidth:
|
|
734
|
+
defaultWidth: r,
|
|
739
735
|
disableHeight: s = !1,
|
|
740
736
|
disableWidth: l = !1,
|
|
741
737
|
doNotBailOutOnEmptyChildren: a = !1,
|
|
742
738
|
nonce: c,
|
|
743
|
-
onResize:
|
|
739
|
+
onResize: f,
|
|
744
740
|
style: g = {},
|
|
745
741
|
tagName: h = "div",
|
|
746
742
|
..._
|
|
@@ -761,15 +757,8 @@ class er extends at {
|
|
|
761
757
|
}, !D && e(S));
|
|
762
758
|
}
|
|
763
759
|
}
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
return window.devicePixelRatio || 1;
|
|
767
|
-
}
|
|
768
|
-
get sy() {
|
|
769
|
-
return window.devicePixelRatio || 1;
|
|
770
|
-
}
|
|
771
|
-
}, rr = lt(({ columnIndex: n, rowIndex: e, data: t, style: o }) => {
|
|
772
|
-
const s = Ot(
|
|
760
|
+
const nr = ct(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
761
|
+
const s = Wt(
|
|
773
762
|
e,
|
|
774
763
|
n,
|
|
775
764
|
t.columnCount,
|
|
@@ -780,13 +769,13 @@ const tr = class {
|
|
|
780
769
|
if (t.isDualPageWithCover) {
|
|
781
770
|
const a = s === t.totalPages && t.totalPages % 2 === 0;
|
|
782
771
|
if (e === 0 && s === 1 || a && n === 0) {
|
|
783
|
-
const
|
|
772
|
+
const f = t.columnWidths.reduce((g, h) => g + h, 0);
|
|
784
773
|
return /* @__PURE__ */ x(
|
|
785
774
|
"div",
|
|
786
775
|
{
|
|
787
776
|
style: {
|
|
788
|
-
...
|
|
789
|
-
width:
|
|
777
|
+
...r,
|
|
778
|
+
width: f,
|
|
790
779
|
display: "flex",
|
|
791
780
|
justifyContent: "center",
|
|
792
781
|
alignItems: "flex-start"
|
|
@@ -800,110 +789,112 @@ const tr = class {
|
|
|
800
789
|
"div",
|
|
801
790
|
{
|
|
802
791
|
style: {
|
|
803
|
-
...
|
|
792
|
+
...r,
|
|
804
793
|
display: "flex",
|
|
805
794
|
justifyContent: n === 0 ? "flex-end" : "flex-start",
|
|
806
795
|
alignItems: "flex-start"
|
|
807
796
|
},
|
|
808
797
|
children: /* @__PURE__ */ x(Ce, { style: { position: "relative" }, pageNumber: s }, s)
|
|
809
798
|
}
|
|
810
|
-
) : /* @__PURE__ */ x(Ce, { style:
|
|
811
|
-
},
|
|
812
|
-
const n = G(new
|
|
813
|
-
|
|
799
|
+
) : /* @__PURE__ */ x(Ce, { style: r, pageNumber: s }, s);
|
|
800
|
+
}, tr), $o = () => {
|
|
801
|
+
const n = G(new kt()), { initialPage: e = 1, initialScrollMode: t } = bt(), { pagesRef: r, setPagesRef: s, setContentRef: l } = zt(), { scrollToPage: a } = ft();
|
|
802
|
+
Dt(r);
|
|
814
803
|
const {
|
|
815
804
|
virtualScrollRef: c,
|
|
816
|
-
getVirtualScrollRef:
|
|
805
|
+
getVirtualScrollRef: f,
|
|
817
806
|
getPageScrollElementRef: g,
|
|
818
807
|
getVirtualScrollableElementRef: h,
|
|
819
808
|
setTotalInnerDimensions: _,
|
|
820
809
|
virtualScrollableElementRef: i,
|
|
821
810
|
totalInnerDimensions: y,
|
|
822
811
|
pageScrollElementRef: w
|
|
823
|
-
} =
|
|
812
|
+
} = dt(), S = G(!0), { nextPage: D, prevPage: b, setFocusedPage: I, focusedPage: W, totalPages: A } = mt(), { scrollMode: o } = gt(), { viewMode: u } = ht(), d = G(null), { loading: m, error: C } = pt(), { passwordRequired: p } = At(), { LoaderImageComponent: T } = Mt(), z = G(
|
|
824
813
|
y
|
|
825
814
|
), L = G({
|
|
826
815
|
viewMode: u,
|
|
827
|
-
scrollMode:
|
|
828
|
-
}), M = G(!1), E = G(), { isFullScreen: R } =
|
|
816
|
+
scrollMode: o
|
|
817
|
+
}), M = G(!1), E = G(), { isFullScreen: R } = wt(), {
|
|
829
818
|
pageDimension: F,
|
|
830
|
-
rowCount:
|
|
819
|
+
rowCount: P,
|
|
831
820
|
rowHeight: H,
|
|
832
|
-
columnCount:
|
|
821
|
+
columnCount: N,
|
|
833
822
|
columnWidth: k,
|
|
834
823
|
estimatedColumnWidth: Z,
|
|
835
824
|
estimatedRowHeight: J,
|
|
836
825
|
totalDimension: Q
|
|
837
|
-
} =
|
|
838
|
-
|
|
839
|
-
const X = G(
|
|
826
|
+
} = ut(), ie = Lt(y, 100), { onScroll: j, onTextSelect: le } = Ft();
|
|
827
|
+
Ht({ onTextSelect: le, pagesRef: r });
|
|
828
|
+
const X = G();
|
|
829
|
+
Ot(N, P, i, u);
|
|
830
|
+
const Y = G({
|
|
840
831
|
scrollTop: 0,
|
|
841
832
|
scrollLeft: 0
|
|
842
833
|
});
|
|
843
|
-
|
|
844
|
-
const { isPressed:
|
|
845
|
-
isPressed:
|
|
846
|
-
}),
|
|
847
|
-
const v = Array.from({ length:
|
|
834
|
+
yt(r);
|
|
835
|
+
const { isPressed: ee } = Tt(), { selectionMode: B } = Rt(), { initializeGrabScroll: K, resetGrabState: pe } = xt({
|
|
836
|
+
isPressed: ee
|
|
837
|
+
}), te = we(() => B === vt.HAND, [B]), Qe = we(() => {
|
|
838
|
+
const v = Array.from({ length: N }, (O, q) => k(q));
|
|
848
839
|
return {
|
|
849
|
-
columnCount:
|
|
840
|
+
columnCount: N,
|
|
850
841
|
isDualPageWithCover: u === Se.DUAL_PAGE_WITH_COVER,
|
|
851
842
|
columnWidths: v,
|
|
852
|
-
totalPages:
|
|
843
|
+
totalPages: A
|
|
853
844
|
};
|
|
854
|
-
}, [
|
|
845
|
+
}, [N, u, k, A]), he = ae(
|
|
855
846
|
(v) => {
|
|
856
|
-
const O = document.activeElement !==
|
|
847
|
+
const O = document.activeElement !== r;
|
|
857
848
|
!R && O || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), b()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), D()));
|
|
858
849
|
},
|
|
859
|
-
[D, b, R,
|
|
850
|
+
[D, b, R, o]
|
|
860
851
|
);
|
|
861
|
-
|
|
852
|
+
ne(() => (window.addEventListener("keydown", he), () => {
|
|
862
853
|
window.removeEventListener("keydown", he);
|
|
863
|
-
}), [he]),
|
|
854
|
+
}), [he]), ne(() => {
|
|
864
855
|
if (d.current && (d.current.style.position = "relative"), !!c)
|
|
865
|
-
for (let v = 0; v <
|
|
866
|
-
for (let O = 0; O <
|
|
856
|
+
for (let v = 0; v < P; v++)
|
|
857
|
+
for (let O = 0; O < N; O++)
|
|
867
858
|
c.resetAfterIndices({
|
|
868
859
|
columnIndex: O,
|
|
869
860
|
rowIndex: v,
|
|
870
861
|
shouldForceUpdate: !0
|
|
871
862
|
});
|
|
872
|
-
}, [
|
|
873
|
-
const
|
|
863
|
+
}, [P, N, F, c]);
|
|
864
|
+
const Xe = ae(
|
|
874
865
|
(v, O) => {
|
|
875
866
|
if (!i)
|
|
876
867
|
return { scrollTop: 0, scrollLeft: 0 };
|
|
877
|
-
const q =
|
|
878
|
-
return q ||
|
|
868
|
+
const q = Y.current.scrollTop > O, re = Y.current.scrollLeft > v;
|
|
869
|
+
return q || re ? Y.current : {
|
|
879
870
|
scrollTop: i.scrollTop,
|
|
880
871
|
scrollLeft: i.scrollLeft
|
|
881
872
|
};
|
|
882
873
|
},
|
|
883
874
|
[i]
|
|
884
|
-
), Ee =
|
|
875
|
+
), Ee = ae(
|
|
885
876
|
(v, O) => {
|
|
886
|
-
if (L.current.viewMode !== u || L.current.scrollMode !==
|
|
887
|
-
|
|
877
|
+
if (L.current.viewMode !== u || L.current.scrollMode !== o) {
|
|
878
|
+
X.current && clearTimeout(X.current), M.current = !0, a(W, "auto"), X.current = setTimeout(() => {
|
|
888
879
|
requestAnimationFrame(() => {
|
|
889
|
-
L.current = { viewMode: u, scrollMode:
|
|
880
|
+
L.current = { viewMode: u, scrollMode: o };
|
|
890
881
|
});
|
|
891
882
|
}, 100);
|
|
892
883
|
return;
|
|
893
884
|
}
|
|
894
|
-
const
|
|
885
|
+
const re = v.scrollTop, ge = v.scrollLeft;
|
|
895
886
|
if (!O.height || !O.width)
|
|
896
887
|
return;
|
|
897
888
|
M.current = !0;
|
|
898
|
-
const { height:
|
|
899
|
-
if (Oe ===
|
|
889
|
+
const { height: oe, width: ve } = O, { height: Oe, width: We } = z.current;
|
|
890
|
+
if (Oe === oe && We === ve)
|
|
900
891
|
return;
|
|
901
|
-
const
|
|
892
|
+
const rt = re / Oe * oe, ot = ge / We * ve, nt = Math.round(Math.min(rt, oe)) || 0, it = Math.round(Math.min(ot, ve)) || 0;
|
|
902
893
|
E.current = setTimeout(() => {
|
|
903
894
|
requestAnimationFrame(() => {
|
|
904
895
|
i == null || i.scrollTo({
|
|
905
|
-
top:
|
|
906
|
-
left:
|
|
896
|
+
top: nt,
|
|
897
|
+
left: it,
|
|
907
898
|
behavior: "auto"
|
|
908
899
|
});
|
|
909
900
|
});
|
|
@@ -912,55 +903,55 @@ const tr = class {
|
|
|
912
903
|
width: O.width
|
|
913
904
|
};
|
|
914
905
|
},
|
|
915
|
-
[i, u,
|
|
906
|
+
[i, u, o, a]
|
|
916
907
|
);
|
|
917
|
-
|
|
908
|
+
ne(() => {
|
|
918
909
|
clearTimeout(E.current);
|
|
919
|
-
const v = Array.from({ length:
|
|
920
|
-
(
|
|
910
|
+
const v = Array.from({ length: P }).reduce(
|
|
911
|
+
(re, ge, oe) => re + H(oe),
|
|
921
912
|
0
|
|
922
|
-
), O = Array.from({ length:
|
|
923
|
-
(
|
|
913
|
+
), O = Array.from({ length: N }).reduce(
|
|
914
|
+
(re, ge, oe) => re + k(oe),
|
|
924
915
|
0
|
|
925
|
-
), q =
|
|
926
|
-
|
|
916
|
+
), q = Xe(O, v);
|
|
917
|
+
Y.current = q, Ee(q, { height: v, width: O }), _({
|
|
927
918
|
height: v,
|
|
928
919
|
width: O
|
|
929
920
|
});
|
|
930
|
-
}, [F,
|
|
931
|
-
const
|
|
921
|
+
}, [F, P, N, Ee]);
|
|
922
|
+
const Ye = ae(
|
|
932
923
|
(v) => {
|
|
933
|
-
|
|
924
|
+
Y.current = {
|
|
934
925
|
scrollTop: v.scrollTop,
|
|
935
926
|
scrollLeft: v.scrollLeft
|
|
936
927
|
};
|
|
937
928
|
},
|
|
938
929
|
[i]
|
|
939
930
|
);
|
|
940
|
-
|
|
931
|
+
ne(() => {
|
|
941
932
|
if (j)
|
|
942
933
|
return w && w.addEventListener("scroll", j), i && i.addEventListener("scroll", j), () => {
|
|
943
934
|
w == null || w.removeEventListener("scroll", j), i == null || i.removeEventListener("scroll", j);
|
|
944
935
|
};
|
|
945
|
-
}, [i, w, j]),
|
|
946
|
-
|
|
936
|
+
}, [i, w, j]), ne(() => () => {
|
|
937
|
+
X.current && clearTimeout(X.current);
|
|
947
938
|
}, []);
|
|
948
|
-
const
|
|
949
|
-
[U["rp-cursor-grab"]]:
|
|
950
|
-
[U["rp-cursor-grabbing"]]:
|
|
951
|
-
}), [
|
|
939
|
+
const et = we(() => ce(U["rp-pages-container"], {
|
|
940
|
+
[U["rp-cursor-grab"]]: te && !ee,
|
|
941
|
+
[U["rp-cursor-grabbing"]]: te && ee
|
|
942
|
+
}), [te, ee]), tt = ae(
|
|
952
943
|
(v) => {
|
|
953
|
-
if (
|
|
944
|
+
if (te && v) {
|
|
954
945
|
const O = ce(U["rp-pages"]), q = document.querySelector(`.${O}`);
|
|
955
946
|
K(q);
|
|
956
947
|
}
|
|
957
948
|
},
|
|
958
|
-
[
|
|
949
|
+
[te, K, U]
|
|
959
950
|
);
|
|
960
|
-
return
|
|
961
|
-
|
|
962
|
-
}, [
|
|
963
|
-
if (!(
|
|
951
|
+
return ne(() => {
|
|
952
|
+
m && pe();
|
|
953
|
+
}, [m]), ne(() => {
|
|
954
|
+
if (!(ie.height === 0 || !S.current)) {
|
|
964
955
|
if (t === Ie.PAGE_SCROLLING) {
|
|
965
956
|
e !== W && w && I(e), S.current = !1;
|
|
966
957
|
return;
|
|
@@ -972,55 +963,55 @@ const tr = class {
|
|
|
972
963
|
t,
|
|
973
964
|
w,
|
|
974
965
|
I,
|
|
975
|
-
|
|
976
|
-
]), /* @__PURE__ */ _e(
|
|
977
|
-
/* @__PURE__ */ x(
|
|
978
|
-
|
|
966
|
+
ie
|
|
967
|
+
]), /* @__PURE__ */ _e(st, { children: [
|
|
968
|
+
/* @__PURE__ */ x(Pt, { ref: l, children: /* @__PURE__ */ x(
|
|
969
|
+
Nt,
|
|
979
970
|
{
|
|
980
971
|
ref: s,
|
|
981
972
|
tabIndex: -1,
|
|
982
|
-
className:
|
|
973
|
+
className: et,
|
|
983
974
|
style: {
|
|
984
|
-
"--scale-round-x": `${
|
|
985
|
-
"--scale-round-y": `${
|
|
975
|
+
"--scale-round-x": `${Ae(n.current.sx)[1]}px`,
|
|
976
|
+
"--scale-round-y": `${Ae(n.current.sy)[1]}px`
|
|
986
977
|
},
|
|
987
|
-
children: /* @__PURE__ */ x(
|
|
978
|
+
children: /* @__PURE__ */ x(or, { style: { minHeight: "50px" }, children: ({ width: v, height: O }) => /* @__PURE__ */ x("div", { "data-rp": "pages", ref: tt, style: { width: v, height: O }, children: o === Ie.PAGE_SCROLLING ? /* @__PURE__ */ x(
|
|
988
979
|
"div",
|
|
989
980
|
{
|
|
990
981
|
ref: g,
|
|
991
982
|
style: { width: v, height: O },
|
|
992
983
|
className: ce(U["rp-pages"], U["rp-page-scrolling-wrapper"]),
|
|
993
|
-
children: u === Se.DUAL_PAGE ? /* @__PURE__ */ x(
|
|
984
|
+
children: u === Se.DUAL_PAGE ? /* @__PURE__ */ x(Ct, { widths: k, heights: H }) : u === Se.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ x(St, { widths: k, heights: H }) : /* @__PURE__ */ x(It, { widths: k, heights: H })
|
|
994
985
|
}
|
|
995
986
|
) : J ? /* @__PURE__ */ x(
|
|
996
|
-
|
|
987
|
+
Xt,
|
|
997
988
|
{
|
|
998
|
-
ref:
|
|
999
|
-
itemData:
|
|
989
|
+
ref: f,
|
|
990
|
+
itemData: Qe,
|
|
1000
991
|
outerRef: h,
|
|
1001
992
|
innerRef: d,
|
|
1002
|
-
onScroll:
|
|
1003
|
-
columnCount:
|
|
993
|
+
onScroll: Ye,
|
|
994
|
+
columnCount: N,
|
|
1004
995
|
columnWidth: k,
|
|
1005
996
|
rowHeight: H,
|
|
1006
997
|
height: O,
|
|
1007
998
|
width: v,
|
|
1008
999
|
estimatedColumnWidth: Z,
|
|
1009
1000
|
estimatedRowHeight: J,
|
|
1010
|
-
rowCount:
|
|
1001
|
+
rowCount: P,
|
|
1011
1002
|
className: ce(
|
|
1012
1003
|
U["rp-pages"],
|
|
1013
|
-
|
|
1004
|
+
o === Ie.HORIZONTAL_SCROLLING ? U["rp-pages-horizontal-scroll"] : ""
|
|
1014
1005
|
),
|
|
1015
1006
|
style: {
|
|
1016
1007
|
"--rp-pages-height": `${Q.height}px`,
|
|
1017
1008
|
"--rp-pages-width": `${Q.width}px`,
|
|
1018
|
-
"--rp-row-count": `${
|
|
1019
|
-
"--rp-column-count": `${
|
|
1009
|
+
"--rp-row-count": `${P}`,
|
|
1010
|
+
"--rp-column-count": `${N}`
|
|
1020
1011
|
},
|
|
1021
|
-
children:
|
|
1012
|
+
children: nr
|
|
1022
1013
|
}
|
|
1023
|
-
) : !
|
|
1014
|
+
) : !m && !C ? /* @__PURE__ */ x(
|
|
1024
1015
|
"div",
|
|
1025
1016
|
{
|
|
1026
1017
|
className: U["rp-loader"],
|
|
@@ -1033,7 +1024,7 @@ const tr = class {
|
|
|
1033
1024
|
},
|
|
1034
1025
|
children: T && /* @__PURE__ */ x(T, {})
|
|
1035
1026
|
}
|
|
1036
|
-
) : C ===
|
|
1027
|
+
) : C === _t.NOT_SUPPORTED ? /* @__PURE__ */ x("div", { className: U["rp-not-supported"], children: /* @__PURE__ */ _e("div", { className: U["rp-not-supported-content"], children: [
|
|
1037
1028
|
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
1038
1029
|
/* @__PURE__ */ x("div", { children: /* @__PURE__ */ _e("ul", { children: [
|
|
1039
1030
|
/* @__PURE__ */ x("li", { children: "Chrome 126+" }),
|
|
@@ -1046,9 +1037,9 @@ const tr = class {
|
|
|
1046
1037
|
] }) }) : null }) })
|
|
1047
1038
|
}
|
|
1048
1039
|
) }),
|
|
1049
|
-
p && /* @__PURE__ */ x(
|
|
1040
|
+
p && /* @__PURE__ */ x(Et, {})
|
|
1050
1041
|
] });
|
|
1051
1042
|
};
|
|
1052
1043
|
export {
|
|
1053
|
-
|
|
1044
|
+
$o as RPPages
|
|
1054
1045
|
};
|