deepsea-components 5.17.4 → 5.17.6
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 +1 -1
- package/dist/components/AutoFit.js +1 -1
- package/dist/components/AutoScroll.cjs +1 -1
- package/dist/components/AutoScroll.js +1 -1
- package/dist/components/AutoSizeTextarea.cjs +1 -1
- package/dist/components/AutoSizeTextarea.js +1 -1
- package/dist/components/CopyButton.cjs +1 -1
- package/dist/components/CopyButton.d.ts +1 -1
- package/dist/components/CopyButton.js +1 -1
- package/dist/components/DraggableGrid.cjs +1 -1
- package/dist/components/DraggableGrid.js +1 -1
- package/dist/components/Echart.cjs +125 -14
- package/dist/components/Echart.d.ts +56 -11
- package/dist/components/Echart.js +51 -13
- package/dist/components/Flow.cjs +1 -1
- package/dist/components/Flow.js +1 -1
- package/dist/components/HlsPlayer.cjs +1 -1
- package/dist/components/HlsPlayer.js +1 -1
- package/dist/components/InfiniteScroll.cjs +1 -1
- package/dist/components/InfiniteScroll.js +1 -1
- package/dist/components/LoopSwiper.cjs +9 -5
- package/dist/components/LoopSwiper.d.ts +1 -0
- package/dist/components/LoopSwiper.js +9 -5
- package/dist/components/ReadSheet.d.ts +1 -1
- package/dist/components/Scroll.cjs +11 -11
- package/dist/components/Scroll.js +1 -1
- package/dist/components/ScrollMask.cjs +1 -1
- package/dist/components/ScrollMask.js +1 -1
- package/dist/components/SectionRing.cjs +1 -1
- package/dist/components/SectionRing.js +1 -1
- package/dist/components/Skeleton.cjs +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/TransitionNum.cjs +1 -1
- package/dist/components/TransitionNum.js +1 -1
- package/dist/components/Trapezium.cjs +1 -1
- package/dist/components/Trapezium.js +1 -1
- package/dist/components/Unify.cjs +1 -1
- package/dist/components/Unify.js +1 -1
- package/dist/components/WriteSheet.cjs +1 -1
- package/dist/components/WriteSheet.d.ts +1 -1
- package/dist/components/WriteSheet.js +1 -1
- package/package.json +4 -3
- package/src/components/AutoFit.tsx +1 -1
- package/src/components/AutoScroll.tsx +1 -1
- package/src/components/AutoSizeTextarea.tsx +1 -1
- package/src/components/CopyButton.tsx +1 -1
- package/src/components/DraggableGrid.tsx +1 -1
- package/src/components/Echart.tsx +209 -36
- package/src/components/Flow.tsx +1 -1
- package/src/components/HlsPlayer.tsx +1 -1
- package/src/components/InfiniteScroll.tsx +1 -1
- package/src/components/LoopSwiper.tsx +15 -4
- package/src/components/ReadSheet.tsx +1 -1
- package/src/components/Scroll.tsx +1 -1
- package/src/components/ScrollMask.tsx +1 -1
- package/src/components/SectionRing.tsx +1 -1
- package/src/components/Skeleton.tsx +1 -1
- package/src/components/TransitionNum.tsx +1 -1
- package/src/components/Trapezium.tsx +1 -1
- package/src/components/Unify.tsx +1 -1
- package/src/components/WriteSheet.tsx +1 -1
|
@@ -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"> & {
|
|
@@ -15,6 +15,7 @@ export interface LoopSwiperProps extends ComponentProps<"div"> {
|
|
|
15
15
|
direction?: "horizontal" | "vertical"
|
|
16
16
|
reverse?: boolean
|
|
17
17
|
period: number
|
|
18
|
+
pauseOnHover?: boolean
|
|
18
19
|
gap?: number
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -27,6 +28,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
27
28
|
direction,
|
|
28
29
|
period,
|
|
29
30
|
reverse,
|
|
31
|
+
pauseOnHover = true,
|
|
30
32
|
gap = 0,
|
|
31
33
|
...rest
|
|
32
34
|
}) => {
|
|
@@ -58,6 +60,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
58
60
|
let wrapperHeight = 0
|
|
59
61
|
let containerWidth = 0
|
|
60
62
|
let containerHeight = 0
|
|
63
|
+
|
|
61
64
|
const observer = new ResizeObserver(entries => {
|
|
62
65
|
entries.forEach(entry => {
|
|
63
66
|
if (entry.target === wrapperEle) {
|
|
@@ -68,8 +71,10 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
68
71
|
containerHeight = entry.contentRect.height
|
|
69
72
|
}
|
|
70
73
|
})
|
|
74
|
+
|
|
71
75
|
setSwiper(directionRef.current === "vertical" ? containerHeight > wrapperHeight : containerWidth > wrapperWidth)
|
|
72
76
|
})
|
|
77
|
+
|
|
73
78
|
observer.observe(wrapperEle)
|
|
74
79
|
observer.observe(containerEle)
|
|
75
80
|
}, [])
|
|
@@ -89,7 +94,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
89
94
|
transform: translateX(0);
|
|
90
95
|
}
|
|
91
96
|
to {
|
|
92
|
-
transform: translateX(-100%);
|
|
97
|
+
transform: translateX(calc(-100% - ${gap}px));
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
|
|
@@ -98,7 +103,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
98
103
|
transform: translateX(0);
|
|
99
104
|
}
|
|
100
105
|
to {
|
|
101
|
-
transform: translateX(100%);
|
|
106
|
+
transform: translateX(calc(100% + ${gap}px));
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
|
|
@@ -107,7 +112,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
107
112
|
transform: translateY(0);
|
|
108
113
|
}
|
|
109
114
|
to {
|
|
110
|
-
transform: translateY(-100%);
|
|
115
|
+
transform: translateY(calc(-100% - ${gap}px));
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
|
|
@@ -116,9 +121,15 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
116
121
|
transform: translateY(0);
|
|
117
122
|
}
|
|
118
123
|
to {
|
|
119
|
-
transform: translateY(100%);
|
|
124
|
+
transform: translateY(calc(100% + ${gap}px));
|
|
120
125
|
}
|
|
121
126
|
}
|
|
127
|
+
|
|
128
|
+
${pauseOnHover
|
|
129
|
+
? `&:hover > * {
|
|
130
|
+
animation-play-state: paused;
|
|
131
|
+
}`
|
|
132
|
+
: ""}
|
|
122
133
|
`,
|
|
123
134
|
className,
|
|
124
135
|
rootClassName,
|
|
@@ -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,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
|
/** 当前数字 */
|
package/src/components/Unify.tsx
CHANGED
|
@@ -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
|