office-singature 0.0.1
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/.vscode/extensions.json +3 -0
- package/README.md +5 -0
- package/deps/1.bat +1 -0
- package/deps/pdf/lib/index.d.ts +11 -0
- package/deps/pdf/lib/script/postinstall.js +15 -0
- package/deps/pdf/lib/script/switch-cli.js +14 -0
- package/deps/pdf/lib/script/utils.js +31 -0
- package/deps/pdf/lib/v2/index.js +5 -0
- package/deps/pdf/lib/v2/style.css +1 -0
- package/deps/pdf/lib/v2/vue-office-pdf.mjs +2109 -0
- package/deps/pdf/lib/v2/vue-office-pdf.umd.js +5 -0
- package/deps/pdf/lib/v3/index.js +5 -0
- package/deps/pdf/lib/v3/style.css +1 -0
- package/deps/pdf/lib/v3/vue-office-pdf.mjs +2071 -0
- package/deps/pdf/lib/v3/vue-office-pdf.umd.js +5 -0
- package/deps/pdf/package.json +28 -0
- package/deps/pdf.3.4.6.tar.gz +0 -0
- package/index.html +12 -0
- package/package.json +21 -0
- package/src/App.vue +48 -0
- package/src/components/index.ts +16 -0
- package/src/components/pdf.vue +88 -0
- package/src/main.ts +5 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Vue 3 + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
package/deps/1.bat
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tar zcvf pdf.tar.gz -C ./pdf .
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const VueOfficePdf: {
|
|
2
|
+
install?: (vue: any) => void;
|
|
3
|
+
src: string|ArrayBuffer|Blob;
|
|
4
|
+
rerender?: () => any;
|
|
5
|
+
staticFileUrl?: string,
|
|
6
|
+
requestOptions?: any;
|
|
7
|
+
options?: any;
|
|
8
|
+
getScale?: () => number;
|
|
9
|
+
setScale?: (number) => void;
|
|
10
|
+
};
|
|
11
|
+
export default VueOfficePdf;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { switchVersion, loadModule } = require('./utils');
|
|
2
|
+
const Vue = loadModule('vue');
|
|
3
|
+
if (!Vue || typeof Vue.version !== 'string') {
|
|
4
|
+
console.warn(
|
|
5
|
+
'[vue-office] Vue is not found. Please run "npm install vue" to install.'
|
|
6
|
+
);
|
|
7
|
+
} else if (Vue.version.startsWith('2.')) {
|
|
8
|
+
switchVersion(2);
|
|
9
|
+
} else if (Vue.version.startsWith('3.')) {
|
|
10
|
+
switchVersion(3);
|
|
11
|
+
} else {
|
|
12
|
+
console.warn(
|
|
13
|
+
`[vue-office] Vue version v${Vue.version} is not supported.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const { switchVersion } = require('./utils');
|
|
2
|
+
|
|
3
|
+
const version = process.argv[2];
|
|
4
|
+
|
|
5
|
+
if (version == '2') {
|
|
6
|
+
switchVersion(2);
|
|
7
|
+
} else if (version == '3') {
|
|
8
|
+
switchVersion(3);
|
|
9
|
+
} else {
|
|
10
|
+
console.warn(
|
|
11
|
+
`[vue-office] expecting version "2" or "3" but got "${version}"`
|
|
12
|
+
);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const dir = path.resolve(__dirname, '../');
|
|
4
|
+
function loadModule(name) {
|
|
5
|
+
try {
|
|
6
|
+
return require(name);
|
|
7
|
+
} catch (e) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function copy(name, version) {
|
|
13
|
+
const src = path.join(dir, `v${version}`, name);
|
|
14
|
+
const dest = path.join(dir, name);
|
|
15
|
+
if(!fs.existsSync(src)){
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let content = fs.readFileSync(src, 'utf-8');
|
|
19
|
+
try {
|
|
20
|
+
fs.unlinkSync(dest);
|
|
21
|
+
} catch (error) {}
|
|
22
|
+
fs.writeFileSync(dest, content, 'utf-8');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function switchVersion(version) {
|
|
26
|
+
copy('index.js', version);
|
|
27
|
+
copy('index.css', version);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports.loadModule = loadModule;
|
|
31
|
+
module.exports.switchVersion = switchVersion;
|