@teamix/pro 1.5.11-beta.1 → 1.5.11
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/pro.css +1 -1
- package/dist/pro.js +465 -96
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/index.d.ts +2 -2
- package/es/actions/index.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +1 -1
- package/es/sidebar/index.d.ts +2 -2
- package/es/sidebar/index.js +1 -1
- package/es/sidebar/utils/index.d.ts +2 -2
- package/es/skeleton/index.d.ts +2 -3
- package/es/skeleton/index.js +1 -2
- package/es/table/components/ToolBar/FilterColumnIcon.js +28 -23
- package/es/table/components/ToolBar/RefreshIcon.js +162 -24
- package/es/table/components/ToolBar/index.scss +17 -0
- package/es/table/index.d.ts +2 -3
- package/es/table/index.js +64 -25
- package/es/table/typing.d.ts +17 -3
- package/es/timeline/ProTimeLineItem/index.js +1 -1
- package/lib/actions/index.d.ts +2 -2
- package/lib/actions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +1 -1
- package/lib/sidebar/index.d.ts +2 -2
- package/lib/sidebar/index.js +1 -1
- package/lib/sidebar/utils/index.d.ts +2 -2
- package/lib/skeleton/index.d.ts +2 -3
- package/lib/skeleton/index.js +1 -3
- package/lib/table/components/ToolBar/FilterColumnIcon.js +27 -22
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -27
- package/lib/table/components/ToolBar/index.scss +17 -0
- package/lib/table/index.d.ts +2 -3
- package/lib/table/index.js +63 -24
- package/lib/table/typing.d.ts +17 -3
- package/lib/timeline/ProTimeLineItem/index.js +1 -1
- package/package.json +1 -1
package/es/actions/index.d.ts
CHANGED
@@ -77,8 +77,8 @@ export declare type ProActionGroupProps = {
|
|
77
77
|
icon?: React.ReactNode;
|
78
78
|
} & React.HTMLAttributes<HTMLElement>;
|
79
79
|
export declare function ProActionGroup(props: ProActionGroupProps): JSX.Element;
|
80
|
-
declare const
|
81
|
-
export default
|
80
|
+
declare const ProAction: (props: ProActionProps) => JSX.Element;
|
81
|
+
export default ProAction;
|
82
82
|
export * from './quick';
|
83
83
|
/**
|
84
84
|
* @deprecated 建议使用 ProActionGroup 代替
|
package/es/actions/index.js
CHANGED
@@ -420,7 +420,7 @@ export function ProActionGroup(props) {
|
|
420
420
|
var ProAction = function ProAction(props) {
|
421
421
|
return renderCommonActionButton(props);
|
422
422
|
};
|
423
|
-
export default
|
423
|
+
export default ProAction;
|
424
424
|
export * from './quick';
|
425
425
|
/**
|
426
426
|
* @deprecated 建议使用 ProActionGroup 代替
|
package/es/index.d.ts
CHANGED
@@ -28,5 +28,5 @@ export * from './table';
|
|
28
28
|
export * from './sidebar';
|
29
29
|
export * from './utils';
|
30
30
|
export * from './timeline';
|
31
|
-
declare const version = "1.5.
|
31
|
+
declare const version = "1.5.11";
|
32
32
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -54,8 +54,8 @@ export declare type ProPageHeaderProps = {
|
|
54
54
|
/** 切换 tabs */
|
55
55
|
tabs?: CapsuleTabType;
|
56
56
|
} & Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
|
57
|
-
declare const
|
58
|
-
export default
|
57
|
+
declare const ProPageHeader: React.FC<ProPageHeaderProps>;
|
58
|
+
export default ProPageHeader;
|
59
59
|
/**
|
60
60
|
* @deprecated 建议使用 ProPageHeaderBreadcrumbItem 代替
|
61
61
|
*/
|
package/es/page-header/index.js
CHANGED
@@ -215,4 +215,4 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
215
215
|
className: classnames(cls('section'), cls('info'))
|
216
216
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, !loading && renderInfo(info), loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Header, null))), children);
|
217
217
|
};
|
218
|
-
export default
|
218
|
+
export default ProPageHeader;
|
package/es/sidebar/index.d.ts
CHANGED
@@ -4,6 +4,6 @@ import { ProSidebarProps } from './typing';
|
|
4
4
|
export * from './typing';
|
5
5
|
export * from './utils';
|
6
6
|
import ProIconSwitch from './components/tree-node/components/IconSwitch';
|
7
|
-
declare const
|
8
|
-
export default
|
7
|
+
declare const ProSidebar: React.FC<ProSidebarProps>;
|
8
|
+
export default ProSidebar;
|
9
9
|
export { ProIconSwitch };
|
package/es/sidebar/index.js
CHANGED
@@ -118,7 +118,7 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
118
118
|
style?: import("react").CSSProperties | undefined;
|
119
119
|
tabIndex?: number | undefined;
|
120
120
|
title?: string | undefined;
|
121
|
-
translate?: "
|
121
|
+
translate?: "yes" | "no" | undefined;
|
122
122
|
radioGroup?: string | undefined;
|
123
123
|
role?: import("react").AriaRole | undefined;
|
124
124
|
about?: string | undefined;
|
@@ -141,7 +141,7 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
141
141
|
results?: number | undefined;
|
142
142
|
security?: string | undefined;
|
143
143
|
unselectable?: "on" | "off" | undefined;
|
144
|
-
inputMode?: "url" | "none" | "text" | "search" | "
|
144
|
+
inputMode?: "url" | "none" | "text" | "search" | "tel" | "email" | "numeric" | "decimal" | undefined;
|
145
145
|
is?: string | undefined;
|
146
146
|
'aria-activedescendant'?: string | undefined;
|
147
147
|
'aria-atomic'?: (boolean | "false" | "true") | undefined;
|
package/es/skeleton/index.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import
|
1
|
+
import ProSkeleton from '@teamix/pro-skeleton';
|
2
2
|
export * from '@teamix/pro-skeleton';
|
3
|
-
|
4
|
-
export default _default;
|
3
|
+
export default ProSkeleton;
|
package/es/skeleton/index.js
CHANGED
@@ -18,7 +18,7 @@ import { Button, Dropdown, Menu, Dialog, Grid, Checkbox } from '@alicloudfe/comp
|
|
18
18
|
import TeamixIcon from '@teamix/icon';
|
19
19
|
import { usePrefixCls, getMessage, getGlobalConfig } from '@teamix/utils';
|
20
20
|
import React, { useState, useEffect } from 'react';
|
21
|
-
import {
|
21
|
+
import { off, on } from '../../utils';
|
22
22
|
import { Ellipsis } from '../../../field';
|
23
23
|
import './index.scss';
|
24
24
|
var CheckboxItem = Menu.CheckboxItem;
|
@@ -80,9 +80,11 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
80
80
|
var showDataIndex = stateFilterColumns.map(function (item) {
|
81
81
|
return item.dataIndex;
|
82
82
|
});
|
83
|
-
var stateColumns =
|
83
|
+
var stateColumns = processColumns(columns).map(function (item) {
|
84
84
|
if (!showDataIndex.includes(item.dataIndex)) {
|
85
|
-
item
|
85
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
86
|
+
columnFilters: false
|
87
|
+
});
|
86
88
|
}
|
87
89
|
return item;
|
88
90
|
});
|
@@ -103,11 +105,11 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
103
105
|
// 全选
|
104
106
|
var onChangeAllColumns = function onChangeAllColumns(check) {
|
105
107
|
setAllVisible(check);
|
106
|
-
var keyNewColumns =
|
107
|
-
keyNewColumns.map(function (item) {
|
108
|
+
var keyNewColumns = newColumns.map(function (item) {
|
108
109
|
var _item$columnFiltersDi;
|
109
|
-
|
110
|
-
|
110
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
111
|
+
columnFilters: (_item$columnFiltersDi = item.columnFiltersDisabled) !== null && _item$columnFiltersDi !== void 0 ? _item$columnFiltersDi : check
|
112
|
+
});
|
111
113
|
});
|
112
114
|
notifyTableRender(keyNewColumns);
|
113
115
|
};
|
@@ -119,10 +121,12 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
119
121
|
};
|
120
122
|
// 修改
|
121
123
|
var onChangeColumns = function onChangeColumns(check, dataIndex) {
|
122
|
-
var keyNewColumns =
|
123
|
-
keyNewColumns.map(function (item) {
|
124
|
+
var keyNewColumns = newColumns.map(function (item) {
|
124
125
|
if (item.dataIndex === dataIndex) {
|
125
126
|
item.columnFilters = check;
|
127
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
128
|
+
columnFilters: check
|
129
|
+
});
|
126
130
|
}
|
127
131
|
return item;
|
128
132
|
});
|
@@ -130,26 +134,25 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
130
134
|
};
|
131
135
|
// 修改:dialog
|
132
136
|
var onChangeColumnsForDialog = function onChangeColumnsForDialog() {
|
133
|
-
|
134
|
-
notifyTableRender(keyNewColumns);
|
137
|
+
notifyTableRender(newColumns);
|
135
138
|
setDropdownVisible(false);
|
136
139
|
};
|
137
140
|
// 向上
|
138
141
|
var moveUp = function moveUp(e, dataIndex) {
|
139
142
|
var _newColumns$filter, _newColumns$filter2;
|
140
143
|
e.stopPropagation();
|
141
|
-
var keyNewColumns =
|
144
|
+
var keyNewColumns = _toConsumableArray(newColumns).filter(function (_ref) {
|
142
145
|
var lock = _ref.lock;
|
143
146
|
return !lock;
|
144
147
|
});
|
145
|
-
var headLock =
|
148
|
+
var headLock = (_newColumns$filter = newColumns.filter(function (_ref2) {
|
146
149
|
var lock = _ref2.lock;
|
147
150
|
return lock === true || lock === 'left';
|
148
|
-
})) !== null && _newColumns$filter !== void 0 ? _newColumns$filter : []
|
149
|
-
var tailLock =
|
151
|
+
})) !== null && _newColumns$filter !== void 0 ? _newColumns$filter : [];
|
152
|
+
var tailLock = (_newColumns$filter2 = newColumns.filter(function (_ref3) {
|
150
153
|
var lock = _ref3.lock;
|
151
154
|
return lock === 'right';
|
152
|
-
})) !== null && _newColumns$filter2 !== void 0 ? _newColumns$filter2 : []
|
155
|
+
})) !== null && _newColumns$filter2 !== void 0 ? _newColumns$filter2 : [];
|
153
156
|
var index = keyNewColumns.findIndex(function (_ref4) {
|
154
157
|
var index = _ref4.dataIndex;
|
155
158
|
return index === dataIndex;
|
@@ -165,18 +168,18 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
165
168
|
var moveDown = function moveDown(e, dataIndex) {
|
166
169
|
var _newColumns$filter3, _newColumns$filter4;
|
167
170
|
e.stopPropagation();
|
168
|
-
var keyNewColumns =
|
171
|
+
var keyNewColumns = _toConsumableArray(newColumns).filter(function (_ref5) {
|
169
172
|
var lock = _ref5.lock;
|
170
173
|
return !lock;
|
171
174
|
});
|
172
|
-
var headLock =
|
175
|
+
var headLock = (_newColumns$filter3 = newColumns.filter(function (_ref6) {
|
173
176
|
var lock = _ref6.lock;
|
174
177
|
return lock === true || lock === 'left';
|
175
|
-
})) !== null && _newColumns$filter3 !== void 0 ? _newColumns$filter3 : []
|
176
|
-
var tailLock =
|
178
|
+
})) !== null && _newColumns$filter3 !== void 0 ? _newColumns$filter3 : [];
|
179
|
+
var tailLock = (_newColumns$filter4 = newColumns.filter(function (_ref7) {
|
177
180
|
var lock = _ref7.lock;
|
178
181
|
return lock === 'right';
|
179
|
-
})) !== null && _newColumns$filter4 !== void 0 ? _newColumns$filter4 : []
|
182
|
+
})) !== null && _newColumns$filter4 !== void 0 ? _newColumns$filter4 : [];
|
180
183
|
var index = keyNewColumns.findIndex(function (_ref8) {
|
181
184
|
var index = _ref8.dataIndex;
|
182
185
|
return index === dataIndex;
|
@@ -329,9 +332,11 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
329
332
|
return key === dataIndex;
|
330
333
|
})) === null || _newColumns$find2 === void 0 ? void 0 : _newColumns$find2.columnFilters,
|
331
334
|
onChange: function onChange(check) {
|
332
|
-
var columnsList =
|
335
|
+
var columnsList = newColumns.map(function (item) {
|
333
336
|
if (item.dataIndex === dataIndex) {
|
334
|
-
item
|
337
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
338
|
+
columnFilters: check
|
339
|
+
});
|
335
340
|
}
|
336
341
|
return item;
|
337
342
|
});
|
@@ -1,41 +1,179 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
4
|
+
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; }
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
1
7
|
/**
|
2
8
|
* 刷新
|
3
9
|
*/
|
4
|
-
import { Button, Balloon } from '@alicloudfe/components';
|
10
|
+
import { Button, Balloon, Menu, Dropdown } from '@alicloudfe/components';
|
5
11
|
import TeamixIcon from '@teamix/icon';
|
6
12
|
import { usePrefixCls, getMessage } from '@teamix/utils';
|
7
|
-
import React from 'react';
|
13
|
+
import React, { useEffect, useRef, useState } from 'react';
|
14
|
+
import { on } from '../../utils';
|
8
15
|
import './index.scss';
|
9
16
|
var cls = usePrefixCls('teamix-pro-table-toolbar-icon');
|
10
17
|
var LayoutIcon = function LayoutIcon(props) {
|
11
|
-
var
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
//
|
26
|
-
|
18
|
+
var _autoRefreshProps$dat;
|
19
|
+
var actionRef = props.actionRef,
|
20
|
+
autoRefresh = props.autoRefresh,
|
21
|
+
autoRefreshProps = props.autoRefreshProps;
|
22
|
+
var autoRefreshRadio = (_autoRefreshProps$dat = autoRefreshProps === null || autoRefreshProps === void 0 ? void 0 : autoRefreshProps.dataSource) !== null && _autoRefreshProps$dat !== void 0 ? _autoRefreshProps$dat : [{
|
23
|
+
label: '每 1 分钟',
|
24
|
+
value: 60000
|
25
|
+
}, {
|
26
|
+
label: '每 3 分钟',
|
27
|
+
value: 180000
|
28
|
+
}, {
|
29
|
+
label: '每 5 分钟',
|
30
|
+
value: 300000
|
31
|
+
}];
|
32
|
+
// dropdown 开关
|
33
|
+
var _useState = useState(false),
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
35
|
+
dropdownVisible = _useState2[0],
|
36
|
+
setDropdownVisible = _useState2[1];
|
37
|
+
// 自动刷新状态
|
38
|
+
var _useState3 = useState(!!autoRefresh),
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
40
|
+
autoRefreshVisible = _useState4[0],
|
41
|
+
setAutoRefreshVisible = _useState4[1];
|
42
|
+
// 间隔时间 ms
|
43
|
+
var _useState5 = useState(60000),
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
45
|
+
times = _useState6[0],
|
46
|
+
setTimes = _useState6[1];
|
47
|
+
// 展示计时器时间 s
|
48
|
+
var _useState7 = useState(60),
|
49
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
50
|
+
remainTime = _useState8[0],
|
51
|
+
setRemainTime = _useState8[1];
|
52
|
+
// 循环计时器
|
53
|
+
var timerRef = useRef({
|
54
|
+
timer: undefined,
|
55
|
+
remain: 60
|
56
|
+
});
|
57
|
+
useEffect(function () {
|
58
|
+
on(function (timer) {
|
59
|
+
setTimes(timer);
|
60
|
+
timerRef.current.remain = timer / 1000;
|
61
|
+
if (timerRef.current.timer) {
|
62
|
+
clearInterval(timerRef.current.timer);
|
63
|
+
timerRef.current.timer = undefined;
|
64
|
+
}
|
65
|
+
timerRef.current.timer = setInterval(function () {
|
66
|
+
var remainTime = timerRef.current.remain - 1;
|
67
|
+
if (remainTime >= 0) {
|
68
|
+
setRemainTime(remainTime);
|
69
|
+
timerRef.current.remain = remainTime;
|
70
|
+
}
|
71
|
+
}, 1000);
|
72
|
+
}, 'PRO_TABLE_REFRESH_TIMER_FLAG');
|
73
|
+
}, []);
|
74
|
+
// 下拉菜单显示隐藏回调
|
75
|
+
var onDropdownVisibleChange = function onDropdownVisibleChange(state) {
|
76
|
+
setDropdownVisible(state);
|
77
|
+
};
|
78
|
+
// 自动刷新开启关闭回调
|
79
|
+
var onAutoRefreshChange = function onAutoRefreshChange(visible) {
|
80
|
+
if (visible) {
|
81
|
+
var _actionRef$current, _actionRef$current$se;
|
82
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setAutoRefreshTimers) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, times);
|
83
|
+
} else {
|
84
|
+
var _actionRef$current2, _actionRef$current2$c;
|
85
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$c = _actionRef$current2.clearAutoRefreshTimers) === null || _actionRef$current2$c === void 0 ? void 0 : _actionRef$current2$c.call(_actionRef$current2);
|
86
|
+
if (timerRef.current.timer) {
|
87
|
+
clearInterval(timerRef.current.timer);
|
88
|
+
timerRef.current.timer = undefined;
|
89
|
+
timerRef.current.remain = times / 1000;
|
90
|
+
setRemainTime(times / 1000);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
setAutoRefreshVisible(visible);
|
94
|
+
};
|
95
|
+
// 手动刷新回调
|
96
|
+
var onManualRefresh = function onManualRefresh() {
|
97
|
+
var _actionRef$current3, _actionRef$current3$r;
|
98
|
+
(_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$r = _actionRef$current3.refresh) === null || _actionRef$current3$r === void 0 ? void 0 : _actionRef$current3$r.call(_actionRef$current3);
|
99
|
+
onDropdownVisibleChange(false);
|
100
|
+
};
|
101
|
+
// 选择间隔时间回调
|
102
|
+
var onTimeRadioChange = function onTimeRadioChange(timer) {
|
103
|
+
var _actionRef$current4, _actionRef$current4$s;
|
104
|
+
setTimes(timer);
|
105
|
+
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setAutoRefreshTimers) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, timer);
|
106
|
+
};
|
107
|
+
// 渲染刷新图标
|
108
|
+
var renderRefreshIcon = function renderRefreshIcon() {
|
109
|
+
if (!!autoRefresh && autoRefreshVisible && typeof autoRefresh !== 'function') {
|
110
|
+
return /*#__PURE__*/React.createElement(TeamixIcon, {
|
111
|
+
size: "small",
|
112
|
+
type: "auto-refresh-on-line"
|
113
|
+
});
|
114
|
+
}
|
115
|
+
if (!!autoRefresh && !autoRefreshVisible && typeof autoRefresh !== 'function') {
|
116
|
+
return /*#__PURE__*/React.createElement(TeamixIcon, {
|
117
|
+
size: "small",
|
118
|
+
type: "auto-refresh-off-line"
|
119
|
+
});
|
120
|
+
}
|
121
|
+
return /*#__PURE__*/React.createElement(TeamixIcon, {
|
122
|
+
size: "small",
|
123
|
+
type: "refresh-line"
|
124
|
+
});
|
125
|
+
};
|
126
|
+
// 渲染 Radio
|
127
|
+
var renderRadio = autoRefreshRadio.map(function (item) {
|
128
|
+
return /*#__PURE__*/React.createElement(Menu.RadioItem, {
|
129
|
+
className: cls('time-radio'),
|
130
|
+
key: item.value,
|
131
|
+
disabled: !autoRefreshVisible,
|
132
|
+
checked: times === item.value,
|
133
|
+
onChange: function onChange() {
|
134
|
+
var _item$value;
|
135
|
+
return onTimeRadioChange((_item$value = item === null || item === void 0 ? void 0 : item.value) !== null && _item$value !== void 0 ? _item$value : 0);
|
136
|
+
}
|
137
|
+
}, item.label);
|
138
|
+
});
|
139
|
+
if (autoRefresh && typeof autoRefresh !== 'function') {
|
140
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
141
|
+
trigger: /*#__PURE__*/React.createElement(Button, {
|
142
|
+
iconSize: "small",
|
143
|
+
className: cls()
|
144
|
+
}, renderRefreshIcon()),
|
145
|
+
visible: dropdownVisible,
|
146
|
+
onVisibleChange: onDropdownVisibleChange,
|
147
|
+
followTrigger: true,
|
148
|
+
cache: true,
|
149
|
+
triggerType: ['click'],
|
150
|
+
align: "tr br"
|
151
|
+
}, /*#__PURE__*/React.createElement("div", {
|
152
|
+
className: cls()
|
153
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
154
|
+
className: cls('auto-refresh')
|
155
|
+
}, /*#__PURE__*/React.createElement(Menu.CheckboxItem, {
|
156
|
+
checked: autoRefreshVisible,
|
157
|
+
onChange: onAutoRefreshChange
|
158
|
+
}, getMessage('autoRefresh'), autoRefreshVisible && /*#__PURE__*/React.createElement("span", null, "\uFF08", remainTime, "s\uFF09")), renderRadio, /*#__PURE__*/React.createElement(Menu.Divider, {
|
159
|
+
key: "divider"
|
160
|
+
}), /*#__PURE__*/React.createElement("div", {
|
161
|
+
className: cls('manual-refresh')
|
162
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
163
|
+
type: "primary",
|
164
|
+
text: true,
|
165
|
+
onClick: onManualRefresh
|
166
|
+
}, getMessage('manualRefresh'))))));
|
167
|
+
}
|
27
168
|
return /*#__PURE__*/React.createElement(Balloon.Tooltip, {
|
28
169
|
trigger: /*#__PURE__*/React.createElement(Button, {
|
29
170
|
iconSize: "small",
|
30
171
|
className: cls(),
|
31
172
|
onClick: function onClick() {
|
32
|
-
var _actionRef$
|
33
|
-
return (_actionRef$
|
173
|
+
var _actionRef$current5, _actionRef$current5$r;
|
174
|
+
return (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$r = _actionRef$current5.refresh) === null || _actionRef$current5$r === void 0 ? void 0 : _actionRef$current5$r.call(_actionRef$current5);
|
34
175
|
}
|
35
|
-
},
|
36
|
-
size: "small",
|
37
|
-
type: "refresh-line"
|
38
|
-
})),
|
176
|
+
}, renderRefreshIcon()),
|
39
177
|
align: "t"
|
40
178
|
}, getMessage('refresh'));
|
41
179
|
};
|
@@ -158,3 +158,20 @@
|
|
158
158
|
padding-right: 8px;
|
159
159
|
}
|
160
160
|
}
|
161
|
+
|
162
|
+
// refresh
|
163
|
+
.teamix-pro-table-toolbar-icon {
|
164
|
+
&-auto-refresh {
|
165
|
+
width: 145px;
|
166
|
+
}
|
167
|
+
|
168
|
+
&-manual-refresh {
|
169
|
+
text-align: center;
|
170
|
+
line-height: 1;
|
171
|
+
margin-bottom: 2px;
|
172
|
+
}
|
173
|
+
|
174
|
+
.teamix-pro-table-toolbar-icon-time-radio.teamix-pro-table-toolbar-icon-time-radio.teamix-pro-table-toolbar-icon-time-radio {
|
175
|
+
padding-left: 32px;
|
176
|
+
}
|
177
|
+
}
|
package/es/table/index.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import { ProTableProps } from './typing';
|
3
2
|
import './index.scss';
|
4
3
|
export * from './typing';
|
5
|
-
declare const
|
6
|
-
export default
|
4
|
+
declare const ProTable: (props: ProTableProps) => JSX.Element;
|
5
|
+
export default ProTable;
|