@aloudata/aloudata-design 1.9.8 → 1.9.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/AldTable/helper.js +21 -23
- package/dist/AldTable/index.d.ts +2 -2
- package/dist/AldTable/index.js +40 -50
- package/dist/AldTable/style/index.less +26 -6
- package/dist/AldTable/types.d.ts +2 -0
- package/dist/App/index.js +2 -9
- package/dist/Avatar/component/Avatar/avatar.d.ts +2 -2
- package/dist/Avatar/component/Avatar/avatar.js +0 -2
- package/dist/Avatar/component/Avatar/index.d.ts +1 -1
- package/dist/Avatar/component/Avatar/index.js +6 -20
- package/dist/Breadcrumb/index.d.ts +1 -1
- package/dist/Breadcrumb/index.js +6 -16
- package/dist/Button/index.d.ts +4 -4
- package/dist/Button/index.js +21 -41
- package/dist/Checkbox/component/CheckboxGroup/index.d.ts +2 -2
- package/dist/Checkbox/component/CheckboxGroup/index.js +4 -10
- package/dist/Checkbox/index.d.ts +3 -3
- package/dist/Checkbox/index.js +5 -14
- package/dist/Checkbox/type.js +3 -4
- package/dist/ColorPicker/constant.js +2 -1
- package/dist/ColorPicker/index.d.ts +1 -1
- package/dist/ColorPicker/index.js +15 -42
- package/dist/ConfigProvider/defaultRenderEmpty.d.ts +1 -1
- package/dist/ConfigProvider/defaultRenderEmpty.js +0 -5
- package/dist/ConfigProvider/getUserList.d.ts +4 -4
- package/dist/ConfigProvider/getUserList.js +2 -2
- package/dist/ConfigProvider/hooks/useGetUserList.js +2 -5
- package/dist/ConfigProvider/index.js +2 -6
- package/dist/ConfigProvider/sizeContext.d.ts +1 -1
- package/dist/ConfigProvider/sizeContext.js +1 -1
- package/dist/DataPreviewTable/components/Body/Cell.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/Cell.js +4 -10
- package/dist/DataPreviewTable/components/Body/Error.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/Error.js +3 -5
- package/dist/DataPreviewTable/components/Body/SkeletonBody.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/SkeletonBody.js +10 -19
- package/dist/DataPreviewTable/components/Body/index.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/index.js +10 -19
- package/dist/DataPreviewTable/components/DragBar/index.d.ts +1 -1
- package/dist/DataPreviewTable/components/DragBar/index.js +14 -24
- package/dist/DataPreviewTable/components/Header/index.d.ts +2 -2
- package/dist/DataPreviewTable/components/Header/index.js +7 -15
- package/dist/DataPreviewTable/hooks/useDirection.js +32 -57
- package/dist/DataPreviewTable/index.js +22 -29
- package/dist/DataPreviewTable/interface.d.ts +2 -2
- package/dist/DataPreviewTable/interface.js +6 -9
- package/dist/DataPreviewTable/utils/findRange.js +2 -20
- package/dist/DataPreviewTable/utils/getColumnRange.js +3 -7
- package/dist/DataPreviewTable/utils/getRowRange.js +2 -8
- package/dist/DataPreviewTable/utils/getTableLayout.js +0 -1
- package/dist/DatePicker/index.d.ts +11 -11
- package/dist/DatePicker/index.js +85 -116
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +0 -3
- package/dist/DoubleCircleIcon/index.d.ts +2 -2
- package/dist/DoubleCircleIcon/index.js +7 -9
- package/dist/Dropdown/Button.d.ts +2 -2
- package/dist/Dropdown/Button.js +7 -11
- package/dist/Dropdown/index.d.ts +4 -4
- package/dist/Dropdown/index.js +11 -21
- package/dist/Dropdown/style/index.less +5 -0
- package/dist/Empty/image/Data.d.ts +2 -2
- package/dist/Empty/image/Data.js +0 -2
- package/dist/Empty/image/Search.d.ts +2 -2
- package/dist/Empty/image/Search.js +0 -2
- package/dist/Empty/image/SearchSmall.d.ts +2 -2
- package/dist/Empty/image/SearchSmall.js +0 -2
- package/dist/Empty/image/User.d.ts +2 -2
- package/dist/Empty/image/User.js +0 -2
- package/dist/Empty/image/WorkBook.d.ts +2 -2
- package/dist/Empty/image/WorkBook.js +0 -2
- package/dist/Empty/index.d.ts +1 -1
- package/dist/Empty/index.js +13 -23
- package/dist/Form/index.d.ts +4 -4
- package/dist/Form/index.js +16 -27
- package/dist/Icon/components/AlertTriangleDuotone.d.ts +1 -1
- package/dist/Icon/components/AlertTriangleDuotone.js +4 -11
- package/dist/Icon/components/CancelCircleDuotone.d.ts +1 -1
- package/dist/Icon/components/CancelCircleDuotone.js +9 -16
- package/dist/Icon/components/CheckCircleDuotone.d.ts +1 -1
- package/dist/Icon/components/CheckCircleDuotone.js +4 -11
- package/dist/Icon/components/Icon.d.ts +1 -1
- package/dist/Icon/components/Icon.js +9 -13
- package/dist/Icon/components/InfoCircleLine.d.ts +1 -1
- package/dist/Icon/components/InfoCircleLine.js +4 -11
- package/dist/Icon/components/createFromScripts.js +2 -8
- package/dist/IconButton/index.js +36 -57
- package/dist/IconButton/style/index.less +4 -0
- package/dist/Input/components/Group/index.d.ts +2 -2
- package/dist/Input/components/Group/index.js +4 -9
- package/dist/Input/components/Input/index.d.ts +2 -2
- package/dist/Input/components/Input/index.js +9 -17
- package/dist/Input/components/Password/index.js +4 -9
- package/dist/Input/components/TextArea/index.js +5 -10
- package/dist/InputNumber/index.d.ts +2 -2
- package/dist/InputNumber/index.js +13 -20
- package/dist/MemberPicker/components/MemberSelection.d.ts +2 -2
- package/dist/MemberPicker/components/MemberSelection.js +12 -20
- package/dist/MemberPicker/components/MultipleOption.d.ts +2 -2
- package/dist/MemberPicker/components/MultipleOption.js +8 -9
- package/dist/MemberPicker/components/NickLabel.js +2 -4
- package/dist/MemberPicker/components/Panel.d.ts +2 -2
- package/dist/MemberPicker/components/Panel.js +14 -25
- package/dist/MemberPicker/components/SelectedMemberTags.d.ts +2 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +2 -4
- package/dist/MemberPicker/components/SelectorFooter.d.ts +2 -2
- package/dist/MemberPicker/components/SingleOption.d.ts +2 -2
- package/dist/MemberPicker/components/SingleOption.js +9 -10
- package/dist/MemberPicker/index.js +46 -79
- package/dist/MemberPicker/interface.d.ts +2 -2
- package/dist/MemberPicker/utils/getUsersWithUserId.js +0 -1
- package/dist/Menu/Divider.d.ts +3 -3
- package/dist/Menu/MenuItem.d.ts +1 -1
- package/dist/Menu/SubMenu.d.ts +1 -1
- package/dist/Menu/SubMenu.js +1 -6
- package/dist/Menu/index.d.ts +2 -2
- package/dist/Menu/index.js +7 -16
- package/dist/Menu/style/dropdown.less +4 -2
- package/dist/Modal/index.d.ts +4 -4
- package/dist/Modal/index.js +108 -130
- package/dist/Modal/locale.js +4 -6
- package/dist/Navigator/components/Header/index.d.ts +2 -2
- package/dist/Navigator/components/Header/index.js +0 -2
- package/dist/Navigator/components/Menu/index.d.ts +2 -2
- package/dist/Navigator/components/Menu/index.js +8 -19
- package/dist/Navigator/components/MenuItem/index.d.ts +1 -1
- package/dist/Navigator/components/MenuItem/index.js +6 -9
- package/dist/Navigator/index.d.ts +1 -1
- package/dist/Navigator/index.js +5 -7
- package/dist/Pagination/index.d.ts +3 -3
- package/dist/Pagination/index.js +18 -43
- package/dist/Popconfirm/index.d.ts +2 -2
- package/dist/Popconfirm/index.js +19 -27
- package/dist/Popover/index.d.ts +2 -2
- package/dist/Popover/index.js +2 -9
- package/dist/Progress/index.js +21 -33
- package/dist/Radio/components/Group/index.d.ts +1 -1
- package/dist/Radio/components/Group/index.js +27 -36
- package/dist/Radio/components/Radio/index.d.ts +2 -2
- package/dist/Radio/components/Radio/index.js +10 -18
- package/dist/Radio/interface/radioGroup.d.ts +3 -3
- package/dist/Result/index.d.ts +7 -7
- package/dist/Result/index.js +17 -26
- package/dist/Result/noFound.js +0 -3
- package/dist/Result/serverError.js +0 -3
- package/dist/Result/unauthorized.js +1 -4
- package/dist/ScrollArea/index.js +6 -13
- package/dist/Select/components/MultipleOption.d.ts +2 -2
- package/dist/Select/components/MultipleOption.js +4 -8
- package/dist/Select/components/SingleOption.d.ts +2 -2
- package/dist/Select/components/SingleOption.js +5 -9
- package/dist/Select/index.d.ts +2 -2
- package/dist/Select/index.js +66 -134
- package/dist/Spin/CustomIcon/index.d.ts +2 -2
- package/dist/Spin/CustomIcon/index.js +0 -2
- package/dist/Spin/Icon/index.d.ts +2 -2
- package/dist/Spin/index.d.ts +2 -2
- package/dist/Spin/index.js +1 -10
- package/dist/Steps/components/ProcessIcon/index.d.ts +2 -2
- package/dist/Steps/components/ProcessIcon/index.js +0 -2
- package/dist/Steps/components/Step/index.d.ts +3 -3
- package/dist/Steps/components/Step/index.js +2 -8
- package/dist/Steps/index.d.ts +3 -3
- package/dist/Steps/index.js +8 -10
- package/dist/Switch/index.js +17 -30
- package/dist/Table/Table.js +88 -131
- package/dist/Table/components/Empty/index.d.ts +2 -2
- package/dist/Table/components/Empty/index.js +0 -2
- package/dist/Table/components/Loading/index.d.ts +2 -2
- package/dist/Table/components/Loading/index.js +0 -2
- package/dist/Table/components/TableBodyRowList/index.d.ts +2 -2
- package/dist/Table/components/TableBodyRowList/index.js +19 -39
- package/dist/Table/components/TableHead/index.d.ts +1 -1
- package/dist/Table/components/TableHead/index.js +56 -82
- package/dist/Table/hooks/useFrame.d.ts +1 -1
- package/dist/Table/hooks/useFrame.js +9 -24
- package/dist/Table/interface.d.ts +1 -1
- package/dist/Table/utils.js +8 -28
- package/dist/Tabs/TabPane.d.ts +2 -2
- package/dist/Tabs/index.d.ts +2 -2
- package/dist/Tabs/index.js +18 -33
- package/dist/Tooltip/index.d.ts +2 -2
- package/dist/Tooltip/index.js +12 -12
- package/dist/Tree/demo/basic/index.d.ts +2 -2
- package/dist/Tree/index.d.ts +1 -1
- package/dist/Tree/index.js +2 -4
- package/dist/_utils/hooks/useControlledState.js +9 -21
- package/dist/_utils/hooks/useId.js +4 -5
- package/dist/_utils/hooks/usePrefixCls.js +2 -5
- package/dist/index.js +3 -1
- package/dist/locale-provider/context.d.ts +1 -1
- package/dist/locale-provider/index.d.ts +1 -1
- package/dist/locale-provider/index.js +8 -33
- package/dist/message/index.js +3 -7
- package/dist/notification/demo/index.d.ts +2 -2
- package/dist/notification/demo/index.js +0 -1
- package/dist/notification/index.js +23 -32
- package/package.json +1 -1
package/dist/Button/index.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
var _excluded = ["type", "size", "shape", "loading", "disabled", "icon", "className", "prefixCls"];
|
|
2
|
-
|
|
2
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
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; }
|
|
8
|
-
|
|
9
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
11
|
import { LoadingLine } from '@aloudata/icons-react';
|
|
16
12
|
import { Button as AntdButton } from 'antd';
|
|
17
13
|
import { useCompactItemContext } from 'antd/lib/space/Compact';
|
|
@@ -27,22 +23,18 @@ export function getButtonType(buttonType) {
|
|
|
27
23
|
if (!['primary', 'secondary', 'dangerous', 'text', 'link'].includes(buttonType)) {
|
|
28
24
|
return 'default';
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
if (buttonType === 'dangerous') {
|
|
32
27
|
return 'primary';
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
if (buttonType === 'secondary') {
|
|
36
30
|
return 'default';
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
return buttonType;
|
|
40
33
|
}
|
|
41
34
|
export function getDangerStatus(buttonType) {
|
|
42
35
|
if (buttonType === 'dangerous') {
|
|
43
36
|
return true;
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
return false;
|
|
47
39
|
}
|
|
48
40
|
export function getButtonSizeClass(ButtonSize) {
|
|
@@ -52,18 +44,15 @@ export function getIconSize(ButtonSize) {
|
|
|
52
44
|
if (ButtonSize === 'large') {
|
|
53
45
|
return ICON_LARGE;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
if (ButtonSize === 'small') {
|
|
57
48
|
return ICON_SMALL;
|
|
58
49
|
}
|
|
59
|
-
|
|
60
50
|
return ICON_MIDDLE;
|
|
61
51
|
}
|
|
62
52
|
export function getShape(ButtonShape) {
|
|
63
53
|
if (ButtonShape === 'circle') {
|
|
64
54
|
return ButtonShape;
|
|
65
55
|
}
|
|
66
|
-
|
|
67
56
|
return 'default';
|
|
68
57
|
}
|
|
69
58
|
export var setIcon = function setIcon(iconNode, size, loading) {
|
|
@@ -73,11 +62,9 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
73
62
|
size: ICON_LARGE,
|
|
74
63
|
fill: 'currentColor'
|
|
75
64
|
}, iconNode.props);
|
|
76
|
-
|
|
77
65
|
p.size = getIconSize(size);
|
|
78
66
|
return /*#__PURE__*/React.cloneElement(iconNode, p);
|
|
79
67
|
}
|
|
80
|
-
|
|
81
68
|
if (loading) {
|
|
82
69
|
return /*#__PURE__*/React.createElement(LoadingLine, {
|
|
83
70
|
spin: true,
|
|
@@ -85,36 +72,30 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
85
72
|
fill: "currentColor"
|
|
86
73
|
});
|
|
87
74
|
}
|
|
88
|
-
|
|
89
75
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
90
76
|
};
|
|
91
|
-
|
|
92
77
|
function Button(props) {
|
|
93
78
|
var _props$type = props.type,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
79
|
+
type = _props$type === void 0 ? 'secondary' : _props$type,
|
|
80
|
+
customSize = props.size,
|
|
81
|
+
_props$shape = props.shape,
|
|
82
|
+
shape = _props$shape === void 0 ? 'default' : _props$shape,
|
|
83
|
+
_props$loading = props.loading,
|
|
84
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
85
|
+
disabled = props.disabled,
|
|
86
|
+
icon = props.icon,
|
|
87
|
+
className = props.className,
|
|
88
|
+
customizePrefixCls = props.prefixCls,
|
|
89
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
106
90
|
var contentSize = useContext(SizeContext);
|
|
107
|
-
|
|
108
91
|
var _React$useContext = React.useContext(ConfigContext),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
92
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
93
|
+
direction = _React$useContext.direction;
|
|
94
|
+
var prefixCls = getPrefixCls('btn', customizePrefixCls);
|
|
95
|
+
// ===================== Compact Item =====================
|
|
114
96
|
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
97
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
98
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
118
99
|
var size = compactSize || customSize || contentSize || 'middle';
|
|
119
100
|
return /*#__PURE__*/React.createElement(AntdButton, _extends({}, rest, {
|
|
120
101
|
disabled: loading ? true : disabled,
|
|
@@ -125,5 +106,4 @@ function Button(props) {
|
|
|
125
106
|
shape: getShape(shape)
|
|
126
107
|
}), props.children);
|
|
127
108
|
}
|
|
128
|
-
|
|
129
109
|
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ICheckboxGroupProps } from '../../type';
|
|
3
|
-
declare const CheckboxGroup: (props: ICheckboxGroupProps) => JSX.Element;
|
|
3
|
+
declare const CheckboxGroup: (props: ICheckboxGroupProps) => React.JSX.Element;
|
|
4
4
|
export default CheckboxGroup;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
var _excluded = ["className", "direction"];
|
|
2
|
-
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
4
|
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; }
|
|
8
|
-
|
|
9
5
|
import { Checkbox as AntdCheckbox } from 'antd';
|
|
10
6
|
import classNames from 'classnames';
|
|
11
7
|
import React from 'react';
|
|
12
|
-
import { EDirection } from "../../type";
|
|
8
|
+
import { EDirection } from "../../type";
|
|
9
|
+
// "vertical" | "horizontal"
|
|
13
10
|
|
|
14
11
|
var AntdCheckboxGroup = AntdCheckbox.Group;
|
|
15
|
-
|
|
16
12
|
var CheckboxGroup = function CheckboxGroup(props) {
|
|
17
13
|
var className = props.className,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
direction = props.direction,
|
|
15
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
21
16
|
return /*#__PURE__*/React.createElement(AntdCheckboxGroup, _extends({
|
|
22
17
|
className: classNames('ald-checkbox', className, {
|
|
23
18
|
'ald-checkout-group-vertical': direction === EDirection.VERTICAL
|
|
24
19
|
})
|
|
25
20
|
}, otherProps));
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
export default CheckboxGroup;
|
package/dist/Checkbox/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ICheckboxGroupProps, ICheckboxProps } from './type';
|
|
3
3
|
export type { CheckboxChangeEvent } from 'antd/lib/checkbox/Checkbox';
|
|
4
4
|
export type { CheckboxOptionType, CheckboxValueType, } from 'antd/lib/checkbox/Group';
|
|
5
5
|
export type { ICheckboxProps, ICheckboxGroupProps };
|
|
6
|
-
declare function Checkbox(props: ICheckboxProps): JSX.Element;
|
|
6
|
+
declare function Checkbox(props: ICheckboxProps): React.JSX.Element;
|
|
7
7
|
declare namespace Checkbox {
|
|
8
|
-
var Group: (props: ICheckboxGroupProps) => JSX.Element;
|
|
8
|
+
var Group: (props: ICheckboxGroupProps) => React.JSX.Element;
|
|
9
9
|
}
|
|
10
10
|
export default Checkbox;
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
var _excluded = ["className", "disabled"],
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
_excluded2 = ["className", "disabled"];
|
|
4
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
|
|
6
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
-
|
|
8
5
|
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; }
|
|
9
|
-
|
|
10
6
|
import { Checkbox as AntdCheckbox } from 'antd';
|
|
11
7
|
import DisabledContext from 'antd/lib/config-provider/DisabledContext';
|
|
12
8
|
import classNames from 'classnames';
|
|
13
9
|
import React from 'react';
|
|
14
10
|
import CheckboxGroup from "./component/CheckboxGroup";
|
|
15
|
-
|
|
16
11
|
function Checkbox(props) {
|
|
17
12
|
var className = props.className,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
customDisabled = props.disabled,
|
|
14
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
21
15
|
var disabled = React.useContext(DisabledContext);
|
|
22
16
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
23
17
|
return /*#__PURE__*/React.createElement(AntdCheckbox, _extends({
|
|
@@ -25,12 +19,10 @@ function Checkbox(props) {
|
|
|
25
19
|
disabled: mergedDisabled
|
|
26
20
|
}, otherProps));
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
Checkbox.Group = function Group(props) {
|
|
30
23
|
var className = props.className,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
customDisabled = props.disabled,
|
|
25
|
+
otherProps = _objectWithoutProperties(props, _excluded2);
|
|
34
26
|
var disabled = React.useContext(DisabledContext);
|
|
35
27
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
36
28
|
return /*#__PURE__*/React.createElement(CheckboxGroup, _extends({
|
|
@@ -38,5 +30,4 @@ Checkbox.Group = function Group(props) {
|
|
|
38
30
|
disabled: mergedDisabled
|
|
39
31
|
}, otherProps));
|
|
40
32
|
};
|
|
41
|
-
|
|
42
33
|
export default Checkbox;
|
package/dist/Checkbox/type.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export var EDirection
|
|
2
|
-
|
|
3
|
-
(function (EDirection) {
|
|
1
|
+
export var EDirection = /*#__PURE__*/function (EDirection) {
|
|
4
2
|
EDirection["VERTICAL"] = "vertical";
|
|
5
3
|
EDirection["HORIZONTAL"] = "horizontal";
|
|
6
|
-
|
|
4
|
+
return EDirection;
|
|
5
|
+
}({});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export var colors = ['#171717', '#333333', '#545454', '#656565', '#898989', '#B4B4B4', '#D4D4D4', '#E2E2E2', '#F8F8F8', '#FFFFFF', '#F28D2C', '#B7992D', '#59A14E', '#4A9794', '#4E79A7', '#B07AA1', '#D47295', '#E15658', '#9D7560', '#78706E', '#F9A654', '#D3B348', '#71B965', '#69AAA4', '#74A1C8', '#C290B4', '#E899B3', '#F17B79', '#BA9482', '#998E8C', '#FFBF7C', '#F1CE63', '#8CD17E', '#86BCB6', '#A0CBE8', '#D4A6C9', '#FABFD2', '#FF9D99', '#D7B5A6', '#B6ADAA'];
|
|
1
|
+
export var colors = ['#171717', '#333333', '#545454', '#656565', '#898989', '#B4B4B4', '#D4D4D4', '#E2E2E2', '#F8F8F8', '#FFFFFF', '#F28D2C', '#B7992D', '#59A14E', '#4A9794', '#4E79A7', '#B07AA1', '#D47295', '#E15658', '#9D7560', '#78706E', '#F9A654', '#D3B348', '#71B965', '#69AAA4', '#74A1C8', '#C290B4', '#E899B3', '#F17B79', '#BA9482', '#998E8C', '#FFBF7C', '#F1CE63', '#8CD17E', '#86BCB6', '#A0CBE8', '#D4A6C9', '#FABFD2', '#FF9D99', '#D7B5A6', '#B6ADAA'];
|
|
2
2
|
|
|
3
|
+
// 这 2个颜色因为比较白,需要加个灰色的 border,不然看不见
|
|
3
4
|
export var specialColors = ['#F8F8F8', '#FFFFFF'];
|
|
@@ -7,4 +7,4 @@ export interface IColorPickerProps {
|
|
|
7
7
|
onChange?: (color: string) => void;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export default function ColorPicker({ className, value, icon, onChange, defaultColor, localStorageKey, }: IColorPickerProps): JSX.Element;
|
|
10
|
+
export default function ColorPicker({ className, value, icon, onChange, defaultColor, localStorageKey, }: IColorPickerProps): React.JSX.Element;
|
|
@@ -1,106 +1,79 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
4
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
|
|
11
6
|
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."); }
|
|
12
|
-
|
|
13
7
|
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); }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
19
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
|
|
21
11
|
import { FoldDownFill } from '@aloudata/icons-react';
|
|
22
12
|
import cls from 'classnames';
|
|
23
13
|
import React, { useEffect, useRef, useState } from 'react';
|
|
24
14
|
import Dropdown from "../Dropdown";
|
|
25
15
|
import { colors as defaultColors, specialColors } from "./constant";
|
|
26
|
-
|
|
27
16
|
function getLocalRecentColors(localStorageKey) {
|
|
28
17
|
if (!window.localStorage) {
|
|
29
18
|
return [];
|
|
30
19
|
}
|
|
31
|
-
|
|
32
20
|
var colorStr = localStorage.getItem(localStorageKey);
|
|
33
|
-
|
|
34
21
|
if (!colorStr) {
|
|
35
22
|
return [];
|
|
36
23
|
}
|
|
37
|
-
|
|
38
24
|
return colorStr.split(',');
|
|
39
25
|
}
|
|
40
|
-
|
|
41
26
|
function setLocalRecentColors(localStorageKey, colors) {
|
|
42
27
|
if (!window.localStorage) {
|
|
43
28
|
return;
|
|
44
29
|
}
|
|
45
|
-
|
|
46
30
|
localStorage.setItem(localStorageKey, colors.join(','));
|
|
47
31
|
}
|
|
48
|
-
|
|
49
32
|
var MAX_RECENT_COLORS = 10;
|
|
50
33
|
export default function ColorPicker(_ref) {
|
|
51
34
|
var className = _ref.className,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
value = _ref.value,
|
|
36
|
+
icon = _ref.icon,
|
|
37
|
+
onChange = _ref.onChange,
|
|
38
|
+
_ref$defaultColor = _ref.defaultColor,
|
|
39
|
+
defaultColor = _ref$defaultColor === void 0 ? defaultColors[0] : _ref$defaultColor,
|
|
40
|
+
_ref$localStorageKey = _ref.localStorageKey,
|
|
41
|
+
localStorageKey = _ref$localStorageKey === void 0 ? 'ald_recent_colors' : _ref$localStorageKey;
|
|
60
42
|
var _useState = useState(false),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
open = _useState2[0],
|
|
45
|
+
setOpen = _useState2[1];
|
|
65
46
|
var _useState3 = useState([]),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
recentColors = _useState4[0],
|
|
49
|
+
setRecentColors = _useState4[1];
|
|
70
50
|
var overlayRef = useRef(null);
|
|
71
51
|
var wrapRef = useRef(null);
|
|
72
52
|
useEffect(function () {
|
|
73
53
|
setRecentColors(getLocalRecentColors(localStorageKey));
|
|
74
54
|
}, [localStorageKey]);
|
|
75
|
-
|
|
76
55
|
var onColorSelect = function onColorSelect(color) {
|
|
77
56
|
var newRecentColors = [color].concat(_toConsumableArray(recentColors.filter(function (c) {
|
|
78
57
|
return c !== color;
|
|
79
58
|
})));
|
|
80
|
-
|
|
81
59
|
if (newRecentColors.length > MAX_RECENT_COLORS) {
|
|
82
60
|
newRecentColors.pop();
|
|
83
61
|
}
|
|
84
|
-
|
|
85
62
|
setRecentColors(newRecentColors);
|
|
86
63
|
setLocalRecentColors(localStorageKey, newRecentColors);
|
|
87
64
|
onChange === null || onChange === void 0 ? void 0 : onChange(color);
|
|
88
65
|
setOpen(false);
|
|
89
66
|
};
|
|
90
|
-
|
|
91
67
|
useEffect(function () {
|
|
92
68
|
var handleClick = function handleClick(e) {
|
|
93
69
|
var _wrapRef$current, _overlayRef$current;
|
|
94
|
-
|
|
95
70
|
if ((_wrapRef$current = wrapRef.current) !== null && _wrapRef$current !== void 0 && _wrapRef$current.contains(e.target)) {
|
|
96
71
|
return setOpen(!open);
|
|
97
72
|
}
|
|
98
|
-
|
|
99
73
|
if (!((_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.contains(e.target))) {
|
|
100
74
|
return setOpen(false);
|
|
101
75
|
}
|
|
102
76
|
};
|
|
103
|
-
|
|
104
77
|
document.addEventListener('click', handleClick);
|
|
105
78
|
return function () {
|
|
106
79
|
document.removeEventListener('click', handleClick);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
declare const defaultRenderEmpty: (componentName?: string) => React.ReactNode;
|
|
3
|
-
export
|
|
3
|
+
export type RenderEmptyHandler = typeof defaultRenderEmpty;
|
|
4
4
|
export default defaultRenderEmpty;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConfigConsumer } from '.';
|
|
3
3
|
import Empty from "../Empty";
|
|
4
|
-
|
|
5
4
|
var defaultRenderEmpty = function defaultRenderEmpty(componentName) {
|
|
6
5
|
return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {
|
|
7
6
|
var getPrefixCls = _ref.getPrefixCls;
|
|
8
7
|
var prefix = getPrefixCls('empty');
|
|
9
|
-
|
|
10
8
|
switch (componentName) {
|
|
11
9
|
case 'Table':
|
|
12
10
|
case 'List':
|
|
13
11
|
return /*#__PURE__*/React.createElement(Empty, {
|
|
14
12
|
image: Empty.PRESENTED_IMAGE_SEARCH_SMALL
|
|
15
13
|
});
|
|
16
|
-
|
|
17
14
|
case 'Select':
|
|
18
15
|
case 'TreeSelect':
|
|
19
16
|
case 'Cascader':
|
|
@@ -26,12 +23,10 @@ var defaultRenderEmpty = function defaultRenderEmpty(componentName) {
|
|
|
26
23
|
});
|
|
27
24
|
|
|
28
25
|
/* istanbul ignore next */
|
|
29
|
-
|
|
30
26
|
default:
|
|
31
27
|
// Should never hit if we take all the component into consider.
|
|
32
28
|
return /*#__PURE__*/React.createElement(Empty, null);
|
|
33
29
|
}
|
|
34
30
|
});
|
|
35
31
|
};
|
|
36
|
-
|
|
37
32
|
export default defaultRenderEmpty;
|
|
@@ -6,14 +6,14 @@ export interface IUser {
|
|
|
6
6
|
photo?: string;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type TUser = IUser[];
|
|
10
10
|
export interface IGetUserListParams {
|
|
11
11
|
name?: string;
|
|
12
12
|
id?: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type getUsersByIdsType = ((params: string[]) => Promise<TUser>) | undefined;
|
|
15
|
+
export type getUsersByKeywordsType = ((params: string) => Promise<TUser>) | undefined;
|
|
16
|
+
export type getUserListType = {
|
|
17
17
|
getUsersByIds?: getUsersByIdsType;
|
|
18
18
|
getUsersByKeywords?: getUsersByKeywordsType;
|
|
19
19
|
};
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
var GetUserListContext = /*#__PURE__*/React.createContext({});
|
|
3
3
|
export var SizeContextProvider = function SizeContextProvider(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getUsersByIds = _ref.getUsersByIds,
|
|
6
|
+
getUsersByKeywords = _ref.getUsersByKeywords;
|
|
7
7
|
return /*#__PURE__*/React.createElement(GetUserListContext.Consumer, null, function (originGetUserList) {
|
|
8
8
|
return /*#__PURE__*/React.createElement(GetUserListContext.Provider, {
|
|
9
9
|
value: {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import GetUserListContext from "../getUserList";
|
|
3
|
-
|
|
4
3
|
function useGetUserList() {
|
|
5
4
|
var _useContext = useContext(GetUserListContext),
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
getUsersByIds = _useContext.getUsersByIds,
|
|
6
|
+
getUsersByKeywords = _useContext.getUsersByKeywords;
|
|
9
7
|
return {
|
|
10
8
|
getUsersByIds: getUsersByIds,
|
|
11
9
|
getUsersByKeywords: getUsersByKeywords
|
|
12
10
|
};
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
export default useGetUserList;
|
|
@@ -5,13 +5,11 @@ import useGetUserList from "./hooks/useGetUserList";
|
|
|
5
5
|
import SizeContext from "./sizeContext";
|
|
6
6
|
export { ConfigContext } from 'antd/lib/config-provider';
|
|
7
7
|
export { ConfigConsumer } from 'antd/lib/config-provider/';
|
|
8
|
-
|
|
9
8
|
var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
|
|
10
9
|
var children = props.children,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
getUsersByIds = props.getUsersByIds,
|
|
11
|
+
getUsersByKeywords = props.getUsersByKeywords;
|
|
13
12
|
var childNode = children;
|
|
14
|
-
|
|
15
13
|
if (getUsersByIds || getUsersByKeywords) {
|
|
16
14
|
childNode = /*#__PURE__*/React.createElement(getUserListContext.Provider, {
|
|
17
15
|
value: {
|
|
@@ -20,10 +18,8 @@ var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
|
|
|
20
18
|
}
|
|
21
19
|
}, children);
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return /*#__PURE__*/React.createElement(ConfigProvider, props, childNode);
|
|
25
22
|
};
|
|
26
|
-
|
|
27
23
|
AldCustomConfigProvider.ConfigContext = ConfigProvider.ConfigContext;
|
|
28
24
|
AldCustomConfigProvider.SizeContext = SizeContext;
|
|
29
25
|
AldCustomConfigProvider.useConfig = ConfigProvider.useConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
3
3
|
declare const SizeContext: React.Context<SizeType>;
|
|
4
4
|
export interface ISizeContextProps {
|
|
5
5
|
size?: SizeType;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
var SizeContext = /*#__PURE__*/React.createContext(undefined);
|
|
3
3
|
export var SizeContextProvider = function SizeContextProvider(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
|
-
|
|
5
|
+
size = _ref.size;
|
|
6
6
|
return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (originSize) {
|
|
7
7
|
return /*#__PURE__*/React.createElement(SizeContext.Provider, {
|
|
8
8
|
value: size || originSize
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
6
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
|
-
|
|
9
7
|
import classNames from 'classnames';
|
|
10
8
|
import React from 'react';
|
|
11
9
|
export default function Cell(props) {
|
|
12
10
|
var style = props.style,
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
value = props.value;
|
|
15
12
|
if (typeof value === 'string') {
|
|
16
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
14
|
style: style,
|
|
18
15
|
className: "ald-data-preview-body-cell"
|
|
19
16
|
}, value);
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
23
19
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
20
|
style: style,
|
|
25
21
|
className: "ald-data-preview-body-cell"
|
|
26
22
|
}, JSON.stringify(value));
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
if (_typeof(value) === 'object' && value === null) {
|
|
30
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
26
|
style: _objectSpread({
|
|
@@ -35,7 +30,6 @@ export default function Cell(props) {
|
|
|
35
30
|
className: classNames('ald-data-preview-body-cell', 'ald-data-preview-body-cell-null')
|
|
36
31
|
}, "null");
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
34
|
style: style,
|
|
41
35
|
className: "ald-data-preview-body-cell"
|
|
@@ -4,6 +4,6 @@ interface IErrorProps {
|
|
|
4
4
|
wrapWidth: number;
|
|
5
5
|
errorMsg?: string;
|
|
6
6
|
}
|
|
7
|
-
declare function ErrorBody(props: IErrorProps): JSX.Element;
|
|
7
|
+
declare function ErrorBody(props: IErrorProps): React.JSX.Element;
|
|
8
8
|
declare const _default: React.MemoExoticComponent<typeof ErrorBody>;
|
|
9
9
|
export default _default;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import Result from "../../../Result";
|
|
3
|
-
|
|
4
3
|
function ErrorBody(props) {
|
|
5
4
|
var contentWidth = props.contentWidth,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
wrapWidth = props.wrapWidth,
|
|
6
|
+
_props$errorMsg = props.errorMsg,
|
|
7
|
+
errorMsg = _props$errorMsg === void 0 ? '加载失败' : _props$errorMsg;
|
|
9
8
|
var width = contentWidth > wrapWidth ? wrapWidth : contentWidth;
|
|
10
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
10
|
className: "ald-data-preview-table-error",
|
|
@@ -17,5 +16,4 @@ function ErrorBody(props) {
|
|
|
17
16
|
title: errorMsg
|
|
18
17
|
}));
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
export default /*#__PURE__*/memo(ErrorBody);
|
|
@@ -7,6 +7,6 @@ interface IHeader {
|
|
|
7
7
|
rowRange: [number, number];
|
|
8
8
|
rows: number;
|
|
9
9
|
}
|
|
10
|
-
declare function SkeletonBody(props: IHeader): JSX.Element;
|
|
10
|
+
declare function SkeletonBody(props: IHeader): React.JSX.Element;
|
|
11
11
|
declare const _default: React.MemoExoticComponent<typeof SkeletonBody>;
|
|
12
12
|
export default _default;
|