@corbe30/fortune-excel 1.0.3 → 1.0.5
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 +24 -24
- package/dist/HandleZip.js +90 -34
- package/dist/ImportHelper.d.ts +2 -0
- package/dist/ImportHelper.js +51 -0
- package/dist/ToExcel/ExcelBorder.js +141 -141
- package/dist/ToExcel/ExcelConvert.js +19 -8
- package/dist/ToExcel/ExcelFile.js +66 -22
- package/dist/ToExcel/ExcelImage.js +27 -17
- package/dist/ToExcel/ExcelStyle.js +7 -7
- package/dist/ToFortuneSheet/FortuneBase.js +84 -28
- package/dist/ToFortuneSheet/FortuneCell.js +205 -185
- package/dist/ToFortuneSheet/FortuneFile.js +117 -111
- package/dist/ToFortuneSheet/FortuneImage.js +35 -15
- package/dist/ToFortuneSheet/FortuneSheet.js +217 -191
- package/dist/ToFortuneSheet/ReadXml.js +114 -87
- package/dist/ToolbarItem.d.ts +13 -0
- package/dist/ToolbarItem.js +67 -0
- package/dist/Transform.d.ts +2 -0
- package/dist/Transform.js +78 -0
- package/dist/common/constant.js +24 -24
- package/dist/common/emf.js +5 -5
- package/dist/common/method.js +169 -162
- package/dist/icons/ExportIcon.d.ts +3 -0
- package/dist/icons/ExportIcon.js +7 -0
- package/dist/icons/ImportIcon.d.ts +3 -0
- package/dist/icons/ImportIcon.js +7 -0
- package/dist/main.d.ts +2 -2
- package/dist/main.js +2 -24
- package/package.json +2 -2
- package/tsconfig.json +4 -3
- package/.github/workflows/main.yml +0 -30
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
function ExportIcon() {
|
|
3
|
+
return React.createElement("svg", { width: "24", height: "24", fill: "none" },
|
|
4
|
+
React.createElement("path", { d: "M12 14L11.6464 14.3536L12 14.7071L12.3536 14.3536L12 14ZM12.5 5C12.5 4.72386 12.2761 4.5 12 4.5C11.7239 4.5 11.5 4.72386 11.5 5L12.5 5ZM6.64645 9.35355L11.6464 14.3536L12.3536 13.6464L7.35355 8.64645L6.64645 9.35355ZM12.3536 14.3536L17.3536 9.35355L16.6464 8.64645L11.6464 13.6464L12.3536 14.3536ZM12.5 14L12.5 5L11.5 5L11.5 14L12.5 14Z", fill: "#525C6F", "stroke-width": "0.35", stroke: "#525C6F" }),
|
|
5
|
+
React.createElement("path", { d: "M5 16L5 17C5 18.1046 5.89543 19 7 19L17 19C18.1046 19 19 18.1046 19 17V16", stroke: "#525C6F", "stroke-width": "1.25" }));
|
|
6
|
+
}
|
|
7
|
+
export default ExportIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
function ImportIcon() {
|
|
3
|
+
return React.createElement("svg", { width: "24", height: "24", fill: "none" },
|
|
4
|
+
React.createElement("path", { d: "M12 5L11.6464 4.64645L12 4.29289L12.3536 4.64645L12 5ZM12.5 14C12.5 14.2761 12.2761 14.5 12 14.5C11.7239 14.5 11.5 14.2761 11.5 14L12.5 14ZM6.64645 9.64645L11.6464 4.64645L12.3536 5.35355L7.35355 10.3536L6.64645 9.64645ZM12.3536 4.64645L17.3536 9.64645L16.6464 10.3536L11.6464 5.35355L12.3536 4.64645ZM12.5 5L12.5 14L11.5 14L11.5 5L12.5 5Z", fill: "#525C6F", stroke: "#525C6F", "stroke-width": "0.35" }),
|
|
5
|
+
React.createElement("path", { d: "M5 16L5 17C5 18.1046 5.89543 19 7 19L17 19C18.1046 19 19 18.1046 19 17V16", stroke: "#525C6F", "stroke-width": "1.25" }));
|
|
6
|
+
}
|
|
7
|
+
export default ImportIcon;
|
package/dist/main.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./ToolbarItem.js";
|
|
2
|
+
export * from "./ImportHelper.js";
|
package/dist/main.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { exportSheetExcel } from "./ToExcel/ExcelFile.js";
|
|
4
|
-
export const transformExcelToFortune = async (e, setSheets, setKey, sheetRef) => {
|
|
5
|
-
const excelFile = await e.target.files[0].arrayBuffer();
|
|
6
|
-
const files = await new HandleZip(excelFile).unzipFile();
|
|
7
|
-
const fortuneFile = new FortuneFile(files, excelFile.name);
|
|
8
|
-
fortuneFile.Parse();
|
|
9
|
-
const lsh = fortuneFile.serialize();
|
|
10
|
-
let config = lsh.sheets[0].config;
|
|
11
|
-
for (let sheet of lsh.sheets) {
|
|
12
|
-
delete sheet.config;
|
|
13
|
-
}
|
|
14
|
-
setSheets(lsh.sheets);
|
|
15
|
-
setKey((k) => k + 1);
|
|
16
|
-
setTimeout(() => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
(_a = sheetRef.current) === null || _a === void 0 ? void 0 : _a.setColumnWidth((config === null || config === void 0 ? void 0 : config.columnlen) || {});
|
|
19
|
-
(_b = sheetRef.current) === null || _b === void 0 ? void 0 : _b.setRowHeight((config === null || config === void 0 ? void 0 : config.rowlen) || {});
|
|
20
|
-
}, 1);
|
|
21
|
-
};
|
|
22
|
-
export const transformFortuneToExcel = async (luckysheetRef) => {
|
|
23
|
-
await exportSheetExcel(luckysheetRef);
|
|
24
|
-
};
|
|
1
|
+
export * from "./ToolbarItem.js";
|
|
2
|
+
export * from "./ImportHelper.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corbe30/fortune-excel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "An Excel import/export import library for FortuneSheet",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"homepage": "https://github.com/Corbe30/FortuneExcel",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/Corbe30/FortuneExcel.git"
|
|
17
|
+
"url": "git+https://github.com/Corbe30/FortuneExcel.git"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"devDependencies": {
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": ["src/main.ts"],
|
|
3
3
|
"compilerOptions": {
|
|
4
|
+
"jsx": "react",
|
|
4
5
|
"noImplicitAny": true,
|
|
5
6
|
"declaration": true,
|
|
6
|
-
"target": "
|
|
7
|
+
"target": "es5",
|
|
7
8
|
"outDir": "dist/",
|
|
8
9
|
"esModuleInterop": true,
|
|
9
10
|
"skipLibCheck": true,
|
|
10
|
-
"module": "
|
|
11
|
-
"moduleResolution": "
|
|
11
|
+
"module": "es2015",
|
|
12
|
+
"moduleResolution": "node",
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: npm
|
|
2
|
-
on:
|
|
3
|
-
release:
|
|
4
|
-
types: [published]
|
|
5
|
-
workflow_dispatch:
|
|
6
|
-
permissions:
|
|
7
|
-
contents: read
|
|
8
|
-
pages: write
|
|
9
|
-
id-token: write
|
|
10
|
-
jobs:
|
|
11
|
-
publish:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: "20.x"
|
|
18
|
-
registry-url: "https://registry.npmjs.org"
|
|
19
|
-
- run: npm ci
|
|
20
|
-
- run: npm publish --tag latest --provenance --access public
|
|
21
|
-
env:
|
|
22
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
23
|
-
- run: npm run build-storybook
|
|
24
|
-
- uses: actions/upload-pages-artifact@v2
|
|
25
|
-
with:
|
|
26
|
-
path: storybook-static
|
|
27
|
-
- id: deploy
|
|
28
|
-
uses: actions/deploy-pages@v3
|
|
29
|
-
with:
|
|
30
|
-
token: ${{ github.token }}
|