deepsea-components 5.10.17 → 5.11.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/cjs/components/ReadExcel.d.ts +8 -0
- package/dist/cjs/components/{ImportExcel.js → ReadExcel.js} +8 -8
- package/dist/cjs/components/ReadExcel.js.map +7 -0
- package/dist/cjs/components/WriteExcel.d.ts +8 -0
- package/dist/cjs/components/{ExportExcel.js → WriteExcel.js} +17 -14
- package/dist/cjs/components/WriteExcel.js.map +7 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/components/ReadExcel.d.ts +8 -0
- package/dist/esm/components/{ImportExcel.js → ReadExcel.js} +2 -2
- package/dist/esm/components/ReadExcel.js.map +1 -0
- package/dist/esm/components/WriteExcel.d.ts +8 -0
- package/dist/esm/components/WriteExcel.js +22 -0
- package/dist/esm/components/WriteExcel.js.map +1 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/{ImportExcel.tsx → ReadExcel.tsx} +4 -4
- package/src/components/WriteExcel.tsx +24 -0
- package/src/index.ts +2 -2
- package/dist/cjs/components/ExportExcel.d.ts +0 -6
- package/dist/cjs/components/ExportExcel.js.map +0 -7
- package/dist/cjs/components/ImportExcel.d.ts +0 -7
- package/dist/cjs/components/ImportExcel.js.map +0 -7
- package/dist/esm/components/ExportExcel.d.ts +0 -6
- package/dist/esm/components/ExportExcel.js +0 -27
- package/dist/esm/components/ExportExcel.js.map +0 -1
- package/dist/esm/components/ImportExcel.d.ts +0 -7
- package/dist/esm/components/ImportExcel.js.map +0 -1
- package/src/components/ExportExcel.tsx +0 -18
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ReadExcelData } from "deepsea-tools";
|
|
3
|
+
import { InputFileProps } from "./InputFile";
|
|
4
|
+
export interface ReadExcelProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
5
|
+
onValueChange?: (data: ReadExcelData) => void;
|
|
6
|
+
}
|
|
7
|
+
/** 专门用于读取 excel 的组件 */
|
|
8
|
+
export declare const ReadExcel: FC<ReadExcelProps>;
|
|
@@ -17,20 +17,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/components/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// src/components/ReadExcel.tsx
|
|
21
|
+
var ReadExcel_exports = {};
|
|
22
|
+
__export(ReadExcel_exports, {
|
|
23
|
+
ReadExcel: () => ReadExcel
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(ReadExcel_exports);
|
|
26
26
|
var import_deepsea_tools = require("deepsea-tools");
|
|
27
27
|
var import_InputFile = require("./InputFile");
|
|
28
|
-
var
|
|
28
|
+
var ReadExcel = (props) => {
|
|
29
29
|
const { onValueChange, ...rest } = props;
|
|
30
30
|
return /* @__PURE__ */ React.createElement(import_InputFile.InputFile, { accept: ".xlsx", type: "arrayBuffer", onValueChange: (data) => onValueChange?.((0, import_deepsea_tools.readExcel)(data)), ...rest });
|
|
31
31
|
};
|
|
32
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
33
|
0 && (module.exports = {
|
|
34
|
-
|
|
34
|
+
ReadExcel
|
|
35
35
|
});
|
|
36
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=ReadExcel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ReadExcel.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport { FC } from \"react\"\nimport { ReadExcelData, readExcel } from \"deepsea-tools\"\n\nimport { InputFile, InputFileProps } from \"./InputFile\"\n\nexport interface ReadExcelProps extends Omit<InputFileProps<false, \"arrayBuffer\">, \"multiple\" | \"accept\" | \"type\" | \"onValueChange\"> {\n onValueChange?: (data: ReadExcelData) => void\n}\n\n/** 专门用于读取 excel 的组件 */\nexport const ReadExcel: FC<ReadExcelProps> = props => {\n const { onValueChange, ...rest } = props\n\n return <InputFile accept=\".xlsx\" type=\"arrayBuffer\" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAAyC;AAEzC,uBAA0C;AAOnC,IAAM,YAAgC,WAAS;AAClD,QAAM,EAAE,eAAe,GAAG,KAAK,IAAI;AAEnC,SAAO,oCAAC,8BAAU,QAAO,SAAQ,MAAK,eAAc,eAAe,UAAQ,oBAAgB,gCAAU,IAAI,CAAC,GAAI,GAAG,MAAM;AAC3H;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps, JSX, JSXElementConstructor } from "react";
|
|
2
|
+
import { WriteExcelParams } from "deepsea-tools";
|
|
3
|
+
export type WriteExcelProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "data"> & {
|
|
4
|
+
as?: AS;
|
|
5
|
+
data: WriteExcelParams;
|
|
6
|
+
};
|
|
7
|
+
/** 导出 excel 的 button 组件 */
|
|
8
|
+
export declare function WriteExcel<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button">(props: WriteExcelProps<AS>): import("react").ReactElement<any, string | JSXElementConstructor<any>>;
|
|
@@ -17,24 +17,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/components/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// src/components/WriteExcel.tsx
|
|
21
|
+
var WriteExcel_exports = {};
|
|
22
|
+
__export(WriteExcel_exports, {
|
|
23
|
+
WriteExcel: () => WriteExcel
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(WriteExcel_exports);
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import_deepsea_tools = require("deepsea-tools");
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
function
|
|
31
|
-
(0, import_deepsea_tools.
|
|
32
|
-
|
|
28
|
+
function WriteExcel(props) {
|
|
29
|
+
const { as, data, onClick: _onClick, ...rest } = props;
|
|
30
|
+
function onClick(e) {
|
|
31
|
+
(0, import_deepsea_tools.writeExcel)(data);
|
|
32
|
+
_onClick?.(e);
|
|
33
33
|
}
|
|
34
|
-
return
|
|
35
|
-
|
|
34
|
+
return (0, import_react.createElement)(as ?? "button", {
|
|
35
|
+
onClick,
|
|
36
|
+
...rest
|
|
37
|
+
});
|
|
38
|
+
}
|
|
36
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
40
|
0 && (module.exports = {
|
|
38
|
-
|
|
41
|
+
WriteExcel
|
|
39
42
|
});
|
|
40
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=WriteExcel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/WriteExcel.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport { ComponentProps, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent, createElement } from \"react\"\nimport { WriteExcelParams, writeExcel } from \"deepsea-tools\"\n\nexport type WriteExcelProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\"> = Omit<ComponentProps<AS>, \"as\" | \"data\"> & {\n as?: AS\n data: WriteExcelParams\n}\n\n/** 导出 excel 的 button 组件 */\nexport function WriteExcel<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\">(props: WriteExcelProps<AS>) {\n const { as, data, onClick: _onClick, ...rest } = props\n\n function onClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n writeExcel(data)\n _onClick?.(e)\n }\n\n return createElement(as ?? \"button\", {\n onClick,\n ...rest,\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAyG;AACzG,2BAA6C;AAQtC,SAAS,WAA2F,OAA4B;AACnI,QAAM,EAAE,IAAI,MAAM,SAAS,UAAU,GAAG,KAAK,IAAI;AAEjD,WAAS,QAAQ,GAAmD;AAChE,yCAAW,IAAI;AACf,eAAW,CAAC;AAAA,EAChB;AAEA,aAAO,4BAAc,MAAM,UAAU;AAAA,IACjC;AAAA,IACA,GAAG;AAAA,EACP,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -4,15 +4,14 @@ export * from "./components/AutoSizeTextarea";
|
|
|
4
4
|
export * from "./components/CircleText";
|
|
5
5
|
export * from "./components/CopyButton";
|
|
6
6
|
export * from "./components/Echart";
|
|
7
|
-
export * from "./components/ExportExcel";
|
|
8
7
|
export * from "./components/Flow";
|
|
9
8
|
export * from "./components/FormLabel";
|
|
10
9
|
export * from "./components/HlsPlayer";
|
|
11
|
-
export * from "./components/ImportExcel";
|
|
12
10
|
export * from "./components/InfiniteScroll";
|
|
13
11
|
export * from "./components/InputFile";
|
|
14
12
|
export * from "./components/InputFileButton";
|
|
15
13
|
export * from "./components/LoopSwiper";
|
|
14
|
+
export * from "./components/ReadExcel";
|
|
16
15
|
export * from "./components/Ring";
|
|
17
16
|
export * from "./components/Scroll";
|
|
18
17
|
export * from "./components/SectionRing";
|
|
@@ -22,5 +21,6 @@ export * from "./components/TransitionBox";
|
|
|
22
21
|
export * from "./components/TransitionNum";
|
|
23
22
|
export * from "./components/Trapezium";
|
|
24
23
|
export * from "./components/Unify";
|
|
24
|
+
export * from "./components/WriteExcel";
|
|
25
25
|
export * from "./utils/getReactVersion";
|
|
26
26
|
export * from "./utils/index";
|
package/dist/cjs/index.js
CHANGED
|
@@ -22,15 +22,14 @@ __reExport(src_exports, require("./components/AutoSizeTextarea"), module.exports
|
|
|
22
22
|
__reExport(src_exports, require("./components/CircleText"), module.exports);
|
|
23
23
|
__reExport(src_exports, require("./components/CopyButton"), module.exports);
|
|
24
24
|
__reExport(src_exports, require("./components/Echart"), module.exports);
|
|
25
|
-
__reExport(src_exports, require("./components/ExportExcel"), module.exports);
|
|
26
25
|
__reExport(src_exports, require("./components/Flow"), module.exports);
|
|
27
26
|
__reExport(src_exports, require("./components/FormLabel"), module.exports);
|
|
28
27
|
__reExport(src_exports, require("./components/HlsPlayer"), module.exports);
|
|
29
|
-
__reExport(src_exports, require("./components/ImportExcel"), module.exports);
|
|
30
28
|
__reExport(src_exports, require("./components/InfiniteScroll"), module.exports);
|
|
31
29
|
__reExport(src_exports, require("./components/InputFile"), module.exports);
|
|
32
30
|
__reExport(src_exports, require("./components/InputFileButton"), module.exports);
|
|
33
31
|
__reExport(src_exports, require("./components/LoopSwiper"), module.exports);
|
|
32
|
+
__reExport(src_exports, require("./components/ReadExcel"), module.exports);
|
|
34
33
|
__reExport(src_exports, require("./components/Ring"), module.exports);
|
|
35
34
|
__reExport(src_exports, require("./components/Scroll"), module.exports);
|
|
36
35
|
__reExport(src_exports, require("./components/SectionRing"), module.exports);
|
|
@@ -40,6 +39,7 @@ __reExport(src_exports, require("./components/TransitionBox"), module.exports);
|
|
|
40
39
|
__reExport(src_exports, require("./components/TransitionNum"), module.exports);
|
|
41
40
|
__reExport(src_exports, require("./components/Trapezium"), module.exports);
|
|
42
41
|
__reExport(src_exports, require("./components/Unify"), module.exports);
|
|
42
|
+
__reExport(src_exports, require("./components/WriteExcel"), module.exports);
|
|
43
43
|
__reExport(src_exports, require("./utils/getReactVersion"), module.exports);
|
|
44
44
|
__reExport(src_exports, require("./utils/index"), module.exports);
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -50,15 +50,14 @@ __reExport(src_exports, require("./utils/index"), module.exports);
|
|
|
50
50
|
...require("./components/CircleText"),
|
|
51
51
|
...require("./components/CopyButton"),
|
|
52
52
|
...require("./components/Echart"),
|
|
53
|
-
...require("./components/ExportExcel"),
|
|
54
53
|
...require("./components/Flow"),
|
|
55
54
|
...require("./components/FormLabel"),
|
|
56
55
|
...require("./components/HlsPlayer"),
|
|
57
|
-
...require("./components/ImportExcel"),
|
|
58
56
|
...require("./components/InfiniteScroll"),
|
|
59
57
|
...require("./components/InputFile"),
|
|
60
58
|
...require("./components/InputFileButton"),
|
|
61
59
|
...require("./components/LoopSwiper"),
|
|
60
|
+
...require("./components/ReadExcel"),
|
|
62
61
|
...require("./components/Ring"),
|
|
63
62
|
...require("./components/Scroll"),
|
|
64
63
|
...require("./components/SectionRing"),
|
|
@@ -68,6 +67,7 @@ __reExport(src_exports, require("./utils/index"), module.exports);
|
|
|
68
67
|
...require("./components/TransitionNum"),
|
|
69
68
|
...require("./components/Trapezium"),
|
|
70
69
|
...require("./components/Unify"),
|
|
70
|
+
...require("./components/WriteExcel"),
|
|
71
71
|
...require("./utils/getReactVersion"),
|
|
72
72
|
...require("./utils/index")
|
|
73
73
|
});
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"@/components/AutoFit\"\nexport * from \"@/components/AutoScroll\"\nexport * from \"@/components/AutoSizeTextarea\"\nexport * from \"@/components/CircleText\"\nexport * from \"@/components/CopyButton\"\nexport * from \"@/components/Echart\"\nexport * from \"@/components/
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oCADd;AAEA,wBAAc,0CAFd;AAGA,wBAAc,oCAHd;AAIA,wBAAc,oCAJd;AAKA,wBAAc,gCALd;AAMA,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from \"@/components/AutoFit\"\nexport * from \"@/components/AutoScroll\"\nexport * from \"@/components/AutoSizeTextarea\"\nexport * from \"@/components/CircleText\"\nexport * from \"@/components/CopyButton\"\nexport * from \"@/components/Echart\"\nexport * from \"@/components/Flow\"\nexport * from \"@/components/FormLabel\"\nexport * from \"@/components/HlsPlayer\"\nexport * from \"@/components/InfiniteScroll\"\nexport * from \"@/components/InputFile\"\nexport * from \"@/components/InputFileButton\"\nexport * from \"@/components/LoopSwiper\"\nexport * from \"@/components/ReadExcel\"\nexport * from \"@/components/Ring\"\nexport * from \"@/components/Scroll\"\nexport * from \"@/components/SectionRing\"\nexport * from \"@/components/Skeleton\"\nexport * from \"@/components/Title\"\nexport * from \"@/components/TransitionBox\"\nexport * from \"@/components/TransitionNum\"\nexport * from \"@/components/Trapezium\"\nexport * from \"@/components/Unify\"\nexport * from \"@/components/WriteExcel\"\nexport * from \"@/utils/getReactVersion\"\nexport * from \"@/utils/index\"\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oCADd;AAEA,wBAAc,0CAFd;AAGA,wBAAc,oCAHd;AAIA,wBAAc,oCAJd;AAKA,wBAAc,gCALd;AAMA,wBAAc,8BANd;AAOA,wBAAc,mCAPd;AAQA,wBAAc,mCARd;AASA,wBAAc,wCATd;AAUA,wBAAc,mCAVd;AAWA,wBAAc,yCAXd;AAYA,wBAAc,oCAZd;AAaA,wBAAc,mCAbd;AAcA,wBAAc,8BAdd;AAeA,wBAAc,gCAfd;AAgBA,wBAAc,qCAhBd;AAiBA,wBAAc,kCAjBd;AAkBA,wBAAc,+BAlBd;AAmBA,wBAAc,uCAnBd;AAoBA,wBAAc,uCApBd;AAqBA,wBAAc,mCArBd;AAsBA,wBAAc,+BAtBd;AAuBA,wBAAc,oCAvBd;AAwBA,wBAAc,oCAxBd;AAyBA,wBAAc,0BAzBd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ReadExcelData } from "deepsea-tools";
|
|
3
|
+
import { InputFileProps } from "./InputFile";
|
|
4
|
+
export interface ReadExcelProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
5
|
+
onValueChange?: (data: ReadExcelData) => void;
|
|
6
|
+
}
|
|
7
|
+
/** 专门用于读取 excel 的组件 */
|
|
8
|
+
export declare const ReadExcel: FC<ReadExcelProps>;
|
|
@@ -4,7 +4,7 @@ import { readExcel } from "deepsea-tools";
|
|
|
4
4
|
import { InputFile } from "./InputFile";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
/** 专门用于读取 excel 的组件 */
|
|
7
|
-
export const
|
|
7
|
+
export const ReadExcel = props => {
|
|
8
8
|
const {
|
|
9
9
|
onValueChange,
|
|
10
10
|
...rest
|
|
@@ -16,4 +16,4 @@ export const ImportExcel = props => {
|
|
|
16
16
|
...rest
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=ReadExcel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["readExcel","InputFile","jsx","_jsx","ReadExcel","props","onValueChange","rest","accept","type","data"],"sources":["../../../src/components/ReadExcel.tsx"],"sourcesContent":["\"use client\"\n\nimport { FC } from \"react\"\nimport { ReadExcelData, readExcel } from \"deepsea-tools\"\n\nimport { InputFile, InputFileProps } from \"./InputFile\"\n\nexport interface ReadExcelProps extends Omit<InputFileProps<false, \"arrayBuffer\">, \"multiple\" | \"accept\" | \"type\" | \"onValueChange\"> {\n onValueChange?: (data: ReadExcelData) => void\n}\n\n/** 专门用于读取 excel 的组件 */\nexport const ReadExcel: FC<ReadExcelProps> = props => {\n const { onValueChange, ...rest } = props\n\n return <InputFile accept=\".xlsx\" type=\"arrayBuffer\" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAAwBA,SAAS,QAAQ,eAAe;AAExD,SAASC,SAAS;AAAqC,SAAAC,GAAA,IAAAC,IAAA;AAMvD;AACA,OAAO,MAAMC,SAA6B,GAAGC,KAAK,IAAI;EAClD,MAAM;IAAEC,aAAa;IAAE,GAAGC;EAAK,CAAC,GAAGF,KAAK;EAExC,oBAAOF,IAAA,CAACF,SAAS;IAACO,MAAM,EAAC,OAAO;IAACC,IAAI,EAAC,aAAa;IAACH,aAAa,EAAEI,IAAI,IAAIJ,aAAa,GAAGN,SAAS,CAACU,IAAI,CAAC,CAAE;IAAA,GAAKH;EAAI,CAAG,CAAC;AAC7H,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps, JSX, JSXElementConstructor } from "react";
|
|
2
|
+
import { WriteExcelParams } from "deepsea-tools";
|
|
3
|
+
export type WriteExcelProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "data"> & {
|
|
4
|
+
as?: AS;
|
|
5
|
+
data: WriteExcelParams;
|
|
6
|
+
};
|
|
7
|
+
/** 导出 excel 的 button 组件 */
|
|
8
|
+
export declare function WriteExcel<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button">(props: WriteExcelProps<AS>): import("react").ReactElement<any, string | JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
import { writeExcel } from "deepsea-tools";
|
|
5
|
+
/** 导出 excel 的 button 组件 */
|
|
6
|
+
export function WriteExcel(props) {
|
|
7
|
+
const {
|
|
8
|
+
as,
|
|
9
|
+
data,
|
|
10
|
+
onClick: _onClick,
|
|
11
|
+
...rest
|
|
12
|
+
} = props;
|
|
13
|
+
function onClick(e) {
|
|
14
|
+
writeExcel(data);
|
|
15
|
+
_onClick?.(e);
|
|
16
|
+
}
|
|
17
|
+
return /*#__PURE__*/createElement(as ?? "button", {
|
|
18
|
+
onClick,
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=WriteExcel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createElement","writeExcel","WriteExcel","props","as","data","onClick","_onClick","rest","e"],"sources":["../../../src/components/WriteExcel.tsx"],"sourcesContent":["\"use client\"\n\nimport { ComponentProps, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent, createElement } from \"react\"\nimport { WriteExcelParams, writeExcel } from \"deepsea-tools\"\n\nexport type WriteExcelProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\"> = Omit<ComponentProps<AS>, \"as\" | \"data\"> & {\n as?: AS\n data: WriteExcelParams\n}\n\n/** 导出 excel 的 button 组件 */\nexport function WriteExcel<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\">(props: WriteExcelProps<AS>) {\n const { as, data, onClick: _onClick, ...rest } = props\n\n function onClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n writeExcel(data)\n _onClick?.(e)\n }\n\n return createElement(as ?? \"button\", {\n onClick,\n ...rest,\n })\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAAoFA,aAAa,QAAQ,OAAO;AAChH,SAA2BC,UAAU,QAAQ,eAAe;AAO5D;AACA,OAAO,SAASC,UAAUA,CAAiFC,KAA0B,EAAE;EACnI,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,OAAO,EAAEC,QAAQ;IAAE,GAAGC;EAAK,CAAC,GAAGL,KAAK;EAEtD,SAASG,OAAOA,CAACG,CAAiD,EAAE;IAChER,UAAU,CAACI,IAAI,CAAC;IAChBE,QAAQ,GAAGE,CAAC,CAAC;EACjB;EAEA,oBAAOT,aAAa,CAACI,EAAE,IAAI,QAAQ,EAAE;IACjCE,OAAO;IACP,GAAGE;EACP,CAAC,CAAC;AACN"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,15 +4,14 @@ export * from "./components/AutoSizeTextarea";
|
|
|
4
4
|
export * from "./components/CircleText";
|
|
5
5
|
export * from "./components/CopyButton";
|
|
6
6
|
export * from "./components/Echart";
|
|
7
|
-
export * from "./components/ExportExcel";
|
|
8
7
|
export * from "./components/Flow";
|
|
9
8
|
export * from "./components/FormLabel";
|
|
10
9
|
export * from "./components/HlsPlayer";
|
|
11
|
-
export * from "./components/ImportExcel";
|
|
12
10
|
export * from "./components/InfiniteScroll";
|
|
13
11
|
export * from "./components/InputFile";
|
|
14
12
|
export * from "./components/InputFileButton";
|
|
15
13
|
export * from "./components/LoopSwiper";
|
|
14
|
+
export * from "./components/ReadExcel";
|
|
16
15
|
export * from "./components/Ring";
|
|
17
16
|
export * from "./components/Scroll";
|
|
18
17
|
export * from "./components/SectionRing";
|
|
@@ -22,5 +21,6 @@ export * from "./components/TransitionBox";
|
|
|
22
21
|
export * from "./components/TransitionNum";
|
|
23
22
|
export * from "./components/Trapezium";
|
|
24
23
|
export * from "./components/Unify";
|
|
24
|
+
export * from "./components/WriteExcel";
|
|
25
25
|
export * from "./utils/getReactVersion";
|
|
26
26
|
export * from "./utils/index";
|
package/dist/esm/index.js
CHANGED
|
@@ -4,15 +4,14 @@ export * from "./components/AutoSizeTextarea";
|
|
|
4
4
|
export * from "./components/CircleText";
|
|
5
5
|
export * from "./components/CopyButton";
|
|
6
6
|
export * from "./components/Echart";
|
|
7
|
-
export * from "./components/ExportExcel";
|
|
8
7
|
export * from "./components/Flow";
|
|
9
8
|
export * from "./components/FormLabel";
|
|
10
9
|
export * from "./components/HlsPlayer";
|
|
11
|
-
export * from "./components/ImportExcel";
|
|
12
10
|
export * from "./components/InfiniteScroll";
|
|
13
11
|
export * from "./components/InputFile";
|
|
14
12
|
export * from "./components/InputFileButton";
|
|
15
13
|
export * from "./components/LoopSwiper";
|
|
14
|
+
export * from "./components/ReadExcel";
|
|
16
15
|
export * from "./components/Ring";
|
|
17
16
|
export * from "./components/Scroll";
|
|
18
17
|
export * from "./components/SectionRing";
|
|
@@ -22,6 +21,7 @@ export * from "./components/TransitionBox";
|
|
|
22
21
|
export * from "./components/TransitionNum";
|
|
23
22
|
export * from "./components/Trapezium";
|
|
24
23
|
export * from "./components/Unify";
|
|
24
|
+
export * from "./components/WriteExcel";
|
|
25
25
|
export * from "./utils/getReactVersion";
|
|
26
26
|
export * from "./utils";
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"@/components/AutoFit\"\nexport * from \"@/components/AutoScroll\"\nexport * from \"@/components/AutoSizeTextarea\"\nexport * from \"@/components/CircleText\"\nexport * from \"@/components/CopyButton\"\nexport * from \"@/components/Echart\"\nexport * from \"@/components/
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"@/components/AutoFit\"\nexport * from \"@/components/AutoScroll\"\nexport * from \"@/components/AutoSizeTextarea\"\nexport * from \"@/components/CircleText\"\nexport * from \"@/components/CopyButton\"\nexport * from \"@/components/Echart\"\nexport * from \"@/components/Flow\"\nexport * from \"@/components/FormLabel\"\nexport * from \"@/components/HlsPlayer\"\nexport * from \"@/components/InfiniteScroll\"\nexport * from \"@/components/InputFile\"\nexport * from \"@/components/InputFileButton\"\nexport * from \"@/components/LoopSwiper\"\nexport * from \"@/components/ReadExcel\"\nexport * from \"@/components/Ring\"\nexport * from \"@/components/Scroll\"\nexport * from \"@/components/SectionRing\"\nexport * from \"@/components/Skeleton\"\nexport * from \"@/components/Title\"\nexport * from \"@/components/TransitionBox\"\nexport * from \"@/components/TransitionNum\"\nexport * from \"@/components/Trapezium\"\nexport * from \"@/components/Unify\"\nexport * from \"@/components/WriteExcel\"\nexport * from \"@/utils/getReactVersion\"\nexport * from \"@/utils/index\"\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepsea-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "格数科技自用组件库",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"echarts": "^5.6.0",
|
|
32
32
|
"hls.js": "^1.5.20",
|
|
33
33
|
"smooth-scrollbar": "^8.8.4",
|
|
34
|
-
"deepsea-tools": "5.
|
|
35
|
-
"soda-hooks": "6.6.
|
|
34
|
+
"deepsea-tools": "5.24.0",
|
|
35
|
+
"soda-hooks": "6.6.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@types/react": ">=18.3.18",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { FC } from "react"
|
|
4
|
-
import { readExcel } from "deepsea-tools"
|
|
4
|
+
import { ReadExcelData, readExcel } from "deepsea-tools"
|
|
5
5
|
|
|
6
6
|
import { InputFile, InputFileProps } from "./InputFile"
|
|
7
7
|
|
|
8
|
-
export interface
|
|
9
|
-
onValueChange?: (data:
|
|
8
|
+
export interface ReadExcelProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
9
|
+
onValueChange?: (data: ReadExcelData) => void
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/** 专门用于读取 excel 的组件 */
|
|
13
|
-
export const
|
|
13
|
+
export const ReadExcel: FC<ReadExcelProps> = props => {
|
|
14
14
|
const { onValueChange, ...rest } = props
|
|
15
15
|
|
|
16
16
|
return <InputFile accept=".xlsx" type="arrayBuffer" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ComponentProps, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent, createElement } from "react"
|
|
4
|
+
import { WriteExcelParams, writeExcel } from "deepsea-tools"
|
|
5
|
+
|
|
6
|
+
export type WriteExcelProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "data"> & {
|
|
7
|
+
as?: AS
|
|
8
|
+
data: WriteExcelParams
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** 导出 excel 的 button 组件 */
|
|
12
|
+
export function WriteExcel<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button">(props: WriteExcelProps<AS>) {
|
|
13
|
+
const { as, data, onClick: _onClick, ...rest } = props
|
|
14
|
+
|
|
15
|
+
function onClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {
|
|
16
|
+
writeExcel(data)
|
|
17
|
+
_onClick?.(e)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return createElement(as ?? "button", {
|
|
21
|
+
onClick,
|
|
22
|
+
...rest,
|
|
23
|
+
})
|
|
24
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -4,15 +4,14 @@ export * from "@/components/AutoSizeTextarea"
|
|
|
4
4
|
export * from "@/components/CircleText"
|
|
5
5
|
export * from "@/components/CopyButton"
|
|
6
6
|
export * from "@/components/Echart"
|
|
7
|
-
export * from "@/components/ExportExcel"
|
|
8
7
|
export * from "@/components/Flow"
|
|
9
8
|
export * from "@/components/FormLabel"
|
|
10
9
|
export * from "@/components/HlsPlayer"
|
|
11
|
-
export * from "@/components/ImportExcel"
|
|
12
10
|
export * from "@/components/InfiniteScroll"
|
|
13
11
|
export * from "@/components/InputFile"
|
|
14
12
|
export * from "@/components/InputFileButton"
|
|
15
13
|
export * from "@/components/LoopSwiper"
|
|
14
|
+
export * from "@/components/ReadExcel"
|
|
16
15
|
export * from "@/components/Ring"
|
|
17
16
|
export * from "@/components/Scroll"
|
|
18
17
|
export * from "@/components/SectionRing"
|
|
@@ -22,5 +21,6 @@ export * from "@/components/TransitionBox"
|
|
|
22
21
|
export * from "@/components/TransitionNum"
|
|
23
22
|
export * from "@/components/Trapezium"
|
|
24
23
|
export * from "@/components/Unify"
|
|
24
|
+
export * from "@/components/WriteExcel"
|
|
25
25
|
export * from "@/utils/getReactVersion"
|
|
26
26
|
export * from "@/utils/index"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
-
import { ExportExcelParams } from "deepsea-tools";
|
|
3
|
-
export interface ExportExcelProps extends ComponentPropsWithoutRef<"button">, ExportExcelParams {
|
|
4
|
-
}
|
|
5
|
-
/** 导出 excel 的 button 组件 */
|
|
6
|
-
export declare const ExportExcel: import("react").ForwardRefExoticComponent<ExportExcelProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ExportExcel.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { ComponentPropsWithoutRef, ComponentRef, MouseEvent as ReactMouseEvent, forwardRef } from \"react\"\nimport { ExportExcelParams, exportExcel } from \"deepsea-tools\"\n\nexport interface ExportExcelProps extends ComponentPropsWithoutRef<\"button\">, ExportExcelParams {}\n\n/** 导出 excel 的 button 组件 */\nexport const ExportExcel = forwardRef<ComponentRef<\"button\">, ExportExcelProps>((props, ref) => {\n const { data, fileName, onClick, ...rest } = props\n\n function onButtonClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n exportExcel({ data, fileName })\n onClick?.(e)\n }\n\n return <button ref={ref} onClick={onButtonClick} {...rest} />\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAkG;AAClG,2BAA+C;AAKxC,IAAM,kBAAc,yBAAqD,CAAC,OAAO,QAAQ;AAC5F,QAAM,EAAE,MAAM,UAAU,SAAS,GAAG,KAAK,IAAI;AAE7C,WAAS,cAAc,GAAmD;AACtE,0CAAY,EAAE,MAAM,SAAS,CAAC;AAC9B,cAAU,CAAC;AAAA,EACf;AAEA,SAAO,oCAAC,YAAO,KAAU,SAAS,eAAgB,GAAG,MAAM;AAC/D,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { InputFileProps } from "./InputFile";
|
|
3
|
-
export interface ImportExcelProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
4
|
-
onValueChange?: (data: Record<string, any>[]) => void;
|
|
5
|
-
}
|
|
6
|
-
/** 专门用于读取 excel 的组件 */
|
|
7
|
-
export declare const ImportExcel: FC<ImportExcelProps>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ImportExcel.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { FC } from \"react\"\nimport { readExcel } from \"deepsea-tools\"\n\nimport { InputFile, InputFileProps } from \"./InputFile\"\n\nexport interface ImportExcelProps extends Omit<InputFileProps<false, \"arrayBuffer\">, \"multiple\" | \"accept\" | \"type\" | \"onValueChange\"> {\n onValueChange?: (data: Record<string, any>[]) => void\n}\n\n/** 专门用于读取 excel 的组件 */\nexport const ImportExcel: FC<ImportExcelProps> = props => {\n const { onValueChange, ...rest } = props\n\n return <InputFile accept=\".xlsx\" type=\"arrayBuffer\" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA0B;AAE1B,uBAA0C;AAOnC,IAAM,cAAoC,WAAS;AACtD,QAAM,EAAE,eAAe,GAAG,KAAK,IAAI;AAEnC,SAAO,oCAAC,8BAAU,QAAO,SAAQ,MAAK,eAAc,eAAe,UAAQ,oBAAgB,gCAAU,IAAI,CAAC,GAAI,GAAG,MAAM;AAC3H;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
-
import { ExportExcelParams } from "deepsea-tools";
|
|
3
|
-
export interface ExportExcelProps extends ComponentPropsWithoutRef<"button">, ExportExcelParams {
|
|
4
|
-
}
|
|
5
|
-
/** 导出 excel 的 button 组件 */
|
|
6
|
-
export declare const ExportExcel: import("react").ForwardRefExoticComponent<ExportExcelProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { exportExcel } from "deepsea-tools";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
/** 导出 excel 的 button 组件 */
|
|
7
|
-
export const ExportExcel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
-
const {
|
|
9
|
-
data,
|
|
10
|
-
fileName,
|
|
11
|
-
onClick,
|
|
12
|
-
...rest
|
|
13
|
-
} = props;
|
|
14
|
-
function onButtonClick(e) {
|
|
15
|
-
exportExcel({
|
|
16
|
-
data,
|
|
17
|
-
fileName
|
|
18
|
-
});
|
|
19
|
-
onClick?.(e);
|
|
20
|
-
}
|
|
21
|
-
return /*#__PURE__*/_jsx("button", {
|
|
22
|
-
ref: ref,
|
|
23
|
-
onClick: onButtonClick,
|
|
24
|
-
...rest
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=ExportExcel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","exportExcel","jsx","_jsx","ExportExcel","props","ref","data","fileName","onClick","rest","onButtonClick","e"],"sources":["../../../src/components/ExportExcel.tsx"],"sourcesContent":["\"use client\"\n\nimport { ComponentPropsWithoutRef, ComponentRef, MouseEvent as ReactMouseEvent, forwardRef } from \"react\"\nimport { ExportExcelParams, exportExcel } from \"deepsea-tools\"\n\nexport interface ExportExcelProps extends ComponentPropsWithoutRef<\"button\">, ExportExcelParams {}\n\n/** 导出 excel 的 button 组件 */\nexport const ExportExcel = forwardRef<ComponentRef<\"button\">, ExportExcelProps>((props, ref) => {\n const { data, fileName, onClick, ...rest } = props\n\n function onButtonClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n exportExcel({ data, fileName })\n onClick?.(e)\n }\n\n return <button ref={ref} onClick={onButtonClick} {...rest} />\n})\n"],"mappings":"AAAA,YAAY;;AAEZ,SAAgFA,UAAU,QAAQ,OAAO;AACzG,SAA4BC,WAAW,QAAQ,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI9D;AACA,OAAO,MAAMC,WAAW,gBAAGJ,UAAU,CAA2C,CAACK,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,OAAO;IAAE,GAAGC;EAAK,CAAC,GAAGL,KAAK;EAElD,SAASM,aAAaA,CAACC,CAAiD,EAAE;IACtEX,WAAW,CAAC;MAAEM,IAAI;MAAEC;IAAS,CAAC,CAAC;IAC/BC,OAAO,GAAGG,CAAC,CAAC;EAChB;EAEA,oBAAOT,IAAA;IAAQG,GAAG,EAAEA,GAAI;IAACG,OAAO,EAAEE,aAAc;IAAA,GAAKD;EAAI,CAAG,CAAC;AACjE,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { InputFileProps } from "./InputFile";
|
|
3
|
-
export interface ImportExcelProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
4
|
-
onValueChange?: (data: Record<string, any>[]) => void;
|
|
5
|
-
}
|
|
6
|
-
/** 专门用于读取 excel 的组件 */
|
|
7
|
-
export declare const ImportExcel: FC<ImportExcelProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["readExcel","InputFile","jsx","_jsx","ImportExcel","props","onValueChange","rest","accept","type","data"],"sources":["../../../src/components/ImportExcel.tsx"],"sourcesContent":["\"use client\"\n\nimport { FC } from \"react\"\nimport { readExcel } from \"deepsea-tools\"\n\nimport { InputFile, InputFileProps } from \"./InputFile\"\n\nexport interface ImportExcelProps extends Omit<InputFileProps<false, \"arrayBuffer\">, \"multiple\" | \"accept\" | \"type\" | \"onValueChange\"> {\n onValueChange?: (data: Record<string, any>[]) => void\n}\n\n/** 专门用于读取 excel 的组件 */\nexport const ImportExcel: FC<ImportExcelProps> = props => {\n const { onValueChange, ...rest } = props\n\n return <InputFile accept=\".xlsx\" type=\"arrayBuffer\" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,SAAS,QAAQ,eAAe;AAEzC,SAASC,SAAS;AAAqC,SAAAC,GAAA,IAAAC,IAAA;AAMvD;AACA,OAAO,MAAMC,WAAiC,GAAGC,KAAK,IAAI;EACtD,MAAM;IAAEC,aAAa;IAAE,GAAGC;EAAK,CAAC,GAAGF,KAAK;EAExC,oBAAOF,IAAA,CAACF,SAAS;IAACO,MAAM,EAAC,OAAO;IAACC,IAAI,EAAC,aAAa;IAACH,aAAa,EAAEI,IAAI,IAAIJ,aAAa,GAAGN,SAAS,CAACU,IAAI,CAAC,CAAE;IAAA,GAAKH;EAAI,CAAG,CAAC;AAC7H,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { ComponentPropsWithoutRef, ComponentRef, MouseEvent as ReactMouseEvent, forwardRef } from "react"
|
|
4
|
-
import { ExportExcelParams, exportExcel } from "deepsea-tools"
|
|
5
|
-
|
|
6
|
-
export interface ExportExcelProps extends ComponentPropsWithoutRef<"button">, ExportExcelParams {}
|
|
7
|
-
|
|
8
|
-
/** 导出 excel 的 button 组件 */
|
|
9
|
-
export const ExportExcel = forwardRef<ComponentRef<"button">, ExportExcelProps>((props, ref) => {
|
|
10
|
-
const { data, fileName, onClick, ...rest } = props
|
|
11
|
-
|
|
12
|
-
function onButtonClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {
|
|
13
|
-
exportExcel({ data, fileName })
|
|
14
|
-
onClick?.(e)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return <button ref={ref} onClick={onButtonClick} {...rest} />
|
|
18
|
-
})
|