@ghyassd/office-preview 0.1.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/README.md +55 -0
- package/dist/assets/xlsxParser.worker-CUZcso8W.js +38 -0
- package/dist/index.es.js +392 -0
- package/dist/index.umd.js +105 -0
- package/dist/style.css +1 -0
- package/dist/xlsx-BopDBbWb.js +24176 -0
- package/package.json +40 -0
- package/src/index.d.ts +38 -0
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ghyassd/office-preview",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vue office preview components for Word and Excel",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.umd.js",
|
|
8
|
+
"module": "dist/index.es.js",
|
|
9
|
+
"types": "src/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.d.ts",
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.umd.js"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/style.css",
|
|
17
|
+
"./dist/style.css": "./dist/style.css"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"src/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"dev": "vite"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"vue": "^3.4.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"xlsx": "^0.18.5"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@vitejs/plugin-vue": "^5.1.0",
|
|
38
|
+
"vite": "^5.4.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface OfficeFile {
|
|
4
|
+
hash?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
mimeType?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface OfficePageImagesResult {
|
|
12
|
+
images?: string[];
|
|
13
|
+
fallbackPdfUrl?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface OfficePreviewAdapter {
|
|
17
|
+
getArrayBuffer?: (file: OfficeFile) => Promise<ArrayBuffer>;
|
|
18
|
+
getPageImages?: (file: OfficeFile) => Promise<OfficePageImagesResult>;
|
|
19
|
+
getPdfUrl?: (file: OfficeFile) => string | Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface OfficePreviewProps {
|
|
23
|
+
file: OfficeFile;
|
|
24
|
+
adapter: OfficePreviewAdapter;
|
|
25
|
+
kind?: 'word' | 'excel' | '';
|
|
26
|
+
maxRows?: number;
|
|
27
|
+
maxCols?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const OfficePreview: DefineComponent<OfficePreviewProps>;
|
|
31
|
+
export const WordPreview: DefineComponent<{ file: OfficeFile; adapter: OfficePreviewAdapter }>;
|
|
32
|
+
export const ExcelPreview: DefineComponent<{ file: OfficeFile; adapter: OfficePreviewAdapter; maxRows?: number; maxCols?: number }>;
|
|
33
|
+
|
|
34
|
+
declare const _default: {
|
|
35
|
+
install: (app: import('vue').App) => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default _default;
|