@chaoswise/ui 3.1.9 → 3.1.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/lib/AbreastLayout/index.js +20 -23
- package/lib/Antd5/config-provider/index.js +10 -6
- package/lib/Antd5/dropdown/dropdown.js +1 -1
- package/lib/Antd5/menu/menu.js +1 -1
- package/lib/Antd5/splitter/SplitBar.js +20 -10
- package/lib/Antd5/splitter/hooks/useItems.js +6 -3
- package/lib/Antd5/typography/hooks/useCopyClick.js +2 -2
- package/lib/Antd5/upload/Upload.js +1 -1
- package/lib/BasicLayout/index.js +29 -29
- package/lib/Button/index.js +0 -3
- package/lib/CWCascader/index.js +0 -5
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +1 -1
- package/lib/CWColorPicker/SketchPicker/components/common/Checkboard.js +8 -10
- package/lib/CWColorPicker/SketchPicker/components/common/Raised.js +6 -9
- package/lib/CWColorPicker/SketchPicker/components/sketch/index.js +7 -9
- package/lib/CWColorPicker/index.js +2 -4
- package/lib/CWMessage/MessageContent/TabList/index.js +1 -1
- package/lib/CWMessage/MessageContent/index.js +1 -1
- package/lib/CWMessage/index.js +6 -14
- package/lib/CWRadioTabs/index.js +2 -5
- package/lib/CWRangePicker/Refresh/index.js +2 -1
- package/lib/CWRangePicker/TimeSpan/index.js +2 -1
- package/lib/CWRangePicker/index.js +0 -5
- package/lib/CWSelect/index.js +2 -4
- package/lib/CWTable/CWTable.js +29 -18
- package/lib/CWTable/index.js +0 -12
- package/lib/CWTree/index.js +188 -149
- package/lib/CWTree/index.style.js +4 -2
- package/lib/CWTree/utils/index.js +148 -53
- package/lib/CardSelect/index.js +8 -12
- package/lib/ChangeIcon/index.js +3 -5
- package/lib/Collapse/index.js +9 -13
- package/lib/CustomScrollBar/index.js +6 -13
- package/lib/EchartsBase/index.js +0 -3
- package/lib/Empty/index.js +0 -4
- package/lib/Flow/Flow.js +0 -3
- package/lib/Header/index.js +17 -20
- package/lib/LayoutWrapper/Footer.js +3 -8
- package/lib/LayoutWrapper/index.js +2 -58
- package/lib/Modal/assets/Close.js +0 -8
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +3 -3
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +2 -2
- package/lib/QuickTransfer/index.js +9 -11
- package/lib/QuickTransfer/utils.js +50 -29
- package/lib/ScrollLoad/index.js +17 -19
- package/lib/SearchBar/index.js +2 -5
- package/lib/SiderMenu/index.js +2 -4
- package/lib/SimpleCard/index.js +5 -12
- package/lib/SimplePagination/index.js +6 -8
- package/lib/SingleSpa/index.js +2 -2
- package/lib/Tag/CheckableTag.js +8 -10
- package/lib/Tag/index.js +0 -1
- package/lib/TimeRangeSlider/index.js +0 -3
- package/lib/TimeZoneSelect/index.js +2 -2
- package/lib/Tooltip/index.js +9 -6
- package/lib/TooltipText/index.js +2 -4
- package/lib/UniversalLayout/index.js +5 -7
- package/lib/WangEditor/index.js +10 -11
- package/lib/useChartTheme/index.js +3 -2
- package/package.json +3 -2
package/lib/CWRadioTabs/index.js
CHANGED
|
@@ -12,13 +12,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
13
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
|
-
import React, {
|
|
15
|
+
import React, { useState, useEffect } from "react";
|
|
16
16
|
import { EllipsisOutlined } from "@ant-design/icons";
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import classnames from "classnames";
|
|
19
19
|
import useConfigContext from "../useConfigContext";
|
|
20
20
|
import useStyle from "./index.style";
|
|
21
|
-
var CWRadioTabs =
|
|
21
|
+
var CWRadioTabs = function CWRadioTabs(props) {
|
|
22
22
|
var _dataSource$find;
|
|
23
23
|
var _props$dataSource = props.dataSource,
|
|
24
24
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
@@ -102,9 +102,6 @@ var CWRadioTabs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
102
102
|
}, dropdownOption), /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
103
103
|
value: "more"
|
|
104
104
|
}, /*#__PURE__*/React.createElement(EllipsisOutlined, null)))), props.children));
|
|
105
|
-
});
|
|
106
|
-
CWRadioTabs.defaultProps = {
|
|
107
|
-
size: "default"
|
|
108
105
|
};
|
|
109
106
|
CWRadioTabs.propTypes = {
|
|
110
107
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import _Space from "@chaoswise/ui/lib/Space";
|
|
2
3
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
4
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
5
|
var _excluded = ["value", "key"];
|
|
@@ -143,7 +144,7 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
143
144
|
onAutoRefresh: onAutoRefresh
|
|
144
145
|
};
|
|
145
146
|
});
|
|
146
|
-
return wrapCSSVar((showRefresh || showAutoRefresh) && /*#__PURE__*/React.createElement(
|
|
147
|
+
return wrapCSSVar((showRefresh || showAutoRefresh) && /*#__PURE__*/React.createElement(_Space.Compact, {
|
|
147
148
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-range-picker-refresh-wrapper"))
|
|
148
149
|
}, showRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
149
150
|
title: intl.get("1d0f3c0c-188f-4f83-bff0-2792dffcdc2d").d("刷新")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _Space from "@chaoswise/ui/lib/Space";
|
|
1
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
3
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
3
4
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
@@ -71,7 +72,7 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
var showTimeSpan = showForwardBtn || showBackwardBtn || showEnlargeBtn;
|
|
74
|
-
return wrapCSSVar(isHasDate && showTimeSpan && /*#__PURE__*/React.createElement(
|
|
75
|
+
return wrapCSSVar(isHasDate && showTimeSpan && /*#__PURE__*/React.createElement(_Space.Compact, {
|
|
75
76
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-range-picker-time-span-wrapper"))
|
|
76
77
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
77
78
|
title: forwardTitle
|
|
@@ -686,11 +686,6 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
686
686
|
ref: refreshRef
|
|
687
687
|
}))));
|
|
688
688
|
});
|
|
689
|
-
CWRangePicker.defaultProps = {
|
|
690
|
-
moreItemDropdownPosition: "left",
|
|
691
|
-
format: "YYYY/MM/DD HH:mm:ss",
|
|
692
|
-
rangePickerFormat: "YYYY/MM/DD"
|
|
693
|
-
};
|
|
694
689
|
CWRangePicker.propTypes = {
|
|
695
690
|
/**
|
|
696
691
|
* 默认value
|
package/lib/CWSelect/index.js
CHANGED
|
@@ -26,7 +26,6 @@ import { DndProvider } from "react-dnd";
|
|
|
26
26
|
import { cloneComProps } from "../utils";
|
|
27
27
|
import update from "immutability-helper";
|
|
28
28
|
import PropTypes from "prop-types";
|
|
29
|
-
import { useIntl } from "../locales";
|
|
30
29
|
import useStyle from "./index.style";
|
|
31
30
|
|
|
32
31
|
/**
|
|
@@ -73,7 +72,6 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
73
72
|
children = props.children,
|
|
74
73
|
maxCount = props.maxCount,
|
|
75
74
|
rest = _objectWithoutProperties(props, _excluded);
|
|
76
|
-
var intl = useIntl();
|
|
77
75
|
var _useConfigContext = useConfigContext(),
|
|
78
76
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
79
77
|
var prefixCls = getPrefixCls("select");
|
|
@@ -341,9 +339,9 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
341
339
|
menuItemSelectedIcon: null,
|
|
342
340
|
onSelect: onSelect,
|
|
343
341
|
onDeselect: onDeselect,
|
|
344
|
-
dropdownRender: dropdownRender,
|
|
345
342
|
labelInValue: labelInValue,
|
|
346
|
-
maxCount: maxCount
|
|
343
|
+
maxCount: maxCount,
|
|
344
|
+
popupRender: dropdownRender
|
|
347
345
|
}, rest), children)));
|
|
348
346
|
});
|
|
349
347
|
|
package/lib/CWTable/CWTable.js
CHANGED
|
@@ -26,21 +26,24 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
26
26
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
27
27
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
28
28
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
29
|
-
import React, { useState, useEffect, useRef, useMemo, forwardRef } from "react";
|
|
29
|
+
import React, { useState, useEffect, useRef, useMemo, useCallback, forwardRef } from "react";
|
|
30
30
|
import Icon, { LoadingOutlined, DownOutlined, RightOutlined } from "@ant-design/icons";
|
|
31
31
|
import classnames from "classnames";
|
|
32
32
|
import ResizeObserver from "resize-observer-polyfill";
|
|
33
33
|
import { merge } from "lodash-es";
|
|
34
34
|
import { HeaderCell } from "./header";
|
|
35
35
|
import useStyle from "./index.style";
|
|
36
|
+
// 在组件外部定义默认数组,确保引用稳定
|
|
37
|
+
var DEFAULT_DATA_SOURCE = [];
|
|
38
|
+
var DEFAULT_COLUMNS = [];
|
|
36
39
|
var CWTable = function CWTable(_ref, ref) {
|
|
37
40
|
var _ref$columns = _ref.columns,
|
|
38
|
-
columns = _ref$columns === void 0 ?
|
|
41
|
+
columns = _ref$columns === void 0 ? DEFAULT_COLUMNS : _ref$columns,
|
|
39
42
|
_ref$lazyLoading = _ref.lazyLoading,
|
|
40
43
|
lazyLoading = _ref$lazyLoading === void 0 ? false : _ref$lazyLoading,
|
|
41
44
|
loadData = _ref.loadData,
|
|
42
45
|
_ref$dataSource = _ref.dataSource,
|
|
43
|
-
dataSource = _ref$dataSource === void 0 ?
|
|
46
|
+
dataSource = _ref$dataSource === void 0 ? DEFAULT_DATA_SOURCE : _ref$dataSource,
|
|
44
47
|
rowSelection = _ref.rowSelection,
|
|
45
48
|
_ref$pagination = _ref.pagination,
|
|
46
49
|
pagination = _ref$pagination === void 0 ? false : _ref$pagination,
|
|
@@ -159,20 +162,28 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
159
162
|
colsFilterTitle = columnFilter.colsFilterTitle,
|
|
160
163
|
_columnFilter$isShowS = columnFilter.isShowSelectAll,
|
|
161
164
|
isShowSelectAll = _columnFilter$isShowS === void 0 ? false : _columnFilter$isShowS;
|
|
162
|
-
var getDataSource = function
|
|
163
|
-
|
|
164
|
-
if (frontPagination) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
_total = pagination.total;
|
|
168
|
-
var current = _current || pageInfo.current;
|
|
169
|
-
var pageSize = _pageSize || pageInfo.pageSize;
|
|
170
|
-
var total = _total || dataSource.length;
|
|
171
|
-
_dataSource = _dataSource.slice((current - 1) * pageSize, current * pageSize > total ? total : current * pageSize);
|
|
165
|
+
var getDataSource = useCallback(function () {
|
|
166
|
+
// 如果不是前端分页,直接使用原数据
|
|
167
|
+
if (!frontPagination) {
|
|
168
|
+
setFinalDataSource(_toConsumableArray(dataSource));
|
|
169
|
+
return;
|
|
172
170
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
|
|
172
|
+
// 前端分页逻辑
|
|
173
|
+
var _ref2 = pagination || {},
|
|
174
|
+
paginationCurrent = _ref2.current,
|
|
175
|
+
paginationPageSize = _ref2.pageSize,
|
|
176
|
+
paginationTotal = _ref2.total;
|
|
177
|
+
var current = paginationCurrent || pageInfo.current;
|
|
178
|
+
var pageSize = paginationPageSize || pageInfo.pageSize;
|
|
179
|
+
var total = paginationTotal || dataSource.length;
|
|
180
|
+
|
|
181
|
+
// 计算分页范围
|
|
182
|
+
var startIndex = (current - 1) * pageSize;
|
|
183
|
+
var endIndex = Math.min(startIndex + pageSize, total);
|
|
184
|
+
setFinalDataSource(dataSource.slice(startIndex, endIndex));
|
|
185
|
+
}, [frontPagination, pagination, pageInfo, dataSource]);
|
|
186
|
+
useEffect(getDataSource, [getDataSource]);
|
|
176
187
|
useEffect(function () {
|
|
177
188
|
if (!autoHeight) {
|
|
178
189
|
return;
|
|
@@ -380,8 +391,8 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
380
391
|
});
|
|
381
392
|
};
|
|
382
393
|
var handleResize = function handleResize(index) {
|
|
383
|
-
return function (e,
|
|
384
|
-
var size =
|
|
394
|
+
return function (e, _ref3, isDragEnd) {
|
|
395
|
+
var size = _ref3.size;
|
|
385
396
|
var nextColumns = _toConsumableArray(resizeColsRef.current);
|
|
386
397
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
387
398
|
width: size.width
|
package/lib/CWTable/index.js
CHANGED
|
@@ -202,16 +202,4 @@ Table.propTypes = {
|
|
|
202
202
|
*/
|
|
203
203
|
onColumnsResizeEnd: PropTypes.func
|
|
204
204
|
};
|
|
205
|
-
Table.defaultProps = {
|
|
206
|
-
autoHeight: false,
|
|
207
|
-
lazyLoading: false,
|
|
208
|
-
dataSource: [],
|
|
209
|
-
pagination: false,
|
|
210
|
-
showHeader: true,
|
|
211
|
-
bordered: false,
|
|
212
|
-
size: "default",
|
|
213
|
-
columnFilter: false,
|
|
214
|
-
frontPagination: false,
|
|
215
|
-
tableHeader: null
|
|
216
|
-
};
|
|
217
205
|
export default Table;
|