deepsea-components 5.16.16 → 5.17.0
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 +9 -9
- package/dist/components/AutoFit.js +9 -9
- package/dist/components/AutoScroll.cjs +4 -4
- package/dist/components/AutoScroll.js +4 -4
- package/dist/components/AutoSizeTextarea.cjs +23 -81
- package/dist/components/AutoSizeTextarea.js +23 -81
- package/dist/components/CircleText.cjs +24 -120
- package/dist/components/CircleText.js +24 -120
- package/dist/components/CopyButton.cjs +2 -2
- package/dist/components/CopyButton.js +2 -2
- package/dist/components/DraggableGrid.cjs +98 -149
- package/dist/components/DraggableGrid.js +98 -149
- package/dist/components/Echart.cjs +24 -94
- package/dist/components/Echart.js +24 -94
- package/dist/components/Flow.cjs +8 -8
- package/dist/components/Flow.js +8 -8
- package/dist/components/FormLabel.cjs +27 -92
- package/dist/components/FormLabel.js +27 -92
- package/dist/components/HlsPlayer.cjs +24 -65
- package/dist/components/HlsPlayer.js +24 -65
- package/dist/components/IconFileType.cjs +4 -14
- package/dist/components/IconFileType.js +4 -14
- package/dist/components/InfiniteScroll.cjs +4 -4
- package/dist/components/InfiniteScroll.js +4 -4
- package/dist/components/InputFileButton.cjs +7 -7
- package/dist/components/InputFileButton.js +7 -7
- package/dist/components/ReadSheet.cjs +7 -32
- package/dist/components/ReadSheet.js +7 -32
- package/dist/components/Ring.cjs +10 -48
- package/dist/components/Ring.js +10 -48
- package/dist/components/ScrollMask.cjs +11 -97
- package/dist/components/ScrollMask.js +11 -97
- package/dist/components/SectionRing.cjs +15 -60
- package/dist/components/SectionRing.js +15 -60
- package/dist/components/TransitionBox.cjs +28 -118
- package/dist/components/TransitionBox.js +28 -118
- package/dist/components/TransitionNum.cjs +8 -8
- package/dist/components/TransitionNum.js +8 -8
- package/dist/components/Trapezium.cjs +9 -68
- package/dist/components/Trapezium.js +9 -68
- package/dist/components/Unify.cjs +19 -79
- package/dist/components/Unify.js +19 -79
- package/package.json +2 -2
|
@@ -56,13 +56,13 @@ const AutoFit = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((pr
|
|
|
56
56
|
setWidth((0, index_cjs_namespaceObject.px)(designWidth));
|
|
57
57
|
setHeight((0, index_cjs_namespaceObject.px)(contentRect.height / scale));
|
|
58
58
|
} else if ("vertical" === direction) {
|
|
59
|
-
const
|
|
60
|
-
setTransform(`scale(${
|
|
61
|
-
setWidth((0, index_cjs_namespaceObject.px)(contentRect.width /
|
|
59
|
+
const scale = contentRect.height / designHeight;
|
|
60
|
+
setTransform(`scale(${scale})`);
|
|
61
|
+
setWidth((0, index_cjs_namespaceObject.px)(contentRect.width / scale));
|
|
62
62
|
setHeight((0, index_cjs_namespaceObject.px)(designHeight));
|
|
63
63
|
} else {
|
|
64
|
-
const
|
|
65
|
-
setTransform(`translateX(${(contentRect.width - designWidth *
|
|
64
|
+
const scale = Math.min(contentRect.width / designWidth, contentRect.height / designHeight);
|
|
65
|
+
setTransform(`translateX(${(contentRect.width - designWidth * scale) / 2}px) translateY(${(contentRect.height - designHeight * scale) / 2}px) scale(${scale})`);
|
|
66
66
|
setWidth((0, index_cjs_namespaceObject.px)(designWidth));
|
|
67
67
|
setHeight((0, index_cjs_namespaceObject.px)(designHeight));
|
|
68
68
|
}
|
|
@@ -81,10 +81,10 @@ const AutoFit = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((pr
|
|
|
81
81
|
var _ele_current1;
|
|
82
82
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
83
83
|
var _ele_current;
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
const
|
|
87
|
-
if ("static" ===
|
|
84
|
+
const parent = null == (_ele_current = ele.current) ? void 0 : _ele_current.parentElement;
|
|
85
|
+
if (!parent) return;
|
|
86
|
+
const style = getComputedStyle(parent);
|
|
87
|
+
if ("static" === style.position) console.warn("AutoFit \u7EC4\u4EF6\u7684\u7236\u5143\u7D20\u7684 position \u5C5E\u6027\u4E0D\u5E94\u8BE5\u662F static");
|
|
88
88
|
}, [
|
|
89
89
|
null == (_ele_current1 = ele.current) ? void 0 : _ele_current1.parentElement
|
|
90
90
|
]);
|
|
@@ -28,13 +28,13 @@ const AutoFit = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
28
28
|
setWidth(px(designWidth));
|
|
29
29
|
setHeight(px(contentRect.height / scale));
|
|
30
30
|
} else if ("vertical" === direction) {
|
|
31
|
-
const
|
|
32
|
-
setTransform(`scale(${
|
|
33
|
-
setWidth(px(contentRect.width /
|
|
31
|
+
const scale = contentRect.height / designHeight;
|
|
32
|
+
setTransform(`scale(${scale})`);
|
|
33
|
+
setWidth(px(contentRect.width / scale));
|
|
34
34
|
setHeight(px(designHeight));
|
|
35
35
|
} else {
|
|
36
|
-
const
|
|
37
|
-
setTransform(`translateX(${(contentRect.width - designWidth *
|
|
36
|
+
const scale = Math.min(contentRect.width / designWidth, contentRect.height / designHeight);
|
|
37
|
+
setTransform(`translateX(${(contentRect.width - designWidth * scale) / 2}px) translateY(${(contentRect.height - designHeight * scale) / 2}px) scale(${scale})`);
|
|
38
38
|
setWidth(px(designWidth));
|
|
39
39
|
setHeight(px(designHeight));
|
|
40
40
|
}
|
|
@@ -53,10 +53,10 @@ const AutoFit = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
53
53
|
var _ele_current1;
|
|
54
54
|
useEffect(()=>{
|
|
55
55
|
var _ele_current;
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
const
|
|
59
|
-
if ("static" ===
|
|
56
|
+
const parent = null == (_ele_current = ele.current) ? void 0 : _ele_current.parentElement;
|
|
57
|
+
if (!parent) return;
|
|
58
|
+
const style = getComputedStyle(parent);
|
|
59
|
+
if ("static" === style.position) console.warn("AutoFit \u7EC4\u4EF6\u7684\u7236\u5143\u7D20\u7684 position \u5C5E\u6027\u4E0D\u5E94\u8BE5\u662F static");
|
|
60
60
|
}, [
|
|
61
61
|
null == (_ele_current1 = ele.current) ? void 0 : _ele_current1.parentElement
|
|
62
62
|
]);
|
|
@@ -69,8 +69,8 @@ const AutoScroll = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(
|
|
|
69
69
|
function listener(status) {
|
|
70
70
|
const { y } = status.offset;
|
|
71
71
|
const scrollToBottom = Math.abs(y + height - scrollHeight) / itemHeight <= 0.05;
|
|
72
|
-
const
|
|
73
|
-
scroll(
|
|
72
|
+
const target = scrollToBottom ? 0 : range.find((item)=>item > y);
|
|
73
|
+
scroll(target);
|
|
74
74
|
}
|
|
75
75
|
null == (_bar_current = bar.current) || _bar_current.addListener(listener);
|
|
76
76
|
return ()=>{
|
|
@@ -92,10 +92,10 @@ const AutoScroll = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(
|
|
|
92
92
|
pausedRef.current = true;
|
|
93
93
|
null == onMouseEnter || onMouseEnter(e);
|
|
94
94
|
}
|
|
95
|
-
function onContainerMouseLeave(
|
|
95
|
+
function onContainerMouseLeave(e) {
|
|
96
96
|
if (playOnMouseEnter) return;
|
|
97
97
|
pausedRef.current = false;
|
|
98
|
-
null == onMouseLeave || onMouseLeave(
|
|
98
|
+
null == onMouseLeave || onMouseLeave(e);
|
|
99
99
|
}
|
|
100
100
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Scroll_cjs_namespaceObject.Scroll, {
|
|
101
101
|
ref: ele,
|
|
@@ -41,8 +41,8 @@ const AutoScroll = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
41
41
|
function listener(status) {
|
|
42
42
|
const { y } = status.offset;
|
|
43
43
|
const scrollToBottom = Math.abs(y + height - scrollHeight) / itemHeight <= 0.05;
|
|
44
|
-
const
|
|
45
|
-
scroll(
|
|
44
|
+
const target = scrollToBottom ? 0 : range.find((item)=>item > y);
|
|
45
|
+
scroll(target);
|
|
46
46
|
}
|
|
47
47
|
null == (_bar_current = bar.current) || _bar_current.addListener(listener);
|
|
48
48
|
return ()=>{
|
|
@@ -64,10 +64,10 @@ const AutoScroll = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
64
64
|
pausedRef.current = true;
|
|
65
65
|
null == onMouseEnter || onMouseEnter(e);
|
|
66
66
|
}
|
|
67
|
-
function onContainerMouseLeave(
|
|
67
|
+
function onContainerMouseLeave(e) {
|
|
68
68
|
if (playOnMouseEnter) return;
|
|
69
69
|
pausedRef.current = false;
|
|
70
|
-
null == onMouseLeave || onMouseLeave(
|
|
70
|
+
null == onMouseLeave || onMouseLeave(e);
|
|
71
71
|
}
|
|
72
72
|
return /*#__PURE__*/ jsx(Scroll, {
|
|
73
73
|
ref: ele,
|
|
@@ -28,99 +28,41 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
AutoSizeTextArea: ()=>AutoSizeTextArea
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const compiler_runtime_namespaceObject = require("react/compiler-runtime");
|
|
32
31
|
const css_namespaceObject = require("@emotion/css");
|
|
33
32
|
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
34
33
|
const external_react_namespaceObject = require("react");
|
|
35
34
|
const index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
36
35
|
const AutoSizeTextArea = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
|
|
37
|
-
const
|
|
38
|
-
let className;
|
|
39
|
-
let rest;
|
|
40
|
-
let style;
|
|
41
|
-
if ($[0] !== props) {
|
|
42
|
-
({ className, style, ...rest } = props);
|
|
43
|
-
$[0] = props;
|
|
44
|
-
$[1] = className;
|
|
45
|
-
$[2] = rest;
|
|
46
|
-
$[3] = style;
|
|
47
|
-
} else {
|
|
48
|
-
className = $[1];
|
|
49
|
-
rest = $[2];
|
|
50
|
-
style = $[3];
|
|
51
|
-
}
|
|
36
|
+
const { className, style, ...rest } = props;
|
|
52
37
|
const [height, setHeight] = (0, external_react_namespaceObject.useState)(void 0);
|
|
53
38
|
const ele = (0, external_react_namespaceObject.useRef)(null);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let t3;
|
|
68
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
69
|
-
t2 = ()=>{
|
|
70
|
-
const textarea = ele.current;
|
|
71
|
-
const resizeTextarea = function() {
|
|
72
|
-
setHeight("auto");
|
|
73
|
-
setHeight((0, index_cjs_namespaceObject.px)(textarea.scrollHeight + textarea.offsetHeight - textarea.clientHeight));
|
|
74
|
-
};
|
|
75
|
-
resizeTextarea();
|
|
76
|
-
textarea.addEventListener("input", resizeTextarea);
|
|
77
|
-
textarea.addEventListener("change", resizeTextarea);
|
|
78
|
-
return ()=>{
|
|
79
|
-
textarea.removeEventListener("input", resizeTextarea);
|
|
80
|
-
textarea.removeEventListener("change", resizeTextarea);
|
|
81
|
-
};
|
|
39
|
+
(0, external_react_namespaceObject.useImperativeHandle)(ref, ()=>ele.current, []);
|
|
40
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
41
|
+
const textarea = ele.current;
|
|
42
|
+
function resizeTextarea() {
|
|
43
|
+
setHeight("auto");
|
|
44
|
+
setHeight((0, index_cjs_namespaceObject.px)(textarea.scrollHeight + textarea.offsetHeight - textarea.clientHeight));
|
|
45
|
+
}
|
|
46
|
+
resizeTextarea();
|
|
47
|
+
textarea.addEventListener("input", resizeTextarea);
|
|
48
|
+
textarea.addEventListener("change", resizeTextarea);
|
|
49
|
+
return ()=>{
|
|
50
|
+
textarea.removeEventListener("input", resizeTextarea);
|
|
51
|
+
textarea.removeEventListener("change", resizeTextarea);
|
|
82
52
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
t2 = $[6];
|
|
88
|
-
t3 = $[7];
|
|
89
|
-
}
|
|
90
|
-
(0, external_react_namespaceObject.useLayoutEffect)(t2, t3);
|
|
91
|
-
let t4;
|
|
92
|
-
if ($[8] !== className) {
|
|
93
|
-
t4 = (0, external_deepsea_tools_namespaceObject.clsx)((0, css_namespaceObject.css)`
|
|
53
|
+
}, []);
|
|
54
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
55
|
+
ref: ele,
|
|
56
|
+
className: (0, external_deepsea_tools_namespaceObject.clsx)((0, css_namespaceObject.css)`
|
|
94
57
|
height: var(--height);
|
|
95
58
|
resize: none;
|
|
96
59
|
overflow-y: hidden;
|
|
97
|
-
`, className)
|
|
98
|
-
|
|
99
|
-
$[9] = t4;
|
|
100
|
-
} else t4 = $[9];
|
|
101
|
-
let t5;
|
|
102
|
-
if ($[10] !== height || $[11] !== style) {
|
|
103
|
-
t5 = (0, index_cjs_namespaceObject.transformCSSVariable)({
|
|
60
|
+
`, className),
|
|
61
|
+
style: (0, index_cjs_namespaceObject.transformCSSVariable)({
|
|
104
62
|
height
|
|
105
|
-
}, style)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
$[12] = t5;
|
|
109
|
-
} else t5 = $[12];
|
|
110
|
-
let t6;
|
|
111
|
-
if ($[13] !== rest || $[14] !== t4 || $[15] !== t5) {
|
|
112
|
-
t6 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
113
|
-
ref: ele,
|
|
114
|
-
className: t4,
|
|
115
|
-
style: t5,
|
|
116
|
-
...rest
|
|
117
|
-
});
|
|
118
|
-
$[13] = rest;
|
|
119
|
-
$[14] = t4;
|
|
120
|
-
$[15] = t5;
|
|
121
|
-
$[16] = t6;
|
|
122
|
-
} else t6 = $[16];
|
|
123
|
-
return t6;
|
|
63
|
+
}, style),
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
124
66
|
});
|
|
125
67
|
exports.AutoSizeTextArea = __webpack_exports__.AutoSizeTextArea;
|
|
126
68
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -1,97 +1,39 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { css } from "@emotion/css";
|
|
5
4
|
import { clsx } from "deepsea-tools";
|
|
6
5
|
import { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
7
6
|
import { px, transformCSSVariable } from "../utils/index.js";
|
|
8
7
|
const AutoSizeTextArea = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
9
|
-
const
|
|
10
|
-
let className;
|
|
11
|
-
let rest;
|
|
12
|
-
let style;
|
|
13
|
-
if ($[0] !== props) {
|
|
14
|
-
({ className, style, ...rest } = props);
|
|
15
|
-
$[0] = props;
|
|
16
|
-
$[1] = className;
|
|
17
|
-
$[2] = rest;
|
|
18
|
-
$[3] = style;
|
|
19
|
-
} else {
|
|
20
|
-
className = $[1];
|
|
21
|
-
rest = $[2];
|
|
22
|
-
style = $[3];
|
|
23
|
-
}
|
|
8
|
+
const { className, style, ...rest } = props;
|
|
24
9
|
const [height, setHeight] = useState(void 0);
|
|
25
10
|
const ele = useRef(null);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
let t3;
|
|
40
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
-
t2 = ()=>{
|
|
42
|
-
const textarea = ele.current;
|
|
43
|
-
const resizeTextarea = function() {
|
|
44
|
-
setHeight("auto");
|
|
45
|
-
setHeight(px(textarea.scrollHeight + textarea.offsetHeight - textarea.clientHeight));
|
|
46
|
-
};
|
|
47
|
-
resizeTextarea();
|
|
48
|
-
textarea.addEventListener("input", resizeTextarea);
|
|
49
|
-
textarea.addEventListener("change", resizeTextarea);
|
|
50
|
-
return ()=>{
|
|
51
|
-
textarea.removeEventListener("input", resizeTextarea);
|
|
52
|
-
textarea.removeEventListener("change", resizeTextarea);
|
|
53
|
-
};
|
|
11
|
+
useImperativeHandle(ref, ()=>ele.current, []);
|
|
12
|
+
useLayoutEffect(()=>{
|
|
13
|
+
const textarea = ele.current;
|
|
14
|
+
function resizeTextarea() {
|
|
15
|
+
setHeight("auto");
|
|
16
|
+
setHeight(px(textarea.scrollHeight + textarea.offsetHeight - textarea.clientHeight));
|
|
17
|
+
}
|
|
18
|
+
resizeTextarea();
|
|
19
|
+
textarea.addEventListener("input", resizeTextarea);
|
|
20
|
+
textarea.addEventListener("change", resizeTextarea);
|
|
21
|
+
return ()=>{
|
|
22
|
+
textarea.removeEventListener("input", resizeTextarea);
|
|
23
|
+
textarea.removeEventListener("change", resizeTextarea);
|
|
54
24
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
t2 = $[6];
|
|
60
|
-
t3 = $[7];
|
|
61
|
-
}
|
|
62
|
-
useLayoutEffect(t2, t3);
|
|
63
|
-
let t4;
|
|
64
|
-
if ($[8] !== className) {
|
|
65
|
-
t4 = clsx(css`
|
|
25
|
+
}, []);
|
|
26
|
+
return /*#__PURE__*/ jsx("textarea", {
|
|
27
|
+
ref: ele,
|
|
28
|
+
className: clsx(css`
|
|
66
29
|
height: var(--height);
|
|
67
30
|
resize: none;
|
|
68
31
|
overflow-y: hidden;
|
|
69
|
-
`, className)
|
|
70
|
-
|
|
71
|
-
$[9] = t4;
|
|
72
|
-
} else t4 = $[9];
|
|
73
|
-
let t5;
|
|
74
|
-
if ($[10] !== height || $[11] !== style) {
|
|
75
|
-
t5 = transformCSSVariable({
|
|
32
|
+
`, className),
|
|
33
|
+
style: transformCSSVariable({
|
|
76
34
|
height
|
|
77
|
-
}, style)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
$[12] = t5;
|
|
81
|
-
} else t5 = $[12];
|
|
82
|
-
let t6;
|
|
83
|
-
if ($[13] !== rest || $[14] !== t4 || $[15] !== t5) {
|
|
84
|
-
t6 = /*#__PURE__*/ jsx("textarea", {
|
|
85
|
-
ref: ele,
|
|
86
|
-
className: t4,
|
|
87
|
-
style: t5,
|
|
88
|
-
...rest
|
|
89
|
-
});
|
|
90
|
-
$[13] = rest;
|
|
91
|
-
$[14] = t4;
|
|
92
|
-
$[15] = t5;
|
|
93
|
-
$[16] = t6;
|
|
94
|
-
} else t6 = $[16];
|
|
95
|
-
return t6;
|
|
35
|
+
}, style),
|
|
36
|
+
...rest
|
|
37
|
+
});
|
|
96
38
|
});
|
|
97
39
|
export { AutoSizeTextArea };
|
|
@@ -28,132 +28,36 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
CircleText: ()=>CircleText
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const compiler_runtime_namespaceObject = require("react/compiler-runtime");
|
|
32
31
|
const external_react_namespaceObject = require("react");
|
|
33
32
|
const CircleText = (props)=>{
|
|
34
|
-
const
|
|
35
|
-
let children;
|
|
36
|
-
let height;
|
|
37
|
-
let radius;
|
|
38
|
-
let rest;
|
|
39
|
-
let separator;
|
|
40
|
-
let style;
|
|
41
|
-
let t0;
|
|
42
|
-
let t1;
|
|
43
|
-
let t2;
|
|
44
|
-
let t3;
|
|
45
|
-
let t4;
|
|
46
|
-
let width;
|
|
47
|
-
if ($[0] !== props) {
|
|
48
|
-
({ width, height, radius, startAngel: t0, gapAngel: t1, align: t2, style, direction: t3, reverse: t4, separator, children, ...rest } = props);
|
|
49
|
-
$[0] = props;
|
|
50
|
-
$[1] = children;
|
|
51
|
-
$[2] = height;
|
|
52
|
-
$[3] = radius;
|
|
53
|
-
$[4] = rest;
|
|
54
|
-
$[5] = separator;
|
|
55
|
-
$[6] = style;
|
|
56
|
-
$[7] = t0;
|
|
57
|
-
$[8] = t1;
|
|
58
|
-
$[9] = t2;
|
|
59
|
-
$[10] = t3;
|
|
60
|
-
$[11] = t4;
|
|
61
|
-
$[12] = width;
|
|
62
|
-
} else {
|
|
63
|
-
children = $[1];
|
|
64
|
-
height = $[2];
|
|
65
|
-
radius = $[3];
|
|
66
|
-
rest = $[4];
|
|
67
|
-
separator = $[5];
|
|
68
|
-
style = $[6];
|
|
69
|
-
t0 = $[7];
|
|
70
|
-
t1 = $[8];
|
|
71
|
-
t2 = $[9];
|
|
72
|
-
t3 = $[10];
|
|
73
|
-
t4 = $[11];
|
|
74
|
-
width = $[12];
|
|
75
|
-
}
|
|
76
|
-
const startAngel = void 0 === t0 ? 0 : t0;
|
|
77
|
-
const gapAngel = void 0 === t1 ? 0 : t1;
|
|
78
|
-
const align = void 0 === t2 ? "center" : t2;
|
|
79
|
-
const direction = void 0 === t3 ? "outer" : t3;
|
|
80
|
-
const reverse = void 0 === t4 ? false : t4;
|
|
33
|
+
const { width, height, radius, startAngel = 0, gapAngel = 0, align = "center", style, direction = "outer", reverse = false, separator, children, ...rest } = props;
|
|
81
34
|
const unitAngle = 2 * Math.atan(width / 2 / radius);
|
|
82
35
|
const totalAngle = (unitAngle + gapAngel) * children.length - gapAngel;
|
|
83
36
|
const offsetAngle = "left" === align ? 0 : "right" === align ? totalAngle : totalAngle / 2;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const z = Math.PI / 2 - angle + ("inner" === direction ? Math.PI : 0);
|
|
91
|
-
return `translateX(${x}px) translateY(${y}px) rotateZ(${z / Math.PI * 180}deg)`;
|
|
92
|
-
};
|
|
93
|
-
$[13] = direction;
|
|
94
|
-
$[14] = gapAngel;
|
|
95
|
-
$[15] = height;
|
|
96
|
-
$[16] = offsetAngle;
|
|
97
|
-
$[17] = radius;
|
|
98
|
-
$[18] = startAngel;
|
|
99
|
-
$[19] = unitAngle;
|
|
100
|
-
$[20] = width;
|
|
101
|
-
$[21] = t5;
|
|
102
|
-
} else t5 = $[21];
|
|
103
|
-
const getTransform = t5;
|
|
104
|
-
let T0;
|
|
105
|
-
let t6;
|
|
106
|
-
if ($[22] !== children || $[23] !== getTransform || $[24] !== height || $[25] !== rest || $[26] !== reverse || $[27] !== separator || $[28] !== style || $[29] !== width) {
|
|
107
|
-
const words = "function" == typeof separator ? separator(children) : children.split(separator ?? "");
|
|
108
|
-
if (reverse) words.reverse();
|
|
109
|
-
T0 = external_react_namespaceObject.Fragment;
|
|
110
|
-
let t7;
|
|
111
|
-
if ($[32] !== getTransform || $[33] !== height || $[34] !== rest || $[35] !== style || $[36] !== width) {
|
|
112
|
-
t7 = (w, idx_0)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
113
|
-
style: {
|
|
114
|
-
position: "absolute",
|
|
115
|
-
...style,
|
|
116
|
-
transform: getTransform(idx_0),
|
|
117
|
-
textAlign: "center",
|
|
118
|
-
width,
|
|
119
|
-
lineHeight: `${height}px`,
|
|
120
|
-
height
|
|
121
|
-
},
|
|
122
|
-
...rest,
|
|
123
|
-
children: w
|
|
124
|
-
}, idx_0);
|
|
125
|
-
$[32] = getTransform;
|
|
126
|
-
$[33] = height;
|
|
127
|
-
$[34] = rest;
|
|
128
|
-
$[35] = style;
|
|
129
|
-
$[36] = width;
|
|
130
|
-
$[37] = t7;
|
|
131
|
-
} else t7 = $[37];
|
|
132
|
-
t6 = words.map(t7);
|
|
133
|
-
$[22] = children;
|
|
134
|
-
$[23] = getTransform;
|
|
135
|
-
$[24] = height;
|
|
136
|
-
$[25] = rest;
|
|
137
|
-
$[26] = reverse;
|
|
138
|
-
$[27] = separator;
|
|
139
|
-
$[28] = style;
|
|
140
|
-
$[29] = width;
|
|
141
|
-
$[30] = T0;
|
|
142
|
-
$[31] = t6;
|
|
143
|
-
} else {
|
|
144
|
-
T0 = $[30];
|
|
145
|
-
t6 = $[31];
|
|
37
|
+
function getTransform(idx) {
|
|
38
|
+
const angle = startAngel - idx * (unitAngle + gapAngel) + offsetAngle - unitAngle / 2;
|
|
39
|
+
const x = (radius + height / 2) * Math.cos(angle) - width / 2;
|
|
40
|
+
const y = (radius + height / 2) * Math.sin(angle) * -1 - height / 2;
|
|
41
|
+
const z = Math.PI / 2 - angle + ("inner" === direction ? Math.PI : 0);
|
|
42
|
+
return `translateX(${x}px) translateY(${y}px) rotateZ(${z / Math.PI * 180}deg)`;
|
|
146
43
|
}
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
44
|
+
const words = "function" == typeof separator ? separator(children) : children.split(separator ?? "");
|
|
45
|
+
if (reverse) words.reverse();
|
|
46
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment, {
|
|
47
|
+
children: words.map((w, idx)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
48
|
+
style: {
|
|
49
|
+
position: "absolute",
|
|
50
|
+
...style,
|
|
51
|
+
transform: getTransform(idx),
|
|
52
|
+
textAlign: "center",
|
|
53
|
+
width,
|
|
54
|
+
lineHeight: `${height}px`,
|
|
55
|
+
height: height
|
|
56
|
+
},
|
|
57
|
+
...rest,
|
|
58
|
+
children: w
|
|
59
|
+
}, idx))
|
|
60
|
+
});
|
|
157
61
|
};
|
|
158
62
|
exports.CircleText = __webpack_exports__.CircleText;
|
|
159
63
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|