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