deepsea-components 5.17.3 → 5.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/components/AutoFit.cjs +1 -1
  2. package/dist/components/AutoFit.js +1 -1
  3. package/dist/components/AutoScroll.cjs +1 -1
  4. package/dist/components/AutoScroll.js +1 -1
  5. package/dist/components/AutoSizeTextarea.cjs +1 -1
  6. package/dist/components/AutoSizeTextarea.js +1 -1
  7. package/dist/components/CopyButton.cjs +1 -1
  8. package/dist/components/CopyButton.d.ts +1 -1
  9. package/dist/components/CopyButton.js +1 -1
  10. package/dist/components/DraggableGrid.cjs +1 -1
  11. package/dist/components/DraggableGrid.js +1 -1
  12. package/dist/components/Echart.cjs +1 -1
  13. package/dist/components/Echart.d.ts +1 -1
  14. package/dist/components/Echart.js +1 -1
  15. package/dist/components/Flow.cjs +1 -1
  16. package/dist/components/Flow.js +1 -1
  17. package/dist/components/HlsPlayer.cjs +1 -1
  18. package/dist/components/HlsPlayer.js +1 -1
  19. package/dist/components/InfiniteScroll.cjs +1 -1
  20. package/dist/components/InfiniteScroll.js +1 -1
  21. package/dist/components/LoopSwiper.cjs +38 -33
  22. package/dist/components/LoopSwiper.d.ts +11 -4
  23. package/dist/components/LoopSwiper.js +38 -33
  24. package/dist/components/ReadSheet.d.ts +1 -1
  25. package/dist/components/Scroll.cjs +11 -11
  26. package/dist/components/Scroll.js +1 -1
  27. package/dist/components/ScrollMask.cjs +1 -1
  28. package/dist/components/ScrollMask.js +1 -1
  29. package/dist/components/SectionRing.cjs +1 -1
  30. package/dist/components/SectionRing.js +1 -1
  31. package/dist/components/Skeleton.cjs +1 -1
  32. package/dist/components/Skeleton.js +1 -1
  33. package/dist/components/TransitionNum.cjs +1 -1
  34. package/dist/components/TransitionNum.js +1 -1
  35. package/dist/components/Trapezium.cjs +1 -1
  36. package/dist/components/Trapezium.js +1 -1
  37. package/dist/components/Unify.cjs +1 -1
  38. package/dist/components/Unify.js +1 -1
  39. package/dist/components/WriteSheet.cjs +1 -1
  40. package/dist/components/WriteSheet.d.ts +1 -1
  41. package/dist/components/WriteSheet.js +1 -1
  42. package/package.json +3 -3
  43. package/src/components/AutoFit.tsx +1 -1
  44. package/src/components/AutoScroll.tsx +1 -1
  45. package/src/components/AutoSizeTextarea.tsx +1 -1
  46. package/src/components/CopyButton.tsx +1 -1
  47. package/src/components/DraggableGrid.tsx +1 -1
  48. package/src/components/Echart.tsx +11 -11
  49. package/src/components/Flow.tsx +1 -1
  50. package/src/components/HlsPlayer.tsx +1 -1
  51. package/src/components/InfiniteScroll.tsx +1 -1
  52. package/src/components/LoopSwiper.tsx +70 -21
  53. package/src/components/ReadSheet.tsx +1 -1
  54. package/src/components/Scroll.tsx +1 -1
  55. package/src/components/ScrollMask.tsx +1 -1
  56. package/src/components/SectionRing.tsx +1 -1
  57. package/src/components/Skeleton.tsx +1 -1
  58. package/src/components/TransitionNum.tsx +1 -1
  59. package/src/components/Trapezium.tsx +1 -1
  60. package/src/components/Unify.tsx +1 -1
  61. package/src/components/WriteSheet.tsx +1 -1
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  AutoFit: ()=>AutoFit
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const index_cjs_namespaceObject = require("../utils/index.cjs");
35
35
  const AutoFit = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
36
36
  var _ele_current;
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
6
6
  import { px, transformCSSVariable } from "../utils/index.js";
7
7
  const AutoFit = /*#__PURE__*/ forwardRef((props, ref)=>{
8
8
  var _ele_current;
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  AutoScroll: ()=>AutoScroll
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const external_soda_hooks_namespaceObject = require("soda-hooks");
35
35
  const index_cjs_namespaceObject = require("../utils/index.cjs");
36
36
  const external_Scroll_cjs_namespaceObject = require("./Scroll.cjs");
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx, getArray } from "deepsea-tools";
5
- import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
6
6
  import { useSize } from "soda-hooks";
7
7
  import { px, transformCSSVariable } from "../utils/index.js";
8
8
  import { Scroll } from "./Scroll.js";
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  AutoSizeTextArea: ()=>AutoSizeTextArea
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const index_cjs_namespaceObject = require("../utils/index.cjs");
35
35
  const AutoSizeTextArea = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
36
36
  const { className, style, ...rest } = props;
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
6
6
  import { px, transformCSSVariable } from "../utils/index.js";
7
7
  const AutoSizeTextArea = /*#__PURE__*/ forwardRef((props, ref)=>{
8
8
  const { className, style, ...rest } = props;
@@ -38,9 +38,9 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  Event: ()=>external_clipboard_namespaceObject.Event
39
39
  });
40
40
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
41
+ const external_react_namespaceObject = require("react");
41
42
  const external_clipboard_namespaceObject = require("clipboard");
42
43
  var external_clipboard_default = /*#__PURE__*/ __webpack_require__.n(external_clipboard_namespaceObject);
43
- const external_react_namespaceObject = require("react");
44
44
  const external_soda_hooks_namespaceObject = require("soda-hooks");
45
45
  const CopyButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
46
46
  const { text, onCopySuccess: _onCoptSuccess, onCopyError: _onCopyError, ...rest } = props;
@@ -1,5 +1,5 @@
1
- import { Event } from "clipboard";
2
1
  import { ComponentPropsWithoutRef } from "react";
2
+ import { Event } from "clipboard";
3
3
  export { Event } from "clipboard";
4
4
  export type CopyButtonProps = ComponentPropsWithoutRef<"button"> & {
5
5
  text?: string;
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import clipboard_0, { Event } from "clipboard";
4
3
  import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
4
+ import clipboard_0, { Event } from "clipboard";
5
5
  import { useLatest } from "soda-hooks";
6
6
  const CopyButton = /*#__PURE__*/ forwardRef((props, ref)=>{
7
7
  const { text, onCopySuccess: _onCoptSuccess, onCopyError: _onCopyError, ...rest } = props;
@@ -36,8 +36,8 @@ __webpack_require__.d(__webpack_exports__, {
36
36
  DraggableGrid: ()=>DraggableGrid
37
37
  });
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
40
39
  const external_react_namespaceObject = require("react");
40
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
41
41
  const external_soda_hooks_namespaceObject = require("soda-hooks");
42
42
  const external_DraggableGrid_module_cjs_namespaceObject = require("./DraggableGrid.module.cjs");
43
43
  var external_DraggableGrid_module_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_DraggableGrid_module_cjs_namespaceObject);
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { clsx, getArray, isNullable } from "deepsea-tools";
3
2
  import { useEffect, useMemo, useRef, useState } from "react";
3
+ import { clsx, getArray, isNullable } from "deepsea-tools";
4
4
  import { useDragMove } from "soda-hooks";
5
5
  import DraggableGrid_module from "./DraggableGrid.module.js";
6
6
  function isTheSameArray(a, b) {
@@ -30,8 +30,8 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  Bar: ()=>Bar
31
31
  });
32
32
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
- const external_echarts_namespaceObject = require("echarts");
34
33
  const external_react_namespaceObject = require("react");
34
+ const external_echarts_namespaceObject = require("echarts");
35
35
  const Echart = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
36
36
  const { width, height, option, chart, ...rest } = props;
37
37
  const container = (0, external_react_namespaceObject.useRef)(null);
@@ -1,5 +1,5 @@
1
- import { BarSeriesOption, ComposeOption, DatasetComponentOption, ECharts, GridComponentOption, LineSeriesOption, PieSeriesOption, TitleComponentOption, TooltipComponentOption } from "echarts";
2
1
  import { ComponentPropsWithoutRef, ForwardRefExoticComponent, ForwardedRef, RefAttributes } from "react";
2
+ import { BarSeriesOption, ComposeOption, DatasetComponentOption, ECharts, GridComponentOption, LineSeriesOption, PieSeriesOption, TitleComponentOption, TooltipComponentOption } from "echarts";
3
3
  export type PieOption = ComposeOption<PieSeriesOption | TitleComponentOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>;
4
4
  export type BarOption = ComposeOption<BarSeriesOption | TitleComponentOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>;
5
5
  export type LineOption = ComposeOption<LineSeriesOption | TitleComponentOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>;
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { init } from "echarts";
4
3
  import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
4
+ import { init } from "echarts";
5
5
  const Echart = /*#__PURE__*/ forwardRef((props, ref)=>{
6
6
  const { width, height, option, chart, ...rest } = props;
7
7
  const container = useRef(null);
@@ -31,9 +31,9 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  Flow: ()=>Flow
32
32
  });
33
33
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
+ const external_react_namespaceObject = require("react");
34
35
  const css_namespaceObject = require("@emotion/css");
35
36
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
36
- const external_react_namespaceObject = require("react");
37
37
  const external_soda_hooks_namespaceObject = require("soda-hooks");
38
38
  const index_cjs_namespaceObject = require("../utils/index.cjs");
39
39
  function getGapRange(gap) {
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useImperativeHandle, useRef, useState } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { useEffect, useImperativeHandle, useRef, useState } from "react";
6
6
  import { useSize } from "soda-hooks";
7
7
  import { px, transformCSSVariable } from "../utils/index.js";
8
8
  function getGapRange(gap) {
@@ -37,9 +37,9 @@ __webpack_require__.d(__webpack_exports__, {
37
37
  HlsPlayer: ()=>HlsPlayer
38
38
  });
39
39
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
40
+ const external_react_namespaceObject = require("react");
40
41
  const external_hls_js_namespaceObject = require("hls.js");
41
42
  var external_hls_js_default = /*#__PURE__*/ __webpack_require__.n(external_hls_js_namespaceObject);
42
- const external_react_namespaceObject = require("react");
43
43
  const HlsPlayer = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
44
44
  const { src, ...rest } = props;
45
45
  const video = (0, external_react_namespaceObject.useRef)(null);
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import hls_0 from "hls.js";
4
3
  import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
4
+ import hls_0 from "hls.js";
5
5
  const HlsPlayer = /*#__PURE__*/ forwardRef((props, ref)=>{
6
6
  const { src, ...rest } = props;
7
7
  const video = useRef(null);
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  InfiniteScroll: ()=>InfiniteScroll
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const external_soda_hooks_namespaceObject = require("soda-hooks");
35
35
  const InfiniteScroll = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
36
36
  const { className, direction = "vertical", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, pauseOnHover, onMouseEnter, onMouseLeave, ...rest } = props;
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
6
6
  import { useSize } from "soda-hooks";
7
7
  const InfiniteScroll = /*#__PURE__*/ forwardRef((props, ref)=>{
8
8
  const { className, direction = "vertical", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, pauseOnHover, onMouseEnter, onMouseLeave, ...rest } = props;
@@ -28,11 +28,10 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  LoopSwiper: ()=>LoopSwiper
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
- const LoopSwiper = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
35
- const { className, style, children, direction, period, reverse, gap, ...rest } = props;
34
+ const LoopSwiper = ({ ref, className, classNames: { root: rootClassName, container: containerClassName, mirror: mirrorClassName } = {}, children, direction, period, reverse, pauseOnHover = true, gap = 0, ...rest })=>{
36
35
  const wrapper = (0, external_react_namespaceObject.useRef)(null);
37
36
  const container = (0, external_react_namespaceObject.useRef)(null);
38
37
  const [swiper, setSwiper] = (0, external_react_namespaceObject.useState)(false);
@@ -69,75 +68,81 @@ const LoopSwiper = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(
69
68
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
70
69
  ref: wrapper,
71
70
  className: (0, external_deepsea_tools_namespaceObject.clsx)((0, css_namespaceObject.css)`
71
+ display: flex;
72
+ flex-direction: ${flexDirection};
73
+ gap: ${gap}px;
74
+ ${"vertical" === direction ? "overflow-y: hidden;" : "overflow-x: hidden;"}
75
+
72
76
  @keyframes deepsea-horizontal-loop-swipe {
73
77
  from {
74
78
  transform: translateX(0);
75
79
  }
76
80
  to {
77
- transform: translateX(-100%);
81
+ transform: translateX(calc(-100% - ${gap}px));
78
82
  }
79
83
  }
84
+
80
85
  @keyframes deepsea-reverse-horizontal-loop-swipe {
81
86
  from {
82
87
  transform: translateX(0);
83
88
  }
84
89
  to {
85
- transform: translateX(100%);
90
+ transform: translateX(calc(100% + ${gap}px));
86
91
  }
87
92
  }
93
+
88
94
  @keyframes deepsea-vertical-loop-swipe {
89
95
  from {
90
96
  transform: translateY(0);
91
97
  }
92
98
  to {
93
- transform: translateY(-100%);
99
+ transform: translateY(calc(-100% - ${gap}px));
94
100
  }
95
101
  }
102
+
96
103
  @keyframes deepsea-reverse-vertical-loop-swipe {
97
104
  from {
98
105
  transform: translateY(0);
99
106
  }
100
107
  to {
101
- transform: translateY(100%);
108
+ transform: translateY(calc(100% + ${gap}px));
102
109
  }
103
110
  }
104
- `, className),
105
- style: {
106
- display: "flex",
107
- flexDirection,
108
- gap,
109
- ...style
110
- },
111
+
112
+ ${pauseOnHover ? `&:hover > * {
113
+ animation-play-state: paused;
114
+ }` : ""}
115
+ `, className, rootClassName),
111
116
  ...rest,
112
117
  children: [
113
118
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
114
119
  ref: container,
115
- style: {
116
- display: "flex",
117
- flexDirection,
118
- gap,
119
- animationName,
120
- animationTimingFunction,
121
- animationDuration,
122
- animationIterationCount
123
- },
120
+ className: (0, external_deepsea_tools_namespaceObject.clsx)((0, css_namespaceObject.css)`
121
+ display: flex;
122
+ flex-direction: ${flexDirection};
123
+ gap: ${gap}px;
124
+ animation-name: ${animationName};
125
+ animation-timing-function: ${animationTimingFunction};
126
+ animation-duration: ${animationDuration};
127
+ animation-iteration-count: ${animationIterationCount};
128
+ `, containerClassName),
124
129
  children: children
125
130
  }),
126
131
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
127
- style: {
128
- display: swiper ? "flex" : "none",
129
- flexDirection,
130
- gap,
131
- animationName,
132
- animationTimingFunction,
133
- animationDuration,
134
- animationIterationCount
135
- },
132
+ className: (0, external_deepsea_tools_namespaceObject.clsx)((0, css_namespaceObject.css)`
133
+ display: ${swiper ? "flex" : "none"};
134
+ flex-direction: ${flexDirection};
135
+ gap: ${gap}px;
136
+ animation-name: ${animationName};
137
+ animation-timing-function: ${animationTimingFunction};
138
+ animation-duration: ${animationDuration};
139
+ animation-iteration-count: ${animationIterationCount};
140
+ `, mirrorClassName),
136
141
  children: children
137
142
  })
138
143
  ]
139
144
  });
140
- });
145
+ };
141
146
  exports.LoopSwiper = __webpack_exports__.LoopSwiper;
142
147
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
143
148
  "LoopSwiper"
@@ -1,9 +1,16 @@
1
- import { CSSProperties, HTMLAttributes } from "react";
2
- export interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {
1
+ import { ComponentProps, FC } from "react";
2
+ export interface LoopSwiperClassNames {
3
+ root?: string;
4
+ container?: string;
5
+ mirror?: string;
6
+ }
7
+ export interface LoopSwiperProps extends ComponentProps<"div"> {
8
+ classNames?: LoopSwiperClassNames;
3
9
  direction?: "horizontal" | "vertical";
4
10
  reverse?: boolean;
5
11
  period: number;
6
- gap?: CSSProperties["gap"];
12
+ pauseOnHover?: boolean;
13
+ gap?: number;
7
14
  }
8
15
  /** 循环播放组件 */
9
- export declare const LoopSwiper: import("react").ForwardRefExoticComponent<LoopSwiperProps & import("react").RefAttributes<HTMLDivElement>>;
16
+ export declare const LoopSwiper: FC<LoopSwiperProps>;
@@ -1,10 +1,9 @@
1
1
  "use client"
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useImperativeHandle, useRef, useState } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
6
- const LoopSwiper = /*#__PURE__*/ forwardRef((props, ref)=>{
7
- const { className, style, children, direction, period, reverse, gap, ...rest } = props;
6
+ const LoopSwiper = ({ ref, className, classNames: { root: rootClassName, container: containerClassName, mirror: mirrorClassName } = {}, children, direction, period, reverse, pauseOnHover = true, gap = 0, ...rest })=>{
8
7
  const wrapper = useRef(null);
9
8
  const container = useRef(null);
10
9
  const [swiper, setSwiper] = useState(false);
@@ -41,73 +40,79 @@ const LoopSwiper = /*#__PURE__*/ forwardRef((props, ref)=>{
41
40
  return /*#__PURE__*/ jsxs("div", {
42
41
  ref: wrapper,
43
42
  className: clsx(css`
43
+ display: flex;
44
+ flex-direction: ${flexDirection};
45
+ gap: ${gap}px;
46
+ ${"vertical" === direction ? "overflow-y: hidden;" : "overflow-x: hidden;"}
47
+
44
48
  @keyframes deepsea-horizontal-loop-swipe {
45
49
  from {
46
50
  transform: translateX(0);
47
51
  }
48
52
  to {
49
- transform: translateX(-100%);
53
+ transform: translateX(calc(-100% - ${gap}px));
50
54
  }
51
55
  }
56
+
52
57
  @keyframes deepsea-reverse-horizontal-loop-swipe {
53
58
  from {
54
59
  transform: translateX(0);
55
60
  }
56
61
  to {
57
- transform: translateX(100%);
62
+ transform: translateX(calc(100% + ${gap}px));
58
63
  }
59
64
  }
65
+
60
66
  @keyframes deepsea-vertical-loop-swipe {
61
67
  from {
62
68
  transform: translateY(0);
63
69
  }
64
70
  to {
65
- transform: translateY(-100%);
71
+ transform: translateY(calc(-100% - ${gap}px));
66
72
  }
67
73
  }
74
+
68
75
  @keyframes deepsea-reverse-vertical-loop-swipe {
69
76
  from {
70
77
  transform: translateY(0);
71
78
  }
72
79
  to {
73
- transform: translateY(100%);
80
+ transform: translateY(calc(100% + ${gap}px));
74
81
  }
75
82
  }
76
- `, className),
77
- style: {
78
- display: "flex",
79
- flexDirection,
80
- gap,
81
- ...style
82
- },
83
+
84
+ ${pauseOnHover ? `&:hover > * {
85
+ animation-play-state: paused;
86
+ }` : ""}
87
+ `, className, rootClassName),
83
88
  ...rest,
84
89
  children: [
85
90
  /*#__PURE__*/ jsx("div", {
86
91
  ref: container,
87
- style: {
88
- display: "flex",
89
- flexDirection,
90
- gap,
91
- animationName,
92
- animationTimingFunction,
93
- animationDuration,
94
- animationIterationCount
95
- },
92
+ className: clsx(css`
93
+ display: flex;
94
+ flex-direction: ${flexDirection};
95
+ gap: ${gap}px;
96
+ animation-name: ${animationName};
97
+ animation-timing-function: ${animationTimingFunction};
98
+ animation-duration: ${animationDuration};
99
+ animation-iteration-count: ${animationIterationCount};
100
+ `, containerClassName),
96
101
  children: children
97
102
  }),
98
103
  /*#__PURE__*/ jsx("div", {
99
- style: {
100
- display: swiper ? "flex" : "none",
101
- flexDirection,
102
- gap,
103
- animationName,
104
- animationTimingFunction,
105
- animationDuration,
106
- animationIterationCount
107
- },
104
+ className: clsx(css`
105
+ display: ${swiper ? "flex" : "none"};
106
+ flex-direction: ${flexDirection};
107
+ gap: ${gap}px;
108
+ animation-name: ${animationName};
109
+ animation-timing-function: ${animationTimingFunction};
110
+ animation-duration: ${animationDuration};
111
+ animation-iteration-count: ${animationIterationCount};
112
+ `, mirrorClassName),
108
113
  children: children
109
114
  })
110
115
  ]
111
116
  });
112
- });
117
+ };
113
118
  export { LoopSwiper };
@@ -1,5 +1,5 @@
1
- import { WorkBookData, WorkSheetData } from "deepsea-tools";
2
1
  import { FC } from "react";
2
+ import { WorkBookData, WorkSheetData } from "deepsea-tools";
3
3
  import { InputFileProps } from "./InputFile";
4
4
  export interface ReadSheetProps extends Omit<InputFileProps<false, "arrayBuffer">, "multiple" | "accept" | "type" | "onValueChange"> {
5
5
  onValueChange?: <Sheet = WorkSheetData>(data: WorkBookData<Sheet>) => void;
@@ -71,9 +71,9 @@ var __webpack_exports__ = {};
71
71
  Scrollbar: ()=>smooth_scrollbar__WEBPACK_IMPORTED_MODULE_4___default.a
72
72
  });
73
73
  var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("react/jsx-runtime");
74
- var _emotion_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@emotion/css");
75
- var deepsea_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("deepsea-tools");
76
- var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("react");
74
+ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("react");
75
+ var _emotion_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("@emotion/css");
76
+ var deepsea_tools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("deepsea-tools");
77
77
  var smooth_scrollbar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("smooth-scrollbar");
78
78
  var smooth_scrollbar__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/ __webpack_require__.n(smooth_scrollbar__WEBPACK_IMPORTED_MODULE_4__);
79
79
  var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("@/utils");
@@ -87,21 +87,21 @@ var __webpack_exports__ = {};
87
87
  return smooth_scrollbar_interfaces__WEBPACK_IMPORTED_MODULE_6__[key];
88
88
  }).bind(0, __WEBPACK_IMPORT_KEY__);
89
89
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
90
- const Scroll = /*#__PURE__*/ (0, react__WEBPACK_IMPORTED_MODULE_3__.forwardRef)((props, ref)=>{
90
+ const Scroll = /*#__PURE__*/ (0, react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((props, ref)=>{
91
91
  const { children, options, className, style, scrollbar, onScrollbar, ...rest } = props;
92
92
  const { thumbWidth, thumbRadius, thumbColor, trackColor, ...scrollbarOptions } = options || {};
93
- const ele = (0, react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
94
- const bar = (0, react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
95
- (0, react__WEBPACK_IMPORTED_MODULE_3__.useLayoutEffect)(()=>{
93
+ const ele = (0, react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
94
+ const bar = (0, react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
95
+ (0, react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(()=>{
96
96
  bar.current = smooth_scrollbar__WEBPACK_IMPORTED_MODULE_4___default().init(ele.current, scrollbarOptions);
97
97
  return ()=>{
98
98
  var _bar_current;
99
99
  return null == (_bar_current = bar.current) ? void 0 : _bar_current.destroy();
100
100
  };
101
101
  }, []);
102
- (0, react__WEBPACK_IMPORTED_MODULE_3__.useImperativeHandle)(ref, ()=>ele.current, []);
103
- (0, react__WEBPACK_IMPORTED_MODULE_3__.useImperativeHandle)(scrollbar, ()=>bar.current, []);
104
- (0, react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
102
+ (0, react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(ref, ()=>ele.current, []);
103
+ (0, react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(scrollbar, ()=>bar.current, []);
104
+ (0, react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
105
105
  var _bar_current;
106
106
  if (!onScrollbar) return;
107
107
  null == (_bar_current = bar.current) || _bar_current.addListener(onScrollbar);
@@ -114,7 +114,7 @@ var __webpack_exports__ = {};
114
114
  ]);
115
115
  return /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
116
116
  ref: ele,
117
- className: (0, deepsea_tools__WEBPACK_IMPORTED_MODULE_2__.clsx)((0, _emotion_css__WEBPACK_IMPORTED_MODULE_1__.css)`
117
+ className: (0, deepsea_tools__WEBPACK_IMPORTED_MODULE_3__.clsx)((0, _emotion_css__WEBPACK_IMPORTED_MODULE_2__.css)`
118
118
  .scrollbar-track.scrollbar-track-x {
119
119
  ${void 0 !== thumbWidth ? "height: var(--thumb-width);" : ""} ${void 0 !== trackColor ? "background-color: var(--track-color);" : ""}
120
120
  }
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
6
6
  import smooth_scrollbar from "smooth-scrollbar";
7
7
  import { px, transformCSSVariable } from "../utils/index.js";
8
8
  export * from "smooth-scrollbar/interfaces";
@@ -36,8 +36,8 @@ __webpack_require__.d(__webpack_exports__, {
36
36
  ScrollMask: ()=>ScrollMask
37
37
  });
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
40
39
  const external_react_namespaceObject = require("react");
40
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
41
41
  const external_soda_hooks_namespaceObject = require("soda-hooks");
42
42
  const external_ScrollMask_module_cjs_namespaceObject = require("./ScrollMask.module.cjs");
43
43
  var external_ScrollMask_module_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_ScrollMask_module_cjs_namespaceObject);
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { clsx, isNonNullable } from "deepsea-tools";
3
2
  import { useRef } from "react";
3
+ import { clsx, isNonNullable } from "deepsea-tools";
4
4
  import { useSize } from "soda-hooks";
5
5
  import ScrollMask_module from "./ScrollMask.module.js";
6
6
  const ScrollMask = ({ className, style, position = "top", size = 8, from = "rgba(0, 0, 0, 0.1)", to = "rgba(0, 0, 0, 0)", contentClassName, contentStyle, showRadian = false, ...rest })=>{
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  SectionRing: ()=>SectionRing
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
32
31
  const external_react_namespaceObject = require("react");
32
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
33
  const SectionRing = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
34
34
  const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props;
35
35
  const s = 2 * Math.PI / c - a;
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { drawArc } from "deepsea-tools";
4
3
  import { forwardRef } from "react";
4
+ import { drawArc } from "deepsea-tools";
5
5
  const SectionRing = /*#__PURE__*/ forwardRef((props, ref)=>{
6
6
  const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props;
7
7
  const s = 2 * Math.PI / c - a;
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  Skeleton: ()=>Skeleton
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const Skeleton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
35
35
  const { className, children, loading = null == children, ...rest } = props;
36
36
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef } from "react";
6
6
  const Skeleton = /*#__PURE__*/ forwardRef((props, ref)=>{
7
7
  const { className, children, loading = null == children, ...rest } = props;
8
8
  return /*#__PURE__*/ jsx("div", {
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  TransitionNum: ()=>TransitionNum
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
32
31
  const external_react_namespaceObject = require("react");
32
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
33
  const TransitionNum = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
34
34
  const { children: num, period, numToStr, ins, ...rest } = props;
35
35
  if (!Number.isInteger(num) || !Number.isInteger(period) || period <= 0) throw new RangeError("目标数字必须是整数,周期必须是正整数");
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { setFrameInterval } from "deepsea-tools";
4
3
  import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
4
+ import { setFrameInterval } from "deepsea-tools";
5
5
  const TransitionNum = /*#__PURE__*/ forwardRef((props, ref)=>{
6
6
  const { children: num, period, numToStr, ins, ...rest } = props;
7
7
  if (!Number.isInteger(num) || !Number.isInteger(period) || period <= 0) throw new RangeError("目标数字必须是整数,周期必须是正整数");
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  Trapezium: ()=>Trapezium
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
31
32
  const css_namespaceObject = require("@emotion/css");
32
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
- const external_react_namespaceObject = require("react");
34
34
  const index_cjs_namespaceObject = require("../utils/index.cjs");
35
35
  const Trapezium = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
36
36
  const { top, bottom, height, borderRadius, className, style, ...rest } = props;
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
3
4
  import { css } from "@emotion/css";
4
5
  import { clsx } from "deepsea-tools";
5
- import { forwardRef } from "react";
6
6
  import { px, transformCSSVariable } from "../utils/index.js";
7
7
  const Trapezium = /*#__PURE__*/ forwardRef((props, ref)=>{
8
8
  const { top, bottom, height, borderRadius, className, style, ...rest } = props;
@@ -29,8 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  UnifyConfigProvider: ()=>UnifyConfigProvider
30
30
  });
31
31
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
32
  const external_react_namespaceObject = require("react");
33
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
34
34
  const UnifyConfigContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({});
35
35
  const UnifyConfigProvider = ({ className, style, children })=>{
36
36
  const { className: _className, style: _style } = (0, external_react_namespaceObject.useContext)(UnifyConfigContext);
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { clsx } from "deepsea-tools";
4
3
  import { createContext, createElement, useContext } from "react";
4
+ import { clsx } from "deepsea-tools";
5
5
  const UnifyConfigContext = /*#__PURE__*/ createContext({});
6
6
  const UnifyConfigProvider = ({ className, style, children })=>{
7
7
  const { className: _className, style: _style } = useContext(UnifyConfigContext);
@@ -27,8 +27,8 @@ __webpack_require__.r(__webpack_exports__);
27
27
  __webpack_require__.d(__webpack_exports__, {
28
28
  WriteSheet: ()=>WriteSheet
29
29
  });
30
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
31
30
  const external_react_namespaceObject = require("react");
31
+ const external_deepsea_tools_namespaceObject = require("deepsea-tools");
32
32
  function WriteSheet(props) {
33
33
  const { as, excel, onClick: _onClick, ...rest } = props;
34
34
  function onClick(e) {
@@ -1,5 +1,5 @@
1
- import { WriteSheetParams } from "deepsea-tools";
2
1
  import { ComponentProps, JSX, JSXElementConstructor } from "react";
2
+ import { WriteSheetParams } from "deepsea-tools";
3
3
  export type WriteSheetProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "excel"> & {
4
4
  as?: AS;
5
5
  excel?: WriteSheetParams;
@@ -1,6 +1,6 @@
1
1
  "use client"
2
- import { writeSheet } from "deepsea-tools";
3
2
  import { createElement } from "react";
3
+ import { writeSheet } from "deepsea-tools";
4
4
  function WriteSheet(props) {
5
5
  const { as, excel, onClick: _onClick, ...rest } = props;
6
6
  function onClick(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepsea-components",
3
- "version": "5.17.3",
3
+ "version": "5.17.5",
4
4
  "description": "格数科技自用组件库",
5
5
  "type": "module",
6
6
  "exports": {
@@ -40,8 +40,8 @@
40
40
  "echarts": "^6.0.0",
41
41
  "hls.js": "^1.6.13",
42
42
  "smooth-scrollbar": "^8.8.4",
43
- "soda-hooks": "6.15.2",
44
- "deepsea-tools": "5.42.4"
43
+ "deepsea-tools": "5.42.4",
44
+ "soda-hooks": "6.15.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^5.9.3"
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
6
6
 
7
7
  import { px, transformCSSVariable } from "@/utils"
8
8
 
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { CSSProperties, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx, getArray } from "deepsea-tools"
5
- import { CSSProperties, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
6
6
  import Scrollbar from "smooth-scrollbar"
7
7
  import { ScrollStatus } from "smooth-scrollbar/interfaces/scrollbar"
8
8
  import { useSize } from "soda-hooks"
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { TextareaHTMLAttributes, forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { TextareaHTMLAttributes, forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
6
6
 
7
7
  import { px, transformCSSVariable } from "@/utils"
8
8
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import ClipboardJS, { Event } from "clipboard"
4
3
  import { ComponentPropsWithoutRef, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
4
+ import ClipboardJS, { Event } from "clipboard"
5
5
  import { useLatest } from "soda-hooks"
6
6
 
7
7
  export { Event } from "clipboard"
@@ -1,5 +1,5 @@
1
- import { clsx, getArray, isNullable } from "deepsea-tools"
2
1
  import { CSSProperties, ComponentProps, Key, ReactNode, useEffect, useMemo, useRef, useState } from "react"
2
+ import { clsx, getArray, isNullable } from "deepsea-tools"
3
3
  import { DragMoveEvent, DragMoveEvents, useDragMove } from "soda-hooks"
4
4
 
5
5
  import styles from "./DraggableGrid.module.css"
@@ -1,5 +1,16 @@
1
1
  "use client"
2
2
 
3
+ import {
4
+ ComponentPropsWithoutRef,
5
+ ForwardRefExoticComponent,
6
+ ForwardedRef,
7
+ RefAttributes,
8
+ forwardRef,
9
+ useEffect,
10
+ useImperativeHandle,
11
+ useLayoutEffect,
12
+ useRef,
13
+ } from "react"
3
14
  import {
4
15
  BarSeriesOption,
5
16
  ComposeOption,
@@ -12,17 +23,6 @@ import {
12
23
  TooltipComponentOption,
13
24
  init,
14
25
  } from "echarts"
15
- import {
16
- ComponentPropsWithoutRef,
17
- ForwardRefExoticComponent,
18
- ForwardedRef,
19
- RefAttributes,
20
- forwardRef,
21
- useEffect,
22
- useImperativeHandle,
23
- useLayoutEffect,
24
- useRef,
25
- } from "react"
26
26
 
27
27
  export type PieOption = ComposeOption<PieSeriesOption | TitleComponentOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>
28
28
 
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { CSSProperties, HTMLAttributes, Key, ReactNode, Ref, useEffect, useImperativeHandle, useRef, useState } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { CSSProperties, HTMLAttributes, Key, ReactNode, Ref, useEffect, useImperativeHandle, useRef, useState } from "react"
6
6
  import { useSize } from "soda-hooks"
7
7
 
8
8
  import { px, transformCSSVariable } from "@/utils"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import Hls from "hls.js"
4
3
  import { MediaHTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
4
+ import Hls from "hls.js"
5
5
 
6
6
  export interface HlsPlayerProps extends Omit<MediaHTMLAttributes<HTMLVideoElement>, "src"> {
7
7
  src: string
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { CSSProperties, ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { CSSProperties, ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
6
6
  import { useSize } from "soda-hooks"
7
7
 
8
8
  export type InfiniteScrollProps = ComponentPropsWithoutRef<"div"> & {
@@ -1,19 +1,37 @@
1
1
  "use client"
2
2
 
3
+ import { CSSProperties, ComponentProps, FC, useEffect, useImperativeHandle, useRef, useState } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { CSSProperties, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react"
6
6
 
7
- export interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {
7
+ export interface LoopSwiperClassNames {
8
+ root?: string
9
+ container?: string
10
+ mirror?: string
11
+ }
12
+
13
+ export interface LoopSwiperProps extends ComponentProps<"div"> {
14
+ classNames?: LoopSwiperClassNames
8
15
  direction?: "horizontal" | "vertical"
9
16
  reverse?: boolean
10
17
  period: number
11
- gap?: CSSProperties["gap"]
18
+ pauseOnHover?: boolean
19
+ gap?: number
12
20
  }
13
21
 
14
22
  /** 循环播放组件 */
15
- export const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, ref) => {
16
- const { className, style, children, direction, period, reverse, gap, ...rest } = props
23
+ export const LoopSwiper: FC<LoopSwiperProps> = ({
24
+ ref,
25
+ className,
26
+ classNames: { root: rootClassName, container: containerClassName, mirror: mirrorClassName } = {},
27
+ children,
28
+ direction,
29
+ period,
30
+ reverse,
31
+ pauseOnHover = true,
32
+ gap = 0,
33
+ ...rest
34
+ }) => {
17
35
  const wrapper = useRef<HTMLDivElement>(null)
18
36
  const container = useRef<HTMLDivElement>(null)
19
37
  const [swiper, setSwiper] = useState(false)
@@ -42,6 +60,7 @@ export const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, re
42
60
  let wrapperHeight = 0
43
61
  let containerWidth = 0
44
62
  let containerHeight = 0
63
+
45
64
  const observer = new ResizeObserver(entries => {
46
65
  entries.forEach(entry => {
47
66
  if (entry.target === wrapperEle) {
@@ -52,8 +71,10 @@ export const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, re
52
71
  containerHeight = entry.contentRect.height
53
72
  }
54
73
  })
74
+
55
75
  setSwiper(directionRef.current === "vertical" ? containerHeight > wrapperHeight : containerWidth > wrapperWidth)
56
76
  })
77
+
57
78
  observer.observe(wrapperEle)
58
79
  observer.observe(containerEle)
59
80
  }, [])
@@ -63,63 +84,91 @@ export const LoopSwiper = forwardRef<HTMLDivElement, LoopSwiperProps>((props, re
63
84
  ref={wrapper}
64
85
  className={clsx(
65
86
  css`
87
+ display: flex;
88
+ flex-direction: ${flexDirection};
89
+ gap: ${gap}px;
90
+ ${direction === "vertical" ? "overflow-y: hidden;" : "overflow-x: hidden;"}
91
+
66
92
  @keyframes deepsea-horizontal-loop-swipe {
67
93
  from {
68
94
  transform: translateX(0);
69
95
  }
70
96
  to {
71
- transform: translateX(-100%);
97
+ transform: translateX(calc(-100% - ${gap}px));
72
98
  }
73
99
  }
100
+
74
101
  @keyframes deepsea-reverse-horizontal-loop-swipe {
75
102
  from {
76
103
  transform: translateX(0);
77
104
  }
78
105
  to {
79
- transform: translateX(100%);
106
+ transform: translateX(calc(100% + ${gap}px));
80
107
  }
81
108
  }
109
+
82
110
  @keyframes deepsea-vertical-loop-swipe {
83
111
  from {
84
112
  transform: translateY(0);
85
113
  }
86
114
  to {
87
- transform: translateY(-100%);
115
+ transform: translateY(calc(-100% - ${gap}px));
88
116
  }
89
117
  }
118
+
90
119
  @keyframes deepsea-reverse-vertical-loop-swipe {
91
120
  from {
92
121
  transform: translateY(0);
93
122
  }
94
123
  to {
95
- transform: translateY(100%);
124
+ transform: translateY(calc(100% + ${gap}px));
96
125
  }
97
126
  }
127
+
128
+ ${pauseOnHover
129
+ ? `&:hover > * {
130
+ animation-play-state: paused;
131
+ }`
132
+ : ""}
98
133
  `,
99
134
  className,
135
+ rootClassName,
100
136
  )}
101
- style={{ display: "flex", flexDirection, gap, ...style }}
102
137
  {...rest}
103
138
  >
104
139
  <div
105
140
  ref={container}
106
- style={{ display: "flex", flexDirection, gap, animationName, animationTimingFunction, animationDuration, animationIterationCount }}
141
+ className={clsx(
142
+ css`
143
+ display: flex;
144
+ flex-direction: ${flexDirection};
145
+ gap: ${gap}px;
146
+ animation-name: ${animationName};
147
+ animation-timing-function: ${animationTimingFunction};
148
+ animation-duration: ${animationDuration};
149
+ animation-iteration-count: ${animationIterationCount};
150
+ `,
151
+ containerClassName,
152
+ )}
107
153
  >
108
154
  {children}
109
155
  </div>
110
156
  <div
111
- style={{
112
- display: swiper ? "flex" : "none",
113
- flexDirection,
114
- gap,
115
- animationName,
116
- animationTimingFunction,
117
- animationDuration,
118
- animationIterationCount,
119
- }}
157
+ className={clsx(
158
+ css`
159
+ display: ${swiper ? "flex" : "none"};
160
+ flex-direction: ${flexDirection};
161
+ gap: ${gap}px;
162
+ animation-name: ${animationName};
163
+ animation-timing-function: ${animationTimingFunction};
164
+ animation-duration: ${animationDuration};
165
+ animation-iteration-count: ${animationIterationCount};
166
+ `,
167
+ mirrorClassName,
168
+ )}
120
169
  >
121
170
  {children}
122
171
  </div>
123
172
  </div>
124
173
  )
125
- })
174
+ }
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { WorkBookData, WorkSheetData, readSheet } from "deepsea-tools"
4
3
  import { FC } from "react"
4
+ import { WorkBookData, WorkSheetData, readSheet } from "deepsea-tools"
5
5
 
6
6
  import { InputFile, InputFileProps } from "./InputFile"
7
7
 
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react"
6
6
  import Scrollbar from "smooth-scrollbar"
7
7
  import type { ScrollListener, ScrollbarOptions } from "smooth-scrollbar/interfaces"
8
8
 
@@ -1,5 +1,5 @@
1
- import { clsx, isNonNullable } from "deepsea-tools"
2
1
  import { CSSProperties, ComponentProps, FC, useRef } from "react"
2
+ import { clsx, isNonNullable } from "deepsea-tools"
3
3
  import { useSize } from "soda-hooks"
4
4
 
5
5
  import styles from "./ScrollMask.module.css"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { DrawArcOptions, drawArc } from "deepsea-tools"
4
3
  import { HTMLAttributes, forwardRef } from "react"
4
+ import { DrawArcOptions, drawArc } from "deepsea-tools"
5
5
 
6
6
  export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
7
7
  outerRadius: number
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { HTMLAttributes, forwardRef } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { HTMLAttributes, forwardRef } from "react"
6
6
 
7
7
  export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
8
8
  loading?: boolean
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { setFrameInterval } from "deepsea-tools"
4
3
  import { ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
4
+ import { setFrameInterval } from "deepsea-tools"
5
5
 
6
6
  export interface TransitionNumProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
7
7
  /** 当前数字 */
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
+ import { HTMLAttributes, forwardRef } from "react"
3
4
  import { css } from "@emotion/css"
4
5
  import { clsx } from "deepsea-tools"
5
- import { HTMLAttributes, forwardRef } from "react"
6
6
 
7
7
  import { px, transformCSSVariable } from "@/utils"
8
8
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { clsx } from "deepsea-tools"
4
3
  import { CSSProperties, ComponentProps, FC, JSX, JSXElementConstructor, ReactNode, createContext, createElement, useContext } from "react"
4
+ import { clsx } from "deepsea-tools"
5
5
 
6
6
  export interface UnifyConfig {
7
7
  className?: string
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { WriteSheetParams, writeSheet } from "deepsea-tools"
4
3
  import { ComponentProps, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent, createElement } from "react"
4
+ import { WriteSheetParams, writeSheet } from "deepsea-tools"
5
5
 
6
6
  export type WriteSheetProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "excel"> & {
7
7
  as?: AS