@ccs-ui/rc-pro 1.1.24-beta-16 → 1.1.24-beta-18
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.
|
@@ -1,17 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ButtonProps } from 'antd';
|
|
2
|
-
type
|
|
3
|
+
export type IntervalBtnInstance = {
|
|
4
|
+
onStart: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<ButtonProps & {
|
|
3
7
|
/** 计时数 */
|
|
4
|
-
num?: number;
|
|
8
|
+
num?: number | undefined;
|
|
5
9
|
/** 包含字符串`num`的文本内容 */
|
|
6
|
-
disabledText?: string;
|
|
10
|
+
disabledText?: string | undefined;
|
|
7
11
|
/** 缓存key */
|
|
8
|
-
cacheKey?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
* 倒计时按钮组件
|
|
12
|
-
* @param PropsType
|
|
13
|
-
* @param IntervalInstance
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
declare function IntervalButton({ num, cacheKey, disabledText, children, ...restProps }: CcsIntervalButton): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
-
export default IntervalButton;
|
|
12
|
+
cacheKey?: string | undefined;
|
|
13
|
+
} & import("react").RefAttributes<IntervalBtnInstance>>;
|
|
14
|
+
export default _default;
|
|
@@ -18,7 +18,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
18
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
19
|
import { useInterval } from 'ahooks';
|
|
20
20
|
import { Button } from 'antd';
|
|
21
|
-
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
21
|
+
import { forwardRef, useImperativeHandle, useLayoutEffect, useMemo, useState } from 'react';
|
|
22
22
|
import { CcsUtils } from "../";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
/**
|
|
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
27
27
|
* @param IntervalInstance
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
function IntervalButton(_ref) {
|
|
30
|
+
function IntervalButton(_ref, ref) {
|
|
31
31
|
var _ref$num = _ref.num,
|
|
32
32
|
num = _ref$num === void 0 ? 60 : _ref$num,
|
|
33
33
|
cacheKey = _ref.cacheKey,
|
|
@@ -99,6 +99,8 @@ function IntervalButton(_ref) {
|
|
|
99
99
|
immediate: true
|
|
100
100
|
});
|
|
101
101
|
var disabled = count !== 0 && count !== num;
|
|
102
|
+
|
|
103
|
+
// 开始计时
|
|
102
104
|
var onStart = function onStart() {
|
|
103
105
|
setCodeInterval(1000);
|
|
104
106
|
if (key) {
|
|
@@ -108,12 +110,17 @@ function IntervalButton(_ref) {
|
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
};
|
|
113
|
+
useImperativeHandle(ref, function () {
|
|
114
|
+
return {
|
|
115
|
+
onStart: onStart
|
|
116
|
+
};
|
|
117
|
+
});
|
|
111
118
|
return count === -1 ? null : /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
112
119
|
type: "primary"
|
|
113
120
|
}, restProps), {}, {
|
|
114
|
-
onClick: onStart,
|
|
121
|
+
onClick: restProps.onClick ? restProps.onClick : onStart,
|
|
115
122
|
disabled: restProps.disabled ? true : disabled,
|
|
116
123
|
children: disabled ? "".concat(count, "\u79D2").concat(disabledText) : "".concat(children)
|
|
117
124
|
}));
|
|
118
125
|
}
|
|
119
|
-
export default IntervalButton;
|
|
126
|
+
export default /*#__PURE__*/forwardRef(IntervalButton);
|
package/es/pro-table/table.js
CHANGED
|
@@ -56,7 +56,7 @@ var onTableInTabItem = function onTableInTabItem(node) {
|
|
|
56
56
|
var parent = node.parentNode;
|
|
57
57
|
if (!parent) return false;
|
|
58
58
|
if ( // 通过指定dom吸顶
|
|
59
|
-
(_parent$classList6 = parent.classList) !== null && _parent$classList6 !== void 0 && _parent$classList6.contains('ccs-table-')) {
|
|
59
|
+
(_parent$classList6 = parent.classList) !== null && _parent$classList6 !== void 0 && _parent$classList6.contains('ccs-table-item-scroll')) {
|
|
60
60
|
return {
|
|
61
61
|
getContainer: function getContainer() {
|
|
62
62
|
return node;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccs-ui/rc-pro",
|
|
3
|
-
"version": "1.1.24-beta-
|
|
4
|
-
"description": "修复table双滚动条问题;修复modal按钮无间距问题;修改antd组件过期参数使用问题;修复ccs date-picker插件bug;colorful
|
|
3
|
+
"version": "1.1.24-beta-18",
|
|
4
|
+
"description": "修复table双滚动条问题;修复modal按钮无间距问题;修改antd组件过期参数使用问题;修复ccs date-picker插件bug;colorful 主题组件样式调整;添加单页布局模式;倒计时按钮组件添加实例方法",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hong",
|