@ccs-ui/rc-pro 1.1.24-beta-19 → 1.1.25-beta-1
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/es/aj-captcha/index.js +40 -9
- package/es/aj-captcha/index.less +0 -7
- package/package.json +2 -2
package/es/aj-captcha/index.js
CHANGED
|
@@ -14,14 +14,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
15
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import { Button, Modal, Spin } from 'antd';
|
|
18
|
-
import "./index.less";
|
|
17
|
+
import { Button, Modal, Spin, theme } from 'antd';
|
|
19
18
|
import { useEffect, useRef, useState } from 'react';
|
|
20
19
|
import { CloseOutlined, LeftOutlined, LoadingOutlined, ReloadOutlined, RightOutlined } from '@ant-design/icons';
|
|
21
20
|
import { useEventListener } from 'ahooks';
|
|
21
|
+
import "./index.less";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
+
var useToken = theme.useToken;
|
|
25
26
|
function ShowMsg(_ref) {
|
|
26
27
|
var msg = _ref.msg;
|
|
27
28
|
var _useState = useState(true),
|
|
@@ -47,6 +48,7 @@ function AjCaptchaSliding(_ref2) {
|
|
|
47
48
|
onCancel = _ref2.onCancel,
|
|
48
49
|
onRefresh = _ref2.onRefresh;
|
|
49
50
|
var sliderBarRef = useRef(null);
|
|
51
|
+
var sliderRef = useRef(null);
|
|
50
52
|
var sliderImgRef = useRef(null);
|
|
51
53
|
var moveRef = useRef({
|
|
52
54
|
start: false,
|
|
@@ -89,7 +91,7 @@ function AjCaptchaSliding(_ref2) {
|
|
|
89
91
|
onChangePosition(offsetX);
|
|
90
92
|
}
|
|
91
93
|
}, {
|
|
92
|
-
target:
|
|
94
|
+
target: sliderRef
|
|
93
95
|
});
|
|
94
96
|
|
|
95
97
|
// 结束
|
|
@@ -102,15 +104,20 @@ function AjCaptchaSliding(_ref2) {
|
|
|
102
104
|
}, 'sliding');
|
|
103
105
|
moveRef.current.start = false;
|
|
104
106
|
}, {
|
|
105
|
-
target:
|
|
107
|
+
target: sliderRef
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
// 离开
|
|
109
|
-
useEventListener(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
111
|
+
// useEventListener(
|
|
112
|
+
// 'mouseleave',
|
|
113
|
+
// () => {
|
|
114
|
+
// moveRef.current.start = false;
|
|
115
|
+
// },
|
|
116
|
+
// { target: sliderBarRef },
|
|
117
|
+
// );
|
|
118
|
+
|
|
119
|
+
var _useToken = useToken(),
|
|
120
|
+
token = _useToken.token;
|
|
114
121
|
return /*#__PURE__*/_jsxs(Spin, {
|
|
115
122
|
indicator: /*#__PURE__*/_jsx(LoadingOutlined, {
|
|
116
123
|
style: {
|
|
@@ -120,6 +127,9 @@ function AjCaptchaSliding(_ref2) {
|
|
|
120
127
|
spinning: loadingImg,
|
|
121
128
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
122
129
|
className: "ccs-aj-body",
|
|
130
|
+
style: {
|
|
131
|
+
background: token.colorBgContainerDisabled
|
|
132
|
+
},
|
|
123
133
|
children: [/*#__PURE__*/_jsx("img", {
|
|
124
134
|
className: "ccs-aj-bg",
|
|
125
135
|
src: bgImg ? "data:image/png;base64,".concat(bgImg) : undefined,
|
|
@@ -151,12 +161,23 @@ function AjCaptchaSliding(_ref2) {
|
|
|
151
161
|
})]
|
|
152
162
|
}), /*#__PURE__*/_jsxs("div", {
|
|
153
163
|
className: "ccs-aj-slider",
|
|
164
|
+
ref: sliderRef,
|
|
165
|
+
style: {
|
|
166
|
+
background: token.colorBgElevated
|
|
167
|
+
},
|
|
154
168
|
children: [/*#__PURE__*/_jsx("div", {
|
|
155
169
|
className: "ccs-aj-slider-track",
|
|
170
|
+
style: {
|
|
171
|
+
background: token.colorBgContainerDisabled
|
|
172
|
+
},
|
|
156
173
|
children: "\u6309\u4F4F\u6ED1\u5757\uFF0C\u62D6\u52A8\u5B8C\u6210\u4E0A\u65B9\u62FC\u56FE"
|
|
157
174
|
}), /*#__PURE__*/_jsx("div", {
|
|
158
175
|
className: "ccs-aj-slider-bar",
|
|
159
176
|
ref: sliderBarRef,
|
|
177
|
+
style: {
|
|
178
|
+
backgroundColor: token.colorBgBase,
|
|
179
|
+
border: "1px solid ".concat(token.colorBorder)
|
|
180
|
+
},
|
|
160
181
|
children: loadingValid ? /*#__PURE__*/_jsx(LoadingOutlined, {}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
161
182
|
children: [/*#__PURE__*/_jsx(LeftOutlined, {}), /*#__PURE__*/_jsx(RightOutlined, {})]
|
|
162
183
|
})
|
|
@@ -196,6 +217,9 @@ function AjCaptchaWord(_ref3) {
|
|
|
196
217
|
onValid(points, 'wordSelect');
|
|
197
218
|
}
|
|
198
219
|
}, [points.length]);
|
|
220
|
+
var _useToken2 = useToken(),
|
|
221
|
+
token = _useToken2.token;
|
|
222
|
+
console.log('token', token);
|
|
199
223
|
return /*#__PURE__*/_jsxs(Spin, {
|
|
200
224
|
indicator: /*#__PURE__*/_jsx(LoadingOutlined, {
|
|
201
225
|
style: {
|
|
@@ -205,6 +229,9 @@ function AjCaptchaWord(_ref3) {
|
|
|
205
229
|
spinning: loadingImg || loadingValid,
|
|
206
230
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
207
231
|
className: "ccs-aj-body",
|
|
232
|
+
style: {
|
|
233
|
+
background: token.colorBgContainerDisabled
|
|
234
|
+
},
|
|
208
235
|
children: [/*#__PURE__*/_jsx("img", {
|
|
209
236
|
ref: bgImgRef,
|
|
210
237
|
className: "ccs-aj-bg",
|
|
@@ -239,6 +266,10 @@ function AjCaptchaWord(_ref3) {
|
|
|
239
266
|
})]
|
|
240
267
|
}), /*#__PURE__*/_jsxs("div", {
|
|
241
268
|
className: "ccs-aj-word-slider",
|
|
269
|
+
style: {
|
|
270
|
+
color: token.colorTextLabel,
|
|
271
|
+
border: "1px solid ".concat(token.colorTextLabel)
|
|
272
|
+
},
|
|
242
273
|
children: ["\u8BF7\u4F9D\u6B21\u70B9\u51FB\u3010", words === null || words === void 0 ? void 0 : words.join(', '), "\u3011"]
|
|
243
274
|
})]
|
|
244
275
|
});
|
package/es/aj-captcha/index.less
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
|
|
18
18
|
.ccs-aj-body {
|
|
19
19
|
position: relative;
|
|
20
|
-
background-color: #f5f6f7;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
.ccs-aj-btn {
|
|
@@ -48,13 +47,11 @@
|
|
|
48
47
|
.ccs-aj-slider {
|
|
49
48
|
position: relative;
|
|
50
49
|
height: 40px;
|
|
51
|
-
background-color: #fff;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
.ccs-aj-slider-track {
|
|
55
53
|
height: 30px;
|
|
56
54
|
margin-top: 10px;
|
|
57
|
-
background-color: #f5f6f7;
|
|
58
55
|
text-align: center;
|
|
59
56
|
line-height: 30px;
|
|
60
57
|
border-radius: 15px;
|
|
@@ -66,16 +63,12 @@
|
|
|
66
63
|
width: 40px;
|
|
67
64
|
position: absolute;
|
|
68
65
|
bottom: 5px;
|
|
69
|
-
background: #fff;
|
|
70
66
|
border-radius: 50%;
|
|
71
67
|
display: flex;
|
|
72
68
|
align-items: center;
|
|
73
69
|
justify-content: center;
|
|
74
70
|
color: gray;
|
|
75
71
|
font-size: 12px;
|
|
76
|
-
box-shadow: 0 0 3px #ccc;
|
|
77
|
-
background-color: #f5f6f7;
|
|
78
|
-
border: 1px solid #e1e1e1;
|
|
79
72
|
cursor: move;
|
|
80
73
|
|
|
81
74
|
&:hover {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccs-ui/rc-pro",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.25-beta-1",
|
|
4
|
+
"description": "验证码组件兼容暗黑模式;",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hong",
|