deepsea-components 5.8.0 → 5.8.2
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/README.md +23 -23
- package/dist/cjs/components/AutoFit.js +1 -1
- package/dist/cjs/components/AutoFit.js.map +2 -2
- package/dist/cjs/components/AutoScroll.js +2 -2
- package/dist/cjs/components/AutoScroll.js.map +2 -2
- package/dist/cjs/components/AutoSizeTextarea.js +1 -1
- package/dist/cjs/components/AutoSizeTextarea.js.map +2 -2
- package/dist/cjs/components/CopyButton.d.ts +1 -1
- package/dist/cjs/components/CopyButton.js +1 -1
- package/dist/cjs/components/CopyButton.js.map +2 -2
- package/dist/cjs/components/Echart.d.ts +1 -1
- package/dist/cjs/components/Echart.js +1 -1
- package/dist/cjs/components/Echart.js.map +2 -2
- package/dist/cjs/components/ExportExcel.d.ts +2 -3
- package/dist/cjs/components/ExportExcel.js +7 -3
- package/dist/cjs/components/ExportExcel.js.map +2 -2
- package/dist/cjs/components/Flow.js +2 -2
- package/dist/cjs/components/Flow.js.map +2 -2
- package/dist/cjs/components/HlsPlayer.js +1 -1
- package/dist/cjs/components/HlsPlayer.js.map +2 -2
- package/dist/cjs/components/ImportExcel.js +1 -1
- package/dist/cjs/components/ImportExcel.js.map +2 -2
- package/dist/cjs/components/InfiniteScroll.js +2 -2
- package/dist/cjs/components/InfiniteScroll.js.map +2 -2
- package/dist/cjs/components/LoopSwiper.js +1 -1
- package/dist/cjs/components/LoopSwiper.js.map +2 -2
- package/dist/cjs/components/Scroll.js +6 -15
- package/dist/cjs/components/Scroll.js.map +2 -2
- package/dist/cjs/components/SectionRing.js +1 -1
- package/dist/cjs/components/SectionRing.js.map +2 -2
- package/dist/cjs/components/Skeleton.js +1 -1
- package/dist/cjs/components/Skeleton.js.map +2 -2
- package/dist/cjs/components/Title.js +1 -1
- package/dist/cjs/components/Title.js.map +2 -2
- package/dist/cjs/components/TransitionBox.js +1 -1
- package/dist/cjs/components/TransitionBox.js.map +2 -2
- package/dist/cjs/components/TransitionNum.js +1 -1
- package/dist/cjs/components/TransitionNum.js.map +2 -2
- package/dist/cjs/components/Trapezium.js +1 -1
- package/dist/cjs/components/Trapezium.js.map +2 -2
- package/dist/esm/components/AutoFit.js +1 -1
- package/dist/esm/components/AutoFit.js.map +1 -1
- package/dist/esm/components/AutoScroll.js +2 -2
- package/dist/esm/components/AutoScroll.js.map +1 -1
- package/dist/esm/components/AutoSizeTextarea.js +1 -1
- package/dist/esm/components/AutoSizeTextarea.js.map +1 -1
- package/dist/esm/components/CopyButton.d.ts +1 -1
- package/dist/esm/components/CopyButton.js +1 -1
- package/dist/esm/components/CopyButton.js.map +1 -1
- package/dist/esm/components/Echart.d.ts +1 -1
- package/dist/esm/components/Echart.js +1 -1
- package/dist/esm/components/Echart.js.map +1 -1
- package/dist/esm/components/ExportExcel.d.ts +2 -3
- package/dist/esm/components/ExportExcel.js +4 -3
- package/dist/esm/components/ExportExcel.js.map +1 -1
- package/dist/esm/components/Flow.js +2 -2
- package/dist/esm/components/Flow.js.map +1 -1
- package/dist/esm/components/HlsPlayer.js +1 -1
- package/dist/esm/components/HlsPlayer.js.map +1 -1
- package/dist/esm/components/ImportExcel.js +1 -1
- package/dist/esm/components/ImportExcel.js.map +1 -1
- package/dist/esm/components/InfiniteScroll.js +2 -2
- package/dist/esm/components/InfiniteScroll.js.map +1 -1
- package/dist/esm/components/LoopSwiper.js +1 -1
- package/dist/esm/components/LoopSwiper.js.map +1 -1
- package/dist/esm/components/Scroll.js +6 -15
- package/dist/esm/components/Scroll.js.map +1 -1
- package/dist/esm/components/SectionRing.js +1 -1
- package/dist/esm/components/SectionRing.js.map +1 -1
- package/dist/esm/components/Skeleton.js +1 -1
- package/dist/esm/components/Skeleton.js.map +1 -1
- package/dist/esm/components/Title.js +1 -1
- package/dist/esm/components/Title.js.map +1 -1
- package/dist/esm/components/TransitionBox.js +1 -1
- package/dist/esm/components/TransitionBox.js.map +1 -1
- package/dist/esm/components/TransitionNum.js +1 -1
- package/dist/esm/components/TransitionNum.js.map +1 -1
- package/dist/esm/components/Trapezium.js +1 -1
- package/dist/esm/components/Trapezium.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AutoFit.tsx +2 -2
- package/src/components/AutoScroll.tsx +3 -2
- package/src/components/AutoSizeTextarea.tsx +2 -2
- package/src/components/CopyButton.tsx +1 -1
- package/src/components/Echart.tsx +11 -11
- package/src/components/ExportExcel.tsx +18 -18
- package/src/components/Flow.tsx +2 -2
- package/src/components/HlsPlayer.tsx +1 -1
- package/src/components/ImportExcel.tsx +17 -17
- package/src/components/InfiniteScroll.tsx +2 -3
- package/src/components/LoopSwiper.tsx +1 -2
- package/src/components/Scroll.tsx +14 -15
- package/src/components/SectionRing.tsx +1 -1
- package/src/components/Skeleton.tsx +1 -2
- package/src/components/Title.tsx +1 -1
- package/src/components/TransitionBox.tsx +1 -1
- package/src/components/TransitionNum.tsx +1 -1
- package/src/components/Trapezium.tsx +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { ComponentPropsWithoutRef, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
3
4
|
import { useLatest } from "ahooks"
|
|
4
5
|
import ClipboardJS, { Event } from "clipboard"
|
|
5
|
-
import { ComponentPropsWithoutRef, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
6
6
|
|
|
7
7
|
export { Event } from "clipboard"
|
|
8
8
|
|
|
@@ -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,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ComponentPropsWithoutRef, ComponentRef, MouseEvent as ReactMouseEvent, forwardRef } from "react"
|
|
4
|
+
import { ExportExcelParams, exportExcel } from "deepsea-tools"
|
|
5
|
+
|
|
6
|
+
export interface ExportExcelProps extends ComponentPropsWithoutRef<"button">, ExportExcelParams {}
|
|
7
|
+
|
|
8
|
+
/** 导出 excel 的 button 组件 */
|
|
9
|
+
export const ExportExcel = forwardRef<ComponentRef<"button">, ExportExcelProps>((props, ref) => {
|
|
10
|
+
const { data, fileName, onClick, ...rest } = props
|
|
11
|
+
|
|
12
|
+
function onButtonClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {
|
|
13
|
+
exportExcel({ data, fileName })
|
|
14
|
+
onClick?.(e)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return <button ref={ref} onClick={onButtonClick} {...rest} />
|
|
18
|
+
})
|
package/src/components/Flow.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { CSSProperties, HTMLAttributes, Key, ReactNode, RefObject, useEffect, useImperativeHandle, useRef, useState } from "react"
|
|
4
|
+
import { css } from "@emotion/css"
|
|
3
5
|
import { useSize } from "ahooks"
|
|
4
6
|
import { clsx } from "deepsea-tools"
|
|
5
|
-
import { CSSProperties, HTMLAttributes, Key, ReactNode, RefObject, useEffect, useImperativeHandle, useRef, useState } from "react"
|
|
6
7
|
|
|
7
|
-
import { css } from "@emotion/css"
|
|
8
8
|
import { px, transformCSSVariable } from "@/utils"
|
|
9
9
|
|
|
10
10
|
export interface FlowSizeData {
|
|
@@ -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,17 +1,17 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { InputFile, InputFileProps } from "./InputFile"
|
|
7
|
-
|
|
8
|
-
export interface ImportExcelProps extends Omit<InputFileProps, "multiple" | "onChange" | "accept" | "type"> {
|
|
9
|
-
onChange?: (data: Record<string, any>[]) => void
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** 专门用于读取 excel 的组件 */
|
|
13
|
-
export const ImportExcel = forwardRef<HTMLInputElement, ImportExcelProps>((props, ref) => {
|
|
14
|
-
const { onChange, ...rest } = props
|
|
15
|
-
|
|
16
|
-
return <InputFile ref={ref} accept=".xlsx" type="arrayBuffer" onChange={({ result }) => onChange?.(readExcel(result))} {...rest} />
|
|
17
|
-
})
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from "react"
|
|
4
|
+
import { readExcel } from "deepsea-tools"
|
|
5
|
+
|
|
6
|
+
import { InputFile, InputFileProps } from "./InputFile"
|
|
7
|
+
|
|
8
|
+
export interface ImportExcelProps extends Omit<InputFileProps, "multiple" | "onChange" | "accept" | "type"> {
|
|
9
|
+
onChange?: (data: Record<string, any>[]) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** 专门用于读取 excel 的组件 */
|
|
13
|
+
export const ImportExcel = forwardRef<HTMLInputElement, ImportExcelProps>((props, ref) => {
|
|
14
|
+
const { onChange, ...rest } = props
|
|
15
|
+
|
|
16
|
+
return <InputFile ref={ref} accept=".xlsx" type="arrayBuffer" onChange={({ result }) => onChange?.(readExcel(result))} {...rest} />
|
|
17
|
+
})
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { useSize } from "ahooks"
|
|
4
|
-
import { clsx } from "deepsea-tools"
|
|
5
3
|
import { CSSProperties, ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
6
|
-
|
|
7
4
|
import { css } from "@emotion/css"
|
|
5
|
+
import { useSize } from "ahooks"
|
|
6
|
+
import { clsx } from "deepsea-tools"
|
|
8
7
|
|
|
9
8
|
export type InfiniteScrollProps = ComponentPropsWithoutRef<"div"> & {
|
|
10
9
|
/**
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { clsx } from "deepsea-tools"
|
|
4
3
|
import { CSSProperties, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react"
|
|
5
|
-
|
|
6
4
|
import { css } from "@emotion/css"
|
|
5
|
+
import { clsx } from "deepsea-tools"
|
|
7
6
|
|
|
8
7
|
export interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
8
|
direction?: "horizontal" | "vertical"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { clsx } from "deepsea-tools"
|
|
4
3
|
import { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react"
|
|
4
|
+
import { css } from "@emotion/css"
|
|
5
|
+
import { clsx } from "deepsea-tools"
|
|
5
6
|
import Scrollbar from "smooth-scrollbar"
|
|
6
7
|
import type { ScrollListener, ScrollbarOptions } from "smooth-scrollbar/interfaces"
|
|
7
8
|
|
|
8
|
-
import { css } from "@emotion/css"
|
|
9
9
|
import { px, transformCSSVariable } from "@/utils"
|
|
10
10
|
|
|
11
11
|
export { default as Scrollbar } from "smooth-scrollbar"
|
|
@@ -58,25 +58,24 @@ export const Scroll = forwardRef<HTMLDivElement, ScrollProps>((props, ref) => {
|
|
|
58
58
|
className={clsx(
|
|
59
59
|
css`
|
|
60
60
|
.scrollbar-track.scrollbar-track-x {
|
|
61
|
-
${thumbWidth !== undefined ? "height: var(--thumb-width);" : ""}
|
|
62
|
-
|
|
61
|
+
${thumbWidth !== undefined ? "height: var(--thumb-width);" : ""} ${trackColor !== undefined
|
|
62
|
+
? "background-color: var(--track-color);"
|
|
63
|
+
: ""}
|
|
63
64
|
}
|
|
64
|
-
|
|
65
65
|
.scrollbar-thumb.scrollbar-thumb-x {
|
|
66
|
-
${thumbWidth !== undefined ? "height: var(--thumb-width);" : ""}
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
${thumbWidth !== undefined ? "height: var(--thumb-width);" : ""} ${thumbRadius !== undefined
|
|
67
|
+
? "border-radius: var(--thumb-radius);"
|
|
68
|
+
: ""} ${thumbColor !== undefined ? "background-color: var(--thumb-color);" : ""}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
70
|
.scrollbar-track.scrollbar-track-y {
|
|
72
|
-
${thumbWidth !== undefined ? "width: var(--thumb-width);" : ""}
|
|
73
|
-
|
|
71
|
+
${thumbWidth !== undefined ? "width: var(--thumb-width);" : ""} ${trackColor !== undefined
|
|
72
|
+
? "background-color: var(--track-color);"
|
|
73
|
+
: ""}
|
|
74
74
|
}
|
|
75
|
-
|
|
76
75
|
.scrollbar-thumb.scrollbar-thumb-y {
|
|
77
|
-
${thumbWidth !== undefined ? "width: var(--thumb-width);" : ""}
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
${thumbWidth !== undefined ? "width: var(--thumb-width);" : ""} ${thumbRadius !== undefined
|
|
77
|
+
? "border-radius: var(--thumb-radius);"
|
|
78
|
+
: ""} ${thumbColor !== undefined ? "background-color: var(--thumb-color);" : ""}
|
|
80
79
|
}
|
|
81
80
|
`,
|
|
82
81
|
className,
|
|
@@ -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,9 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { clsx } from "deepsea-tools"
|
|
4
3
|
import { HTMLAttributes, forwardRef } from "react"
|
|
5
|
-
|
|
6
4
|
import { css } from "@emotion/css"
|
|
5
|
+
import { clsx } from "deepsea-tools"
|
|
7
6
|
|
|
8
7
|
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
8
|
loading?: boolean
|
package/src/components/Title.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { isBrowser } from "deepsea-tools"
|
|
4
3
|
import { ComponentPropsWithoutRef, forwardRef, useImperativeHandle, useLayoutEffect, useRef } from "react"
|
|
5
4
|
import { createPortal } from "react-dom"
|
|
5
|
+
import { isBrowser } from "deepsea-tools"
|
|
6
6
|
|
|
7
7
|
import { getReactVersion } from "@/utils/getReactVersion"
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { useSize } from "ahooks"
|
|
4
3
|
import { CSSProperties, FC, HTMLAttributes, forwardRef, useEffect, useRef, useState } from "react"
|
|
4
|
+
import { useSize } from "ahooks"
|
|
5
5
|
|
|
6
6
|
export interface TransitionBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
containerClassName?: string
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { clsx } from "deepsea-tools"
|
|
4
3
|
import { HTMLAttributes, forwardRef } from "react"
|
|
5
|
-
|
|
6
4
|
import { css } from "@emotion/css"
|
|
5
|
+
import { clsx } from "deepsea-tools"
|
|
6
|
+
|
|
7
7
|
import { px, transformCSSVariable } from "@/utils"
|
|
8
8
|
|
|
9
9
|
export interface TrapeziumProps extends HTMLAttributes<HTMLDivElement> {
|