@chaoswise/ui 2.7.6 → 2.7.7
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 +2 -2
- package/lib/AdaptiveLayout/index.js +2 -2
- package/lib/Alert/index.js +2 -2
- package/lib/AlgorithmChart/index.js +2 -2
- package/lib/Antd/Drawer.js +2 -2
- package/lib/Antd4Form/FieldList.js +2 -2
- package/lib/Antd4Form/Form.js +2 -2
- package/lib/Antd4Form/FormItem.js +2 -2
- package/lib/Antd4Form/FormItemChildren.js +2 -2
- package/lib/BasicLayout/Breadcrumb.js +2 -2
- package/lib/BasicLayout/Footer.js +2 -2
- package/lib/BasicLayout/Sider.js +2 -2
- package/lib/BasicLayout/index.js +2 -2
- package/lib/Button/index.js +2 -2
- package/lib/CWCascader/Cascader/index.js +2 -2
- package/lib/CWCascader/rc-cascader/Cascader.js +2 -2
- package/lib/CWMessage/index.js +2 -2
- package/lib/CWRadioTabs/index.js +2 -2
- package/lib/CWRangePicker/DropdownMenu/index.js +2 -2
- package/lib/CWRangePicker/Refresh/index.js +2 -2
- package/lib/CWRangePicker/index.js +2 -2
- package/lib/CWRangePicker/utils/index.js +108 -18
- package/lib/CWSelect/antd-select.js +2 -2
- package/lib/CWSelect/index.js +2 -2
- package/lib/CWTable/CWTable.js +2 -2
- package/lib/CWTable/EditLine.js +2 -2
- package/lib/CWTable/header.js +2 -2
- package/lib/CWTree/index.js +3 -22
- package/lib/CardSelect/index.js +2 -2
- package/lib/Checkbox/Checkbox.js +2 -2
- package/lib/Checkbox/Group.js +2 -2
- package/lib/Collapse/index.js +2 -2
- package/lib/ConfigProvider/ConfigProvider.js +2 -2
- package/lib/CustomNotification/PurePanel.js +2 -2
- package/lib/CustomNotification/useNotification.js +2 -2
- package/lib/CustomScrollBar/index.js +2 -2
- package/lib/DateRangePicker/RangeDatePicker.js +2 -2
- package/lib/DateRangePicker/RangeDateTimePicker.js +2 -2
- package/lib/DateRangePicker/index.js +2 -2
- package/lib/Documentation/index.js +2 -2
- package/lib/Drawer/index.js +2 -2
- package/lib/DropdownDatePicker/DropdownMenu/index.js +2 -2
- package/lib/DropdownDatePicker/index.js +2 -2
- package/lib/DropdownDatePicker/utils/index.js +123 -39
- package/lib/EchartsArea/index.js +2 -2
- package/lib/EchartsBar/index.js +2 -2
- package/lib/EchartsBarRow/index.js +2 -2
- package/lib/EchartsBase/index.js +2 -2
- package/lib/EchartsLine/index.js +2 -2
- package/lib/EchartsPie/index.js +2 -2
- package/lib/EchartsRing/index.js +2 -2
- package/lib/EditableText/index.js +2 -2
- package/lib/Empty/index.js +2 -2
- package/lib/Footer/index.js +2 -2
- package/lib/Form/FormItem.js +2 -2
- package/lib/FormItemWrapper/index.js +2 -2
- package/lib/Formily/FieldList/index.js +2 -2
- package/lib/Formily/FormItem/index.js +2 -2
- package/lib/Formily/FormItem/items/formItemWrapper.js +2 -2
- package/lib/Formily/subscribeFields/index.js +2 -2
- package/lib/GlobalTabs/TabPane.js +2 -2
- package/lib/GlobalTabs/index.js +2 -2
- package/lib/Header/CommonDropMenu.js +2 -2
- package/lib/Header/LocaleSwitcher.js +2 -2
- package/lib/Header/Message/index.js +2 -2
- package/lib/ImagePreview/index.js +2 -2
- package/lib/Input/InputComponent.js +2 -2
- package/lib/InputNumber/index.js +2 -2
- package/lib/IntersectionInput/index.js +2 -2
- package/lib/Joyride/index.js +2 -2
- package/lib/LayoutBreadcrumb/index.js +2 -2
- package/lib/LayoutWrapper/Footer.js +2 -2
- package/lib/LayoutWrapper/Header.js +2 -2
- package/lib/LazyLoadingTreeSelect/index.js +2 -2
- package/lib/Modal/Modal.js +2 -2
- package/lib/Modal/index.js +2 -2
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +2 -2
- package/lib/ModuleTitle/index.js +2 -2
- package/lib/OutlineNumber/index.js +2 -2
- package/lib/Pagination/index.js +2 -2
- package/lib/Popconfirm/index.js +2 -2
- package/lib/Progress/index.js +2 -2
- package/lib/QuickRangePicker/index.js +2 -2
- package/lib/QuickTransfer/index.js +2 -2
- package/lib/QuickTransfer/utils.js +7 -6
- package/lib/Radio/Radio.js +2 -2
- package/lib/RangePicker/index.js +2 -2
- package/lib/ReactSelect/CustomControl.js +2 -2
- package/lib/ReactSelect/CustomMultiValueLabel.js +2 -2
- package/lib/ReactSelect/CustomOption.js +2 -2
- package/lib/ReactSelect/CustomSingleValue.js +2 -2
- package/lib/ReactSelect/index.js +2 -2
- package/lib/ScrollLoad/index.js +2 -2
- package/lib/SearchBar/index.js +2 -2
- package/lib/SelectBackup/index.js +2 -2
- package/lib/SiderMenu/Item.js +2 -2
- package/lib/SiderMenu/index.js +2 -2
- package/lib/SiderMenu/sub-menu.js +2 -2
- package/lib/SimpleCard/index.js +2 -2
- package/lib/SingleSpa/index.js +2 -2
- package/lib/Tabs/index.js +2 -2
- package/lib/Tag/CheckableTag.js +2 -2
- package/lib/Tag/index.js +2 -2
- package/lib/ThemeProvider/main.js +2 -2
- package/lib/TimeRangeSlider/Refresh/index.js +2 -2
- package/lib/TimeRangeSlider/index.js +2 -2
- package/lib/TimeRangeSlider/utils/index.js +112 -60
- package/lib/TimeZoneSelect/index.js +2 -2
- package/lib/Tooltip/index.js +2 -2
- package/lib/TooltipText/index.js +2 -2
- package/lib/TreeSelect111/index.js +2 -2
- package/lib/Upload-back/index.js +2 -2
- package/lib/VerticalLayout/index.js +2 -2
- package/lib/WangEditor/editor4.js +2 -2
- package/lib/WangEditor/index.js +2 -2
- package/lib/configHoc/index.js +2 -2
- package/lib/treeLoad/index.js +57 -24
- package/lib/useLocale/index.js +2 -2
- package/package.json +2 -2
package/lib/treeLoad/index.js
CHANGED
|
@@ -1,46 +1,79 @@
|
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import React from "react";
|
|
2
|
-
import PropTypes from
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
|
|
3
10
|
/**
|
|
4
|
-
*
|
|
5
11
|
* 封装的树形结构懒加载组件
|
|
6
12
|
*/
|
|
7
13
|
function fetchTreeNode(oldData, parentId, childNode) {
|
|
14
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
15
|
+
var _options$keyField = options.keyField,
|
|
16
|
+
keyField = _options$keyField === void 0 ? "value" : _options$keyField,
|
|
17
|
+
compareFn = options.compareFn;
|
|
8
18
|
return oldData.map(function (item) {
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
var isMatch = false;
|
|
20
|
+
if (compareFn) {
|
|
21
|
+
isMatch = compareFn(item, parentId);
|
|
22
|
+
} else {
|
|
23
|
+
var itemKey = item[keyField];
|
|
24
|
+
isMatch = itemKey === parentId;
|
|
25
|
+
}
|
|
26
|
+
if (isMatch) {
|
|
27
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
28
|
+
children: childNode
|
|
29
|
+
});
|
|
11
30
|
} else if (item.children) {
|
|
12
|
-
|
|
31
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
32
|
+
children: fetchTreeNode(item.children, parentId, childNode, options)
|
|
33
|
+
});
|
|
13
34
|
}
|
|
14
35
|
return item;
|
|
15
36
|
});
|
|
16
37
|
}
|
|
17
|
-
|
|
38
|
+
// 1. 旧版API: treeLoad(oldData, treeNodeKey, fetchData, getChildNode)
|
|
39
|
+
// 2. 新版API: treeLoad(oldData, treeNodeKey, fetchData, options)
|
|
40
|
+
// 3. 混合API-1: treeLoad(oldData, treeNodeKey, fetchData, getChildNode, options) - 第四个参数是函数,第五个是对象
|
|
41
|
+
// 4. 混合API-2: treeLoad(oldData, treeNodeKey, fetchData, options, getChildNode) - 第四个参数是对象,第五个是函数
|
|
42
|
+
|
|
43
|
+
function treeLoad(oldData, treeNodeKey, fetchData, getChildNodeOrOptions, maybeOptions) {
|
|
44
|
+
// 兼容旧版API: 第四个参数可能是getChildNode回调函数或options对象
|
|
45
|
+
var getChildNode;
|
|
46
|
+
var options = {};
|
|
47
|
+
if (typeof getChildNodeOrOptions === "function") {
|
|
48
|
+
// 旧版API: 第四个参数是getChildNode回调函数
|
|
49
|
+
getChildNode = getChildNodeOrOptions;
|
|
50
|
+
// 如果第五个参数是对象,则作为options
|
|
51
|
+
if (maybeOptions && _typeof(maybeOptions) === "object") {
|
|
52
|
+
options = maybeOptions;
|
|
53
|
+
}
|
|
54
|
+
} else if (getChildNodeOrOptions && _typeof(getChildNodeOrOptions) === "object") {
|
|
55
|
+
// 新版API: 第四个参数是options对象
|
|
56
|
+
options = getChildNodeOrOptions;
|
|
57
|
+
// 如果提供了第五个参数且为函数,则视为getChildNode
|
|
58
|
+
if (typeof maybeOptions === "function") {
|
|
59
|
+
getChildNode = maybeOptions;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
18
62
|
fetchData(treeNodeKey, function (childNode) {
|
|
19
|
-
var newData = fetchTreeNode(oldData, treeNodeKey, childNode);
|
|
63
|
+
var newData = fetchTreeNode(oldData, treeNodeKey, childNode, options);
|
|
20
64
|
getChildNode && getChildNode();
|
|
21
65
|
return newData;
|
|
22
66
|
});
|
|
23
67
|
}
|
|
24
|
-
treeLoad.defaultProps = {
|
|
25
|
-
//
|
|
26
|
-
};
|
|
27
68
|
treeLoad.propTypes = {
|
|
28
|
-
/**
|
|
29
|
-
* 获取子节点的数据,并通过回调函数返回最终渲染的数据。
|
|
30
|
-
* function(pageNum,callback(res):Data)
|
|
31
|
-
*/
|
|
32
69
|
fetchData: PropTypes.func,
|
|
33
|
-
/**
|
|
34
|
-
* 加载前的树形结构数据,结构中把value作为唯一键值
|
|
35
|
-
*/
|
|
36
70
|
oldData: PropTypes.array,
|
|
37
|
-
/**
|
|
38
|
-
* 要展开的树节点
|
|
39
|
-
*/
|
|
40
71
|
treeNodeKey: PropTypes.string,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
getChildNode: PropTypes.func,
|
|
73
|
+
options: PropTypes.shape({
|
|
74
|
+
keyField: PropTypes.string,
|
|
75
|
+
// 指定用于匹配的字段名
|
|
76
|
+
compareFn: PropTypes.func // 自定义比较函数
|
|
77
|
+
})
|
|
45
78
|
};
|
|
46
79
|
export default treeLoad;
|
package/lib/useLocale/index.js
CHANGED
|
@@ -6,8 +6,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
10
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
11
11
|
function useLocale(langConfig) {
|
|
12
12
|
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
13
13
|
locale = _ConfigProvider$useLo.locale,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.7",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"overrides": {
|
|
153
153
|
"node-fetch": "^2.7.0"
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "cf3568b1947cf3833fbaa6f6f7fa493c5282562b"
|
|
156
156
|
}
|