deepsea-components 5.18.4 → 5.18.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.
- package/dist/components/AutoFit.cjs +4 -4
- package/dist/components/AutoFit.js +1 -1
- package/dist/components/AutoScroll.cjs +4 -4
- package/dist/components/AutoScroll.js +1 -1
- package/dist/components/AutoSizeTextarea.cjs +4 -4
- package/dist/components/AutoSizeTextarea.js +1 -1
- package/dist/components/CircleText.cjs +4 -4
- package/dist/components/CircleText.js +1 -1
- package/dist/components/CopyButton.cjs +4 -4
- package/dist/components/CopyButton.js +1 -1
- package/dist/components/DraggableGrid.cjs +3 -3
- package/dist/components/DraggableGrid.module.cjs +3 -3
- package/dist/components/DraggableGrid.module.js +1 -1
- package/dist/components/Echart.cjs +20 -20
- package/dist/components/Echart.js +1 -1
- package/dist/components/Flow.cjs +7 -7
- package/dist/components/Flow.js +1 -1
- package/dist/components/FormLabel.cjs +6 -6
- package/dist/components/FormLabel.js +1 -1
- package/dist/components/HlsPlayer.cjs +4 -4
- package/dist/components/HlsPlayer.js +1 -1
- package/dist/components/IconFileType.cjs +6 -6
- package/dist/components/InfiniteScroll.cjs +4 -4
- package/dist/components/InfiniteScroll.js +1 -1
- package/dist/components/InputFile.cjs +4 -4
- package/dist/components/InputFile.js +1 -1
- package/dist/components/InputFileButton.cjs +4 -4
- package/dist/components/InputFileButton.js +1 -1
- package/dist/components/LoopSwiper.cjs +4 -4
- package/dist/components/LoopSwiper.js +1 -1
- package/dist/components/ReadExcel.cjs +4 -4
- package/dist/components/ReadExcel.js +1 -1
- package/dist/components/ReadSheet.cjs +4 -4
- package/dist/components/ReadSheet.js +1 -1
- package/dist/components/Ring.cjs +4 -4
- package/dist/components/Ring.js +1 -1
- package/dist/components/RtspPlayer.cjs +5 -5
- package/dist/components/RtspPlayer.js +2 -2
- package/dist/components/Scroll.cjs +38 -40
- package/dist/components/Scroll.js +1 -1
- package/dist/components/ScrollMask.cjs +3 -3
- package/dist/components/ScrollMask.module.cjs +3 -3
- package/dist/components/ScrollMask.module.js +1 -1
- package/dist/components/ScrollMask_module.css +3 -1
- package/dist/components/SectionRing.cjs +4 -4
- package/dist/components/SectionRing.js +1 -1
- package/dist/components/Skeleton.cjs +4 -4
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Title.cjs +4 -4
- package/dist/components/Title.js +1 -1
- package/dist/components/TransitionBox.cjs +4 -4
- package/dist/components/TransitionBox.js +1 -1
- package/dist/components/TransitionNum.cjs +4 -4
- package/dist/components/TransitionNum.js +1 -1
- package/dist/components/Trapezium.cjs +4 -4
- package/dist/components/Trapezium.js +1 -1
- package/dist/components/Unify.cjs +4 -4
- package/dist/components/Unify.js +1 -1
- package/dist/components/WriteExcel.cjs +4 -4
- package/dist/components/WriteExcel.js +1 -1
- package/dist/components/WriteSheet.cjs +4 -4
- package/dist/components/WriteSheet.js +1 -1
- package/dist/components/rtspPlayer/reader.cjs +3 -3
- package/dist/index.cjs +162 -226
- package/dist/utils/getReactVersion.cjs +3 -3
- package/dist/utils/index.cjs +3 -3
- package/package.json +4 -4
- package/src/components/AutoFit.tsx +2 -0
- package/src/components/AutoScroll.tsx +1 -0
- package/src/components/CopyButton.tsx +4 -0
- package/src/components/DraggableGrid.tsx +6 -0
- package/src/components/Echart.tsx +2 -0
- package/src/components/Flow.tsx +6 -0
- package/src/components/InfiniteScroll.tsx +5 -0
- package/src/components/InputFile.tsx +3 -0
- package/src/components/InputFileButton.tsx +5 -0
- package/src/components/LoopSwiper.tsx +1 -0
- package/src/components/Scroll.tsx +1 -0
- package/src/components/Title.tsx +3 -0
- package/src/components/Unify.tsx +2 -0
- package/src/components/WriteSheet.tsx +2 -0
- package/src/components/rtspPlayer/reader.ts +2 -0
- package/tsconfig.json +5 -0
package/dist/utils/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -47,11 +47,11 @@ function px(value) {
|
|
|
47
47
|
exports.px = __webpack_exports__.px;
|
|
48
48
|
exports.transformCSSVariable = __webpack_exports__.transformCSSVariable;
|
|
49
49
|
exports.transformCSSVariableName = __webpack_exports__.transformCSSVariableName;
|
|
50
|
-
for(var
|
|
50
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
51
51
|
"px",
|
|
52
52
|
"transformCSSVariable",
|
|
53
53
|
"transformCSSVariableName"
|
|
54
|
-
].indexOf(
|
|
54
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
55
55
|
Object.defineProperty(exports, '__esModule', {
|
|
56
56
|
value: true
|
|
57
57
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepsea-components",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.5",
|
|
4
4
|
"description": "格数科技自用组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"hls.js": "^1.6.13",
|
|
42
42
|
"smooth-scrollbar": "^8.8.4",
|
|
43
43
|
"stable-hash": "^0.0.6",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
44
|
+
"soda-hooks": "6.17.1",
|
|
45
|
+
"deepsea-tools": "5.48.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"typescript": ">=5.8.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@types/node": "^24.
|
|
51
|
+
"@types/node": "^24.12.4",
|
|
52
52
|
"@types/react": ">=19.2.7",
|
|
53
53
|
"@types/react-dom": ">=19.2.3",
|
|
54
54
|
"react": ">=19.2.3",
|
|
@@ -39,6 +39,7 @@ export const AutoFit = forwardRef<HTMLDivElement, AutoFitProps>((props, ref) =>
|
|
|
39
39
|
const [width, setWidth] = useState<string | undefined>(undefined)
|
|
40
40
|
const [height, setHeight] = useState<string | undefined>(undefined)
|
|
41
41
|
|
|
42
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
43
|
useImperativeHandle(ref, () => ele.current!, [ele.current])
|
|
43
44
|
|
|
44
45
|
useLayoutEffect(() => {
|
|
@@ -80,6 +81,7 @@ export const AutoFit = forwardRef<HTMLDivElement, AutoFitProps>((props, ref) =>
|
|
|
80
81
|
}, [ele.current?.parentElement, designWidth, designHeight, direction])
|
|
81
82
|
|
|
82
83
|
if (process.env.NODE_ENV === "development") {
|
|
84
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
83
85
|
useEffect(() => {
|
|
84
86
|
const parent = ele.current?.parentElement
|
|
85
87
|
if (!parent) return
|
|
@@ -127,6 +127,7 @@ export const AutoScroll: FC<AutoScrollProps> = ({
|
|
|
127
127
|
return () => {
|
|
128
128
|
clearTimeout(timeout.current)
|
|
129
129
|
bar.current?.removeListener(listener)
|
|
130
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
131
|
bar.current?.scrollTo(0, 0)
|
|
131
132
|
}
|
|
132
133
|
}, [size, count, itemSize, gap, duration, animation, isVertical])
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
|
4
|
+
|
|
3
5
|
import { ComponentPropsWithoutRef, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
|
|
4
6
|
|
|
5
7
|
import ClipboardJS, { Event } from "clipboard"
|
|
@@ -19,6 +21,7 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>((props,
|
|
|
19
21
|
const onCopySuccess = useLatest(_onCoptSuccess)
|
|
20
22
|
const onCopyError = useLatest(_onCopyError)
|
|
21
23
|
|
|
24
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
25
|
useImperativeHandle(ref, () => ele.current!, [ele.current])
|
|
23
26
|
|
|
24
27
|
useEffect(() => {
|
|
@@ -26,6 +29,7 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>((props,
|
|
|
26
29
|
clipboard.on("success", event => onCopySuccess.current?.(event))
|
|
27
30
|
clipboard.on("error", event => onCopyError.current?.(event))
|
|
28
31
|
return () => clipboard.destroy()
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
33
|
}, [])
|
|
30
34
|
|
|
31
35
|
return <button ref={ele} {...rest} data-clipboard-text={text} />
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
2
|
+
|
|
1
3
|
import { ComponentProps, CSSProperties, Key, ReactNode, useEffect, useMemo, useRef, useState } from "react"
|
|
2
4
|
|
|
3
5
|
import { clsx, getArray, isNullable } from "deepsea-tools"
|
|
@@ -347,8 +349,10 @@ export function DraggableGrid<T, K extends Key = T extends Key ? T : never>({
|
|
|
347
349
|
setKeyToOrder(newOrderMap)
|
|
348
350
|
onOrderMapChange?.(newOrderMap)
|
|
349
351
|
const newRenderKeys = new Set(newOrderMap.keys())
|
|
352
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
350
353
|
setRenderKeys(prev => prev.intersection(newRenderKeys).union(newRenderKeys.difference(prev)))
|
|
351
354
|
}
|
|
355
|
+
// eslint-disable-next-line react-hooks/refs
|
|
352
356
|
}, [dragging, cache, orders, keyToItem, keyToOrder, orderPriority, onOrderMapChange])
|
|
353
357
|
|
|
354
358
|
/** 渲染的元素的 key,不会随着 keyToOrder 的变化而变化 */
|
|
@@ -384,6 +388,7 @@ export function DraggableGrid<T, K extends Key = T extends Key ? T : never>({
|
|
|
384
388
|
|
|
385
389
|
if (!!orderMap && isLegalOrderMap({ orders, keys: keyToItem.keys(), orderMap })) setKeyToOrder(orderMap)
|
|
386
390
|
else onOrderMapChange?.(keyToOrder)
|
|
391
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
387
392
|
}, [orderMap, keyToOrder, onOrderMapChange])
|
|
388
393
|
|
|
389
394
|
function onDragMoveStart(key: K, event: DragMoveEvent<HTMLDivElement>) {
|
|
@@ -512,6 +517,7 @@ export function DraggableGrid<T, K extends Key = T extends Key ? T : never>({
|
|
|
512
517
|
}
|
|
513
518
|
{...rest}
|
|
514
519
|
>
|
|
520
|
+
{/* eslint-disable-next-line react-hooks/refs */}
|
|
515
521
|
{Array.from(renderKeys).map(key => {
|
|
516
522
|
if (!keyToItem.has(key)) return undefined
|
|
517
523
|
const item = keyToItem.get(key)!
|
|
@@ -180,12 +180,14 @@ export function Echart<T extends ECBasicOption = ECBasicOption>({
|
|
|
180
180
|
const ele = container.current!
|
|
181
181
|
chartRef.current = init(ele, option, { ...initOption, width, height, locale })
|
|
182
182
|
return () => chartRef.current?.dispose()
|
|
183
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
184
|
}, [])
|
|
184
185
|
|
|
185
186
|
useImperativeHandle(ref, () => container.current!)
|
|
186
187
|
|
|
187
188
|
useImperativeHandle(chart, () => chartRef.current!)
|
|
188
189
|
|
|
190
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
191
|
useEffect(() => chartRef.current?.setOption(option), [hash(option)])
|
|
190
192
|
|
|
191
193
|
// @ts-expect-error width and height can be string
|
package/src/components/Flow.tsx
CHANGED
|
@@ -154,6 +154,7 @@ export function ManualFlow<T>(props: ManualFlowProps<T>) {
|
|
|
154
154
|
return index >= maxRows * columnCount
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/refs
|
|
157
158
|
useImperativeHandle(element, () => ele.current!, [ele.current])
|
|
158
159
|
|
|
159
160
|
useEffect(() => {
|
|
@@ -180,6 +181,7 @@ export function ManualFlow<T>(props: ManualFlowProps<T>) {
|
|
|
180
181
|
itemCount: data.length,
|
|
181
182
|
maxRows: maxRows ?? null,
|
|
182
183
|
})
|
|
184
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
185
|
}, [width, height, columnGapSize, columnCount, rowGap, contentShownRows, data.length, itemWidth, itemHeight, maxRows])
|
|
184
186
|
|
|
185
187
|
return (
|
|
@@ -266,8 +268,12 @@ export function Flow<T>(props: FlowProps<T>): ReactNode {
|
|
|
266
268
|
const ele = useRef<HTMLDivElement>(null)
|
|
267
269
|
const size = useSize(ele)
|
|
268
270
|
const width = useRef(size?.width || 0)
|
|
271
|
+
// eslint-disable-next-line react-hooks/refs
|
|
269
272
|
if (size && size.width !== 0) width.current = size.width
|
|
273
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/refs
|
|
270
274
|
useImperativeHandle(element, () => ele.current!, [ele.current])
|
|
275
|
+
// eslint-disable-next-line react-hooks/refs
|
|
271
276
|
if (width.current === 0) return <div ref={ele} {...rest} />
|
|
277
|
+
// eslint-disable-next-line react-hooks/refs
|
|
272
278
|
return <ManualFlow element={ele} {...props} width={width.current} />
|
|
273
279
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
|
4
|
+
|
|
3
5
|
import { ComponentPropsWithoutRef, CSSProperties, forwardRef, MouseEvent as ReactMouseEvent, useEffect, useImperativeHandle, useRef } from "react"
|
|
4
6
|
|
|
5
7
|
import { css } from "@emotion/css"
|
|
@@ -58,6 +60,7 @@ export const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((p
|
|
|
58
60
|
|
|
59
61
|
const ele = useRef<HTMLDivElement>(null)
|
|
60
62
|
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
64
|
useImperativeHandle(ref, () => wrapper.current as HTMLDivElement, [wrapper.current])
|
|
62
65
|
|
|
63
66
|
const container = useRef<HTMLDivElement>(null)
|
|
@@ -88,6 +91,7 @@ export const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((p
|
|
|
88
91
|
{ duration, iterations: Infinity },
|
|
89
92
|
)
|
|
90
93
|
return () => animation.current?.cancel()
|
|
94
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
95
|
}, [wrapperSize, containerSize, overflow, direction, duration])
|
|
92
96
|
|
|
93
97
|
function enter(e: ReactMouseEvent<HTMLDivElement, MouseEvent>) {
|
|
@@ -102,6 +106,7 @@ export const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((p
|
|
|
102
106
|
|
|
103
107
|
useEffect(() => {
|
|
104
108
|
if (!pauseOnHover && animation.current?.playState === "paused") animation.current?.play()
|
|
109
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
105
110
|
}, [animation.current, pauseOnHover])
|
|
106
111
|
|
|
107
112
|
return (
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
|
4
|
+
|
|
3
5
|
import { ChangeEvent, ComponentProps, ReactNode, useState } from "react"
|
|
4
6
|
|
|
5
7
|
export interface InputFileDataTypeMap {
|
|
@@ -34,6 +36,7 @@ export function getFileData<T extends InputFileDataType>(file: File, type: T): P
|
|
|
34
36
|
fileReader.readAsArrayBuffer(file)
|
|
35
37
|
break
|
|
36
38
|
case "binary":
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
37
40
|
fileReader.readAsBinaryString(file)
|
|
38
41
|
break
|
|
39
42
|
case "base64":
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
ComponentProps,
|
|
5
7
|
ComponentRef,
|
|
@@ -68,6 +70,7 @@ export function InputFileButton<
|
|
|
68
70
|
const input = useRef<HTMLInputElement>(null)
|
|
69
71
|
const isDisabled = disabled || _disabled || __disabled
|
|
70
72
|
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/refs
|
|
71
74
|
useImperativeHandle(ref, () => input.current!, [input.current])
|
|
72
75
|
|
|
73
76
|
function onClick(e: ReactMouseEvent<ComponentRef<AS>, MouseEvent>) {
|
|
@@ -116,6 +119,7 @@ export function InputFileButton<
|
|
|
116
119
|
e.preventDefault()
|
|
117
120
|
}
|
|
118
121
|
|
|
122
|
+
/* eslint-disable react-hooks/refs */
|
|
119
123
|
return (
|
|
120
124
|
<Fragment>
|
|
121
125
|
<InputFile<Multiple, Type>
|
|
@@ -141,4 +145,5 @@ export function InputFileButton<
|
|
|
141
145
|
})}
|
|
142
146
|
</Fragment>
|
|
143
147
|
)
|
|
148
|
+
/* eslint-enable react-hooks/refs */
|
|
144
149
|
}
|
|
@@ -39,6 +39,7 @@ export const LoopSwiper: FC<LoopSwiperProps> = ({
|
|
|
39
39
|
const container = useRef<HTMLDivElement>(null)
|
|
40
40
|
const [swiper, setSwiper] = useState(false)
|
|
41
41
|
const directionRef = useRef(direction)
|
|
42
|
+
// eslint-disable-next-line react-hooks/refs
|
|
42
43
|
directionRef.current = direction
|
|
43
44
|
const flexDirection: CSSProperties["flexDirection"] = direction === "vertical" ? (reverse ? "column-reverse" : "column") : reverse ? "row-reverse" : "row"
|
|
44
45
|
const animationName = swiper
|
|
@@ -49,6 +49,7 @@ export const Scroll: FC<ScrollProps> = ({
|
|
|
49
49
|
useLayoutEffect(() => {
|
|
50
50
|
bar.current = Scrollbar.init(ele.current!, scrollbarOptions)
|
|
51
51
|
return () => bar.current?.destroy()
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
53
|
}, [])
|
|
53
54
|
|
|
54
55
|
useImperativeHandle(ref, () => ele.current!, [])
|
package/src/components/Title.tsx
CHANGED
|
@@ -15,10 +15,13 @@ export const Title: FC<ComponentProps<"title">> = ({ ref, children, ...rest }) =
|
|
|
15
15
|
|
|
16
16
|
if (major >= 19) return <title ref={ref} {...rest} children={children} />
|
|
17
17
|
|
|
18
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
18
19
|
const ele = useRef<HTMLTitleElement>(null)
|
|
19
20
|
|
|
21
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks, react-hooks/exhaustive-deps, react-hooks/refs
|
|
20
22
|
useImperativeHandle(ref, () => ele.current as HTMLTitleElement, [ele.current])
|
|
21
23
|
|
|
24
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
22
25
|
useLayoutEffect(() => {
|
|
23
26
|
const title = document.head.querySelector("title")
|
|
24
27
|
if (title === ele.current) return
|
package/src/components/Unify.tsx
CHANGED