@risalabs_frontend_org/oasis-ui-kit 0.136.0 → 0.139.0
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/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/dots-with-popup/dots-with-popup.d.ts +14 -0
- package/dist/src/components/pdf-renderer/pdf-renderer.d.ts +6 -0
- package/dist/src/components/pdf-renderer/pdf-thumbnails.d.ts +9 -0
- package/dist/src/components/pdf-renderer/pdf-toolbar.d.ts +7 -0
- package/dist/src/components/pdf-renderer/types.d.ts +114 -0
- package/dist/src/components/popup-with-api/popup-with-api.d.ts +23 -0
- package/dist/src/hooks/use-portal.d.ts +2 -0
- package/package.json +12 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type PopupWithApiProps } from "../popup-with-api/popup-with-api";
|
|
3
|
+
import "./dots-with-popup.scss";
|
|
4
|
+
export interface DotsWithPopupProps {
|
|
5
|
+
popup: PopupWithApiProps;
|
|
6
|
+
className?: string;
|
|
7
|
+
triggerClassName?: string;
|
|
8
|
+
triggerAriaLabel?: string;
|
|
9
|
+
closeOnMarkSuccess?: boolean;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
getPortalContainer?: () => HTMLElement;
|
|
13
|
+
}
|
|
14
|
+
export declare function DotsWithPopup(props: DotsWithPopupProps): React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PdfRendererHandle, PdfRendererProps } from "./types";
|
|
3
|
+
import "./pdf-renderer.scss";
|
|
4
|
+
export type { PdfRendererProps, PdfRendererHandle, PdfRendererSource, PdfRendererFeatures, PdfToolbarContext, PdfPageInfo, PdfSearchSummary, PdfZoomLevel, } from "./types";
|
|
5
|
+
export declare const PdfRenderer: React.ForwardRefExoticComponent<PdfRendererProps & React.RefAttributes<PdfRendererHandle>>;
|
|
6
|
+
export default PdfRenderer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface PdfThumbnailsProps {
|
|
3
|
+
documentId: string;
|
|
4
|
+
width: number;
|
|
5
|
+
currentPage: number;
|
|
6
|
+
onSelect: (pageNumber: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function PdfThumbnails({ documentId, width, currentPage, onSelect, }: PdfThumbnailsProps): React.JSX.Element;
|
|
9
|
+
export default PdfThumbnails;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export type PdfZoomLevel = number | "automatic" | "fit-page" | "fit-width";
|
|
3
|
+
export type PdfRendererSource = string | ArrayBuffer | Uint8Array | Blob | {
|
|
4
|
+
url: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
mode?: "auto" | "range-request" | "full-fetch";
|
|
8
|
+
} | {
|
|
9
|
+
buffer: ArrayBuffer;
|
|
10
|
+
name: string;
|
|
11
|
+
password?: string;
|
|
12
|
+
};
|
|
13
|
+
export interface PdfRendererFeatures {
|
|
14
|
+
zoom?: boolean;
|
|
15
|
+
search?: boolean;
|
|
16
|
+
thumbnails?: boolean;
|
|
17
|
+
pageNavigation?: boolean;
|
|
18
|
+
gestureZoom?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type ResolvedFeatures = Required<PdfRendererFeatures>;
|
|
21
|
+
export interface PdfPageInfo {
|
|
22
|
+
pageIndex: number;
|
|
23
|
+
pageNumber: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PdfSearchSummary {
|
|
28
|
+
total: number;
|
|
29
|
+
activeResultIndex: number;
|
|
30
|
+
query: string;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface PdfToolbarContext {
|
|
34
|
+
currentPage: number;
|
|
35
|
+
totalPages: number;
|
|
36
|
+
zoom: number;
|
|
37
|
+
zoomLevel: PdfZoomLevel;
|
|
38
|
+
goToPage: (page: number) => void;
|
|
39
|
+
nextPage: () => void;
|
|
40
|
+
previousPage: () => void;
|
|
41
|
+
zoomIn: () => void;
|
|
42
|
+
zoomOut: () => void;
|
|
43
|
+
setZoom: (level: PdfZoomLevel) => void;
|
|
44
|
+
search: (query: string) => void;
|
|
45
|
+
nextSearchResult: () => void;
|
|
46
|
+
previousSearchResult: () => void;
|
|
47
|
+
clearSearch: () => void;
|
|
48
|
+
searchResults: PdfSearchSummary;
|
|
49
|
+
thumbnailsOpen: boolean;
|
|
50
|
+
toggleThumbnails: () => void;
|
|
51
|
+
features: ResolvedFeatures;
|
|
52
|
+
}
|
|
53
|
+
export interface PdfRendererHandle {
|
|
54
|
+
goToPage: (page: number) => void;
|
|
55
|
+
nextPage: () => void;
|
|
56
|
+
previousPage: () => void;
|
|
57
|
+
zoomIn: () => void;
|
|
58
|
+
zoomOut: () => void;
|
|
59
|
+
setZoom: (level: PdfZoomLevel) => void;
|
|
60
|
+
search: (query: string) => void;
|
|
61
|
+
nextSearchResult: () => void;
|
|
62
|
+
previousSearchResult: () => void;
|
|
63
|
+
clearSearch: () => void;
|
|
64
|
+
getState: () => {
|
|
65
|
+
currentPage: number;
|
|
66
|
+
totalPages: number;
|
|
67
|
+
zoom: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface PdfRendererProps {
|
|
71
|
+
src: PdfRendererSource;
|
|
72
|
+
password?: string;
|
|
73
|
+
features?: PdfRendererFeatures;
|
|
74
|
+
initialPage?: number;
|
|
75
|
+
page?: number;
|
|
76
|
+
initialZoom?: PdfZoomLevel;
|
|
77
|
+
scrollDirection?: "vertical" | "horizontal";
|
|
78
|
+
pageGap?: number;
|
|
79
|
+
minZoom?: number;
|
|
80
|
+
maxZoom?: number;
|
|
81
|
+
zoomStep?: number;
|
|
82
|
+
thumbnailWidth?: number;
|
|
83
|
+
thumbnailsPosition?: "left" | "right";
|
|
84
|
+
defaultThumbnailsOpen?: boolean;
|
|
85
|
+
wasmUrl?: string;
|
|
86
|
+
worker?: boolean;
|
|
87
|
+
toolbar?: ReactNode | ((ctx: PdfToolbarContext) => ReactNode) | false;
|
|
88
|
+
toolbarPosition?: "top" | "bottom";
|
|
89
|
+
renderLoading?: () => ReactNode;
|
|
90
|
+
renderError?: (error: Error | null) => ReactNode;
|
|
91
|
+
renderEmpty?: () => ReactNode;
|
|
92
|
+
renderPageOverlay?: (page: PdfPageInfo) => ReactNode;
|
|
93
|
+
className?: string;
|
|
94
|
+
style?: CSSProperties;
|
|
95
|
+
height?: number | string;
|
|
96
|
+
width?: number | string;
|
|
97
|
+
pageClassName?: string;
|
|
98
|
+
backgroundColor?: string;
|
|
99
|
+
searchHighlightColor?: string;
|
|
100
|
+
searchActiveHighlightColor?: string;
|
|
101
|
+
onDocumentLoad?: (info: {
|
|
102
|
+
documentId: string;
|
|
103
|
+
}) => void;
|
|
104
|
+
onError?: (error: Error | null) => void;
|
|
105
|
+
onPageChange?: (page: {
|
|
106
|
+
currentPage: number;
|
|
107
|
+
totalPages: number;
|
|
108
|
+
}) => void;
|
|
109
|
+
onZoomChange?: (zoom: {
|
|
110
|
+
zoomLevel: PdfZoomLevel;
|
|
111
|
+
currentZoomLevel: number;
|
|
112
|
+
}) => void;
|
|
113
|
+
onSearchResults?: (summary: PdfSearchSummary) => void;
|
|
114
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./popup-with-api.scss";
|
|
3
|
+
export interface PopupWithApiItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const POPUP_WITH_API_DEFAULT_ITEMS: PopupWithApiItem[];
|
|
9
|
+
export interface PopupWithApiProps {
|
|
10
|
+
items?: PopupWithApiItem[];
|
|
11
|
+
checkedById?: Record<string, boolean>;
|
|
12
|
+
defaultCheckedById?: Record<string, boolean>;
|
|
13
|
+
onCheckedChange?: (next: Record<string, boolean>) => void;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
onMarkAsSuccess: () => void | Promise<void>;
|
|
16
|
+
cancelLabel?: string;
|
|
17
|
+
markSuccessLabel?: string;
|
|
18
|
+
submittingLabel?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
checkboxesGroupLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function PopupWithApi(props: PopupWithApiProps): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@risalabs_frontend_org/oasis-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.139.0",
|
|
4
4
|
"description": "RISA Oasis UI",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -68,6 +68,17 @@
|
|
|
68
68
|
"webpack-cli": "^5.1.4"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
+
"@embedpdf/core": "^2.14.4",
|
|
72
|
+
"@embedpdf/engines": "^2.14.4",
|
|
73
|
+
"@embedpdf/pdfium": "^2.14.4",
|
|
74
|
+
"@embedpdf/plugin-document-manager": "^2.14.4",
|
|
75
|
+
"@embedpdf/plugin-interaction-manager": "^2.14.4",
|
|
76
|
+
"@embedpdf/plugin-render": "^2.14.4",
|
|
77
|
+
"@embedpdf/plugin-scroll": "^2.14.4",
|
|
78
|
+
"@embedpdf/plugin-search": "^2.14.4",
|
|
79
|
+
"@embedpdf/plugin-thumbnail": "^2.14.4",
|
|
80
|
+
"@embedpdf/plugin-viewport": "^2.14.4",
|
|
81
|
+
"@embedpdf/plugin-zoom": "^2.14.4",
|
|
71
82
|
"@storybook/react-webpack5": "^7.6.17",
|
|
72
83
|
"antd": "^5.24.3",
|
|
73
84
|
"date-fns": "^4.1.0",
|