@aloudata/aloudata-design 0.3.2 → 0.3.5
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/es/Breadcrumb/index.d.ts +1 -0
- package/es/Button/index.js +3 -2
- package/es/Button/style/index.less +135 -126
- package/es/Button/style/variables.less +53 -53
- package/es/Checkbox/index.d.ts +1 -0
- package/es/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
- package/es/ConfigProvider/defaultRenderEmpty.js +37 -0
- package/es/ConfigProvider/sizeContext.d.ts +9 -0
- package/es/ConfigProvider/sizeContext.js +12 -0
- package/es/Dropdown/Button.js +3 -2
- package/es/Empty/image/Authority.d.ts +1 -0
- package/es/Empty/image/Dataspace.d.ts +1 -0
- package/es/Empty/image/Search.d.ts +1 -0
- package/es/Empty/image/Simple.d.ts +1 -0
- package/es/Empty/image/Worksheet.d.ts +1 -0
- package/es/Empty/image/empty.d.ts +1 -0
- package/es/Icon/icons.json +418 -0
- package/es/Input/components/Group/index.d.ts +3 -1
- package/es/Input/components/Group/index.js +6 -12
- package/es/Input/components/Input/index.d.ts +3 -2
- package/es/Input/components/Input/index.js +11 -23
- package/es/Input/components/Password/index.js +11 -16
- package/es/Input/components/TextArea/index.d.ts +8 -1
- package/es/Input/components/TextArea/index.js +8 -1
- package/es/Input/style/index.less +180 -102
- package/es/InputNumber/index.d.ts +1 -0
- package/es/InputNumber/style/index.less +69 -69
- package/es/Menu/Divider.d.ts +1 -0
- package/es/Modal/index.js +4 -7
- package/es/Modal/style/index.less +48 -45
- package/es/Navigator/components/Header/index.d.ts +1 -0
- package/es/Navigator/components/Menu/index.d.ts +1 -0
- package/es/PageHeader/index.d.ts +3 -0
- package/es/PageHeader/index.js +3 -0
- package/es/PageHeader/style/index.d.ts +2 -0
- package/es/PageHeader/style/index.js +2 -0
- package/es/PageHeader/style/index.less +1 -0
- package/es/Popover/index.d.ts +1 -0
- package/es/Radio/components/Group/index.d.ts +6 -0
- package/es/Radio/components/Group/index.js +74 -0
- package/es/Radio/components/Radio/index.d.ts +3 -0
- package/es/Radio/components/Radio/index.js +95 -0
- package/es/Radio/index.d.ts +9 -2
- package/es/Radio/index.js +5 -3
- package/es/Radio/interface/radio.d.ts +24 -0
- package/es/Radio/interface/radio.js +1 -0
- package/es/Radio/interface/radioGroup.d.ts +42 -0
- package/es/Radio/interface/radioGroup.js +1 -0
- package/es/Radio/style/index.less +348 -0
- package/es/Select/index.js +1 -1
- package/es/Select/rc-select/OptionList.js +3 -2
- package/es/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/es/Select/style/index.less +50 -49
- package/es/Select/style/variables.less +45 -45
- package/es/Select/utils/iconUtil.d.ts +2 -2
- package/es/Select/utils/iconUtil.js +6 -4
- package/es/Steps/components/ProcessIcon/index.d.ts +6 -0
- package/es/Steps/components/ProcessIcon/index.js +8 -0
- package/es/Steps/components/Step/index.d.ts +20 -0
- package/es/Steps/components/Step/index.js +45 -0
- package/es/Steps/index.d.ts +36 -2
- package/es/Steps/index.js +30 -1
- package/es/Steps/matchMedia.mock.d.ts +1 -0
- package/es/Steps/matchMedia.mock.js +17 -0
- package/es/Steps/style/index.less +251 -0
- package/es/Switch/index.d.ts +46 -2
- package/es/Switch/index.js +71 -1
- package/es/Switch/style/index.less +129 -0
- package/es/Table/Table.d.ts +2 -1
- package/es/Table/Table.js +223 -330
- package/es/Table/components/Empty/index.d.ts +3 -0
- package/es/Table/components/Empty/index.js +16 -0
- package/es/Table/components/Loading/index.d.ts +3 -0
- package/es/Table/components/Loading/index.js +18 -0
- package/es/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/es/Table/components/TableBodyRowList/index.js +91 -0
- package/es/Table/components/TableHead/index.d.ts +23 -0
- package/es/Table/components/TableHead/index.js +262 -0
- package/es/Table/constant.d.ts +1 -0
- package/es/Table/constant.js +1 -0
- package/es/Table/hooks/useFrame.d.ts +7 -0
- package/es/Table/hooks/useFrame.js +90 -0
- package/es/Table/hooks/useTableColumn.d.ts +28 -0
- package/es/Table/hooks/useTableColumn.js +53 -0
- package/es/Table/interface.d.ts +3 -2
- package/es/Table/style/index.less +41 -37
- package/es/Table/style/index.less.d.ts +126 -0
- package/es/Table/style/variable.less +10 -0
- package/es/Table/style/variable.less.d.ts +7 -0
- package/es/Table/utils.d.ts +15 -0
- package/es/Table/utils.js +131 -0
- package/es/Tabs/index.js +3 -2
- package/es/Tabs/style/index.less +25 -25
- package/es/_utils/hooks/useId.d.ts +4 -0
- package/es/_utils/hooks/useId.js +23 -0
- package/es/index.d.ts +7 -5
- package/es/index.js +2 -1
- package/es/locale-provider/index.d.ts +5 -1
- package/es/style/index.d.ts +0 -1
- package/es/style/index.js +0 -1
- package/es/style/index.less +2 -2
- package/es/style/themes/default/index.less +30 -30
- package/lib/Breadcrumb/index.d.ts +1 -0
- package/lib/Button/index.js +5 -3
- package/lib/Button/style/index.less +135 -126
- package/lib/Button/style/variables.less +53 -53
- package/lib/Checkbox/index.d.ts +1 -0
- package/lib/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
- package/lib/ConfigProvider/defaultRenderEmpty.js +55 -0
- package/lib/ConfigProvider/sizeContext.d.ts +9 -0
- package/lib/ConfigProvider/sizeContext.js +30 -0
- package/lib/Dropdown/Button.js +7 -5
- package/lib/Empty/image/Authority.d.ts +1 -0
- package/lib/Empty/image/Dataspace.d.ts +1 -0
- package/lib/Empty/image/Search.d.ts +1 -0
- package/lib/Empty/image/Simple.d.ts +1 -0
- package/lib/Empty/image/Worksheet.d.ts +1 -0
- package/lib/Empty/image/empty.d.ts +1 -0
- package/lib/Icon/icons.json +418 -0
- package/lib/Input/components/Group/index.d.ts +3 -1
- package/lib/Input/components/Group/index.js +7 -12
- package/lib/Input/components/Input/index.d.ts +3 -2
- package/lib/Input/components/Input/index.js +13 -23
- package/lib/Input/components/Password/index.js +13 -17
- package/lib/Input/components/TextArea/index.d.ts +8 -1
- package/lib/Input/components/TextArea/index.js +10 -1
- package/lib/Input/style/index.less +180 -102
- package/lib/InputNumber/index.d.ts +1 -0
- package/lib/InputNumber/style/index.less +69 -69
- package/lib/Menu/Divider.d.ts +1 -0
- package/lib/Modal/index.js +8 -10
- package/lib/Modal/style/index.less +48 -45
- package/lib/Navigator/components/Header/index.d.ts +1 -0
- package/lib/Navigator/components/Menu/index.d.ts +1 -0
- package/lib/PageHeader/index.d.ts +3 -0
- package/lib/PageHeader/index.js +15 -0
- package/lib/PageHeader/style/index.d.ts +2 -0
- package/lib/PageHeader/style/index.js +5 -0
- package/lib/PageHeader/style/index.less +1 -0
- package/lib/Popover/index.d.ts +1 -0
- package/lib/Radio/components/Group/index.d.ts +6 -0
- package/lib/Radio/components/Group/index.js +95 -0
- package/lib/Radio/components/Radio/index.d.ts +3 -0
- package/lib/Radio/components/Radio/index.js +115 -0
- package/lib/Radio/index.d.ts +9 -2
- package/lib/Radio/index.js +5 -3
- package/lib/Radio/interface/radio.d.ts +24 -0
- package/lib/Radio/interface/radio.js +5 -0
- package/lib/Radio/interface/radioGroup.d.ts +42 -0
- package/lib/Radio/interface/radioGroup.js +5 -0
- package/lib/Radio/style/index.less +348 -0
- package/lib/Select/index.js +1 -1
- package/lib/Select/rc-select/OptionList.js +7 -5
- package/lib/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/lib/Select/style/index.less +50 -49
- package/lib/Select/style/variables.less +45 -45
- package/lib/Select/utils/iconUtil.d.ts +2 -2
- package/lib/Select/utils/iconUtil.js +10 -8
- package/lib/Steps/components/ProcessIcon/index.d.ts +6 -0
- package/lib/Steps/components/ProcessIcon/index.js +19 -0
- package/lib/Steps/components/Step/index.d.ts +20 -0
- package/lib/Steps/components/Step/index.js +61 -0
- package/lib/Steps/index.d.ts +36 -2
- package/lib/Steps/index.js +34 -1
- package/lib/Steps/matchMedia.mock.d.ts +1 -0
- package/lib/Steps/matchMedia.mock.js +17 -0
- package/lib/Steps/style/index.less +251 -0
- package/lib/Switch/index.d.ts +46 -2
- package/lib/Switch/index.js +78 -1
- package/lib/Switch/style/index.less +129 -0
- package/lib/Table/Table.d.ts +2 -1
- package/lib/Table/Table.js +229 -332
- package/lib/Table/components/Empty/index.d.ts +3 -0
- package/lib/Table/components/Empty/index.js +28 -0
- package/lib/Table/components/Loading/index.d.ts +3 -0
- package/lib/Table/components/Loading/index.js +31 -0
- package/lib/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/lib/Table/components/TableBodyRowList/index.js +110 -0
- package/lib/Table/components/TableHead/index.d.ts +23 -0
- package/lib/Table/components/TableHead/index.js +286 -0
- package/lib/Table/constant.d.ts +1 -0
- package/lib/Table/constant.js +1 -0
- package/lib/Table/hooks/useFrame.d.ts +7 -0
- package/lib/Table/hooks/useFrame.js +98 -0
- package/lib/Table/hooks/useTableColumn.d.ts +28 -0
- package/lib/Table/hooks/useTableColumn.js +66 -0
- package/lib/Table/interface.d.ts +3 -2
- package/lib/Table/style/index.less +41 -37
- package/lib/Table/style/index.less.d.ts +126 -0
- package/lib/Table/style/variable.less +10 -0
- package/lib/Table/style/variable.less.d.ts +7 -0
- package/lib/Table/utils.d.ts +15 -0
- package/lib/Table/utils.js +147 -0
- package/lib/Tabs/index.js +5 -3
- package/lib/Tabs/style/index.less +25 -25
- package/lib/_utils/hooks/useId.d.ts +4 -0
- package/lib/_utils/hooks/useId.js +36 -0
- package/lib/index.d.ts +7 -5
- package/lib/index.js +8 -0
- package/lib/locale-provider/index.d.ts +5 -1
- package/lib/style/index.d.ts +0 -1
- package/lib/style/index.js +0 -2
- package/lib/style/index.less +2 -2
- package/lib/style/themes/default/index.less +30 -30
- package/package.json +2 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
|
|
12
|
+
var _message = _interopRequireDefault(require("../../message"));
|
|
13
|
+
|
|
14
|
+
require("react-table/node_modules/@types/react");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
24
|
+
function useTableColumn(props) {
|
|
25
|
+
var columnsWidthMapRef = props.columnsWidthMapRef,
|
|
26
|
+
columnsTotalWidthRef = props.columnsTotalWidthRef,
|
|
27
|
+
columnsRef = props.columnsRef,
|
|
28
|
+
tableClientWidth = props.tableClientWidth,
|
|
29
|
+
sortable = props.sortable; // 转换外部传入的columns
|
|
30
|
+
|
|
31
|
+
var newColumns = (0, _react.useMemo)(function () {
|
|
32
|
+
var _getColumnsWidthMap = (0, _utils.getColumnsWidthMap)(columnsRef.current, tableClientWidth, columnsWidthMapRef.current),
|
|
33
|
+
columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
|
|
34
|
+
totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
|
|
35
|
+
|
|
36
|
+
columnsWidthMapRef.current = columnsWidthMap;
|
|
37
|
+
columnsTotalWidthRef.current = totalColumnWidth;
|
|
38
|
+
return columnsRef.current.map(function (column, index) {
|
|
39
|
+
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
40
|
+
|
|
41
|
+
var key = index.toString(); // 不设置dataIndex同时进行排序 则报错
|
|
42
|
+
|
|
43
|
+
if (!column.dataIndex === undefined && sortable) {
|
|
44
|
+
_message.default.error('不支持未设置dataIndex时进行排序设置');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
48
|
+
width: (_columnsWidthMapRef$c = columnsWidthMapRef.current) === null || _columnsWidthMapRef$c === void 0 ? void 0 : (_columnsWidthMapRef$c2 = _columnsWidthMapRef$c.get(key)) === null || _columnsWidthMapRef$c2 === void 0 ? void 0 : _columnsWidthMapRef$c2.width,
|
|
49
|
+
Header: column.title ? column.title : function () {
|
|
50
|
+
return null;
|
|
51
|
+
},
|
|
52
|
+
disableSortBy: !sortable || typeof column.sorter === 'boolean',
|
|
53
|
+
accessor: column.dataIndex,
|
|
54
|
+
Cell: function Cell(_ref) {
|
|
55
|
+
var row = _ref.row,
|
|
56
|
+
value = _ref.value;
|
|
57
|
+
return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, [columnsRef, columnsTotalWidthRef, columnsWidthMapRef, sortable, tableClientWidth]);
|
|
62
|
+
return newColumns;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var _default = useTableColumn;
|
|
66
|
+
exports.default = _default;
|
package/lib/Table/interface.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface IColumn<RecordType> {
|
|
|
9
9
|
title: string | null;
|
|
10
10
|
dataIndex: string;
|
|
11
11
|
render?: (value: any, row: RecordType, index: number) => React.ReactNode;
|
|
12
|
-
width?: number;
|
|
12
|
+
width?: number | string;
|
|
13
13
|
minWidth?: number;
|
|
14
14
|
sorter?: boolean | 'string' | 'number' | 'basic' | 'datetime' | 'alphanumeric';
|
|
15
15
|
sortOrder?: TSortOrder;
|
|
@@ -20,7 +20,7 @@ export interface ITableProps<RecordType> {
|
|
|
20
20
|
columns: IColumn<RecordType>[];
|
|
21
21
|
data: RecordType[];
|
|
22
22
|
onRowSelected?: (row: RecordType) => void;
|
|
23
|
-
loadMore?: () =>
|
|
23
|
+
loadMore?: () => Promise<void>;
|
|
24
24
|
hasNextPage?: boolean;
|
|
25
25
|
loading?: boolean;
|
|
26
26
|
sortable?: boolean;
|
|
@@ -29,6 +29,7 @@ export interface ITableProps<RecordType> {
|
|
|
29
29
|
sortDirections?: Array<'ascend' | 'descend'>;
|
|
30
30
|
resizeColumn?: boolean;
|
|
31
31
|
showHeader?: boolean;
|
|
32
|
+
height?: string | number;
|
|
32
33
|
innerScroll?: boolean;
|
|
33
34
|
ref?: React.RefObject<unknown>;
|
|
34
35
|
scrollThreshold?: string | number;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/* stylelint-disable property-no-unknown */
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
@
|
|
3
|
+
@import '../../style/index.less';
|
|
4
|
+
@import '../../Empty/style/index.less';
|
|
5
|
+
@import '../../message/style/index.less';
|
|
6
|
+
@import './variable.less';
|
|
5
7
|
|
|
6
8
|
.ald-table {
|
|
7
9
|
display: flex;
|
|
8
10
|
flex-direction: column;
|
|
9
11
|
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
12
|
overflow: hidden;
|
|
13
|
+
user-select: none;
|
|
12
14
|
|
|
13
15
|
&-page-loading {
|
|
14
16
|
opacity: 0;
|
|
@@ -21,6 +23,17 @@
|
|
|
21
23
|
overflow: hidden;
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
&-inner-wrap {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
overflow-x: overlay;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-tableHeadScrollWrap {
|
|
33
|
+
width: 100%;
|
|
34
|
+
overflow-x: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
&-cell {
|
|
25
38
|
flex-grow: 1;
|
|
26
39
|
height: unset;
|
|
@@ -35,8 +48,7 @@
|
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
&-row {
|
|
38
|
-
|
|
39
|
-
height: 48px;
|
|
51
|
+
height: @table-head-row-height;
|
|
40
52
|
|
|
41
53
|
&-ellipsis {
|
|
42
54
|
.ald-table-cell {
|
|
@@ -48,8 +60,12 @@
|
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
&-thead {
|
|
63
|
+
flex: 1;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
|
|
51
66
|
.ald-table-row {
|
|
52
|
-
|
|
67
|
+
min-width: 9999px; // 防止拖动时的闪动
|
|
68
|
+
height: @table-head-row-height;
|
|
53
69
|
}
|
|
54
70
|
|
|
55
71
|
.ald-table-cell {
|
|
@@ -57,7 +73,7 @@
|
|
|
57
73
|
padding: 14px 24px;
|
|
58
74
|
color: @NL50;
|
|
59
75
|
line-height: 20px;
|
|
60
|
-
background-color: @
|
|
76
|
+
background-color: @BG95;
|
|
61
77
|
|
|
62
78
|
.ald-table-cell-content {
|
|
63
79
|
overflow: hidden;
|
|
@@ -72,7 +88,7 @@
|
|
|
72
88
|
z-index: 1;
|
|
73
89
|
display: inline-block;
|
|
74
90
|
width: 12px;
|
|
75
|
-
height:
|
|
91
|
+
height: 14px;
|
|
76
92
|
transform: translateY(-50%);
|
|
77
93
|
touch-action: none;
|
|
78
94
|
|
|
@@ -80,7 +96,7 @@
|
|
|
80
96
|
display: block;
|
|
81
97
|
width: 1px;
|
|
82
98
|
height: 100%;
|
|
83
|
-
background-color: @
|
|
99
|
+
background-color: @BG70;
|
|
84
100
|
content: '';
|
|
85
101
|
}
|
|
86
102
|
}
|
|
@@ -103,11 +119,12 @@
|
|
|
103
119
|
}
|
|
104
120
|
|
|
105
121
|
.ald-table-row {
|
|
106
|
-
height:
|
|
122
|
+
height: @table-body-row-height;
|
|
107
123
|
|
|
108
124
|
.ald-table-cell {
|
|
109
|
-
|
|
110
|
-
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
padding-left: 24px;
|
|
111
128
|
}
|
|
112
129
|
|
|
113
130
|
&:hover {
|
|
@@ -124,10 +141,18 @@
|
|
|
124
141
|
}
|
|
125
142
|
}
|
|
126
143
|
|
|
144
|
+
&-tbody&-tbody-innerScroll {
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-row-list-wrap {
|
|
149
|
+
overflow: unset;
|
|
150
|
+
}
|
|
151
|
+
|
|
127
152
|
&-loading {
|
|
128
|
-
height:
|
|
153
|
+
height: @table-body-row-height;
|
|
129
154
|
color: @NL80;
|
|
130
|
-
line-height: @table-row-height;
|
|
155
|
+
line-height: @table-body-row-height;
|
|
131
156
|
text-align: center;
|
|
132
157
|
|
|
133
158
|
&-icon {
|
|
@@ -145,6 +170,7 @@
|
|
|
145
170
|
align-items: center;
|
|
146
171
|
justify-content: center;
|
|
147
172
|
padding-top: 84px;
|
|
173
|
+
padding-bottom: 84px;
|
|
148
174
|
}
|
|
149
175
|
}
|
|
150
176
|
|
|
@@ -170,33 +196,11 @@
|
|
|
170
196
|
}
|
|
171
197
|
}
|
|
172
198
|
|
|
173
|
-
/* stylelint-disable-next-line selector-class-pattern */
|
|
174
|
-
&-list&-innerScroll {
|
|
175
|
-
height: 100%;
|
|
176
|
-
overflow: overlay !important;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
199
|
// 当出现多行的时候 会顶出一个滚动条 通过复写三方库的样式覆盖
|
|
180
200
|
&-list&-canNotInnerScroll {
|
|
181
201
|
overflow: hidden !important;
|
|
182
202
|
}
|
|
183
203
|
|
|
184
|
-
&-list {
|
|
185
|
-
&::-webkit-scrollbar-thumb {
|
|
186
|
-
background: @NL90;
|
|
187
|
-
background-clip: padding-box;
|
|
188
|
-
border: 3px solid transparent;
|
|
189
|
-
border-radius: 6px;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
&::-webkit-scrollbar {
|
|
193
|
-
width: 12px;
|
|
194
|
-
height: 12px;
|
|
195
|
-
min-height: 12px;
|
|
196
|
-
background-color: transparent;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
204
|
&-sortIcon {
|
|
201
205
|
margin-top: -2px;
|
|
202
206
|
margin-left: 4px;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// This file is automatically generated.
|
|
2
|
+
// Please do not change this file!
|
|
3
|
+
interface CssExports {
|
|
4
|
+
'B10': string;
|
|
5
|
+
'B20': string;
|
|
6
|
+
'B30': string;
|
|
7
|
+
'B40': string;
|
|
8
|
+
'B50': string;
|
|
9
|
+
'B60': string;
|
|
10
|
+
'B70': string;
|
|
11
|
+
'B80': string;
|
|
12
|
+
'B90': string;
|
|
13
|
+
'B95': string;
|
|
14
|
+
'B98': string;
|
|
15
|
+
'BG0': string;
|
|
16
|
+
'BG10': string;
|
|
17
|
+
'BG100': string;
|
|
18
|
+
'BG20': string;
|
|
19
|
+
'BG30': string;
|
|
20
|
+
'BG40': string;
|
|
21
|
+
'BG50': string;
|
|
22
|
+
'BG60': string;
|
|
23
|
+
'BG70': string;
|
|
24
|
+
'BG80': string;
|
|
25
|
+
'BG90': string;
|
|
26
|
+
'BG95': string;
|
|
27
|
+
'BG97': string;
|
|
28
|
+
'BLACK': string;
|
|
29
|
+
'IMAGE_HOLDER': string;
|
|
30
|
+
'MATE': string;
|
|
31
|
+
'ND0': string;
|
|
32
|
+
'ND10': string;
|
|
33
|
+
'ND20': string;
|
|
34
|
+
'ND30': string;
|
|
35
|
+
'ND40': string;
|
|
36
|
+
'ND50': string;
|
|
37
|
+
'ND60': string;
|
|
38
|
+
'ND70': string;
|
|
39
|
+
'ND80': string;
|
|
40
|
+
'ND90': string;
|
|
41
|
+
'ND95': string;
|
|
42
|
+
'ND97': string;
|
|
43
|
+
'NL0': string;
|
|
44
|
+
'NL10': string;
|
|
45
|
+
'NL20': string;
|
|
46
|
+
'NL30': string;
|
|
47
|
+
'NL40': string;
|
|
48
|
+
'NL50': string;
|
|
49
|
+
'NL60': string;
|
|
50
|
+
'NL70': string;
|
|
51
|
+
'NL80': string;
|
|
52
|
+
'NL90': string;
|
|
53
|
+
'NL95': string;
|
|
54
|
+
'NL97': string;
|
|
55
|
+
'SA10': string;
|
|
56
|
+
'SA20': string;
|
|
57
|
+
'SA30': string;
|
|
58
|
+
'SA40': string;
|
|
59
|
+
'SA50': string;
|
|
60
|
+
'SA60': string;
|
|
61
|
+
'SA70': string;
|
|
62
|
+
'SA80': string;
|
|
63
|
+
'SA90': string;
|
|
64
|
+
'SA95': string;
|
|
65
|
+
'SA98': string;
|
|
66
|
+
'SB10': string;
|
|
67
|
+
'SB20': string;
|
|
68
|
+
'SB30': string;
|
|
69
|
+
'SB40': string;
|
|
70
|
+
'SB50': string;
|
|
71
|
+
'SB60': string;
|
|
72
|
+
'SB70': string;
|
|
73
|
+
'SB80': string;
|
|
74
|
+
'SB90': string;
|
|
75
|
+
'SB95': string;
|
|
76
|
+
'SB98': string;
|
|
77
|
+
'SC10': string;
|
|
78
|
+
'SC20': string;
|
|
79
|
+
'SC30': string;
|
|
80
|
+
'SC40': string;
|
|
81
|
+
'SC50': string;
|
|
82
|
+
'SC60': string;
|
|
83
|
+
'SC70': string;
|
|
84
|
+
'SC80': string;
|
|
85
|
+
'SC90': string;
|
|
86
|
+
'SC95': string;
|
|
87
|
+
'SC98': string;
|
|
88
|
+
'SHADOW_L': string;
|
|
89
|
+
'TableHeadRowHeight': string;
|
|
90
|
+
'WHITE': string;
|
|
91
|
+
'ald-empty': string;
|
|
92
|
+
'ald-empty-description': string;
|
|
93
|
+
'ald-empty-image': string;
|
|
94
|
+
'ald-empty-img': string;
|
|
95
|
+
'ald-empty-large': string;
|
|
96
|
+
'ald-empty-small': string;
|
|
97
|
+
'ald-empty-title': string;
|
|
98
|
+
'ald-table': string;
|
|
99
|
+
'ald-table-bar': string;
|
|
100
|
+
'ald-table-canNotInnerScroll': string;
|
|
101
|
+
'ald-table-cell': string;
|
|
102
|
+
'ald-table-cell-content': string;
|
|
103
|
+
'ald-table-column-resizable': string;
|
|
104
|
+
'ald-table-empty-icon': string;
|
|
105
|
+
'ald-table-header': string;
|
|
106
|
+
'ald-table-header-left': string;
|
|
107
|
+
'ald-table-header-right': string;
|
|
108
|
+
'ald-table-init-loading': string;
|
|
109
|
+
'ald-table-inner-wrap': string;
|
|
110
|
+
'ald-table-list': string;
|
|
111
|
+
'ald-table-loading': string;
|
|
112
|
+
'ald-table-loading-icon': string;
|
|
113
|
+
'ald-table-page-loading': string;
|
|
114
|
+
'ald-table-row': string;
|
|
115
|
+
'ald-table-row-ellipsis': string;
|
|
116
|
+
'ald-table-row-list-wrap': string;
|
|
117
|
+
'ald-table-row-selected': string;
|
|
118
|
+
'ald-table-sortIcon': string;
|
|
119
|
+
'ald-table-table-wrap': string;
|
|
120
|
+
'ald-table-tableHeadScrollWrap': string;
|
|
121
|
+
'ald-table-tbody': string;
|
|
122
|
+
'ald-table-tbody-innerScroll': string;
|
|
123
|
+
'ald-table-thead': string;
|
|
124
|
+
}
|
|
125
|
+
export const cssExports: CssExports;
|
|
126
|
+
export default cssExports;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IColumn } from './interface';
|
|
2
|
+
export interface IWidthDetail {
|
|
3
|
+
width: number;
|
|
4
|
+
isSpecific: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function getColumnsWidthMap<T>(columns: IColumn<T>[], clientWidth: number, lastWidthMap?: Map<string, IWidthDetail>): {
|
|
7
|
+
columnsWidthMap: Map<string, IWidthDetail>;
|
|
8
|
+
totalColumnWidth: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function isPercentageWidth(width: string): boolean;
|
|
11
|
+
export declare function isSpecificPxWidth(width: string): boolean;
|
|
12
|
+
export declare function getValidWidthByNumber(width: number): number;
|
|
13
|
+
export declare function getValidScrollThreshold(height: string | number, clientHeight: number): number;
|
|
14
|
+
export declare function getPercentageValue(percentage: string, containerNum: number): number;
|
|
15
|
+
export declare function getPxValue(px: string): number;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getColumnsWidthMap = getColumnsWidthMap;
|
|
7
|
+
exports.getPercentageValue = getPercentageValue;
|
|
8
|
+
exports.getPxValue = getPxValue;
|
|
9
|
+
exports.getValidScrollThreshold = getValidScrollThreshold;
|
|
10
|
+
exports.getValidWidthByNumber = getValidWidthByNumber;
|
|
11
|
+
exports.isPercentageWidth = isPercentageWidth;
|
|
12
|
+
exports.isSpecificPxWidth = isSpecificPxWidth;
|
|
13
|
+
var ZERO = 0;
|
|
14
|
+
var NOT_SET = -1;
|
|
15
|
+
var COLUMN_MIN_WIDTH = 72;
|
|
16
|
+
var HUNDRED = 100; // TODO: 添加单侧
|
|
17
|
+
|
|
18
|
+
function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
19
|
+
var settedTotalWidth = ZERO;
|
|
20
|
+
var unsetWidthIndex = [];
|
|
21
|
+
var widthMap = new Map();
|
|
22
|
+
var totalColumnWidth = ZERO;
|
|
23
|
+
columns.forEach(function (item, index) {
|
|
24
|
+
var _lastWidthMap$get;
|
|
25
|
+
|
|
26
|
+
var key = index.toString();
|
|
27
|
+
var width = getWidthByColumnsWidth(clientWidth, item.width); // 首先判断是否是否是容器宽度的变化
|
|
28
|
+
|
|
29
|
+
var isSpecific = lastWidthMap ? (_lastWidthMap$get = lastWidthMap.get(key)) === null || _lastWidthMap$get === void 0 ? void 0 : _lastWidthMap$get.isSpecific : isSpecificWidth(item.width);
|
|
30
|
+
|
|
31
|
+
if (lastWidthMap && isSpecific) {
|
|
32
|
+
var _lastWidthMap$get2;
|
|
33
|
+
|
|
34
|
+
width = (_lastWidthMap$get2 = lastWidthMap.get(key)) === null || _lastWidthMap$get2 === void 0 ? void 0 : _lastWidthMap$get2.width;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (width === NOT_SET) {
|
|
38
|
+
unsetWidthIndex.push(key);
|
|
39
|
+
} else {
|
|
40
|
+
settedTotalWidth += width;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
widthMap.set(key, {
|
|
44
|
+
width: width,
|
|
45
|
+
isSpecific: isSpecific
|
|
46
|
+
});
|
|
47
|
+
}); // 设定宽度大于容器宽度时
|
|
48
|
+
|
|
49
|
+
if (settedTotalWidth < clientWidth) {
|
|
50
|
+
unsetWidthIndex.map(function (item) {
|
|
51
|
+
var _widthMap$get;
|
|
52
|
+
|
|
53
|
+
return widthMap.set(item, {
|
|
54
|
+
isSpecific: (_widthMap$get = widthMap.get(item)) === null || _widthMap$get === void 0 ? void 0 : _widthMap$get.isSpecific,
|
|
55
|
+
width: 72
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
} // 设定宽度小于容器宽度时
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if (unsetWidthIndex.length > ZERO) {
|
|
62
|
+
var leftWidth = clientWidth - settedTotalWidth;
|
|
63
|
+
var average = getValidWidthByNumber(leftWidth / unsetWidthIndex.length);
|
|
64
|
+
unsetWidthIndex.map(function (item) {
|
|
65
|
+
var _widthMap$get2;
|
|
66
|
+
|
|
67
|
+
return widthMap.set(item, {
|
|
68
|
+
isSpecific: (_widthMap$get2 = widthMap.get(item)) === null || _widthMap$get2 === void 0 ? void 0 : _widthMap$get2.isSpecific,
|
|
69
|
+
width: average
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
columns.forEach(function (item, index) {
|
|
75
|
+
var _widthMap$get3;
|
|
76
|
+
|
|
77
|
+
var key = index.toString();
|
|
78
|
+
var width = (_widthMap$get3 = widthMap.get(key)) === null || _widthMap$get3 === void 0 ? void 0 : _widthMap$get3.width;
|
|
79
|
+
totalColumnWidth += width;
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
columnsWidthMap: widthMap,
|
|
83
|
+
totalColumnWidth: totalColumnWidth
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getWidthByColumnsWidth(clientWidth, width) {
|
|
88
|
+
if (width === undefined) {
|
|
89
|
+
return NOT_SET;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof width === 'number') {
|
|
93
|
+
return getValidWidthByNumber(width);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (isPercentageWidth(width)) {
|
|
97
|
+
return getPercentageValue(width, clientWidth);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (isSpecificPxWidth(width)) {
|
|
101
|
+
var specificNum = getPxValue(width);
|
|
102
|
+
return getValidWidthByNumber(specificNum);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return NOT_SET;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function isPercentageWidth(width) {
|
|
109
|
+
return /[0-9]{1,}%$/.test(width);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function isSpecificPxWidth(width) {
|
|
113
|
+
return /[0-9]{1,}(px)$/.test(width);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isSpecificWidth(width) {
|
|
117
|
+
return typeof width === 'number' || !!(width && isSpecificPxWidth(width));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getValidWidthByNumber(width) {
|
|
121
|
+
return width < COLUMN_MIN_WIDTH ? COLUMN_MIN_WIDTH : width;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function getValidScrollThreshold(height, clientHeight) {
|
|
125
|
+
var scrollThreshold = ZERO;
|
|
126
|
+
|
|
127
|
+
if (typeof height === 'string') {
|
|
128
|
+
if (isPercentageWidth(height)) {
|
|
129
|
+
scrollThreshold = getPercentageValue(height, clientHeight);
|
|
130
|
+
} else {
|
|
131
|
+
scrollThreshold = getPxValue(height);
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
scrollThreshold = height;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return scrollThreshold;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function getPercentageValue(percentage, containerNum) {
|
|
141
|
+
var percent = Math.floor(Number(percentage.replace('%', '')) / HUNDRED);
|
|
142
|
+
return getValidWidthByNumber(containerNum * percent);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function getPxValue(px) {
|
|
146
|
+
return Number(px.replace('px', ''));
|
|
147
|
+
}
|
package/lib/Tabs/index.js
CHANGED
|
@@ -5,14 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = Tabs;
|
|
7
7
|
|
|
8
|
+
require("@aloudata/icons-react/styles/index.less");
|
|
9
|
+
|
|
10
|
+
var _More2 = _interopRequireDefault(require("@aloudata/icons-react/es/icons/More"));
|
|
11
|
+
|
|
8
12
|
require("antd/es/tabs/style");
|
|
9
13
|
|
|
10
14
|
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
11
15
|
|
|
12
16
|
var _react = _interopRequireDefault(require("react"));
|
|
13
17
|
|
|
14
|
-
var _More = _interopRequireDefault(require("../Icon/icons/More"));
|
|
15
|
-
|
|
16
18
|
var _TabPane = _interopRequireDefault(require("./TabPane"));
|
|
17
19
|
|
|
18
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -47,7 +49,7 @@ function Tabs(props) {
|
|
|
47
49
|
return /*#__PURE__*/_react.default.createElement(_tabs.default, Object.assign({
|
|
48
50
|
moreIcon: /*#__PURE__*/_react.default.createElement("div", {
|
|
49
51
|
className: "ald-tabs-moreIcon"
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_More2.default, {
|
|
51
53
|
color: "currentColor"
|
|
52
54
|
})),
|
|
53
55
|
tabBarGutter: 24,
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
@import '../../style/index.less';
|
|
3
3
|
@import '../../Button/style/index.less';
|
|
4
4
|
//status- default
|
|
5
|
-
@
|
|
6
|
-
@
|
|
5
|
+
@tabs-color: @NL30;
|
|
6
|
+
@tabs-fontWeight: 400;
|
|
7
7
|
//active
|
|
8
|
-
@
|
|
9
|
-
@
|
|
8
|
+
@tabs-color-active: @B60;
|
|
9
|
+
@tabs-fontWeight-active: 600;
|
|
10
10
|
|
|
11
11
|
//middle - default
|
|
12
|
-
@
|
|
13
|
-
@
|
|
14
|
-
@
|
|
12
|
+
@tabs-font-size: 14px;
|
|
13
|
+
@tabs-line-height: 20px;
|
|
14
|
+
@tabs-ink-link-bar-height: 2px;
|
|
15
15
|
//large
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
// @
|
|
16
|
+
@tabs-font-size-large: 16px;
|
|
17
|
+
@tabs-line-height-large: 24px;
|
|
18
|
+
@tabs-ink-link-bar-height-large: 3px;
|
|
19
|
+
// @tabs-
|
|
20
20
|
.ant-tabs.ald-tabs {
|
|
21
21
|
&.ant-tabs {
|
|
22
22
|
color: @NL30;
|
|
@@ -24,29 +24,29 @@
|
|
|
24
24
|
|
|
25
25
|
.ant-tabs-tab {
|
|
26
26
|
padding: 8px 0;
|
|
27
|
-
color: @
|
|
28
|
-
font-weight: @
|
|
29
|
-
font-size: @
|
|
30
|
-
line-height: @
|
|
27
|
+
color: @tabs-color;
|
|
28
|
+
font-weight: @tabs-fontWeight;
|
|
29
|
+
font-size: @tabs-font-size;
|
|
30
|
+
line-height: @tabs-line-height;
|
|
31
31
|
|
|
32
32
|
&:hover {
|
|
33
33
|
color: inherit;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&.ant-tabs-tab-active {
|
|
37
|
-
font-weight: @
|
|
37
|
+
font-weight: @tabs-fontWeight-active;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
|
|
42
|
-
color: @
|
|
43
|
-
font-weight: @
|
|
42
|
+
color: @tabs-color-active;
|
|
43
|
+
font-weight: @tabs-fontWeight-active;
|
|
44
44
|
text-shadow: none;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ant-tabs-ink-bar {
|
|
48
|
-
height: @
|
|
49
|
-
background: @
|
|
48
|
+
height: @tabs-ink-link-bar-height;
|
|
49
|
+
background: @tabs-color-active;
|
|
50
50
|
border-top-left-radius: 2px;
|
|
51
51
|
border-top-right-radius: 2px;
|
|
52
52
|
}
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
/* large size */
|
|
55
55
|
&.ant-tabs-large {
|
|
56
56
|
.ant-tabs-tab {
|
|
57
|
-
font-size: @
|
|
58
|
-
line-height: @
|
|
57
|
+
font-size: @tabs-font-size-large;
|
|
58
|
+
line-height: @tabs-line-height-large;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.ant-tabs-ink-bar {
|
|
62
|
-
height: @
|
|
62
|
+
height: @tabs-ink-link-bar-height-large;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.ald-tabs-moreIcon {
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
|
|
72
72
|
&.ald-tabs-default {
|
|
73
73
|
.ant-tabs-tab {
|
|
74
|
-
font-size: @
|
|
75
|
-
line-height: @
|
|
74
|
+
font-size: @tabs-font-size;
|
|
75
|
+
line-height: @tabs-line-height;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.ald-tabs-moreIcon {
|