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