@aloudata/aloudata-design 1.9.8 → 1.9.10
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 +14 -21
- package/dist/AldTable/index.d.ts +2 -2
- package/dist/AldTable/index.js +34 -48
- 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 +4 -11
- 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/AldTable/helper.js
CHANGED
|
@@ -2,8 +2,8 @@ import _ from 'lodash';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export function getTableColumns(_ref) {
|
|
4
4
|
var columns = _ref.columns,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
columnSizing = _ref.columnSizing,
|
|
6
|
+
totalWidth = _ref.totalWidth;
|
|
7
7
|
var columnWidths = getColumnWidths(columns, columnSizing, totalWidth);
|
|
8
8
|
return _.map(columns, function (col, index) {
|
|
9
9
|
return {
|
|
@@ -15,9 +15,7 @@ export function getTableColumns(_ref) {
|
|
|
15
15
|
}, col.title) : col.title,
|
|
16
16
|
Cell: function Cell(_ref2) {
|
|
17
17
|
var row = _ref2.row;
|
|
18
|
-
|
|
19
18
|
var colValue = _.get(row.original, col.dataIndex || '');
|
|
20
|
-
|
|
21
19
|
var node = col.render ? col.render(colValue, row.original, row.index) : colValue;
|
|
22
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
21
|
className: prefixCls('td-default')
|
|
@@ -29,6 +27,7 @@ export function getTableColumns(_ref) {
|
|
|
29
27
|
};
|
|
30
28
|
});
|
|
31
29
|
}
|
|
30
|
+
|
|
32
31
|
/**
|
|
33
32
|
* 计算
|
|
34
33
|
* @param columns
|
|
@@ -36,29 +35,23 @@ export function getTableColumns(_ref) {
|
|
|
36
35
|
* @param totalWidth
|
|
37
36
|
* @returns
|
|
38
37
|
*/
|
|
39
|
-
|
|
40
38
|
export function getColumnWidths(columns, columnSizing, totalWidth) {
|
|
41
39
|
// 可改变列宽情况,react-table 可拖动列宽要求列宽值必须是数字,因为将百分比列宽转换为数字
|
|
42
|
-
var DEFAULT_WIDTH = 150;
|
|
43
|
-
|
|
40
|
+
var DEFAULT_WIDTH = 150;
|
|
41
|
+
// 计算出每个列的具体宽度值
|
|
44
42
|
var columnWidths = _.map(columns, function (col) {
|
|
45
43
|
var width = col.width;
|
|
46
|
-
|
|
47
44
|
if (typeof width === 'number') {
|
|
48
45
|
return width;
|
|
49
46
|
}
|
|
50
|
-
|
|
51
47
|
if (typeof width === 'string' && isPercentage(width)) {
|
|
52
48
|
var widthNum = getNumberFromPercentageStr(width);
|
|
53
49
|
return widthNum * totalWidth / 100;
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
return DEFAULT_WIDTH;
|
|
57
52
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
var totalColumnWidth = _.sum(columnWidths);
|
|
54
|
+
// 如果实际宽度大于列总宽度之和,则将多余的宽度按列宽的比例分配给各个列
|
|
62
55
|
if (totalWidth !== totalColumnWidth) {
|
|
63
56
|
// 如果实际宽度大于或小于列总宽度之和,则将差额的宽度按列宽的比例分配给各个列
|
|
64
57
|
var widthDiff = totalWidth - totalColumnWidth;
|
|
@@ -67,31 +60,31 @@ export function getColumnWidths(columns, columnSizing, totalWidth) {
|
|
|
67
60
|
});
|
|
68
61
|
var newColumnWidths = columnWidths.map(function (width, index) {
|
|
69
62
|
return width + widthDiff * widthRatios[index];
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
var newTotalColumnWidth = _.sum(newColumnWidths); // 计算并处理可能存在的误差
|
|
63
|
+
});
|
|
73
64
|
|
|
65
|
+
// 计算新的列宽度总和
|
|
66
|
+
var newTotalColumnWidth = _.sum(newColumnWidths);
|
|
74
67
|
|
|
75
|
-
|
|
68
|
+
// 计算并处理可能存在的误差
|
|
69
|
+
var errorWidth = totalWidth - newTotalColumnWidth;
|
|
76
70
|
|
|
71
|
+
// 将误差加到最后一个列宽上
|
|
77
72
|
newColumnWidths[newColumnWidths.length - 1] += errorWidth;
|
|
78
73
|
return newColumnWidths;
|
|
79
74
|
} else {
|
|
80
75
|
return columnWidths;
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
|
-
|
|
84
78
|
function getNumberFromPercentageStr(str) {
|
|
85
79
|
var numberStr = str.replace('%', '');
|
|
86
80
|
return parseFloat(numberStr);
|
|
87
81
|
}
|
|
82
|
+
|
|
88
83
|
/**
|
|
89
84
|
* 判断是否百分比字符串
|
|
90
85
|
* @param str
|
|
91
86
|
* @returns
|
|
92
87
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
88
|
export function isPercentage(str) {
|
|
96
89
|
var regex = /^100(\.\d+)?%?$|^\d{1,2}(\.\d+)?%$/;
|
|
97
90
|
return regex.test(str);
|
package/dist/AldTable/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ITableProps } from './types';
|
|
3
|
-
declare function AldTable<TDataItem extends object>(props: ITableProps<TDataItem>): JSX.Element;
|
|
3
|
+
declare function AldTable<TDataItem extends object>(props: ITableProps<TDataItem>): React.JSX.Element;
|
|
4
4
|
export default AldTable;
|
package/dist/AldTable/index.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
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); }
|
|
1
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); }
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
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); }
|
|
5
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
7
|
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."); }
|
|
8
|
-
|
|
9
8
|
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); }
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
9
|
+
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; }
|
|
10
|
+
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; } }
|
|
15
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
17
12
|
import classnames from 'classnames';
|
|
18
13
|
import _ from 'lodash';
|
|
19
14
|
import ResizeObserver from 'rc-resize-observer';
|
|
@@ -23,57 +18,49 @@ import { Empty, Pagination, ScrollArea, Spin } from '..';
|
|
|
23
18
|
import { getTableColumns, prefixCls } from "./helper";
|
|
24
19
|
// 32 行高 + 1 底线高度
|
|
25
20
|
var HEADER_HEIGHT = 33;
|
|
26
|
-
|
|
27
21
|
function AldTable(props) {
|
|
28
22
|
var columns = props.columns,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
data = props.data,
|
|
24
|
+
rowKey = props.rowKey,
|
|
25
|
+
columnSizing = props.columnSizing,
|
|
26
|
+
sticky = props.sticky,
|
|
27
|
+
loading = props.loading,
|
|
28
|
+
pagination = props.pagination,
|
|
29
|
+
_props$scroll = props.scroll,
|
|
30
|
+
scroll = _props$scroll === void 0 ? {} : _props$scroll,
|
|
31
|
+
emptyComponent = props.empty;
|
|
39
32
|
var _useState = useState(null),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
totalSize = _useState2[0],
|
|
35
|
+
setTotalSize = _useState2[1];
|
|
44
36
|
var tableColumns = useMemo(function () {
|
|
45
37
|
if (!totalSize) {
|
|
46
38
|
return [];
|
|
47
39
|
}
|
|
48
|
-
|
|
49
40
|
return getTableColumns({
|
|
50
41
|
columns: columns,
|
|
51
42
|
columnSizing: !!columnSizing,
|
|
52
43
|
totalWidth: totalSize.width
|
|
53
44
|
});
|
|
54
45
|
}, [columns, totalSize, columnSizing]);
|
|
55
|
-
|
|
56
46
|
var _useTable = useTable({
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
47
|
+
columns: tableColumns,
|
|
48
|
+
data: data,
|
|
49
|
+
getRowId: function getRowId(row, index) {
|
|
50
|
+
var rowKeyStr = index;
|
|
51
|
+
if (typeof rowKey === 'function') {
|
|
52
|
+
rowKeyStr = rowKey(row);
|
|
53
|
+
} else if (rowKey !== undefined) {
|
|
54
|
+
rowKeyStr = _.get(row, rowKey, index);
|
|
55
|
+
}
|
|
56
|
+
return _.toString(rowKeyStr);
|
|
66
57
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rows = _useTable.rows,
|
|
74
|
-
prepareRow = _useTable.prepareRow,
|
|
75
|
-
headerGroups = _useTable.headerGroups;
|
|
76
|
-
|
|
58
|
+
}, useBlockLayout, useResizeColumns),
|
|
59
|
+
getTableProps = _useTable.getTableProps,
|
|
60
|
+
getTableBodyProps = _useTable.getTableBodyProps,
|
|
61
|
+
rows = _useTable.rows,
|
|
62
|
+
prepareRow = _useTable.prepareRow,
|
|
63
|
+
headerGroups = _useTable.headerGroups;
|
|
77
64
|
var y = scroll.y;
|
|
78
65
|
var tableProps = useMemo(function () {
|
|
79
66
|
return getTableProps({});
|
|
@@ -152,5 +139,4 @@ function AldTable(props) {
|
|
|
152
139
|
className: prefixCls('pagination')
|
|
153
140
|
}, /*#__PURE__*/React.createElement(Pagination, pagination)));
|
|
154
141
|
}
|
|
155
|
-
|
|
156
142
|
export default AldTable;
|
package/dist/App/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
var _excluded = ["children", "className"];
|
|
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 { legacyLogicalPropertiesTransformer, StyleProvider } from '@ant-design/cssinjs';
|
|
10
6
|
import { App, ConfigProvider } from 'antd';
|
|
11
7
|
import classNames from 'classnames';
|
|
12
8
|
import React from 'react';
|
|
13
|
-
|
|
14
9
|
var AldApp = function AldApp(_ref) {
|
|
15
10
|
var children = _ref.children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
className = _ref.className,
|
|
12
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
19
13
|
return /*#__PURE__*/React.createElement(StyleProvider, {
|
|
20
14
|
hashPriority: "high",
|
|
21
15
|
transformers: [legacyLogicalPropertiesTransformer]
|
|
@@ -29,5 +23,4 @@ var AldApp = function AldApp(_ref) {
|
|
|
29
23
|
}
|
|
30
24
|
}, children)));
|
|
31
25
|
};
|
|
32
|
-
|
|
33
26
|
export default AldApp;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const SearchSmall: () => JSX.Element;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const SearchSmall: () => React.JSX.Element;
|
|
3
3
|
export default SearchSmall;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
2
|
var SearchSmall = function SearchSmall() {
|
|
4
3
|
return /*#__PURE__*/React.createElement("svg", {
|
|
5
4
|
version: "1.1",
|
|
@@ -21,5 +20,4 @@ var SearchSmall = function SearchSmall() {
|
|
|
21
20
|
d: "M63,45.8c1.7-2.6,2.6-5.6,2.6-8.7c0-4.1-1.6-8.1-4.6-11c-2.9-2.9-6.9-4.6-11-4.6c-3.1,0-6.1,0.9-8.7,2.6 s-4.6,4.2-5.8,7c-1.2,2.9-1.5,6-0.9,9c0.6,3,2.1,5.8,4.3,8c2.2,2.2,5,3.7,8,4.3c3,0.6,6.2,0.3,9-0.9C58.8,50.4,61.3,48.4,63,45.8z M50,93.8c13.4,0,25.4-6,33.4-15.5C75.6,68.4,63.5,62.1,50,62.1c-13.5,0-25.6,6.3-33.4,16.2C24.6,87.7,36.6,93.8,50,93.8z"
|
|
22
21
|
}));
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
export default SearchSmall;
|
|
@@ -2,7 +2,7 @@ import { AvatarProps as antdAvatarProps } from 'antd/lib/avatar/avatar';
|
|
|
2
2
|
import Group from 'antd/lib/avatar/group';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export type { GroupProps } from 'antd/lib/avatar/group';
|
|
5
|
-
|
|
5
|
+
type TSize = 'large' | 'middle' | 'small' | number;
|
|
6
6
|
export interface IAvatarProps extends Omit<antdAvatarProps, 'size'> {
|
|
7
7
|
/**
|
|
8
8
|
* @description 指定头像的形状
|
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
var _excluded = ["size", "showFullValue", "children", "src"];
|
|
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 InternalAvatar from 'antd/lib/avatar/avatar';
|
|
10
6
|
import classNames from 'classnames';
|
|
11
7
|
import * as React from 'react';
|
|
12
8
|
import DefaultAvatar from "./avatar";
|
|
13
9
|
var ZERO = 0;
|
|
14
|
-
|
|
15
10
|
var Avatar = function Avatar(props) {
|
|
16
11
|
var _props$size = props.size,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
13
|
+
_props$showFullValue = props.showFullValue,
|
|
14
|
+
showFullValue = _props$showFullValue === void 0 ? false : _props$showFullValue,
|
|
15
|
+
children = props.children,
|
|
16
|
+
src = props.src,
|
|
17
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
24
18
|
var getSizeClass = function getSizeClass(avatarSize) {
|
|
25
19
|
var defaultAvatarClassName = '';
|
|
26
|
-
|
|
27
20
|
if (typeof src === 'undefined' && typeof children === 'undefined') {
|
|
28
21
|
defaultAvatarClassName = 'ald-avatar-default';
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
if (['large', 'small', 'mini'].includes("".concat(avatarSize))) {
|
|
32
24
|
return classNames('ald-avatar', defaultAvatarClassName, "ald-avatar-".concat(avatarSize));
|
|
33
25
|
}
|
|
34
|
-
|
|
35
26
|
return classNames('ald-avatar', defaultAvatarClassName, 'ald-avatar-middle');
|
|
36
27
|
};
|
|
37
|
-
|
|
38
28
|
var getChildren = function getChildren() {
|
|
39
29
|
if (!showFullValue && typeof children === 'string') {
|
|
40
30
|
return children[ZERO].toLocaleUpperCase();
|
|
41
31
|
}
|
|
42
|
-
|
|
43
32
|
return children;
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
var defaultSrc = React.useMemo(function () {
|
|
47
35
|
if (typeof src === 'undefined' && typeof children === 'undefined') {
|
|
48
36
|
return /*#__PURE__*/React.createElement(DefaultAvatar, null);
|
|
49
37
|
}
|
|
50
|
-
|
|
51
38
|
return src;
|
|
52
39
|
}, [src, children]);
|
|
53
40
|
return /*#__PURE__*/React.createElement(InternalAvatar, _extends({
|
|
@@ -56,5 +43,4 @@ var Avatar = function Avatar(props) {
|
|
|
56
43
|
src: defaultSrc
|
|
57
44
|
}, restProps), getChildren());
|
|
58
45
|
};
|
|
59
|
-
|
|
60
46
|
export default Avatar;
|
|
@@ -5,7 +5,7 @@ interface IBreadcrumbItemInterface extends React.FC<BreadcrumbItemProps> {
|
|
|
5
5
|
__ANT_BREADCRUMB_ITEM: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare const Breadcrumb: {
|
|
8
|
-
(props: BreadcrumbProps): JSX.Element;
|
|
8
|
+
(props: BreadcrumbProps): React.JSX.Element;
|
|
9
9
|
Item: IBreadcrumbItemInterface;
|
|
10
10
|
};
|
|
11
11
|
export default Breadcrumb;
|
package/dist/Breadcrumb/index.js
CHANGED
|
@@ -1,47 +1,37 @@
|
|
|
1
1
|
var _excluded = ["className", "separator"],
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
_excluded2 = ["className"];
|
|
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 React from 'react';
|
|
11
7
|
import { Breadcrumb as AntdBreadcrumb } from 'antd';
|
|
12
8
|
import classNames from 'classnames';
|
|
13
|
-
|
|
14
9
|
var Breadcrumb = function Breadcrumb(props) {
|
|
15
10
|
var className = props.className,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
separator = props.separator,
|
|
12
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
19
13
|
var getSeparator = function getSeparator() {
|
|
20
14
|
if (separator === null) {
|
|
21
15
|
return separator;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
return separator || /*#__PURE__*/React.createElement("span", {
|
|
25
18
|
className: "default-separator"
|
|
26
19
|
});
|
|
27
20
|
};
|
|
28
|
-
|
|
29
21
|
return /*#__PURE__*/React.createElement(AntdBreadcrumb, _extends({}, restProps, {
|
|
30
22
|
separator: getSeparator(),
|
|
31
23
|
className: classNames('ald-breadcrumb', className)
|
|
32
24
|
}));
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
var BreadcrumbItem = function BreadcrumbItem(props) {
|
|
36
27
|
var className = props.className,
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
39
29
|
return /*#__PURE__*/React.createElement(AntdBreadcrumb.Item, _extends({}, restProps, {
|
|
40
30
|
className: classNames('ald-breadcrumb-item', className)
|
|
41
31
|
}));
|
|
42
|
-
};
|
|
43
|
-
|
|
32
|
+
};
|
|
44
33
|
|
|
34
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
45
35
|
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
|
|
46
36
|
Breadcrumb.Item = BreadcrumbItem;
|
|
47
37
|
export default Breadcrumb;
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ButtonProps as AntdButtonProps, ButtonType as AntdButtonType } from 'antd/lib/button';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const btnPrefix = "ald-btn";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type ButtonType = 'primary' | 'secondary' | 'dangerous' | 'text' | 'link';
|
|
5
|
+
export type Size = 'small' | 'middle' | 'large';
|
|
6
6
|
export interface IButtonProps extends Omit<AntdButtonProps, 'type' | 'dangerous' | 'shape' | 'icon' | 'href' | 'target' | 'onClick' | 'loading'> {
|
|
7
7
|
/**
|
|
8
8
|
* @description 类型
|
|
@@ -53,6 +53,6 @@ export declare function getIconSize(ButtonSize: Size): number;
|
|
|
53
53
|
export declare function getShape(ButtonShape: 'circle' | 'default'): 'circle' | 'default';
|
|
54
54
|
export declare const setIcon: (iconNode: React.ReactElement, size: Size, loading: boolean | {
|
|
55
55
|
delay?: number | undefined;
|
|
56
|
-
}) => JSX.Element;
|
|
57
|
-
declare function Button(props: IButtonProps): JSX.Element;
|
|
56
|
+
}) => React.JSX.Element;
|
|
57
|
+
declare function Button(props: IButtonProps): React.JSX.Element;
|
|
58
58
|
export default Button;
|
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;
|