deepsea-components 5.7.4 → 5.7.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/cjs/components/AutoFit.js +1 -1
- package/dist/cjs/components/AutoFit.js.map +2 -2
- package/dist/cjs/components/AutoScroll.js +1 -1
- 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/CircleText.js +0 -1
- package/dist/cjs/components/CircleText.js.map +2 -2
- package/dist/cjs/components/CopyButton.d.ts +7 -3
- package/dist/cjs/components/CopyButton.js +1 -0
- package/dist/cjs/components/CopyButton.js.map +2 -2
- package/dist/cjs/components/Echart.d.ts +2 -2
- package/dist/cjs/components/Echart.js +1 -0
- package/dist/cjs/components/Echart.js.map +2 -2
- package/dist/cjs/components/Flow.d.ts +1 -1
- package/dist/cjs/components/Flow.js +1 -1
- package/dist/cjs/components/Flow.js.map +2 -2
- package/dist/cjs/components/FormLabel.d.ts +2 -2
- package/dist/cjs/components/FormLabel.js +15 -18
- package/dist/cjs/components/FormLabel.js.map +2 -2
- package/dist/cjs/components/InfiniteScroll.d.ts +26 -3
- package/dist/cjs/components/InfiniteScroll.js +2 -1
- 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/Ring.js +0 -1
- package/dist/cjs/components/Ring.js.map +2 -2
- package/dist/cjs/components/Scroll.d.ts +1 -1
- package/dist/cjs/components/Scroll.js +1 -1
- package/dist/cjs/components/Scroll.js.map +2 -2
- package/dist/cjs/components/SectionRing.d.ts +2 -2
- package/dist/cjs/components/SectionRing.js +6 -4
- package/dist/cjs/components/SectionRing.js.map +2 -2
- package/dist/cjs/components/Skeleton.js +2 -4
- package/dist/cjs/components/Skeleton.js.map +2 -2
- package/dist/cjs/components/Title.d.ts +2 -2
- package/dist/cjs/components/Title.js +1 -0
- package/dist/cjs/components/Title.js.map +2 -2
- package/dist/cjs/components/TransitionBox.js.map +1 -1
- package/dist/cjs/components/Trapezium.js +1 -2
- 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 +1 -1
- 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/CircleText.js +0 -2
- package/dist/esm/components/CircleText.js.map +1 -1
- package/dist/esm/components/CopyButton.d.ts +7 -3
- package/dist/esm/components/CopyButton.js +2 -0
- package/dist/esm/components/CopyButton.js.map +1 -1
- package/dist/esm/components/Echart.d.ts +2 -2
- package/dist/esm/components/Echart.js +2 -0
- package/dist/esm/components/Echart.js.map +1 -1
- package/dist/esm/components/Flow.d.ts +1 -1
- package/dist/esm/components/Flow.js +1 -1
- package/dist/esm/components/Flow.js.map +1 -1
- package/dist/esm/components/FormLabel.d.ts +2 -2
- package/dist/esm/components/FormLabel.js +24 -27
- package/dist/esm/components/FormLabel.js.map +1 -1
- package/dist/esm/components/InfiniteScroll.d.ts +26 -3
- package/dist/esm/components/InfiniteScroll.js +3 -1
- 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/Ring.js +0 -2
- package/dist/esm/components/Ring.js.map +1 -1
- package/dist/esm/components/Scroll.d.ts +1 -1
- package/dist/esm/components/Scroll.js +1 -1
- package/dist/esm/components/Scroll.js.map +1 -1
- package/dist/esm/components/SectionRing.d.ts +2 -2
- package/dist/esm/components/SectionRing.js +6 -4
- package/dist/esm/components/SectionRing.js.map +1 -1
- package/dist/esm/components/Skeleton.js +3 -6
- package/dist/esm/components/Skeleton.js.map +1 -1
- package/dist/esm/components/Title.d.ts +2 -2
- package/dist/esm/components/Title.js +2 -0
- package/dist/esm/components/Title.js.map +1 -1
- package/dist/esm/components/TransitionBox.js.map +1 -1
- package/dist/esm/components/Trapezium.js +1 -3
- package/dist/esm/components/Trapezium.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AutoFit.tsx +3 -2
- package/src/components/AutoScroll.tsx +3 -2
- package/src/components/AutoSizeTextarea.tsx +3 -2
- package/src/components/CircleText.tsx +0 -2
- package/src/components/CopyButton.tsx +4 -2
- package/src/components/Echart.tsx +7 -5
- package/src/components/Flow.tsx +3 -2
- package/src/components/FormLabel.tsx +20 -23
- package/src/components/InfiniteScroll.tsx +6 -3
- package/src/components/LoopSwiper.tsx +3 -2
- package/src/components/Ring.tsx +1 -3
- package/src/components/Scroll.tsx +5 -3
- package/src/components/SectionRing.tsx +5 -4
- package/src/components/Skeleton.tsx +3 -6
- package/src/components/Title.tsx +5 -2
- package/src/components/TransitionBox.tsx +1 -1
- package/src/components/Trapezium.tsx +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepsea-components",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.6",
|
|
4
4
|
"description": "格数科技自用组件库",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"hls.js": "^1.5.17",
|
|
33
33
|
"smooth-scrollbar": "^8.8.4",
|
|
34
34
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
|
35
|
-
"deepsea-tools": "5.
|
|
35
|
+
"deepsea-tools": "5.15.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@types/react": "^18.3.1",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { clsx } from "deepsea-tools"
|
|
5
|
-
import {
|
|
4
|
+
import { HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
|
|
5
|
+
|
|
6
|
+
import { css } from "@emotion/css"
|
|
6
7
|
import { px, transformCSSVariable } from "../utils"
|
|
7
8
|
|
|
8
9
|
export interface AutoFitProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { useSize } from "ahooks"
|
|
5
4
|
import { clsx, getArray } from "deepsea-tools"
|
|
6
|
-
import { CSSProperties,
|
|
5
|
+
import { CSSProperties, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
7
6
|
import Scrollbar from "smooth-scrollbar"
|
|
8
7
|
import { ScrollStatus } from "smooth-scrollbar/interfaces/scrollbar"
|
|
8
|
+
|
|
9
|
+
import { css } from "@emotion/css"
|
|
9
10
|
import { px, transformCSSVariable } from "../utils"
|
|
10
11
|
import { Scroll, ScrollProps } from "./Scroll"
|
|
11
12
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { clsx } from "deepsea-tools"
|
|
5
|
-
import {
|
|
4
|
+
import { TextareaHTMLAttributes, forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"
|
|
5
|
+
|
|
6
|
+
import { css } from "@emotion/css"
|
|
6
7
|
import { px, transformCSSVariable } from "../utils"
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import { useLatest } from "ahooks"
|
|
2
4
|
import ClipboardJS, { Event } from "clipboard"
|
|
3
|
-
import {
|
|
5
|
+
import { ComponentPropsWithoutRef, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
4
6
|
|
|
5
7
|
export { Event } from "clipboard"
|
|
6
8
|
|
|
7
|
-
export type CopyButtonProps =
|
|
9
|
+
export type CopyButtonProps = ComponentPropsWithoutRef<"button"> & {
|
|
8
10
|
text?: string
|
|
9
11
|
onCopySuccess?: (e: Event) => void
|
|
10
12
|
onCopyError?: (e: Event) => void
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
BarSeriesOption,
|
|
3
5
|
ComposeOption,
|
|
4
6
|
DatasetComponentOption,
|
|
5
7
|
ECharts,
|
|
6
8
|
GridComponentOption,
|
|
7
|
-
init,
|
|
8
9
|
LineSeriesOption,
|
|
9
10
|
PieSeriesOption,
|
|
10
11
|
TitleComponentOption,
|
|
11
12
|
TooltipComponentOption,
|
|
13
|
+
init,
|
|
12
14
|
} from "echarts"
|
|
13
15
|
import {
|
|
14
|
-
|
|
15
|
-
ForwardedRef,
|
|
16
|
-
forwardRef,
|
|
16
|
+
ComponentPropsWithoutRef,
|
|
17
17
|
ForwardRefExoticComponent,
|
|
18
|
+
ForwardedRef,
|
|
18
19
|
RefAttributes,
|
|
20
|
+
forwardRef,
|
|
19
21
|
useEffect,
|
|
20
22
|
useImperativeHandle,
|
|
21
23
|
useLayoutEffect,
|
|
@@ -28,7 +30,7 @@ export type BarOption = ComposeOption<BarSeriesOption | TitleComponentOption | D
|
|
|
28
30
|
|
|
29
31
|
export type LineOption = ComposeOption<LineSeriesOption | TitleComponentOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>
|
|
30
32
|
|
|
31
|
-
export interface EchartProps<T extends any = any> extends Omit<
|
|
33
|
+
export interface EchartProps<T extends any = any> extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
32
34
|
width: number
|
|
33
35
|
height: number
|
|
34
36
|
option: T
|
package/src/components/Flow.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { useSize } from "ahooks"
|
|
5
4
|
import { clsx } from "deepsea-tools"
|
|
6
5
|
import { CSSProperties, HTMLAttributes, Key, ReactNode, RefObject, useEffect, useImperativeHandle, useRef, useState } from "react"
|
|
6
|
+
|
|
7
|
+
import { css } from "@emotion/css"
|
|
7
8
|
import { px, transformCSSVariable } from "../utils"
|
|
8
9
|
|
|
9
10
|
export interface FlowSizeData {
|
|
@@ -239,7 +240,7 @@ export function ManualFlow<T>(props: ManualFlowProps<T>) {
|
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
/** 自适应浮动组件 */
|
|
242
|
-
export function Flow<T>(props: FlowProps<T>) {
|
|
243
|
+
export function Flow<T>(props: FlowProps<T>): ReactNode {
|
|
243
244
|
const {
|
|
244
245
|
itemWidth,
|
|
245
246
|
itemHeight,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { css } from "@emotion/css"
|
|
2
1
|
import { clsx } from "deepsea-tools"
|
|
3
|
-
import {
|
|
2
|
+
import { ComponentPropsWithoutRef, FC, Fragment } from "react"
|
|
3
|
+
|
|
4
|
+
import { css } from "@emotion/css"
|
|
4
5
|
|
|
5
|
-
export type FormLabelProps =
|
|
6
|
+
export type FormLabelProps = ComponentPropsWithoutRef<"div"> & {
|
|
6
7
|
/**
|
|
7
8
|
* Label 的宽度.
|
|
8
9
|
*/
|
|
@@ -16,23 +17,19 @@ export type FormLabelProps = ComponentProps<"div"> & {
|
|
|
16
17
|
/**
|
|
17
18
|
* 为 Ant Design 的 FormItem 设计的 Label 组件
|
|
18
19
|
*/
|
|
19
|
-
export const FormLabel: FC<FormLabelProps> =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/>
|
|
36
|
-
</Fragment>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
20
|
+
export const FormLabel: FC<FormLabelProps> = ({ className, style, before, width, ...rest }) => (
|
|
21
|
+
<Fragment>
|
|
22
|
+
{!!before && <div style={{ width: 11 }}> </div>}
|
|
23
|
+
<div
|
|
24
|
+
className={clsx(
|
|
25
|
+
css`
|
|
26
|
+
text-align: justify;
|
|
27
|
+
text-align-last: justify;
|
|
28
|
+
`,
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
style={{ width, ...style }}
|
|
32
|
+
{...rest}
|
|
33
|
+
/>
|
|
34
|
+
</Fragment>
|
|
35
|
+
)
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
2
3
|
import { useSize } from "ahooks"
|
|
3
4
|
import { clsx } from "deepsea-tools"
|
|
4
|
-
import {
|
|
5
|
+
import { CSSProperties, ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
6
|
+
|
|
7
|
+
import { css } from "@emotion/css"
|
|
5
8
|
|
|
6
|
-
export type InfiniteScrollProps =
|
|
9
|
+
export type InfiniteScrollProps = ComponentPropsWithoutRef<"div"> & {
|
|
7
10
|
/**
|
|
8
11
|
* 滚动的方向
|
|
9
12
|
* @default "vertical"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { clsx } from "deepsea-tools"
|
|
5
|
-
import { CSSProperties,
|
|
4
|
+
import { CSSProperties, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react"
|
|
5
|
+
|
|
6
|
+
import { css } from "@emotion/css"
|
|
6
7
|
|
|
7
8
|
export interface LoopSwiperProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
9
|
direction?: "horizontal" | "vertical"
|
package/src/components/Ring.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
3
|
import { clsx } from "deepsea-tools"
|
|
5
|
-
import { CSSProperties, ForwardedRef,
|
|
4
|
+
import { CSSProperties, ForwardedRef, HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react"
|
|
6
5
|
import Scrollbar from "smooth-scrollbar"
|
|
7
|
-
import type {
|
|
6
|
+
import type { ScrollListener, ScrollbarOptions } from "smooth-scrollbar/interfaces"
|
|
7
|
+
|
|
8
|
+
import { css } from "@emotion/css"
|
|
8
9
|
import { px, transformCSSVariable } from "../utils"
|
|
10
|
+
|
|
9
11
|
export { default as Scrollbar } from "smooth-scrollbar"
|
|
10
12
|
export * from "smooth-scrollbar/interfaces"
|
|
11
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { DrawArcOptions, drawArc } from "deepsea-tools"
|
|
4
|
-
import {
|
|
4
|
+
import { HTMLAttributes, forwardRef } from "react"
|
|
5
5
|
|
|
6
6
|
export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
outerRadius: number
|
|
@@ -10,7 +10,7 @@ export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
angel: number
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const SectionRing
|
|
13
|
+
export const SectionRing = forwardRef<HTMLDivElement, SectionRingProps>((props, ref) => {
|
|
14
14
|
const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...rest } = props
|
|
15
15
|
|
|
16
16
|
const s = (Math.PI * 2) / c - a
|
|
@@ -21,8 +21,8 @@ export const SectionRing: FC<SectionRingProps> = props => {
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<div
|
|
24
|
+
ref={ref}
|
|
24
25
|
style={{
|
|
25
|
-
...style,
|
|
26
26
|
width: o * 2,
|
|
27
27
|
height: o * 2,
|
|
28
28
|
clipPath: `path("${Array(c)
|
|
@@ -32,8 +32,9 @@ export const SectionRing: FC<SectionRingProps> = props => {
|
|
|
32
32
|
`${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), { line: true, anticlockwise: true })}`,
|
|
33
33
|
)
|
|
34
34
|
.join(" ")} Z")`,
|
|
35
|
+
...style,
|
|
35
36
|
}}
|
|
36
37
|
{...rest}
|
|
37
38
|
/>
|
|
38
39
|
)
|
|
39
|
-
}
|
|
40
|
+
})
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { clsx } from "deepsea-tools"
|
|
2
|
+
import { HTMLAttributes, forwardRef } from "react"
|
|
2
3
|
|
|
3
4
|
import { css } from "@emotion/css"
|
|
4
|
-
import { clsx } from "deepsea-tools"
|
|
5
|
-
import { forwardRef, HTMLAttributes } from "react"
|
|
6
5
|
|
|
7
6
|
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
7
|
loading?: boolean
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>((props, ref) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
loading ??= children === undefined || children === null
|
|
11
|
+
const { className, children, loading = children === undefined || children === null, ...rest } = props
|
|
15
12
|
|
|
16
13
|
return (
|
|
17
14
|
<div
|
package/src/components/Title.tsx
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ComponentPropsWithoutRef, forwardRef, useImperativeHandle, useLayoutEffect, useRef } from "react"
|
|
2
4
|
import { createPortal } from "react-dom"
|
|
5
|
+
|
|
3
6
|
import { getReactVersion } from "../utils/getReactVersion"
|
|
4
7
|
|
|
5
|
-
export type TitleProps =
|
|
8
|
+
export type TitleProps = ComponentPropsWithoutRef<"title">
|
|
6
9
|
|
|
7
10
|
const [major] = getReactVersion()
|
|
8
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { useSize } from "ahooks"
|
|
4
|
-
import { CSSProperties, FC,
|
|
4
|
+
import { CSSProperties, FC, HTMLAttributes, forwardRef, useEffect, useRef, useState } from "react"
|
|
5
5
|
|
|
6
6
|
export interface TransitionBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
containerClassName?: string
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { css } from "@emotion/css"
|
|
4
1
|
import { clsx } from "deepsea-tools"
|
|
5
2
|
import { HTMLAttributes, forwardRef } from "react"
|
|
3
|
+
|
|
4
|
+
import { css } from "@emotion/css"
|
|
6
5
|
import { px, transformCSSVariable } from "../utils"
|
|
7
6
|
|
|
8
7
|
export interface TrapeziumProps extends HTMLAttributes<HTMLDivElement> {
|