deepsea-components 5.11.6 → 5.12.1
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/AutoFit.cjs +116 -0
- package/dist/components/AutoFit.js +82 -0
- package/dist/components/AutoScroll.cjs +125 -0
- package/dist/components/AutoScroll.js +91 -0
- package/dist/components/AutoSizeTextarea.cjs +73 -0
- package/dist/components/AutoSizeTextarea.js +39 -0
- package/dist/components/CircleText.cjs +68 -0
- package/dist/components/CircleText.js +34 -0
- package/dist/components/CopyButton.cjs +73 -0
- package/dist/{cjs/components → components}/CopyButton.d.ts +3 -3
- package/dist/components/CopyButton.js +27 -0
- package/dist/components/Echart.cjs +74 -0
- package/dist/components/Echart.js +34 -0
- package/dist/components/Flow.cjs +211 -0
- package/dist/components/Flow.js +168 -0
- package/dist/components/FormLabel.cjs +77 -0
- package/dist/components/FormLabel.js +37 -0
- package/dist/components/HlsPlayer.cjs +76 -0
- package/dist/components/HlsPlayer.js +32 -0
- package/dist/components/InfiniteScroll.cjs +135 -0
- package/dist/{cjs/components → components}/InfiniteScroll.d.ts +7 -7
- package/dist/components/InfiniteScroll.js +101 -0
- package/dist/components/InputFile.cjs +102 -0
- package/dist/components/InputFile.js +65 -0
- package/dist/components/InputFileButton.cjs +109 -0
- package/dist/components/InputFileButton.js +75 -0
- package/dist/components/LoopSwiper.cjs +147 -0
- package/dist/components/LoopSwiper.js +113 -0
- package/dist/components/ReadExcel.cjs +48 -0
- package/dist/components/ReadExcel.js +14 -0
- package/dist/components/Ring.cjs +53 -0
- package/dist/components/Ring.js +19 -0
- package/dist/components/Scroll.cjs +143 -0
- package/dist/components/Scroll.js +54 -0
- package/dist/components/SectionRing.cjs +59 -0
- package/dist/components/SectionRing.js +25 -0
- package/dist/components/Skeleton.cjs +66 -0
- package/dist/components/Skeleton.js +32 -0
- package/dist/components/Title.cjs +61 -0
- package/dist/components/Title.js +27 -0
- package/dist/components/TransitionBox.cjs +79 -0
- package/dist/components/TransitionBox.js +45 -0
- package/dist/components/TransitionNum.cjs +83 -0
- package/dist/components/TransitionNum.js +49 -0
- package/dist/components/Trapezium.cjs +67 -0
- package/dist/components/Trapezium.js +33 -0
- package/dist/components/Unify.cjs +68 -0
- package/dist/components/Unify.js +31 -0
- package/dist/components/WriteExcel.cjs +50 -0
- package/dist/components/WriteExcel.js +16 -0
- package/dist/index.cjs +285 -0
- package/dist/index.js +26 -0
- package/dist/utils/getReactVersion.cjs +40 -0
- package/dist/utils/getReactVersion.js +6 -0
- package/dist/utils/index.cjs +57 -0
- package/dist/utils/index.js +17 -0
- package/package.json +26 -17
- package/src/components/WriteExcel.tsx +25 -25
- package/tsconfig.json +16 -0
- package/dist/cjs/components/AutoFit.js +0 -106
- package/dist/cjs/components/AutoFit.js.map +0 -7
- package/dist/cjs/components/AutoScroll.js +0 -127
- package/dist/cjs/components/AutoScroll.js.map +0 -7
- package/dist/cjs/components/AutoSizeTextarea.js +0 -70
- package/dist/cjs/components/AutoSizeTextarea.js.map +0 -7
- package/dist/cjs/components/CircleText.js +0 -77
- package/dist/cjs/components/CircleText.js.map +0 -7
- package/dist/cjs/components/CopyButton.js +0 -60
- package/dist/cjs/components/CopyButton.js.map +0 -7
- package/dist/cjs/components/Echart.js +0 -56
- package/dist/cjs/components/Echart.js.map +0 -7
- package/dist/cjs/components/Flow.js +0 -220
- package/dist/cjs/components/Flow.js.map +0 -7
- package/dist/cjs/components/FormLabel.js +0 -42
- package/dist/cjs/components/FormLabel.js.map +0 -7
- package/dist/cjs/components/HlsPlayer.js +0 -65
- package/dist/cjs/components/HlsPlayer.js.map +0 -7
- package/dist/cjs/components/InfiniteScroll.js +0 -148
- package/dist/cjs/components/InfiniteScroll.js.map +0 -7
- package/dist/cjs/components/InputFile.js +0 -90
- package/dist/cjs/components/InputFile.js.map +0 -7
- package/dist/cjs/components/InputFileButton.js +0 -113
- package/dist/cjs/components/InputFileButton.js.map +0 -7
- package/dist/cjs/components/LoopSwiper.js +0 -137
- package/dist/cjs/components/LoopSwiper.js.map +0 -7
- package/dist/cjs/components/ReadExcel.js +0 -36
- package/dist/cjs/components/ReadExcel.js.map +0 -7
- package/dist/cjs/components/Ring.js +0 -49
- package/dist/cjs/components/Ring.js.map +0 -7
- package/dist/cjs/components/Scroll.js +0 -103
- package/dist/cjs/components/Scroll.js.map +0 -7
- package/dist/cjs/components/SectionRing.js +0 -54
- package/dist/cjs/components/SectionRing.js.map +0 -7
- package/dist/cjs/components/Skeleton.js +0 -66
- package/dist/cjs/components/Skeleton.js.map +0 -7
- package/dist/cjs/components/Title.js +0 -48
- package/dist/cjs/components/Title.js.map +0 -7
- package/dist/cjs/components/TransitionBox.js +0 -53
- package/dist/cjs/components/TransitionBox.js.map +0 -7
- package/dist/cjs/components/TransitionNum.js +0 -62
- package/dist/cjs/components/TransitionNum.js.map +0 -7
- package/dist/cjs/components/Trapezium.js +0 -69
- package/dist/cjs/components/Trapezium.js.map +0 -7
- package/dist/cjs/components/Unify.js +0 -48
- package/dist/cjs/components/Unify.js.map +0 -7
- package/dist/cjs/components/WriteExcel.js +0 -45
- package/dist/cjs/components/WriteExcel.js.map +0 -7
- package/dist/cjs/index.js +0 -74
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/utils/getReactVersion.js +0 -34
- package/dist/cjs/utils/getReactVersion.js.map +0 -7
- package/dist/cjs/utils/index.js +0 -52
- package/dist/cjs/utils/index.js.map +0 -7
- package/dist/esm/components/AutoFit.d.ts +0 -25
- package/dist/esm/components/AutoFit.js +0 -97
- package/dist/esm/components/AutoFit.js.map +0 -1
- package/dist/esm/components/AutoScroll.d.ts +0 -38
- package/dist/esm/components/AutoScroll.js +0 -102
- package/dist/esm/components/AutoScroll.js.map +0 -1
- package/dist/esm/components/AutoSizeTextarea.d.ts +0 -5
- package/dist/esm/components/AutoSizeTextarea.js +0 -48
- package/dist/esm/components/AutoSizeTextarea.js.map +0 -1
- package/dist/esm/components/CircleText.d.ts +0 -25
- package/dist/esm/components/CircleText.js +0 -49
- package/dist/esm/components/CircleText.js.map +0 -1
- package/dist/esm/components/CopyButton.d.ts +0 -13
- package/dist/esm/components/CopyButton.js +0 -31
- package/dist/esm/components/CopyButton.js.map +0 -1
- package/dist/esm/components/Echart.d.ts +0 -15
- package/dist/esm/components/Echart.js +0 -41
- package/dist/esm/components/Echart.js.map +0 -1
- package/dist/esm/components/Flow.d.ts +0 -86
- package/dist/esm/components/Flow.js +0 -186
- package/dist/esm/components/Flow.js.map +0 -1
- package/dist/esm/components/FormLabel.d.ts +0 -22
- package/dist/esm/components/FormLabel.js +0 -52
- package/dist/esm/components/FormLabel.js.map +0 -1
- package/dist/esm/components/HlsPlayer.d.ts +0 -5
- package/dist/esm/components/HlsPlayer.js +0 -36
- package/dist/esm/components/HlsPlayer.js.map +0 -1
- package/dist/esm/components/InfiniteScroll.d.ts +0 -54
- package/dist/esm/components/InfiniteScroll.js +0 -102
- package/dist/esm/components/InfiniteScroll.js.map +0 -1
- package/dist/esm/components/InputFile.d.ts +0 -26
- package/dist/esm/components/InputFile.js +0 -78
- package/dist/esm/components/InputFile.js.map +0 -1
- package/dist/esm/components/InputFileButton.d.ts +0 -11
- package/dist/esm/components/InputFileButton.js +0 -95
- package/dist/esm/components/InputFileButton.js.map +0 -1
- package/dist/esm/components/LoopSwiper.d.ts +0 -9
- package/dist/esm/components/LoopSwiper.js +0 -122
- package/dist/esm/components/LoopSwiper.js.map +0 -1
- package/dist/esm/components/ReadExcel.d.ts +0 -8
- package/dist/esm/components/ReadExcel.js +0 -19
- package/dist/esm/components/ReadExcel.js.map +0 -1
- package/dist/esm/components/Ring.d.ts +0 -7
- package/dist/esm/components/Ring.js +0 -26
- package/dist/esm/components/Ring.js.map +0 -1
- package/dist/esm/components/Scroll.d.ts +0 -24
- package/dist/esm/components/Scroll.js +0 -67
- package/dist/esm/components/Scroll.js.map +0 -1
- package/dist/esm/components/SectionRing.d.ts +0 -8
- package/dist/esm/components/SectionRing.js +0 -33
- package/dist/esm/components/SectionRing.js.map +0 -1
- package/dist/esm/components/Skeleton.d.ts +0 -5
- package/dist/esm/components/Skeleton.js +0 -38
- package/dist/esm/components/Skeleton.js.map +0 -1
- package/dist/esm/components/Title.d.ts +0 -3
- package/dist/esm/components/Title.js +0 -26
- package/dist/esm/components/Title.js.map +0 -1
- package/dist/esm/components/TransitionBox.d.ts +0 -10
- package/dist/esm/components/TransitionBox.js +0 -50
- package/dist/esm/components/TransitionBox.js.map +0 -1
- package/dist/esm/components/TransitionNum.d.ts +0 -16
- package/dist/esm/components/TransitionNum.js +0 -65
- package/dist/esm/components/TransitionNum.js.map +0 -1
- package/dist/esm/components/Trapezium.d.ts +0 -9
- package/dist/esm/components/Trapezium.js +0 -43
- package/dist/esm/components/Trapezium.js.map +0 -1
- package/dist/esm/components/Unify.d.ts +0 -13
- package/dist/esm/components/Unify.js +0 -47
- package/dist/esm/components/Unify.js.map +0 -1
- package/dist/esm/components/WriteExcel.d.ts +0 -8
- package/dist/esm/components/WriteExcel.js +0 -23
- package/dist/esm/components/WriteExcel.js.map +0 -1
- package/dist/esm/index.d.ts +0 -26
- package/dist/esm/index.js +0 -27
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/utils/getReactVersion.d.ts +0 -1
- package/dist/esm/utils/getReactVersion.js +0 -6
- package/dist/esm/utils/getReactVersion.js.map +0 -1
- package/dist/esm/utils/index.d.ts +0 -9
- package/dist/esm/utils/index.js +0 -17
- package/dist/esm/utils/index.js.map +0 -1
- /package/dist/{cjs/components → components}/AutoFit.d.ts +0 -0
- /package/dist/{cjs/components → components}/AutoScroll.d.ts +0 -0
- /package/dist/{cjs/components → components}/AutoSizeTextarea.d.ts +0 -0
- /package/dist/{cjs/components → components}/CircleText.d.ts +0 -0
- /package/dist/{cjs/components → components}/Echart.d.ts +0 -0
- /package/dist/{cjs/components → components}/Flow.d.ts +0 -0
- /package/dist/{cjs/components → components}/FormLabel.d.ts +0 -0
- /package/dist/{cjs/components → components}/HlsPlayer.d.ts +0 -0
- /package/dist/{cjs/components → components}/InputFile.d.ts +0 -0
- /package/dist/{cjs/components → components}/InputFileButton.d.ts +0 -0
- /package/dist/{cjs/components → components}/LoopSwiper.d.ts +0 -0
- /package/dist/{cjs/components → components}/ReadExcel.d.ts +0 -0
- /package/dist/{cjs/components → components}/Ring.d.ts +0 -0
- /package/dist/{cjs/components → components}/Scroll.d.ts +0 -0
- /package/dist/{cjs/components → components}/SectionRing.d.ts +0 -0
- /package/dist/{cjs/components → components}/Skeleton.d.ts +0 -0
- /package/dist/{cjs/components → components}/Title.d.ts +0 -0
- /package/dist/{cjs/components → components}/TransitionBox.d.ts +0 -0
- /package/dist/{cjs/components → components}/TransitionNum.d.ts +0 -0
- /package/dist/{cjs/components → components}/Trapezium.d.ts +0 -0
- /package/dist/{cjs/components → components}/Unify.d.ts +0 -0
- /package/dist/{cjs/components → components}/WriteExcel.d.ts +0 -0
- /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/utils → utils}/getReactVersion.d.ts +0 -0
- /package/dist/{cjs/utils → utils}/index.d.ts +0 -0
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/InputFileButton.tsx
|
|
21
|
-
var InputFileButton_exports = {};
|
|
22
|
-
__export(InputFileButton_exports, {
|
|
23
|
-
InputFileButton: () => InputFileButton
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(InputFileButton_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var import_InputFile = require("./InputFile");
|
|
28
|
-
function InputFileButton(props) {
|
|
29
|
-
const {
|
|
30
|
-
as = "button",
|
|
31
|
-
onClick: _onClick,
|
|
32
|
-
inputProps = {},
|
|
33
|
-
accept,
|
|
34
|
-
onDrop: _onDrop,
|
|
35
|
-
onDragOver: _onDragOver,
|
|
36
|
-
dragFile,
|
|
37
|
-
disabled: _disabled,
|
|
38
|
-
type = "file",
|
|
39
|
-
multiple,
|
|
40
|
-
onValueChange,
|
|
41
|
-
onFileChange,
|
|
42
|
-
clearAfterChange,
|
|
43
|
-
...rest
|
|
44
|
-
} = props;
|
|
45
|
-
const { ref, style, disabled: __disabled, ...restInputProps } = inputProps;
|
|
46
|
-
const [disabled, setDisabled] = (0, import_react.useState)(false);
|
|
47
|
-
const input = (0, import_react.useRef)(null);
|
|
48
|
-
(0, import_react.useImperativeHandle)(ref, () => input.current, [input.current]);
|
|
49
|
-
function onClick(e) {
|
|
50
|
-
input.current?.click();
|
|
51
|
-
_onClick?.(e);
|
|
52
|
-
}
|
|
53
|
-
async function onDrop(e) {
|
|
54
|
-
_onDrop?.(e);
|
|
55
|
-
if (disabled || !dragFile)
|
|
56
|
-
return;
|
|
57
|
-
e.preventDefault();
|
|
58
|
-
const { files } = e.dataTransfer;
|
|
59
|
-
if (!files || files.length === 0)
|
|
60
|
-
return;
|
|
61
|
-
setDisabled(true);
|
|
62
|
-
try {
|
|
63
|
-
if (multiple) {
|
|
64
|
-
const files2 = Array.from(files);
|
|
65
|
-
const values = [];
|
|
66
|
-
for (const file of files2) {
|
|
67
|
-
const value = await (0, import_InputFile.getFileData)(file, type);
|
|
68
|
-
values.push(value);
|
|
69
|
-
}
|
|
70
|
-
onFileChange?.(files2);
|
|
71
|
-
onValueChange?.(values);
|
|
72
|
-
} else {
|
|
73
|
-
const file = files[0];
|
|
74
|
-
onFileChange?.(file);
|
|
75
|
-
onValueChange?.(await (0, import_InputFile.getFileData)(file, type));
|
|
76
|
-
}
|
|
77
|
-
} finally {
|
|
78
|
-
setDisabled(false);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function onDragOver(e) {
|
|
82
|
-
_onDragOver?.(e);
|
|
83
|
-
if (disabled || !dragFile)
|
|
84
|
-
return;
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
}
|
|
87
|
-
return /* @__PURE__ */ React.createElement(import_react.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
88
|
-
import_InputFile.InputFile,
|
|
89
|
-
{
|
|
90
|
-
ref: input,
|
|
91
|
-
disabled: disabled || _disabled || __disabled,
|
|
92
|
-
style: { display: "none", ...style },
|
|
93
|
-
multiple,
|
|
94
|
-
accept,
|
|
95
|
-
type,
|
|
96
|
-
onValueChange,
|
|
97
|
-
onFileChange,
|
|
98
|
-
clearAfterChange,
|
|
99
|
-
...restInputProps
|
|
100
|
-
}
|
|
101
|
-
), (0, import_react.createElement)(as, {
|
|
102
|
-
disabled: disabled || _disabled,
|
|
103
|
-
onClick,
|
|
104
|
-
onDrop,
|
|
105
|
-
onDragOver,
|
|
106
|
-
...rest
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
InputFileButton
|
|
112
|
-
});
|
|
113
|
-
//# sourceMappingURL=InputFileButton.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/InputFileButton.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport {\n ComponentProps,\n ComponentRef,\n DragEvent,\n Fragment,\n JSX,\n JSXElementConstructor,\n MouseEvent as ReactMouseEvent,\n createElement,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\"\n\nimport { FileType, InputFile, InputFileBaseProps, InputFileDataType, InputFileDataTypeMap, InputFileExtraProps, ValueType, getFileData } from \"./InputFile\"\n\nexport type InputFileButtonProps<\n Multiple extends boolean = false,\n Type extends InputFileDataType = \"file\",\n AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\",\n> = Omit<ComponentProps<AS>, \"as\" | \"type\" | \"disabled\"> &\n InputFileExtraProps<Multiple, Type> & {\n disabled?: boolean\n inputProps?: Omit<InputFileBaseProps, \"accept\">\n accept?: string\n dragFile?: boolean\n as?: AS\n }\n\n/** 专用于读取文件的 button 组件 */\nexport function InputFileButton<\n Multiple extends boolean = false,\n Type extends InputFileDataType = \"file\",\n AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = \"button\",\n>(props: InputFileButtonProps<Multiple, Type, AS>) {\n const {\n as = \"button\",\n onClick: _onClick,\n inputProps = {},\n accept,\n onDrop: _onDrop,\n onDragOver: _onDragOver,\n dragFile,\n disabled: _disabled,\n type = \"file\",\n multiple,\n onValueChange,\n onFileChange,\n clearAfterChange,\n ...rest\n } = props\n\n const { ref, style, disabled: __disabled, ...restInputProps } = inputProps\n const [disabled, setDisabled] = useState(false)\n const input = useRef<HTMLInputElement>(null)\n\n useImperativeHandle(ref, () => input.current!, [input.current])\n\n function onClick(e: ReactMouseEvent<ComponentRef<AS>, MouseEvent>) {\n input.current?.click()\n _onClick?.(e as any)\n }\n\n async function onDrop(e: DragEvent<ComponentRef<AS>>) {\n _onDrop?.(e as any)\n if (disabled || !dragFile) return\n e.preventDefault()\n const { files } = e.dataTransfer\n if (!files || files.length === 0) return\n setDisabled(true)\n try {\n if (multiple) {\n const files2: File[] = Array.from(files)\n const values: InputFileDataTypeMap[Type][] = []\n for (const file of files2) {\n const value = (await getFileData(file, type)) as InputFileDataTypeMap[Type]\n values.push(value)\n }\n onFileChange?.(files2 as FileType<Multiple>)\n onValueChange?.(values as ValueType<Multiple, Type>)\n } else {\n const file = files[0]\n onFileChange?.(file as FileType<Multiple>)\n onValueChange?.((await getFileData(file, type)) as ValueType<Multiple, Type>)\n }\n } finally {\n setDisabled(false)\n }\n }\n\n function onDragOver(e: DragEvent<ComponentRef<AS>>) {\n _onDragOver?.(e as any)\n if (disabled || !dragFile) return\n e.preventDefault()\n }\n\n return (\n <Fragment>\n <InputFile<Multiple, Type>\n ref={input}\n disabled={disabled || _disabled || __disabled}\n style={{ display: \"none\", ...style }}\n multiple={multiple}\n accept={accept}\n type={type as Type}\n onValueChange={onValueChange}\n onFileChange={onFileChange}\n clearAfterChange={clearAfterChange}\n {...restInputProps}\n />\n {createElement(as, {\n disabled: disabled || _disabled,\n onClick,\n onDrop,\n onDragOver,\n ...rest,\n })}\n </Fragment>\n )\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAYO;AAEP,uBAA8I;AAgBvI,SAAS,gBAId,OAAiD;AAC/C,QAAM;AAAA,IACF,KAAK;AAAA,IACL,SAAS;AAAA,IACT,aAAa,CAAC;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,IACV,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AAEJ,QAAM,EAAE,KAAK,OAAO,UAAU,YAAY,GAAG,eAAe,IAAI;AAChE,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,YAAQ,qBAAyB,IAAI;AAE3C,wCAAoB,KAAK,MAAM,MAAM,SAAU,CAAC,MAAM,OAAO,CAAC;AAE9D,WAAS,QAAQ,GAAkD;AAC/D,UAAM,SAAS,MAAM;AACrB,eAAW,CAAQ;AAAA,EACvB;AAEA,iBAAe,OAAO,GAAgC;AAClD,cAAU,CAAQ;AAClB,QAAI,YAAY,CAAC;AAAU;AAC3B,MAAE,eAAe;AACjB,UAAM,EAAE,MAAM,IAAI,EAAE;AACpB,QAAI,CAAC,SAAS,MAAM,WAAW;AAAG;AAClC,gBAAY,IAAI;AAChB,QAAI;AACA,UAAI,UAAU;AACV,cAAM,SAAiB,MAAM,KAAK,KAAK;AACvC,cAAM,SAAuC,CAAC;AAC9C,mBAAW,QAAQ,QAAQ;AACvB,gBAAM,QAAS,UAAM,8BAAY,MAAM,IAAI;AAC3C,iBAAO,KAAK,KAAK;AAAA,QACrB;AACA,uBAAe,MAA4B;AAC3C,wBAAgB,MAAmC;AAAA,MACvD,OAAO;AACH,cAAM,OAAO,MAAM,CAAC;AACpB,uBAAe,IAA0B;AACzC,wBAAiB,UAAM,8BAAY,MAAM,IAAI,CAA+B;AAAA,MAChF;AAAA,IACJ,UAAE;AACE,kBAAY,KAAK;AAAA,IACrB;AAAA,EACJ;AAEA,WAAS,WAAW,GAAgC;AAChD,kBAAc,CAAQ;AACtB,QAAI,YAAY,CAAC;AAAU;AAC3B,MAAE,eAAe;AAAA,EACrB;AAEA,SACI,oCAAC,6BACG;AAAA,IAAC;AAAA;AAAA,MACG,KAAK;AAAA,MACL,UAAU,YAAY,aAAa;AAAA,MACnC,OAAO,EAAE,SAAS,QAAQ,GAAG,MAAM;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACR,OACC,4BAAc,IAAI;AAAA,IACf,UAAU,YAAY;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,CAAC,CACL;AAER;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/LoopSwiper.tsx
|
|
21
|
-
var LoopSwiper_exports = {};
|
|
22
|
-
__export(LoopSwiper_exports, {
|
|
23
|
-
LoopSwiper: () => LoopSwiper
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(LoopSwiper_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var import_css = require("@emotion/css");
|
|
28
|
-
var import_deepsea_tools = require("deepsea-tools");
|
|
29
|
-
var LoopSwiper = (0, import_react.forwardRef)((props, ref) => {
|
|
30
|
-
const { className, style, children, direction, period, reverse, gap, ...rest } = props;
|
|
31
|
-
const wrapper = (0, import_react.useRef)(null);
|
|
32
|
-
const container = (0, import_react.useRef)(null);
|
|
33
|
-
const [swiper, setSwiper] = (0, import_react.useState)(false);
|
|
34
|
-
const directionRef = (0, import_react.useRef)(direction);
|
|
35
|
-
directionRef.current = direction;
|
|
36
|
-
const flexDirection = direction === "vertical" ? reverse ? "column-reverse" : "column" : reverse ? "row-reverse" : "row";
|
|
37
|
-
const animationName = swiper ? direction === "vertical" ? reverse ? "deepsea-reverse-vertical-loop-swipe" : "deepsea-vertical-loop-swipe" : reverse ? "deepsea-reverse-horizontal-loop-swipe" : "deepsea-horizontal-loop-swipe" : "none";
|
|
38
|
-
const animationDuration = `${period}ms`;
|
|
39
|
-
const animationTimingFunction = "linear";
|
|
40
|
-
const animationIterationCount = "infinite";
|
|
41
|
-
(0, import_react.useImperativeHandle)(ref, () => wrapper.current, []);
|
|
42
|
-
(0, import_react.useEffect)(() => {
|
|
43
|
-
const wrapperEle = wrapper.current;
|
|
44
|
-
const containerEle = container.current;
|
|
45
|
-
let wrapperWidth = 0;
|
|
46
|
-
let wrapperHeight = 0;
|
|
47
|
-
let containerWidth = 0;
|
|
48
|
-
let containerHeight = 0;
|
|
49
|
-
const observer = new ResizeObserver((entries) => {
|
|
50
|
-
entries.forEach((entry) => {
|
|
51
|
-
if (entry.target === wrapperEle) {
|
|
52
|
-
wrapperWidth = entry.contentRect.width;
|
|
53
|
-
wrapperHeight = entry.contentRect.height;
|
|
54
|
-
} else if (entry.target === containerEle) {
|
|
55
|
-
containerWidth = entry.contentRect.width;
|
|
56
|
-
containerHeight = entry.contentRect.height;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
setSwiper(directionRef.current === "vertical" ? containerHeight > wrapperHeight : containerWidth > wrapperWidth);
|
|
60
|
-
});
|
|
61
|
-
observer.observe(wrapperEle);
|
|
62
|
-
observer.observe(containerEle);
|
|
63
|
-
}, []);
|
|
64
|
-
return /* @__PURE__ */ React.createElement(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
ref: wrapper,
|
|
68
|
-
className: (0, import_deepsea_tools.clsx)(
|
|
69
|
-
import_css.css`
|
|
70
|
-
@keyframes deepsea-horizontal-loop-swipe {
|
|
71
|
-
from {
|
|
72
|
-
transform: translateX(0);
|
|
73
|
-
}
|
|
74
|
-
to {
|
|
75
|
-
transform: translateX(-100%);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
@keyframes deepsea-reverse-horizontal-loop-swipe {
|
|
79
|
-
from {
|
|
80
|
-
transform: translateX(0);
|
|
81
|
-
}
|
|
82
|
-
to {
|
|
83
|
-
transform: translateX(100%);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
@keyframes deepsea-vertical-loop-swipe {
|
|
87
|
-
from {
|
|
88
|
-
transform: translateY(0);
|
|
89
|
-
}
|
|
90
|
-
to {
|
|
91
|
-
transform: translateY(-100%);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
@keyframes deepsea-reverse-vertical-loop-swipe {
|
|
95
|
-
from {
|
|
96
|
-
transform: translateY(0);
|
|
97
|
-
}
|
|
98
|
-
to {
|
|
99
|
-
transform: translateY(100%);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
`,
|
|
103
|
-
className
|
|
104
|
-
),
|
|
105
|
-
style: { display: "flex", flexDirection, gap, ...style },
|
|
106
|
-
...rest
|
|
107
|
-
},
|
|
108
|
-
/* @__PURE__ */ React.createElement(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
ref: container,
|
|
112
|
-
style: { display: "flex", flexDirection, gap, animationName, animationTimingFunction, animationDuration, animationIterationCount }
|
|
113
|
-
},
|
|
114
|
-
children
|
|
115
|
-
),
|
|
116
|
-
/* @__PURE__ */ React.createElement(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
style: {
|
|
120
|
-
display: swiper ? "flex" : "none",
|
|
121
|
-
flexDirection,
|
|
122
|
-
gap,
|
|
123
|
-
animationName,
|
|
124
|
-
animationTimingFunction,
|
|
125
|
-
animationDuration,
|
|
126
|
-
animationIterationCount
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
children
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
-
0 && (module.exports = {
|
|
135
|
-
LoopSwiper
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=LoopSwiper.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/LoopSwiper.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { CSSProperties, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef, useState } from \"react\"\nimport { css } from \"@emotion/css\"\nimport { clsx } from \"deepsea-tools\"\n\nexport interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {\n direction?: \"horizontal\" | \"vertical\"\n reverse?: boolean\n period: number\n gap?: CSSProperties[\"gap\"]\n}\n\n/** 循环播放组件 */\nexport const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, ref) => {\n const { className, style, children, direction, period, reverse, gap, ...rest } = props\n const wrapper = useRef<HTMLDivElement>(null)\n const container = useRef<HTMLDivElement>(null)\n const [swiper, setSwiper] = useState(false)\n const directionRef = useRef(direction)\n directionRef.current = direction\n const flexDirection: CSSProperties[\"flexDirection\"] = direction === \"vertical\" ? (reverse ? \"column-reverse\" : \"column\") : reverse ? \"row-reverse\" : \"row\"\n const animationName = swiper\n ? direction === \"vertical\"\n ? reverse\n ? \"deepsea-reverse-vertical-loop-swipe\"\n : \"deepsea-vertical-loop-swipe\"\n : reverse\n ? \"deepsea-reverse-horizontal-loop-swipe\"\n : \"deepsea-horizontal-loop-swipe\"\n : \"none\"\n const animationDuration = `${period}ms`\n const animationTimingFunction = \"linear\"\n const animationIterationCount = \"infinite\"\n\n useImperativeHandle(ref, () => wrapper.current!, [])\n\n useEffect(() => {\n const wrapperEle = wrapper.current!\n const containerEle = container.current!\n let wrapperWidth = 0\n let wrapperHeight = 0\n let containerWidth = 0\n let containerHeight = 0\n const observer = new ResizeObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === wrapperEle) {\n wrapperWidth = entry.contentRect.width\n wrapperHeight = entry.contentRect.height\n } else if (entry.target === containerEle) {\n containerWidth = entry.contentRect.width\n containerHeight = entry.contentRect.height\n }\n })\n setSwiper(directionRef.current === \"vertical\" ? containerHeight > wrapperHeight : containerWidth > wrapperWidth)\n })\n observer.observe(wrapperEle)\n observer.observe(containerEle)\n }, [])\n\n return (\n <div\n ref={wrapper}\n className={clsx(\n css`\n @keyframes deepsea-horizontal-loop-swipe {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-100%);\n }\n }\n @keyframes deepsea-reverse-horizontal-loop-swipe {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n }\n @keyframes deepsea-vertical-loop-swipe {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n }\n @keyframes deepsea-reverse-vertical-loop-swipe {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(100%);\n }\n }\n `,\n className,\n )}\n style={{ display: \"flex\", flexDirection, gap, ...style }}\n {...rest}\n >\n <div\n ref={container}\n style={{ display: \"flex\", flexDirection, gap, animationName, animationTimingFunction, animationDuration, animationIterationCount }}\n >\n {children}\n </div>\n <div\n style={{\n display: swiper ? \"flex\" : \"none\",\n flexDirection,\n gap,\n animationName,\n animationTimingFunction,\n animationDuration,\n animationIterationCount,\n }}\n >\n {children}\n </div>\n </div>\n )\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA4G;AAC5G,iBAAoB;AACpB,2BAAqB;AAUd,IAAM,iBAAa,yBAA4C,CAAC,OAAO,QAAQ;AAClF,QAAM,EAAE,WAAW,OAAO,UAAU,WAAW,QAAQ,SAAS,KAAK,GAAG,KAAK,IAAI;AACjF,QAAM,cAAU,qBAAuB,IAAI;AAC3C,QAAM,gBAAY,qBAAuB,IAAI;AAC7C,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,QAAM,mBAAe,qBAAO,SAAS;AACrC,eAAa,UAAU;AACvB,QAAM,gBAAgD,cAAc,aAAc,UAAU,mBAAmB,WAAY,UAAU,gBAAgB;AACrJ,QAAM,gBAAgB,SAChB,cAAc,aACV,UACI,wCACA,gCACJ,UACE,0CACA,kCACN;AACN,QAAM,oBAAoB,GAAG;AAC7B,QAAM,0BAA0B;AAChC,QAAM,0BAA0B;AAEhC,wCAAoB,KAAK,MAAM,QAAQ,SAAU,CAAC,CAAC;AAEnD,8BAAU,MAAM;AACZ,UAAM,aAAa,QAAQ;AAC3B,UAAM,eAAe,UAAU;AAC/B,QAAI,eAAe;AACnB,QAAI,gBAAgB;AACpB,QAAI,iBAAiB;AACrB,QAAI,kBAAkB;AACtB,UAAM,WAAW,IAAI,eAAe,aAAW;AAC3C,cAAQ,QAAQ,WAAS;AACrB,YAAI,MAAM,WAAW,YAAY;AAC7B,yBAAe,MAAM,YAAY;AACjC,0BAAgB,MAAM,YAAY;AAAA,QACtC,WAAW,MAAM,WAAW,cAAc;AACtC,2BAAiB,MAAM,YAAY;AACnC,4BAAkB,MAAM,YAAY;AAAA,QACxC;AAAA,MACJ,CAAC;AACD,gBAAU,aAAa,YAAY,aAAa,kBAAkB,gBAAgB,iBAAiB,YAAY;AAAA,IACnH,CAAC;AACD,aAAS,QAAQ,UAAU;AAC3B,aAAS,QAAQ,YAAY;AAAA,EACjC,GAAG,CAAC,CAAC;AAEL,SACI;AAAA,IAAC;AAAA;AAAA,MACG,KAAK;AAAA,MACL,eAAW;AAAA,QACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAkCA;AAAA,MACJ;AAAA,MACA,OAAO,EAAE,SAAS,QAAQ,eAAe,KAAK,GAAG,MAAM;AAAA,MACtD,GAAG;AAAA;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACG,KAAK;AAAA,QACL,OAAO,EAAE,SAAS,QAAQ,eAAe,KAAK,eAAe,yBAAyB,mBAAmB,wBAAwB;AAAA;AAAA,MAEhI;AAAA,IACL;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACG,OAAO;AAAA,UACH,SAAS,SAAS,SAAS;AAAA,UAC3B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA;AAAA,MAEC;AAAA,IACL;AAAA,EACJ;AAER,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/ReadExcel.tsx
|
|
21
|
-
var ReadExcel_exports = {};
|
|
22
|
-
__export(ReadExcel_exports, {
|
|
23
|
-
ReadExcel: () => ReadExcel
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ReadExcel_exports);
|
|
26
|
-
var import_deepsea_tools = require("deepsea-tools");
|
|
27
|
-
var import_InputFile = require("./InputFile");
|
|
28
|
-
var ReadExcel = (props) => {
|
|
29
|
-
const { onValueChange, ...rest } = props;
|
|
30
|
-
return /* @__PURE__ */ React.createElement(import_InputFile.InputFile, { accept: ".xlsx", type: "arrayBuffer", onValueChange: (data) => onValueChange?.((0, import_deepsea_tools.readExcel)(data)), ...rest });
|
|
31
|
-
};
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
ReadExcel
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=ReadExcel.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ReadExcel.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { FC } from \"react\"\nimport { WorkBookData, WorkSheetData, 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?: <Sheet = WorkSheetData>(data: WorkBookData<Sheet>) => 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,2BAAuD;AAEvD,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
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/Ring.tsx
|
|
21
|
-
var Ring_exports = {};
|
|
22
|
-
__export(Ring_exports, {
|
|
23
|
-
Ring: () => Ring
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Ring_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var Ring = (0, import_react.forwardRef)((props, ref) => {
|
|
28
|
-
const { outerWidth, innerWidth, style, ...rest } = props;
|
|
29
|
-
const outerRadius = outerWidth / 2;
|
|
30
|
-
const innerRadius = innerWidth / 2;
|
|
31
|
-
return /* @__PURE__ */ React.createElement(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
ref,
|
|
35
|
-
style: {
|
|
36
|
-
...style,
|
|
37
|
-
width: `${outerWidth}px`,
|
|
38
|
-
height: `${outerWidth}px`,
|
|
39
|
-
clipPath: `path("M0,${outerRadius} a${outerRadius},${outerRadius},0,1,0,${outerWidth},0 a${outerRadius},${outerRadius},0,1,0,-${outerWidth},0 l${outerRadius - innerRadius},0 a${innerRadius},${innerRadius},0,0,1,${innerRadius * 2},0 a${innerRadius},${innerRadius},0,0,1,-${innerRadius * 2},0 Z")`
|
|
40
|
-
},
|
|
41
|
-
...rest
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
Ring
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=Ring.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Ring.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { HTMLAttributes, forwardRef } from \"react\"\n\nexport interface RingProps extends HTMLAttributes<HTMLDivElement> {\n outerWidth: number\n innerWidth: number\n}\n\n/** 环形组件 */\nexport const Ring = forwardRef<HTMLDivElement, RingProps>((props, ref) => {\n const { outerWidth, innerWidth, style, ...rest } = props\n\n const outerRadius = outerWidth / 2\n\n const innerRadius = innerWidth / 2\n\n return (\n <div\n ref={ref}\n style={{\n ...style,\n width: `${outerWidth}px`,\n height: `${outerWidth}px`,\n clipPath: `path(\"M0,${outerRadius} a${outerRadius},${outerRadius},0,1,0,${outerWidth},0 a${outerRadius},${outerRadius},0,1,0,-${outerWidth},0 l${outerRadius - innerRadius},0 a${innerRadius},${innerRadius},0,0,1,${innerRadius * 2},0 a${innerRadius},${innerRadius},0,0,1,-${innerRadius * 2},0 Z\")`,\n }}\n {...rest}\n />\n )\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2C;AAQpC,IAAM,WAAO,yBAAsC,CAAC,OAAO,QAAQ;AACtE,QAAM,EAAE,YAAY,YAAY,OAAO,GAAG,KAAK,IAAI;AAEnD,QAAM,cAAc,aAAa;AAEjC,QAAM,cAAc,aAAa;AAEjC,SACI;AAAA,IAAC;AAAA;AAAA,MACG;AAAA,MACA,OAAO;AAAA,QACH,GAAG;AAAA,QACH,OAAO,GAAG;AAAA,QACV,QAAQ,GAAG;AAAA,QACX,UAAU,YAAY,gBAAgB,eAAe,qBAAqB,iBAAiB,eAAe,sBAAsB,iBAAiB,cAAc,kBAAkB,eAAe,qBAAqB,cAAc,QAAQ,eAAe,sBAAsB,cAAc;AAAA,MAClS;AAAA,MACC,GAAG;AAAA;AAAA,EACR;AAER,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/components/Scroll.tsx
|
|
32
|
-
var Scroll_exports = {};
|
|
33
|
-
__export(Scroll_exports, {
|
|
34
|
-
Scroll: () => Scroll,
|
|
35
|
-
Scrollbar: () => import_smooth_scrollbar2.default
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(Scroll_exports);
|
|
38
|
-
var import_react = require("react");
|
|
39
|
-
var import_css = require("@emotion/css");
|
|
40
|
-
var import_deepsea_tools = require("deepsea-tools");
|
|
41
|
-
var import_smooth_scrollbar = __toESM(require("smooth-scrollbar"));
|
|
42
|
-
var import_utils = require("../utils");
|
|
43
|
-
var import_smooth_scrollbar2 = __toESM(require("smooth-scrollbar"));
|
|
44
|
-
__reExport(Scroll_exports, require("smooth-scrollbar/interfaces"), module.exports);
|
|
45
|
-
var Scroll = (0, import_react.forwardRef)((props, ref) => {
|
|
46
|
-
const { children, options, className, style, scrollbar, onScrollbar, ...rest } = props;
|
|
47
|
-
const { thumbWidth, thumbRadius, thumbColor, trackColor, ...scrollbarOptions } = options || {};
|
|
48
|
-
const ele = (0, import_react.useRef)(null);
|
|
49
|
-
const bar = (0, import_react.useRef)(null);
|
|
50
|
-
(0, import_react.useLayoutEffect)(() => {
|
|
51
|
-
bar.current = import_smooth_scrollbar.default.init(ele.current, scrollbarOptions);
|
|
52
|
-
return () => bar.current?.destroy();
|
|
53
|
-
}, []);
|
|
54
|
-
(0, import_react.useImperativeHandle)(ref, () => ele.current, []);
|
|
55
|
-
(0, import_react.useImperativeHandle)(scrollbar, () => bar.current, []);
|
|
56
|
-
(0, import_react.useEffect)(() => {
|
|
57
|
-
if (!onScrollbar)
|
|
58
|
-
return;
|
|
59
|
-
bar.current?.addListener(onScrollbar);
|
|
60
|
-
return () => bar.current?.removeListener(onScrollbar);
|
|
61
|
-
}, [onScrollbar]);
|
|
62
|
-
return /* @__PURE__ */ React.createElement(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
ref: ele,
|
|
66
|
-
className: (0, import_deepsea_tools.clsx)(
|
|
67
|
-
import_css.css`
|
|
68
|
-
.scrollbar-track.scrollbar-track-x {
|
|
69
|
-
${thumbWidth !== void 0 ? "height: var(--thumb-width);" : ""} ${trackColor !== void 0 ? "background-color: var(--track-color);" : ""}
|
|
70
|
-
}
|
|
71
|
-
.scrollbar-thumb.scrollbar-thumb-x {
|
|
72
|
-
${thumbWidth !== void 0 ? "height: var(--thumb-width);" : ""} ${thumbRadius !== void 0 ? "border-radius: var(--thumb-radius);" : ""} ${thumbColor !== void 0 ? "background-color: var(--thumb-color);" : ""}
|
|
73
|
-
}
|
|
74
|
-
.scrollbar-track.scrollbar-track-y {
|
|
75
|
-
${thumbWidth !== void 0 ? "width: var(--thumb-width);" : ""} ${trackColor !== void 0 ? "background-color: var(--track-color);" : ""}
|
|
76
|
-
}
|
|
77
|
-
.scrollbar-thumb.scrollbar-thumb-y {
|
|
78
|
-
${thumbWidth !== void 0 ? "width: var(--thumb-width);" : ""} ${thumbRadius !== void 0 ? "border-radius: var(--thumb-radius);" : ""} ${thumbColor !== void 0 ? "background-color: var(--thumb-color);" : ""}
|
|
79
|
-
}
|
|
80
|
-
`,
|
|
81
|
-
className
|
|
82
|
-
),
|
|
83
|
-
style: (0, import_utils.transformCSSVariable)(
|
|
84
|
-
{
|
|
85
|
-
thumbWidth: (0, import_utils.px)(thumbWidth),
|
|
86
|
-
thumbRadius: (0, import_utils.px)(thumbRadius),
|
|
87
|
-
thumbColor,
|
|
88
|
-
trackColor
|
|
89
|
-
},
|
|
90
|
-
style
|
|
91
|
-
),
|
|
92
|
-
...rest
|
|
93
|
-
},
|
|
94
|
-
children
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
Scroll,
|
|
100
|
-
Scrollbar,
|
|
101
|
-
...require("smooth-scrollbar/interfaces")
|
|
102
|
-
});
|
|
103
|
-
//# sourceMappingURL=Scroll.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Scroll.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from \"react\"\nimport { css } from \"@emotion/css\"\nimport { clsx } from \"deepsea-tools\"\nimport Scrollbar from \"smooth-scrollbar\"\nimport type { ScrollListener, ScrollbarOptions } from \"smooth-scrollbar/interfaces\"\n\nimport { px, transformCSSVariable } from \"@/utils\"\n\nexport { default as Scrollbar } from \"smooth-scrollbar\"\nexport * from \"smooth-scrollbar/interfaces\"\n\nexport interface ScrollOptions extends Partial<ScrollbarOptions> {\n /** 滑块宽度 */\n thumbWidth?: number | string\n /** 滑块圆角大小 */\n thumbRadius?: number | string\n /** 滑块背景颜色 */\n thumbColor?: CSSProperties[\"backgroundColor\"]\n /** 滚动条背景颜色 */\n trackColor?: CSSProperties[\"backgroundColor\"]\n}\n\nexport interface ScrollProps extends HTMLAttributes<HTMLDivElement> {\n /** 滚动的配置 */\n options?: ScrollOptions\n /** 滚动条实例 */\n scrollbar?: ForwardedRef<Scrollbar>\n /** 滚动条滚动事件 */\n onScrollbar?: ScrollListener\n}\n\nexport const Scroll = forwardRef<HTMLDivElement, ScrollProps>((props, ref) => {\n const { children, options, className, style, scrollbar, onScrollbar, ...rest } = props\n const { thumbWidth, thumbRadius, thumbColor, trackColor, ...scrollbarOptions } = options || {}\n const ele = useRef<HTMLDivElement>(null)\n const bar = useRef<Scrollbar | null>(null)\n\n useLayoutEffect(() => {\n bar.current = Scrollbar.init(ele.current!, scrollbarOptions)\n return () => bar.current?.destroy()\n }, [])\n\n useImperativeHandle(ref, () => ele.current!, [])\n\n useImperativeHandle(scrollbar, () => bar.current!, [])\n\n useEffect(() => {\n if (!onScrollbar) return\n bar.current?.addListener(onScrollbar)\n return () => bar.current?.removeListener(onScrollbar)\n }, [onScrollbar])\n\n return (\n <div\n ref={ele}\n className={clsx(\n css`\n .scrollbar-track.scrollbar-track-x {\n ${thumbWidth !== undefined ? \"height: var(--thumb-width);\" : \"\"} ${trackColor !== undefined\n ? \"background-color: var(--track-color);\"\n : \"\"}\n }\n .scrollbar-thumb.scrollbar-thumb-x {\n ${thumbWidth !== undefined ? \"height: var(--thumb-width);\" : \"\"} ${thumbRadius !== undefined\n ? \"border-radius: var(--thumb-radius);\"\n : \"\"} ${thumbColor !== undefined ? \"background-color: var(--thumb-color);\" : \"\"}\n }\n .scrollbar-track.scrollbar-track-y {\n ${thumbWidth !== undefined ? \"width: var(--thumb-width);\" : \"\"} ${trackColor !== undefined\n ? \"background-color: var(--track-color);\"\n : \"\"}\n }\n .scrollbar-thumb.scrollbar-thumb-y {\n ${thumbWidth !== undefined ? \"width: var(--thumb-width);\" : \"\"} ${thumbRadius !== undefined\n ? \"border-radius: var(--thumb-radius);\"\n : \"\"} ${thumbColor !== undefined ? \"background-color: var(--thumb-color);\" : \"\"}\n }\n `,\n className,\n )}\n style={transformCSSVariable(\n {\n thumbWidth: px(thumbWidth),\n thumbRadius: px(thumbRadius),\n thumbColor,\n trackColor,\n },\n style,\n )}\n {...rest}\n >\n {children}\n </div>\n )\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAiI;AACjI,iBAAoB;AACpB,2BAAqB;AACrB,8BAAsB;AAGtB,mBAAyC;AAEzC,IAAAA,2BAAqC;AACrC,2BAAc,wCAXd;AAiCO,IAAM,aAAS,yBAAwC,CAAC,OAAO,QAAQ;AAC1E,QAAM,EAAE,UAAU,SAAS,WAAW,OAAO,WAAW,aAAa,GAAG,KAAK,IAAI;AACjF,QAAM,EAAE,YAAY,aAAa,YAAY,YAAY,GAAG,iBAAiB,IAAI,WAAW,CAAC;AAC7F,QAAM,UAAM,qBAAuB,IAAI;AACvC,QAAM,UAAM,qBAAyB,IAAI;AAEzC,oCAAgB,MAAM;AAClB,QAAI,UAAU,wBAAAC,QAAU,KAAK,IAAI,SAAU,gBAAgB;AAC3D,WAAO,MAAM,IAAI,SAAS,QAAQ;AAAA,EACtC,GAAG,CAAC,CAAC;AAEL,wCAAoB,KAAK,MAAM,IAAI,SAAU,CAAC,CAAC;AAE/C,wCAAoB,WAAW,MAAM,IAAI,SAAU,CAAC,CAAC;AAErD,8BAAU,MAAM;AACZ,QAAI,CAAC;AAAa;AAClB,QAAI,SAAS,YAAY,WAAW;AACpC,WAAO,MAAM,IAAI,SAAS,eAAe,WAAW;AAAA,EACxD,GAAG,CAAC,WAAW,CAAC;AAEhB,SACI;AAAA,IAAC;AAAA;AAAA,MACG,KAAK;AAAA,MACL,eAAW;AAAA,QACP;AAAA;AAAA,0BAEU,eAAe,SAAY,gCAAgC,MAAM,eAAe,SAC5E,0CACA;AAAA;AAAA;AAAA,0BAGJ,eAAe,SAAY,gCAAgC,MAAM,gBAAgB,SAC7E,wCACA,MAAM,eAAe,SAAY,0CAA0C;AAAA;AAAA;AAAA,0BAG/E,eAAe,SAAY,+BAA+B,MAAM,eAAe,SAC3E,0CACA;AAAA;AAAA;AAAA,0BAGJ,eAAe,SAAY,+BAA+B,MAAM,gBAAgB,SAC5E,wCACA,MAAM,eAAe,SAAY,0CAA0C;AAAA;AAAA;AAAA,QAGzF;AAAA,MACJ;AAAA,MACA,WAAO;AAAA,QACH;AAAA,UACI,gBAAY,iBAAG,UAAU;AAAA,UACzB,iBAAa,iBAAG,WAAW;AAAA,UAC3B;AAAA,UACA;AAAA,QACJ;AAAA,QACA;AAAA,MACJ;AAAA,MACC,GAAG;AAAA;AAAA,IAEH;AAAA,EACL;AAER,CAAC;",
|
|
6
|
-
"names": ["import_smooth_scrollbar", "Scrollbar"]
|
|
7
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/SectionRing.tsx
|
|
21
|
-
var SectionRing_exports = {};
|
|
22
|
-
__export(SectionRing_exports, {
|
|
23
|
-
SectionRing: () => SectionRing
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(SectionRing_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var import_deepsea_tools = require("deepsea-tools");
|
|
28
|
-
var SectionRing = (0, import_react.forwardRef)((props, ref) => {
|
|
29
|
-
const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props;
|
|
30
|
-
const s = Math.PI * 2 / c - a;
|
|
31
|
-
function arc(radius, startAngle, endAngle, options = {}) {
|
|
32
|
-
return (0, import_deepsea_tools.drawArc)(o, o, radius, startAngle, endAngle, options);
|
|
33
|
-
}
|
|
34
|
-
return /* @__PURE__ */ React.createElement(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
ref,
|
|
38
|
-
style: {
|
|
39
|
-
width: o * 2,
|
|
40
|
-
height: o * 2,
|
|
41
|
-
clipPath: `path("${Array(c).fill(0).map(
|
|
42
|
-
(it, idx) => `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), { line: true, anticlockwise: true })}`
|
|
43
|
-
).join(" ")} Z")`,
|
|
44
|
-
...style
|
|
45
|
-
},
|
|
46
|
-
...rest
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
-
0 && (module.exports = {
|
|
52
|
-
SectionRing
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=SectionRing.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/SectionRing.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { HTMLAttributes, forwardRef } from \"react\"\nimport { DrawArcOptions, drawArc } from \"deepsea-tools\"\n\nexport interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {\n outerRadius: number\n innerRadius: number\n count: number\n angel: number\n}\n\nexport const SectionRing = forwardRef<HTMLDivElement, SectionRingProps>((props, ref) => {\n const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props\n\n const s = (Math.PI * 2) / c - a\n\n function arc(radius: number, startAngle: number, endAngle: number, options: DrawArcOptions = {}) {\n return drawArc(o, o, radius, startAngle, endAngle, options)\n }\n\n return (\n <div\n ref={ref}\n style={{\n width: o * 2,\n height: o * 2,\n clipPath: `path(\"${Array(c)\n .fill(0)\n .map(\n (it, idx) =>\n `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), { line: true, anticlockwise: true })}`,\n )\n .join(\" \")} Z\")`,\n ...style,\n }}\n {...rest}\n />\n )\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2C;AAC3C,2BAAwC;AASjC,IAAM,kBAAc,yBAA6C,CAAC,OAAO,QAAQ;AACpF,QAAM,EAAE,aAAa,GAAG,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,IAAI;AAE/E,QAAM,IAAK,KAAK,KAAK,IAAK,IAAI;AAE9B,WAAS,IAAI,QAAgB,YAAoB,UAAkB,UAA0B,CAAC,GAAG;AAC7F,eAAO,8BAAQ,GAAG,GAAG,QAAQ,YAAY,UAAU,OAAO;AAAA,EAC9D;AAEA,SACI;AAAA,IAAC;AAAA;AAAA,MACG;AAAA,MACA,OAAO;AAAA,QACH,OAAO,IAAI;AAAA,QACX,QAAQ,IAAI;AAAA,QACZ,UAAU,SAAS,MAAM,CAAC,EACrB,KAAK,CAAC,EACN;AAAA,UACG,CAAC,IAAI,QACD,GAAG,IAAI,GAAG,OAAO,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,KAAK,IAAI,GAAG,OAAO,IAAI,KAAK,GAAG,OAAO,IAAI,IAAI,EAAE,MAAM,MAAM,eAAe,KAAK,CAAC;AAAA,QACnI,EACC,KAAK,GAAG;AAAA,QACb,GAAG;AAAA,MACP;AAAA,MACC,GAAG;AAAA;AAAA,EACR;AAER,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/Skeleton.tsx
|
|
21
|
-
var Skeleton_exports = {};
|
|
22
|
-
__export(Skeleton_exports, {
|
|
23
|
-
Skeleton: () => Skeleton
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Skeleton_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var import_css = require("@emotion/css");
|
|
28
|
-
var import_deepsea_tools = require("deepsea-tools");
|
|
29
|
-
var Skeleton = (0, import_react.forwardRef)((props, ref) => {
|
|
30
|
-
const { className, children, loading = children === void 0 || children === null, ...rest } = props;
|
|
31
|
-
return /* @__PURE__ */ React.createElement(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
ref,
|
|
35
|
-
className: (0, import_deepsea_tools.clsx)(
|
|
36
|
-
import_css.css`
|
|
37
|
-
@keyframes shimmer {
|
|
38
|
-
0% {
|
|
39
|
-
background-position: -400px 0px;
|
|
40
|
-
}
|
|
41
|
-
100% {
|
|
42
|
-
background-position: 400px 0px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`,
|
|
46
|
-
loading && import_css.css`
|
|
47
|
-
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.067) 8%, rgba(0, 0, 0, 0.133) 18%, rgba(0, 0, 0, 0.067) 33%);
|
|
48
|
-
animation-duration: 1s;
|
|
49
|
-
animation-fill-mode: forwards;
|
|
50
|
-
animation-iteration-count: infinite;
|
|
51
|
-
animation-name: shimmer;
|
|
52
|
-
animation-timing-function: linear;
|
|
53
|
-
background-size: 800px 104px;
|
|
54
|
-
`,
|
|
55
|
-
className
|
|
56
|
-
),
|
|
57
|
-
...rest
|
|
58
|
-
},
|
|
59
|
-
children
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
-
0 && (module.exports = {
|
|
64
|
-
Skeleton
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=Skeleton.js.map
|