@himail/xlsx 2.0.0 → 2.0.2
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 +13 -13
- package/lib/{v3/xm-office-excel.css → index.css} +1 -1
- package/lib/index.mjs +4 -0
- package/lib/index.umd.js +1 -0
- package/package.json +7 -19
- package/lib/index.d.ts +0 -12
- package/lib/script/postinstall.js +0 -15
- package/lib/script/switch-cli.js +0 -14
- package/lib/script/utils.js +0 -31
- package/lib/v3/index.css +0 -838
- package/lib/v3/index.js +0 -1
- package/lib/v3/xm-office-excel.mjs +0 -4
- package/lib/v3/xm-office-excel.umd.js +0 -1
package/package.json
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@himail/xlsx",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.mjs",
|
|
6
7
|
"files": [
|
|
7
|
-
"lib/"
|
|
8
|
+
"lib/",
|
|
9
|
+
"README.md"
|
|
8
10
|
],
|
|
9
11
|
"scripts": {
|
|
10
12
|
"clean": "rimraf lib",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"copyReadme": "cp ../../../help.md README.md || true",
|
|
14
|
-
"copyType": "cp index.d.ts lib/index.d.ts",
|
|
15
|
-
"copyScripts": "mkdir -p lib/script/ && cp ../../script/postinstall.js lib/script/postinstall.js && cp ../../script/switch-cli.js lib/script/switch-cli.js && cp ../../script/utils.js lib/script/utils.js",
|
|
16
|
-
"build:2": "npx vue-demi-switch 2 vue2 && vite build && npm run copyFile2",
|
|
17
|
-
"build:3": "npx vue-demi-switch 3 vue3 && vite build && npm run copyFile3",
|
|
18
|
-
"build": "npm run clean && npm run build:3 && npm run copyScripts && npm run copyType",
|
|
19
|
-
"postinstall": "node lib/script/postinstall.js"
|
|
13
|
+
"build:3": "vite build",
|
|
14
|
+
"build": "npm run clean && npm run build:3"
|
|
20
15
|
},
|
|
21
16
|
"peerDependencies": {
|
|
22
|
-
"
|
|
23
|
-
"vue": "^2.0.0 || >=3.0.0",
|
|
24
|
-
"vue-demi": "^0.14.6"
|
|
25
|
-
},
|
|
26
|
-
"peerDependenciesMeta": {
|
|
27
|
-
"@vue/composition-api": {
|
|
28
|
-
"optional": true
|
|
29
|
-
}
|
|
17
|
+
"vue": ">=3.0.0"
|
|
30
18
|
},
|
|
31
19
|
"keywords": [
|
|
32
20
|
"vue",
|
package/lib/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface Options {
|
|
2
|
-
minColLength?: number;
|
|
3
|
-
minRowLength?: number;
|
|
4
|
-
showContextmenu?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const xmExcel: {
|
|
7
|
-
install?: (vue: any) => void;
|
|
8
|
-
src: string | ArrayBuffer | Blob;
|
|
9
|
-
requestOptions?: any;
|
|
10
|
-
options?: Options;
|
|
11
|
-
};
|
|
12
|
-
export default xmExcel;
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
package/lib/script/switch-cli.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
package/lib/script/utils.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
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;
|