deepsea-components 5.17.35 → 5.17.36
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReadSheetProps } from "./ReadSheet";
|
|
1
|
+
import { ReadSheet, ReadSheetProps } from "./ReadSheet";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated 请使用 ReadSheetProps 代替
|
|
4
4
|
*/
|
|
@@ -6,4 +6,4 @@ export type ReadExcelProps = ReadSheetProps;
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated 请使用 ReadSheet 代替
|
|
8
8
|
*/
|
|
9
|
-
export declare const ReadExcel:
|
|
9
|
+
export declare const ReadExcel: typeof ReadSheet;
|
|
@@ -30,15 +30,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
31
|
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
32
32
|
const external_InputFile_cjs_namespaceObject = require("./InputFile.cjs");
|
|
33
|
-
|
|
34
|
-
const { onValueChange, ...rest } = props;
|
|
33
|
+
function ReadSheet({ onValueChange, ...rest }) {
|
|
35
34
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_InputFile_cjs_namespaceObject.InputFile, {
|
|
36
35
|
accept: ".xlsx",
|
|
37
36
|
type: "arrayBuffer",
|
|
38
37
|
onValueChange: (data)=>null == onValueChange ? void 0 : onValueChange((0, external_deepsea_tools_namespaceObject.readSheet)(data)),
|
|
39
38
|
...rest
|
|
40
39
|
});
|
|
41
|
-
}
|
|
40
|
+
}
|
|
42
41
|
exports.ReadSheet = __webpack_exports__.ReadSheet;
|
|
43
42
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
44
43
|
"ReadSheet"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { WorkBookData, WorkSheetData } from "deepsea-tools";
|
|
3
2
|
import { InputFileProps } from "./InputFile";
|
|
4
|
-
export interface ReadSheetProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
5
|
-
onValueChange?:
|
|
3
|
+
export interface ReadSheetProps<Sheet = WorkSheetData> extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
4
|
+
onValueChange?: (data: WorkBookData<Sheet>) => void;
|
|
6
5
|
}
|
|
7
6
|
/** 专门用于读取 excel 的组件 */
|
|
8
|
-
export declare
|
|
7
|
+
export declare function ReadSheet<Sheet = WorkSheetData>({ onValueChange, ...rest }: ReadSheetProps<Sheet>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { readSheet } from "deepsea-tools";
|
|
4
4
|
import { InputFile } from "./InputFile.js";
|
|
5
|
-
|
|
6
|
-
const { onValueChange, ...rest } = props;
|
|
5
|
+
function ReadSheet({ onValueChange, ...rest }) {
|
|
7
6
|
return /*#__PURE__*/ jsx(InputFile, {
|
|
8
7
|
accept: ".xlsx",
|
|
9
8
|
type: "arrayBuffer",
|
|
10
9
|
onValueChange: (data)=>null == onValueChange ? void 0 : onValueChange(readSheet(data)),
|
|
11
10
|
...rest
|
|
12
11
|
});
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
export { ReadSheet };
|
package/package.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { FC } from "react"
|
|
4
|
-
|
|
5
3
|
import { readSheet, WorkBookData, WorkSheetData } from "deepsea-tools"
|
|
6
4
|
|
|
7
5
|
import { InputFile, InputFileProps } from "./InputFile"
|
|
8
6
|
|
|
9
|
-
export interface ReadSheetProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
10
|
-
onValueChange?:
|
|
7
|
+
export interface ReadSheetProps<Sheet = WorkSheetData> extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
8
|
+
onValueChange?: (data: WorkBookData<Sheet>) => void
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
/** 专门用于读取 excel 的组件 */
|
|
14
|
-
export
|
|
15
|
-
const { onValueChange, ...rest } = props
|
|
16
|
-
|
|
12
|
+
export function ReadSheet<Sheet = WorkSheetData>({ onValueChange, ...rest }: ReadSheetProps<Sheet>) {
|
|
17
13
|
return <InputFile accept=".xlsx" type="arrayBuffer" onValueChange={data => onValueChange?.(readSheet(data))} {...rest} />
|
|
18
14
|
}
|