deepsea-components 5.15.23 → 5.15.24
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.js +24 -24
- package/dist/components/AutoScroll.js +24 -24
- package/dist/components/AutoSizeTextarea.js +14 -14
- package/dist/components/CircleText.js +4 -4
- package/dist/components/CopyButton.cjs +2 -2
- package/dist/components/CopyButton.js +13 -14
- package/dist/components/Echart.cjs +2 -2
- package/dist/components/Echart.js +12 -12
- package/dist/components/Flow.cjs +3 -3
- package/dist/components/Flow.js +31 -31
- package/dist/components/FormLabel.cjs +2 -2
- package/dist/components/FormLabel.js +8 -8
- package/dist/components/HlsPlayer.js +10 -10
- package/dist/components/IconFileType.cjs +4 -4
- package/dist/components/IconFileType.js +9 -9
- package/dist/components/InfiniteScroll.js +22 -22
- package/dist/components/InputFile.js +4 -4
- package/dist/components/InputFileButton.js +11 -11
- package/dist/components/LoopSwiper.js +15 -15
- package/dist/components/ReadExcel.js +2 -2
- package/dist/components/ReadSheet.js +5 -5
- package/dist/components/Ring.js +4 -4
- package/dist/components/Scroll.cjs +2 -2
- package/dist/components/Scroll.js +20 -21
- package/dist/components/ScrollMask.js +13 -13
- package/dist/components/SectionRing.js +6 -6
- package/dist/components/Skeleton.js +8 -8
- package/dist/components/Title.js +12 -12
- package/dist/components/TransitionBox.js +10 -10
- package/dist/components/TransitionNum.js +11 -11
- package/dist/components/Trapezium.js +11 -11
- package/dist/components/Unify.js +10 -10
- package/dist/components/WriteExcel.js +2 -2
- package/dist/components/WriteSheet.js +4 -4
- package/dist/utils/getReactVersion.js +2 -2
- package/package.json +5 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const TransitionNum = /*#__PURE__*/
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { setFrameInterval } from "deepsea-tools";
|
|
4
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
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("\u76EE\u6807\u6570\u5B57\u5FC5\u987B\u662F\u6574\u6570\uFF0C\u5468\u671F\u5FC5\u987B\u662F\u6B63\u6574\u6570");
|
|
8
|
-
const ele =
|
|
9
|
-
const cache =
|
|
8
|
+
const ele = useRef(null);
|
|
9
|
+
const cache = useRef({
|
|
10
10
|
num,
|
|
11
11
|
period,
|
|
12
12
|
numToStr,
|
|
@@ -18,17 +18,17 @@ const TransitionNum = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
|
|
|
18
18
|
period,
|
|
19
19
|
numToStr
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
useImperativeHandle(ref, ()=>ele.current, []);
|
|
22
|
+
useImperativeHandle(ins, ()=>({
|
|
23
23
|
get: ()=>cache.current.show
|
|
24
24
|
}), []);
|
|
25
|
-
|
|
25
|
+
useEffect(()=>{
|
|
26
26
|
const { num, period, show, numToStr } = cache.current;
|
|
27
27
|
ele.current.innerText = (numToStr || String)(show);
|
|
28
28
|
if (num === show) return;
|
|
29
29
|
const div = ele.current;
|
|
30
30
|
const speed = (num - show) / period;
|
|
31
|
-
const cancel =
|
|
31
|
+
const cancel = setFrameInterval(()=>{
|
|
32
32
|
const { num, numToStr } = cache.current;
|
|
33
33
|
cache.current.show += speed;
|
|
34
34
|
if (speed > 0 && cache.current.show > num || speed < 0 && cache.current.show < num) {
|
|
@@ -41,7 +41,7 @@ const TransitionNum = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
|
|
|
41
41
|
}, [
|
|
42
42
|
num
|
|
43
43
|
]);
|
|
44
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/ jsx("div", {
|
|
45
45
|
ref: ele,
|
|
46
46
|
...rest
|
|
47
47
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const Trapezium = /*#__PURE__*/
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { css } from "@emotion/css";
|
|
4
|
+
import { clsx } from "deepsea-tools";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { px, transformCSSVariable } from "../utils/index.js";
|
|
7
|
+
const Trapezium = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
8
8
|
const { top, bottom, height, borderRadius, className, style, ...rest } = props;
|
|
9
9
|
const diff = (bottom - top) / 2;
|
|
10
10
|
const a = Math.atan(height / diff) / 2;
|
|
@@ -15,16 +15,16 @@ const Trapezium = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef
|
|
|
15
15
|
const f = borderRadius / Math.tan(e);
|
|
16
16
|
const g = f * Math.cos(2 * a);
|
|
17
17
|
const h = f * Math.sin(2 * a);
|
|
18
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/ jsx("div", {
|
|
19
19
|
ref: ref,
|
|
20
|
-
className:
|
|
20
|
+
className: clsx(css`
|
|
21
21
|
width: var(--width);
|
|
22
22
|
height: var(--height);
|
|
23
23
|
clip-path: var(--clip-path);
|
|
24
24
|
`, className),
|
|
25
|
-
style:
|
|
26
|
-
width:
|
|
27
|
-
height:
|
|
25
|
+
style: transformCSSVariable({
|
|
26
|
+
width: px(bottom),
|
|
27
|
+
height: px(height),
|
|
28
28
|
clipath: `path("M ${diff + f} 0 A ${borderRadius} ${borderRadius} 0 0 0 ${diff - g} ${h} L ${c} ${height - d} A ${borderRadius} ${borderRadius} 0 0 0 ${b} ${height} L ${bottom - b} ${height} A ${borderRadius} ${borderRadius} 0 0 0 ${bottom - c} ${height - d} L ${top + diff + g} ${h} A ${borderRadius} ${borderRadius} 0 0 0 ${top + diff - f} 0 Z")`
|
|
29
29
|
}, style),
|
|
30
30
|
...rest
|
package/dist/components/Unify.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const UnifyConfigContext = /*#__PURE__*/
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "deepsea-tools";
|
|
4
|
+
import { createContext, createElement, useContext } from "react";
|
|
5
|
+
const UnifyConfigContext = /*#__PURE__*/ createContext({});
|
|
6
6
|
const UnifyConfigProvider = ({ className, style, children })=>{
|
|
7
|
-
const { className: _className, style: _style } =
|
|
8
|
-
return /*#__PURE__*/
|
|
7
|
+
const { className: _className, style: _style } = useContext(UnifyConfigContext);
|
|
8
|
+
return /*#__PURE__*/ jsx(UnifyConfigContext.Provider, {
|
|
9
9
|
value: {
|
|
10
|
-
className:
|
|
10
|
+
className: clsx(_className, className),
|
|
11
11
|
style: {
|
|
12
12
|
..._style,
|
|
13
13
|
...style
|
|
@@ -18,9 +18,9 @@ const UnifyConfigProvider = ({ className, style, children })=>{
|
|
|
18
18
|
};
|
|
19
19
|
function Unify(props) {
|
|
20
20
|
const { as = "div", className, style, ...rest } = props;
|
|
21
|
-
const { className: _className, style: _style } =
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
className:
|
|
21
|
+
const { className: _className, style: _style } = useContext(UnifyConfigContext);
|
|
22
|
+
return /*#__PURE__*/ createElement(as, {
|
|
23
|
+
className: clsx(_className, className),
|
|
24
24
|
style: {
|
|
25
25
|
..._style,
|
|
26
26
|
...style
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import
|
|
3
|
-
const WriteExcel =
|
|
2
|
+
import { WriteSheet } from "./WriteSheet.js";
|
|
3
|
+
const WriteExcel = WriteSheet;
|
|
4
4
|
export { WriteExcel };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { writeSheet } from "deepsea-tools";
|
|
3
|
+
import { createElement } from "react";
|
|
4
4
|
function WriteSheet(props) {
|
|
5
5
|
const { as, excel, onClick: _onClick, ...rest } = props;
|
|
6
6
|
function onClick(e) {
|
|
7
7
|
_onClick?.(e);
|
|
8
8
|
if (!excel) return;
|
|
9
|
-
|
|
9
|
+
writeSheet(excel);
|
|
10
10
|
}
|
|
11
|
-
return /*#__PURE__*/
|
|
11
|
+
return /*#__PURE__*/ createElement(as ?? "button", {
|
|
12
12
|
onClick,
|
|
13
13
|
...rest
|
|
14
14
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { version } from "react";
|
|
2
2
|
const reg = /(\d+)\.(\d+)\.(\d+)/;
|
|
3
3
|
function getReactVersion() {
|
|
4
|
-
return
|
|
4
|
+
return version.match(reg).slice(1).map(Number);
|
|
5
5
|
}
|
|
6
6
|
export { getReactVersion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepsea-components",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.24",
|
|
4
4
|
"description": "格数科技自用组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@emotion/css": "^11.13.5",
|
|
39
39
|
"clipboard": "^2.0.11",
|
|
40
40
|
"echarts": "^5.6.0",
|
|
41
|
-
"hls.js": "^1.6.
|
|
41
|
+
"hls.js": "^1.6.9",
|
|
42
42
|
"smooth-scrollbar": "^8.8.4",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"soda-hooks": "6.12.7",
|
|
44
|
+
"deepsea-tools": "5.40.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.9.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@types/node": ">=20",
|