deepsea-components 5.14.2 → 5.15.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/components/ReadExcel.cjs +2 -12
- package/dist/components/ReadExcel.d.ts +9 -8
- package/dist/components/ReadExcel.js +2 -12
- package/dist/components/ReadSheet.cjs +48 -0
- package/dist/components/ReadSheet.d.ts +8 -0
- package/dist/components/ReadSheet.js +14 -0
- package/dist/components/WriteExcel.cjs +2 -14
- package/dist/components/WriteExcel.d.ts +9 -8
- package/dist/components/WriteExcel.js +2 -14
- package/dist/components/WriteSheet.cjs +50 -0
- package/dist/components/WriteSheet.d.ts +8 -0
- package/dist/components/WriteSheet.js +16 -0
- package/dist/index.cjs +57 -39
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +3 -3
- package/src/components/ReadExcel.tsx +9 -13
- package/src/components/ReadSheet.tsx +17 -0
- package/src/components/WriteExcel.tsx +9 -21
- package/src/components/WriteSheet.tsx +25 -0
- package/src/index.ts +2 -0
|
@@ -27,18 +27,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
27
27
|
__webpack_require__.d(__webpack_exports__, {
|
|
28
28
|
ReadExcel: ()=>ReadExcel
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const external_InputFile_cjs_namespaceObject = require("./InputFile.cjs");
|
|
33
|
-
const ReadExcel = (props)=>{
|
|
34
|
-
const { onValueChange, ...rest } = props;
|
|
35
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_InputFile_cjs_namespaceObject.InputFile, {
|
|
36
|
-
accept: ".xlsx",
|
|
37
|
-
type: "arrayBuffer",
|
|
38
|
-
onValueChange: (data)=>onValueChange?.((0, external_deepsea_tools_namespaceObject.readExcel)(data)),
|
|
39
|
-
...rest
|
|
40
|
-
});
|
|
41
|
-
};
|
|
30
|
+
const external_ReadSheet_cjs_namespaceObject = require("./ReadSheet.cjs");
|
|
31
|
+
const ReadExcel = external_ReadSheet_cjs_namespaceObject.ReadSheet;
|
|
42
32
|
exports.ReadExcel = __webpack_exports__.ReadExcel;
|
|
43
33
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
44
34
|
"ReadExcel"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ReadSheetProps } from "./ReadSheet";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated 请使用 ReadSheetProps 代替
|
|
4
|
+
*/
|
|
5
|
+
export type ReadExcelProps = ReadSheetProps;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated 请使用 ReadSheet 代替
|
|
8
|
+
*/
|
|
9
|
+
export declare const ReadExcel: import("react").FC<ReadSheetProps>;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE__InputFile_js_ee583621__ from "./InputFile.js";
|
|
5
|
-
const ReadExcel = (props)=>{
|
|
6
|
-
const { onValueChange, ...rest } = props;
|
|
7
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__InputFile_js_ee583621__.InputFile, {
|
|
8
|
-
accept: ".xlsx",
|
|
9
|
-
type: "arrayBuffer",
|
|
10
|
-
onValueChange: (data)=>onValueChange?.((0, __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__.readExcel)(data)),
|
|
11
|
-
...rest
|
|
12
|
-
});
|
|
13
|
-
};
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__ReadSheet_js_b6d7a923__ from "./ReadSheet.js";
|
|
3
|
+
const ReadExcel = __WEBPACK_EXTERNAL_MODULE__ReadSheet_js_b6d7a923__.ReadSheet;
|
|
14
4
|
export { ReadExcel };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
ReadSheet: ()=>ReadSheet
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
32
|
+
const external_InputFile_cjs_namespaceObject = require("./InputFile.cjs");
|
|
33
|
+
const ReadSheet = (props)=>{
|
|
34
|
+
const { onValueChange, ...rest } = props;
|
|
35
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_InputFile_cjs_namespaceObject.InputFile, {
|
|
36
|
+
accept: ".xlsx",
|
|
37
|
+
type: "arrayBuffer",
|
|
38
|
+
onValueChange: (data)=>onValueChange?.((0, external_deepsea_tools_namespaceObject.readSheet)(data)),
|
|
39
|
+
...rest
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.ReadSheet = __webpack_exports__.ReadSheet;
|
|
43
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
44
|
+
"ReadSheet"
|
|
45
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
46
|
+
Object.defineProperty(exports, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { WorkBookData, WorkSheetData } from "deepsea-tools";
|
|
3
|
+
import { InputFileProps } from "./InputFile";
|
|
4
|
+
export interface ReadSheetProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
5
|
+
onValueChange?: <Sheet = WorkSheetData>(data: WorkBookData<Sheet>) => void;
|
|
6
|
+
}
|
|
7
|
+
/** 专门用于读取 excel 的组件 */
|
|
8
|
+
export declare const ReadSheet: FC<ReadSheetProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__InputFile_js_ee583621__ from "./InputFile.js";
|
|
5
|
+
const ReadSheet = (props)=>{
|
|
6
|
+
const { onValueChange, ...rest } = props;
|
|
7
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__InputFile_js_ee583621__.InputFile, {
|
|
8
|
+
accept: ".xlsx",
|
|
9
|
+
type: "arrayBuffer",
|
|
10
|
+
onValueChange: (data)=>onValueChange?.((0, __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__.readSheet)(data)),
|
|
11
|
+
...rest
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export { ReadSheet };
|
|
@@ -27,20 +27,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
27
27
|
__webpack_require__.d(__webpack_exports__, {
|
|
28
28
|
WriteExcel: ()=>WriteExcel
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
function WriteExcel(props) {
|
|
33
|
-
const { as, excel, onClick: _onClick, ...rest } = props;
|
|
34
|
-
function onClick(e) {
|
|
35
|
-
_onClick?.(e);
|
|
36
|
-
if (!excel) return;
|
|
37
|
-
(0, external_deepsea_tools_namespaceObject.writeExcel)(excel);
|
|
38
|
-
}
|
|
39
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(as ?? "button", {
|
|
40
|
-
onClick,
|
|
41
|
-
...rest
|
|
42
|
-
});
|
|
43
|
-
}
|
|
30
|
+
const external_WriteSheet_cjs_namespaceObject = require("./WriteSheet.cjs");
|
|
31
|
+
const WriteExcel = external_WriteSheet_cjs_namespaceObject.WriteSheet;
|
|
44
32
|
exports.WriteExcel = __webpack_exports__.WriteExcel;
|
|
45
33
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
46
34
|
"WriteExcel"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { WriteSheet, WriteSheetProps } from "./WriteSheet";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated 请使用 WriteSheetProps 代替
|
|
4
|
+
*/
|
|
5
|
+
export type WriteExcelProps = WriteSheetProps;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated 请使用 WriteSheet 代替
|
|
8
|
+
*/
|
|
9
|
+
export declare const WriteExcel: typeof WriteSheet;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
function WriteExcel(props) {
|
|
5
|
-
const { as, excel, onClick: _onClick, ...rest } = props;
|
|
6
|
-
function onClick(e) {
|
|
7
|
-
_onClick?.(e);
|
|
8
|
-
if (!excel) return;
|
|
9
|
-
(0, __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__.writeExcel)(excel);
|
|
10
|
-
}
|
|
11
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createElement)(as ?? "button", {
|
|
12
|
-
onClick,
|
|
13
|
-
...rest
|
|
14
|
-
});
|
|
15
|
-
}
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__WriteSheet_js_e86d0e28__ from "./WriteSheet.js";
|
|
3
|
+
const WriteExcel = __WEBPACK_EXTERNAL_MODULE__WriteSheet_js_e86d0e28__.WriteSheet;
|
|
16
4
|
export { WriteExcel };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
WriteSheet: ()=>WriteSheet
|
|
29
|
+
});
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
32
|
+
function WriteSheet(props) {
|
|
33
|
+
const { as, excel, onClick: _onClick, ...rest } = props;
|
|
34
|
+
function onClick(e) {
|
|
35
|
+
_onClick?.(e);
|
|
36
|
+
if (!excel) return;
|
|
37
|
+
(0, external_deepsea_tools_namespaceObject.writeSheet)(excel);
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(as ?? "button", {
|
|
40
|
+
onClick,
|
|
41
|
+
...rest
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.WriteSheet = __webpack_exports__.WriteSheet;
|
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
46
|
+
"WriteSheet"
|
|
47
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps, JSX, JSXElementConstructor } from "react";
|
|
2
|
+
import { WriteSheetParams } from "deepsea-tools";
|
|
3
|
+
export type WriteSheetProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "excel"> & {
|
|
4
|
+
as?: AS;
|
|
5
|
+
excel?: WriteSheetParams;
|
|
6
|
+
};
|
|
7
|
+
/** 导出 excel 的 button 组件 */
|
|
8
|
+
export declare function WriteSheet<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button">(props: WriteSheetProps<AS>): import("react").ReactElement<any, string | JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
|
|
4
|
+
function WriteSheet(props) {
|
|
5
|
+
const { as, excel, onClick: _onClick, ...rest } = props;
|
|
6
|
+
function onClick(e) {
|
|
7
|
+
_onClick?.(e);
|
|
8
|
+
if (!excel) return;
|
|
9
|
+
(0, __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__.writeSheet)(excel);
|
|
10
|
+
}
|
|
11
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createElement)(as ?? "button", {
|
|
12
|
+
onClick,
|
|
13
|
+
...rest
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export { WriteSheet };
|
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,9 @@ var __webpack_modules__ = {
|
|
|
45
45
|
"@/components/ReadExcel": function(module) {
|
|
46
46
|
module.exports = require("./components/ReadExcel.cjs");
|
|
47
47
|
},
|
|
48
|
+
"@/components/ReadSheet": function(module) {
|
|
49
|
+
module.exports = require("./components/ReadSheet.cjs");
|
|
50
|
+
},
|
|
48
51
|
"@/components/Ring": function(module) {
|
|
49
52
|
module.exports = require("./components/Ring.cjs");
|
|
50
53
|
},
|
|
@@ -78,6 +81,9 @@ var __webpack_modules__ = {
|
|
|
78
81
|
"@/components/WriteExcel": function(module) {
|
|
79
82
|
module.exports = require("./components/WriteExcel.cjs");
|
|
80
83
|
},
|
|
84
|
+
"@/components/WriteSheet": function(module) {
|
|
85
|
+
module.exports = require("./components/WriteSheet.cjs");
|
|
86
|
+
},
|
|
81
87
|
"@/utils/getReactVersion": function(module) {
|
|
82
88
|
module.exports = require("./utils/getReactVersion.cjs");
|
|
83
89
|
},
|
|
@@ -218,82 +224,94 @@ var __webpack_exports__ = {};
|
|
|
218
224
|
return _components_ReadExcel__WEBPACK_IMPORTED_MODULE_14__[key];
|
|
219
225
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
220
226
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
221
|
-
var
|
|
227
|
+
var _components_ReadSheet__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("@/components/ReadSheet");
|
|
228
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
229
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_ReadSheet__WEBPACK_IMPORTED_MODULE_15__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
230
|
+
return _components_ReadSheet__WEBPACK_IMPORTED_MODULE_15__[key];
|
|
231
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
232
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
233
|
+
var _components_Ring__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("@/components/Ring");
|
|
234
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
235
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Ring__WEBPACK_IMPORTED_MODULE_16__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
236
|
+
return _components_Ring__WEBPACK_IMPORTED_MODULE_16__[key];
|
|
237
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
238
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
239
|
+
var _components_Scroll__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("@/components/Scroll");
|
|
222
240
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
223
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
224
|
-
return
|
|
241
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Scroll__WEBPACK_IMPORTED_MODULE_17__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
242
|
+
return _components_Scroll__WEBPACK_IMPORTED_MODULE_17__[key];
|
|
225
243
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
226
244
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
227
|
-
var
|
|
245
|
+
var _components_ScrollMask__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("@/components/ScrollMask");
|
|
228
246
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
229
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
230
|
-
return
|
|
247
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_ScrollMask__WEBPACK_IMPORTED_MODULE_18__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
248
|
+
return _components_ScrollMask__WEBPACK_IMPORTED_MODULE_18__[key];
|
|
231
249
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
232
250
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
233
|
-
var
|
|
251
|
+
var _components_SectionRing__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("@/components/SectionRing");
|
|
234
252
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
235
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
236
|
-
return
|
|
253
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_SectionRing__WEBPACK_IMPORTED_MODULE_19__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
254
|
+
return _components_SectionRing__WEBPACK_IMPORTED_MODULE_19__[key];
|
|
237
255
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
238
256
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
239
|
-
var
|
|
257
|
+
var _components_Skeleton__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("@/components/Skeleton");
|
|
240
258
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
241
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
242
|
-
return
|
|
259
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Skeleton__WEBPACK_IMPORTED_MODULE_20__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
260
|
+
return _components_Skeleton__WEBPACK_IMPORTED_MODULE_20__[key];
|
|
243
261
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
244
262
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
245
|
-
var
|
|
263
|
+
var _components_Title__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("@/components/Title");
|
|
246
264
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
247
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
248
|
-
return
|
|
265
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Title__WEBPACK_IMPORTED_MODULE_21__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
266
|
+
return _components_Title__WEBPACK_IMPORTED_MODULE_21__[key];
|
|
249
267
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
250
268
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
251
|
-
var
|
|
269
|
+
var _components_TransitionBox__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("@/components/TransitionBox");
|
|
252
270
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
253
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
254
|
-
return
|
|
271
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_TransitionBox__WEBPACK_IMPORTED_MODULE_22__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
272
|
+
return _components_TransitionBox__WEBPACK_IMPORTED_MODULE_22__[key];
|
|
255
273
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
256
274
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
257
|
-
var
|
|
275
|
+
var _components_TransitionNum__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("@/components/TransitionNum");
|
|
258
276
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
259
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
260
|
-
return
|
|
277
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_TransitionNum__WEBPACK_IMPORTED_MODULE_23__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
278
|
+
return _components_TransitionNum__WEBPACK_IMPORTED_MODULE_23__[key];
|
|
261
279
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
262
280
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
263
|
-
var
|
|
281
|
+
var _components_Trapezium__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__("@/components/Trapezium");
|
|
264
282
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
265
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
266
|
-
return
|
|
283
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Trapezium__WEBPACK_IMPORTED_MODULE_24__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
284
|
+
return _components_Trapezium__WEBPACK_IMPORTED_MODULE_24__[key];
|
|
267
285
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
268
286
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
269
|
-
var
|
|
287
|
+
var _components_Unify__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__("@/components/Unify");
|
|
270
288
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
271
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
272
|
-
return
|
|
289
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_Unify__WEBPACK_IMPORTED_MODULE_25__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
290
|
+
return _components_Unify__WEBPACK_IMPORTED_MODULE_25__[key];
|
|
273
291
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
274
292
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
275
|
-
var
|
|
293
|
+
var _components_WriteExcel__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__("@/components/WriteExcel");
|
|
276
294
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
277
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
278
|
-
return
|
|
295
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_WriteExcel__WEBPACK_IMPORTED_MODULE_26__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
296
|
+
return _components_WriteExcel__WEBPACK_IMPORTED_MODULE_26__[key];
|
|
279
297
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
280
298
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
281
|
-
var
|
|
299
|
+
var _components_WriteSheet__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__("@/components/WriteSheet");
|
|
282
300
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
283
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
284
|
-
return
|
|
301
|
+
for(var __WEBPACK_IMPORT_KEY__ in _components_WriteSheet__WEBPACK_IMPORTED_MODULE_27__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
302
|
+
return _components_WriteSheet__WEBPACK_IMPORTED_MODULE_27__[key];
|
|
285
303
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
286
304
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
287
|
-
var
|
|
305
|
+
var _utils_getReactVersion__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__("@/utils/getReactVersion");
|
|
288
306
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
289
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
290
|
-
return
|
|
307
|
+
for(var __WEBPACK_IMPORT_KEY__ in _utils_getReactVersion__WEBPACK_IMPORTED_MODULE_28__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
308
|
+
return _utils_getReactVersion__WEBPACK_IMPORTED_MODULE_28__[key];
|
|
291
309
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
292
310
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
293
|
-
var
|
|
311
|
+
var _utils_index__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__("@/utils/index");
|
|
294
312
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
295
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
296
|
-
return
|
|
313
|
+
for(var __WEBPACK_IMPORT_KEY__ in _utils_index__WEBPACK_IMPORTED_MODULE_29__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
314
|
+
return _utils_index__WEBPACK_IMPORTED_MODULE_29__[key];
|
|
297
315
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
298
316
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
299
317
|
})();
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./components/InputFile";
|
|
|
13
13
|
export * from "./components/InputFileButton";
|
|
14
14
|
export * from "./components/LoopSwiper";
|
|
15
15
|
export * from "./components/ReadExcel";
|
|
16
|
+
export * from "./components/ReadSheet";
|
|
16
17
|
export * from "./components/Ring";
|
|
17
18
|
export * from "./components/Scroll";
|
|
18
19
|
export * from "./components/ScrollMask";
|
|
@@ -24,5 +25,6 @@ export * from "./components/TransitionNum";
|
|
|
24
25
|
export * from "./components/Trapezium";
|
|
25
26
|
export * from "./components/Unify";
|
|
26
27
|
export * from "./components/WriteExcel";
|
|
28
|
+
export * from "./components/WriteSheet";
|
|
27
29
|
export * from "./utils/getReactVersion";
|
|
28
30
|
export * from "./utils/index";
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./components/InputFile.js";
|
|
|
13
13
|
export * from "./components/InputFileButton.js";
|
|
14
14
|
export * from "./components/LoopSwiper.js";
|
|
15
15
|
export * from "./components/ReadExcel.js";
|
|
16
|
+
export * from "./components/ReadSheet.js";
|
|
16
17
|
export * from "./components/Ring.js";
|
|
17
18
|
export * from "./components/Scroll.js";
|
|
18
19
|
export * from "./components/ScrollMask.js";
|
|
@@ -24,5 +25,6 @@ export * from "./components/TransitionNum.js";
|
|
|
24
25
|
export * from "./components/Trapezium.js";
|
|
25
26
|
export * from "./components/Unify.js";
|
|
26
27
|
export * from "./components/WriteExcel.js";
|
|
28
|
+
export * from "./components/WriteSheet.js";
|
|
27
29
|
export * from "./utils/getReactVersion.js";
|
|
28
30
|
export * from "./utils/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepsea-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.15.0",
|
|
4
4
|
"description": "格数科技自用组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"echarts": "^5.6.0",
|
|
41
41
|
"hls.js": "^1.6.1",
|
|
42
42
|
"smooth-scrollbar": "^8.8.4",
|
|
43
|
-
"deepsea-tools": "5.
|
|
44
|
-
"soda-hooks": "6.9.
|
|
43
|
+
"deepsea-tools": "5.30.0",
|
|
44
|
+
"soda-hooks": "6.9.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.8.3"
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { WorkBookData, WorkSheetData, readExcel } from "deepsea-tools"
|
|
3
|
+
import { ReadSheet, ReadSheetProps } from "./ReadSheet"
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated 请使用 ReadSheetProps 代替
|
|
7
|
+
*/
|
|
8
|
+
export type ReadExcelProps = ReadSheetProps
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** 专门用于读取 excel 的组件 */
|
|
13
|
-
export const ReadExcel: FC<ReadExcelProps> = props => {
|
|
14
|
-
const { onValueChange, ...rest } = props
|
|
15
|
-
|
|
16
|
-
return <InputFile accept=".xlsx" type="arrayBuffer" onValueChange={data => onValueChange?.(readExcel(data))} {...rest} />
|
|
17
|
-
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated 请使用 ReadSheet 代替
|
|
12
|
+
*/
|
|
13
|
+
export const ReadExcel = ReadSheet
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { FC } from "react"
|
|
4
|
+
import { WorkBookData, WorkSheetData, readSheet } from "deepsea-tools"
|
|
5
|
+
|
|
6
|
+
import { InputFile, InputFileProps } from "./InputFile"
|
|
7
|
+
|
|
8
|
+
export interface ReadSheetProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
|
|
9
|
+
onValueChange?: <Sheet = WorkSheetData>(data: WorkBookData<Sheet>) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** 专门用于读取 excel 的组件 */
|
|
13
|
+
export const ReadSheet: FC<ReadSheetProps> = props => {
|
|
14
|
+
const { onValueChange, ...rest } = props
|
|
15
|
+
|
|
16
|
+
return <InputFile accept=".xlsx" type="arrayBuffer" onValueChange={data => onValueChange?.(readSheet(data))} {...rest} />
|
|
17
|
+
}
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { WriteExcelParams, writeExcel } from "deepsea-tools"
|
|
3
|
+
import { WriteSheet, WriteSheetProps } from "./WriteSheet"
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated 请使用 WriteSheetProps 代替
|
|
7
|
+
*/
|
|
8
|
+
export type WriteExcelProps = WriteSheetProps
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function onClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {
|
|
16
|
-
_onClick?.(e)
|
|
17
|
-
if (!excel) return
|
|
18
|
-
writeExcel(excel)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return createElement(as ?? "button", {
|
|
22
|
-
onClick,
|
|
23
|
-
...rest,
|
|
24
|
-
})
|
|
25
|
-
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated 请使用 WriteSheet 代替
|
|
12
|
+
*/
|
|
13
|
+
export const WriteExcel = WriteSheet
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ComponentProps, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent, createElement } from "react"
|
|
4
|
+
import { WriteSheetParams, writeSheet } from "deepsea-tools"
|
|
5
|
+
|
|
6
|
+
export type WriteSheetProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "excel"> & {
|
|
7
|
+
as?: AS
|
|
8
|
+
excel?: WriteSheetParams
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** 导出 excel 的 button 组件 */
|
|
12
|
+
export function WriteSheet<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button">(props: WriteSheetProps<AS>) {
|
|
13
|
+
const { as, excel, onClick: _onClick, ...rest } = props
|
|
14
|
+
|
|
15
|
+
function onClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {
|
|
16
|
+
_onClick?.(e)
|
|
17
|
+
if (!excel) return
|
|
18
|
+
writeSheet(excel)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return createElement(as ?? "button", {
|
|
22
|
+
onClick,
|
|
23
|
+
...rest,
|
|
24
|
+
})
|
|
25
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "@/components/InputFile"
|
|
|
13
13
|
export * from "@/components/InputFileButton"
|
|
14
14
|
export * from "@/components/LoopSwiper"
|
|
15
15
|
export * from "@/components/ReadExcel"
|
|
16
|
+
export * from "@/components/ReadSheet"
|
|
16
17
|
export * from "@/components/Ring"
|
|
17
18
|
export * from "@/components/Scroll"
|
|
18
19
|
export * from "@/components/ScrollMask"
|
|
@@ -24,5 +25,6 @@ export * from "@/components/TransitionNum"
|
|
|
24
25
|
export * from "@/components/Trapezium"
|
|
25
26
|
export * from "@/components/Unify"
|
|
26
27
|
export * from "@/components/WriteExcel"
|
|
28
|
+
export * from "@/components/WriteSheet"
|
|
27
29
|
export * from "@/utils/getReactVersion"
|
|
28
30
|
export * from "@/utils/index"
|