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