@aloudata/aloudata-design 0.2.0-beta.10 → 0.2.0-beta.13
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/Button/style/index.less +1 -0
- package/es/Dropdown/Button.d.ts +1 -0
- package/es/Dropdown/Button.js +2 -1
- package/es/Dropdown/style/index.d.ts +1 -0
- package/es/Dropdown/style/index.js +1 -0
- package/es/Input/components/TextArea/index.d.ts +1 -0
- package/es/Input/index.d.ts +1 -1
- package/es/Input/style/index.d.ts +1 -0
- package/es/Input/style/index.js +1 -0
- package/es/Menu/style/index.d.ts +1 -0
- package/es/Menu/style/index.js +1 -0
- package/es/Table/index.d.ts +1 -1
- package/es/Table/index.js +79 -44
- package/es/Table/interface.d.ts +0 -1
- package/es/Table/style/index.less +51 -27
- package/es/Tabs/index.js +5 -3
- package/es/Tabs/style/index.d.ts +1 -0
- package/es/Tabs/style/index.js +1 -0
- package/es/index.d.ts +1 -1
- package/es/style/index.d.ts +1 -1
- package/es/style/index.js +1 -1
- package/lib/Button/style/index.less +1 -0
- package/lib/Dropdown/Button.d.ts +1 -0
- package/lib/Dropdown/Button.js +2 -0
- package/lib/Dropdown/style/index.d.ts +1 -0
- package/lib/Dropdown/style/index.js +2 -0
- package/lib/Input/components/TextArea/index.d.ts +1 -0
- package/lib/Input/index.d.ts +1 -1
- package/lib/Input/style/index.d.ts +1 -0
- package/lib/Input/style/index.js +2 -0
- package/lib/Menu/style/index.d.ts +1 -0
- package/lib/Menu/style/index.js +2 -0
- package/lib/Table/index.d.ts +1 -1
- package/lib/Table/index.js +90 -55
- package/lib/Table/interface.d.ts +0 -1
- package/lib/Table/style/index.less +51 -27
- package/lib/Tabs/index.js +4 -2
- package/lib/Tabs/style/index.d.ts +1 -0
- package/lib/Tabs/style/index.js +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/style/index.d.ts +1 -1
- package/lib/style/index.js +1 -1
- package/package.json +2 -2
package/es/Dropdown/Button.d.ts
CHANGED
package/es/Dropdown/Button.js
CHANGED
|
@@ -11,7 +11,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
11
11
|
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; }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import Button from '../Button';
|
|
14
|
+
import Button from '../Button';
|
|
15
|
+
import '../Button/style'; // eslint-disable-next-line import/no-cycle
|
|
15
16
|
|
|
16
17
|
import Dropdown from './index';
|
|
17
18
|
import Icon from '../Icon';
|
package/es/Input/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import TextArea from './components/TextArea';
|
|
|
5
5
|
import Password from './components/Password';
|
|
6
6
|
export type { IInputProps, InputRef, TSize } from './components/Input';
|
|
7
7
|
export type { IGroupProps } from './components/Group';
|
|
8
|
-
export type { ITextAreaProps } from './components/TextArea';
|
|
8
|
+
export type { ITextAreaProps, TextAreaRef } from './components/TextArea';
|
|
9
9
|
export type { IPasswordProps } from './components/Password';
|
|
10
10
|
interface ICompoundedComponent extends React.ForwardRefExoticComponent<IInputProps & React.RefAttributes<InputRef>> {
|
|
11
11
|
Group: typeof Group;
|
package/es/Input/style/index.js
CHANGED
package/es/Menu/style/index.d.ts
CHANGED
package/es/Menu/style/index.js
CHANGED
package/es/Table/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ITableProps } from './interface';
|
|
3
|
-
declare function Table<T extends Record<string, unknown>>({ columns, data, total, renderHeaderLeft, renderHeaderRight,
|
|
3
|
+
declare function Table<T extends Record<string, unknown>>({ columns, data, total, renderHeaderLeft, renderHeaderRight, onRowSelected, loadMore, hasNextPage, loading, sortable, defaultSort, resizeColumn, sortDirections: allSortDirections, showHeader, onChange, }: ITableProps<T>): ReactElement;
|
|
4
4
|
export default Table;
|
package/es/Table/index.js
CHANGED
|
@@ -24,18 +24,19 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
25
|
|
|
26
26
|
/// <reference types ='./react-table-config' />
|
|
27
|
-
import
|
|
28
|
-
import { useTable, useBlockLayout, useRowSelect, useSortBy, useResizeColumns } from 'react-table';
|
|
29
|
-
import usePrefixCls from '../_utils/hooks/usePrefixCls';
|
|
30
|
-
import { FixedSizeList } from 'react-window';
|
|
31
|
-
import InfiniteLoader from 'react-window-infinite-loader';
|
|
27
|
+
import _ from 'lodash';
|
|
32
28
|
import classnames from 'classnames';
|
|
33
|
-
import Icon from '../Icon';
|
|
34
29
|
import Empty from '../Empty';
|
|
35
|
-
import
|
|
30
|
+
import Icon from '../Icon';
|
|
31
|
+
import InfiniteLoader from 'react-window-infinite-loader';
|
|
32
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
33
|
+
import usePrefixCls from '../_utils/hooks/usePrefixCls';
|
|
34
|
+
import { FixedSizeList } from 'react-window';
|
|
35
|
+
import { useTable, useBlockLayout, useRowSelect, useSortBy, useResizeColumns } from 'react-table';
|
|
36
36
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
37
37
|
var ARRAY_FIRST_INDEX = 0;
|
|
38
38
|
var DEFAULT_ROW_WIDTH = 0;
|
|
39
|
+
var DEFAULT_BODY_HEIGHT = 0;
|
|
39
40
|
|
|
40
41
|
function Table(_ref) {
|
|
41
42
|
var columns = _ref.columns,
|
|
@@ -43,10 +44,8 @@ function Table(_ref) {
|
|
|
43
44
|
total = _ref.total,
|
|
44
45
|
renderHeaderLeft = _ref.renderHeaderLeft,
|
|
45
46
|
renderHeaderRight = _ref.renderHeaderRight,
|
|
46
|
-
scrollY = _ref.scrollY,
|
|
47
47
|
onRowSelected = _ref.onRowSelected,
|
|
48
|
-
|
|
49
|
-
loadMore = _ref$loadMore === void 0 ? function () {} : _ref$loadMore,
|
|
48
|
+
loadMore = _ref.loadMore,
|
|
50
49
|
hasNextPage = _ref.hasNextPage,
|
|
51
50
|
loading = _ref.loading,
|
|
52
51
|
_ref$sortable = _ref.sortable,
|
|
@@ -65,6 +64,18 @@ function Table(_ref) {
|
|
|
65
64
|
selectedRowId = _React$useState2[0],
|
|
66
65
|
setSelectedRowId = _React$useState2[1];
|
|
67
66
|
|
|
67
|
+
var tableBodyRef = useRef(null);
|
|
68
|
+
|
|
69
|
+
var _useState = useState(DEFAULT_BODY_HEIGHT),
|
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
+
bodyClientHeight = _useState2[0],
|
|
72
|
+
setBodyClientHeight = _useState2[1];
|
|
73
|
+
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
if (tableBodyRef.current) {
|
|
76
|
+
setBodyClientHeight(tableBodyRef.current.clientHeight);
|
|
77
|
+
}
|
|
78
|
+
}, []);
|
|
68
79
|
var newColumns = useMemo(function () {
|
|
69
80
|
return columns.map(function (column) {
|
|
70
81
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
@@ -103,13 +114,29 @@ function Table(_ref) {
|
|
|
103
114
|
sortDirection = _React$useState4[0],
|
|
104
115
|
setSortDirection = _React$useState4[1];
|
|
105
116
|
|
|
117
|
+
var getInitSortBy = function getInitSortBy() {
|
|
118
|
+
if (!(sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.id)) {
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var sortColumn = newColumns.find(function (column) {
|
|
123
|
+
return column.accessor === sortDirection.id;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
if (sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.sorter) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return [sortDirection];
|
|
131
|
+
};
|
|
132
|
+
|
|
106
133
|
var _useTable = useTable({
|
|
107
134
|
columns: newColumns,
|
|
108
135
|
data: data,
|
|
109
136
|
disableMultiSort: true,
|
|
110
137
|
disableSortBy: !sortable,
|
|
111
138
|
initialState: {
|
|
112
|
-
sortBy:
|
|
139
|
+
sortBy: getInitSortBy()
|
|
113
140
|
}
|
|
114
141
|
}, useBlockLayout, useSortBy, useRowSelect, useResizeColumns),
|
|
115
142
|
getTableProps = _useTable.getTableProps,
|
|
@@ -121,17 +148,6 @@ function Table(_ref) {
|
|
|
121
148
|
|
|
122
149
|
var theadRowWidthRef = React.useRef(DEFAULT_ROW_WIDTH);
|
|
123
150
|
var prefixCls = usePrefixCls('block-table');
|
|
124
|
-
|
|
125
|
-
function getTbodyStyle() {
|
|
126
|
-
if (scrollY) {
|
|
127
|
-
return {
|
|
128
|
-
height: "".concat(scrollY, "px")
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return {};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
151
|
var onRowClick = useCallback(function (row) {
|
|
136
152
|
if (!onRowSelected) {
|
|
137
153
|
return;
|
|
@@ -293,10 +309,47 @@ function Table(_ref) {
|
|
|
293
309
|
});
|
|
294
310
|
};
|
|
295
311
|
|
|
312
|
+
var renderTableBody = function renderTableBody() {
|
|
313
|
+
if (!loading && !rows.length) {
|
|
314
|
+
return /*#__PURE__*/React.createElement(Empty, {
|
|
315
|
+
description: "\u5F53\u524D\u65E0\u6570\u636E"
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (loadMore && typeof loadMore === 'function') {
|
|
320
|
+
return /*#__PURE__*/React.createElement(InfiniteLoader, {
|
|
321
|
+
isItemLoaded: isItemLoaded,
|
|
322
|
+
itemCount: itemCount,
|
|
323
|
+
loadMoreItems: loadMoreItems,
|
|
324
|
+
threshold: 3
|
|
325
|
+
}, function (_ref5) {
|
|
326
|
+
var onItemsRendered = _ref5.onItemsRendered,
|
|
327
|
+
ref = _ref5.ref;
|
|
328
|
+
return /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
329
|
+
itemCount: itemCount,
|
|
330
|
+
onItemsRendered: onItemsRendered,
|
|
331
|
+
height: bodyClientHeight,
|
|
332
|
+
itemSize: DEFAULT_ROW_HEIGHT,
|
|
333
|
+
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
334
|
+
ref: ref,
|
|
335
|
+
className: "".concat(prefixCls, "-list")
|
|
336
|
+
}, RenderRow);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
341
|
+
itemCount: itemCount,
|
|
342
|
+
height: bodyClientHeight,
|
|
343
|
+
itemSize: DEFAULT_ROW_HEIGHT,
|
|
344
|
+
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
345
|
+
className: "".concat(prefixCls, "-list")
|
|
346
|
+
}, RenderRow);
|
|
347
|
+
};
|
|
348
|
+
|
|
296
349
|
return /*#__PURE__*/React.createElement("div", {
|
|
297
350
|
className: prefixCls
|
|
298
351
|
}, showHeader && renderHeader(data.length), /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, getTableProps()), {}, {
|
|
299
|
-
className: classnames(_defineProperty({}, "".concat(prefixCls, "-column-resizable"), resizeColumn))
|
|
352
|
+
className: classnames("".concat(prefixCls, "-table-wrap"), _defineProperty({}, "".concat(prefixCls, "-column-resizable"), resizeColumn))
|
|
300
353
|
}), /*#__PURE__*/React.createElement("div", {
|
|
301
354
|
className: "".concat(prefixCls, "-thead")
|
|
302
355
|
}, headerGroups.map(function (headerGroup) {
|
|
@@ -324,27 +377,9 @@ function Table(_ref) {
|
|
|
324
377
|
}));
|
|
325
378
|
}));
|
|
326
379
|
})), /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, getTableBodyProps()), {}, {
|
|
327
|
-
className: classnames("".concat(prefixCls, "-tbody")
|
|
328
|
-
|
|
329
|
-
}),
|
|
330
|
-
description: "\u5F53\u524D\u65E0\u6570\u636E"
|
|
331
|
-
}), /*#__PURE__*/React.createElement(InfiniteLoader, {
|
|
332
|
-
isItemLoaded: isItemLoaded,
|
|
333
|
-
itemCount: itemCount,
|
|
334
|
-
loadMoreItems: loadMoreItems
|
|
335
|
-
}, function (_ref5) {
|
|
336
|
-
var onItemsRendered = _ref5.onItemsRendered,
|
|
337
|
-
ref = _ref5.ref;
|
|
338
|
-
return /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
339
|
-
itemCount: itemCount,
|
|
340
|
-
onItemsRendered: onItemsRendered,
|
|
341
|
-
height: scrollY || data.length * DEFAULT_ROW_HEIGHT,
|
|
342
|
-
itemSize: DEFAULT_ROW_HEIGHT,
|
|
343
|
-
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
344
|
-
ref: ref,
|
|
345
|
-
className: "".concat(prefixCls, "-list")
|
|
346
|
-
}, RenderRow);
|
|
347
|
-
}))));
|
|
380
|
+
className: classnames("".concat(prefixCls, "-tbody")),
|
|
381
|
+
ref: tableBodyRef
|
|
382
|
+
}), renderTableBody())));
|
|
348
383
|
}
|
|
349
384
|
|
|
350
385
|
export default Table;
|
package/es/Table/interface.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export interface ITableProps<T extends object> {
|
|
|
20
20
|
columns: IColumn<T>[];
|
|
21
21
|
data: T[];
|
|
22
22
|
total?: number;
|
|
23
|
-
scrollY?: number;
|
|
24
23
|
onRowSelected?: (row: T) => void;
|
|
25
24
|
loadMore?: (startIndex: number, stopIndex: number) => void | Promise<void>;
|
|
26
25
|
hasNextPage?: boolean;
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
@ald-prefix:ant;
|
|
4
|
-
@ald-iconfont-css-prefix:anticon;
|
|
5
|
-
@table-row-height:40px;
|
|
3
|
+
@ald-prefix: ant;
|
|
4
|
+
@ald-iconfont-css-prefix: anticon;
|
|
5
|
+
@table-row-height: 40px;
|
|
6
6
|
|
|
7
7
|
.ant-block-table {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
8
12
|
overflow: hidden;
|
|
9
13
|
user-select: none;
|
|
10
14
|
|
|
15
|
+
&-table-wrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex: 1;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
&-cell {
|
|
12
|
-
|
|
22
|
+
flex-grow: 1;
|
|
13
23
|
height: @table-row-height;
|
|
14
|
-
|
|
15
|
-
border-bottom: 1px solid @NL95;
|
|
16
|
-
text-align: left;
|
|
17
|
-
color: @NL0;
|
|
24
|
+
padding: 0 12px;
|
|
18
25
|
overflow: hidden;
|
|
26
|
+
color: @NL0;
|
|
27
|
+
line-height: @table-row-height;
|
|
19
28
|
white-space: nowrap;
|
|
29
|
+
text-align: left;
|
|
20
30
|
text-overflow: ellipsis;
|
|
21
|
-
|
|
31
|
+
border-bottom: 1px solid @NL95;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
&-row {
|
|
@@ -36,17 +46,17 @@
|
|
|
36
46
|
// border: 1px solid red;
|
|
37
47
|
|
|
38
48
|
.ant-block-table-bar {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
background: blue;
|
|
41
|
-
width: 1px;
|
|
42
|
-
height: 12px;
|
|
43
49
|
position: absolute;
|
|
44
50
|
top: 50%;
|
|
45
51
|
right: 0;
|
|
46
|
-
transform: translateY(-50%);
|
|
47
52
|
z-index: 1;
|
|
48
|
-
|
|
53
|
+
display: inline-block;
|
|
54
|
+
width: 1px;
|
|
55
|
+
height: 12px;
|
|
56
|
+
background: blue;
|
|
49
57
|
background-color: @NL95;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
touch-action: none;
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
&:last-child {
|
|
@@ -58,11 +68,11 @@
|
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
&-tbody {
|
|
71
|
+
flex: 1;
|
|
61
72
|
overflow: hidden;
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
overflow-y: overlay;
|
|
74
|
+
.ant-empty {
|
|
75
|
+
padding-top: 80px;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
.ant-block-table-row {
|
|
@@ -87,41 +97,55 @@
|
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
&-loading {
|
|
90
|
-
text-align: center;
|
|
91
|
-
line-height: @table-row-height;
|
|
92
100
|
color: @NL80;
|
|
101
|
+
line-height: @table-row-height;
|
|
102
|
+
text-align: center;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
105
|
&-header {
|
|
96
106
|
display: flex;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
padding: 0 10px;
|
|
99
107
|
align-items: center;
|
|
108
|
+
justify-content: space-between;
|
|
100
109
|
margin-bottom: 24px;
|
|
110
|
+
padding: 0 10px;
|
|
101
111
|
|
|
102
112
|
&-left {
|
|
113
|
+
color: @NL0;
|
|
103
114
|
font-weight: 500;
|
|
104
115
|
font-size: 14px;
|
|
105
|
-
color: @NL0;
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
&-right {
|
|
109
119
|
display: flex;
|
|
120
|
+
align-items: center;
|
|
110
121
|
justify-content: flex-end;
|
|
111
122
|
height: 28px;
|
|
112
|
-
align-items: center;
|
|
113
|
-
font-size: 14px;
|
|
114
123
|
color: @NL0;
|
|
124
|
+
font-size: 14px;
|
|
115
125
|
}
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
&-list {
|
|
119
129
|
overflow: overlay !important;
|
|
130
|
+
|
|
131
|
+
&::-webkit-scrollbar-thumb {
|
|
132
|
+
background: @NL90;
|
|
133
|
+
background-clip: padding-box;
|
|
134
|
+
border: 3px solid transparent;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&::-webkit-scrollbar {
|
|
139
|
+
width: 12px;
|
|
140
|
+
height: 12px;
|
|
141
|
+
min-height: 12px;
|
|
142
|
+
background-color: transparent;
|
|
143
|
+
}
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
&-sortIcon {
|
|
123
|
-
margin-left: 4px;
|
|
124
147
|
margin-top: -2px;
|
|
148
|
+
margin-left: 4px;
|
|
125
149
|
}
|
|
126
150
|
|
|
127
151
|
&-column-resizable {
|
|
@@ -148,4 +172,4 @@
|
|
|
148
172
|
}
|
|
149
173
|
}
|
|
150
174
|
}
|
|
151
|
-
}
|
|
175
|
+
}
|
package/es/Tabs/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "antd/es/tabs/style";
|
|
2
|
+
import _Tabs from "antd/es/tabs";
|
|
1
3
|
var _excluded = ["size", "className", "adaptHeight"];
|
|
2
4
|
|
|
3
5
|
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,8 +12,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
10
12
|
|
|
11
13
|
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; }
|
|
12
14
|
|
|
13
|
-
import React from 'react';
|
|
14
|
-
|
|
15
|
+
import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
16
|
+
|
|
15
17
|
import Icon from '../Icon';
|
|
16
18
|
import TabPane from './TabPane';
|
|
17
19
|
import classNames from 'classnames';
|
|
@@ -27,7 +29,7 @@ export default function Tabs(props) {
|
|
|
27
29
|
tabsProps.size = size;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
return /*#__PURE__*/React.createElement(
|
|
32
|
+
return /*#__PURE__*/React.createElement(_Tabs, _objectSpread({
|
|
31
33
|
moreIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
32
34
|
type: "more_vert",
|
|
33
35
|
size: 18
|
package/es/Tabs/style/index.d.ts
CHANGED
package/es/Tabs/style/index.js
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { MenuClickEventHandler } from 'rc-menu/lib/interface';
|
|
|
7
7
|
export { default as Menu } from './Menu';
|
|
8
8
|
export type { IMenuProps as MenuProps } from './Menu';
|
|
9
9
|
export { default as Input } from './Input';
|
|
10
|
-
export type { IInputProps as InputProps, TSize } from './Input';
|
|
10
|
+
export type { IInputProps as InputProps, TSize, InputRef, TextAreaRef } from './Input';
|
|
11
11
|
export { default as Tabs } from './Tabs';
|
|
12
12
|
export type { ITabsProps as TabsProps, TabsSize } from './Tabs';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
package/es/style/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'antd/
|
|
1
|
+
import 'antd/lib/style/compact.less';
|
|
2
2
|
import './index.less';
|
package/es/style/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'antd/
|
|
1
|
+
import 'antd/lib/style/compact.less';
|
|
2
2
|
import './index.less';
|
package/lib/Dropdown/Button.d.ts
CHANGED
package/lib/Dropdown/Button.js
CHANGED
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
11
11
|
|
|
12
|
+
require("../Button/style");
|
|
13
|
+
|
|
12
14
|
var _index = _interopRequireDefault(require("./index"));
|
|
13
15
|
|
|
14
16
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
package/lib/Input/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import TextArea from './components/TextArea';
|
|
|
5
5
|
import Password from './components/Password';
|
|
6
6
|
export type { IInputProps, InputRef, TSize } from './components/Input';
|
|
7
7
|
export type { IGroupProps } from './components/Group';
|
|
8
|
-
export type { ITextAreaProps } from './components/TextArea';
|
|
8
|
+
export type { ITextAreaProps, TextAreaRef } from './components/TextArea';
|
|
9
9
|
export type { IPasswordProps } from './components/Password';
|
|
10
10
|
interface ICompoundedComponent extends React.ForwardRefExoticComponent<IInputProps & React.RefAttributes<InputRef>> {
|
|
11
11
|
Group: typeof Group;
|
package/lib/Input/style/index.js
CHANGED
package/lib/Menu/style/index.js
CHANGED
package/lib/Table/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ITableProps } from './interface';
|
|
3
|
-
declare function Table<T extends Record<string, unknown>>({ columns, data, total, renderHeaderLeft, renderHeaderRight,
|
|
3
|
+
declare function Table<T extends Record<string, unknown>>({ columns, data, total, renderHeaderLeft, renderHeaderRight, onRowSelected, loadMore, hasNextPage, loading, sortable, defaultSort, resizeColumn, sortDirections: allSortDirections, showHeader, onChange, }: ITableProps<T>): ReactElement;
|
|
4
4
|
export default Table;
|
package/lib/Table/index.js
CHANGED
|
@@ -7,33 +7,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _classnames5 = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _Empty = _interopRequireDefault(require("../Empty"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
17
17
|
|
|
18
18
|
var _reactWindowInfiniteLoader = _interopRequireDefault(require("react-window-infinite-loader"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _usePrefixCls = _interopRequireDefault(require("../_utils/hooks/usePrefixCls"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _reactWindow = require("react-window");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _reactTable = require("react-table");
|
|
27
27
|
|
|
28
28
|
var _excluded = ["style"],
|
|
29
29
|
_excluded2 = ["style"];
|
|
30
30
|
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
|
|
33
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
34
32
|
|
|
35
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
36
34
|
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
|
+
|
|
37
37
|
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; }
|
|
38
38
|
|
|
39
39
|
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; }
|
|
@@ -59,6 +59,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
59
59
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
60
60
|
var ARRAY_FIRST_INDEX = 0;
|
|
61
61
|
var DEFAULT_ROW_WIDTH = 0;
|
|
62
|
+
var DEFAULT_BODY_HEIGHT = 0;
|
|
62
63
|
|
|
63
64
|
function Table(_ref) {
|
|
64
65
|
var columns = _ref.columns,
|
|
@@ -66,10 +67,8 @@ function Table(_ref) {
|
|
|
66
67
|
total = _ref.total,
|
|
67
68
|
renderHeaderLeft = _ref.renderHeaderLeft,
|
|
68
69
|
renderHeaderRight = _ref.renderHeaderRight,
|
|
69
|
-
scrollY = _ref.scrollY,
|
|
70
70
|
onRowSelected = _ref.onRowSelected,
|
|
71
|
-
|
|
72
|
-
loadMore = _ref$loadMore === void 0 ? function () {} : _ref$loadMore,
|
|
71
|
+
loadMore = _ref.loadMore,
|
|
73
72
|
hasNextPage = _ref.hasNextPage,
|
|
74
73
|
loading = _ref.loading,
|
|
75
74
|
_ref$sortable = _ref.sortable,
|
|
@@ -88,6 +87,18 @@ function Table(_ref) {
|
|
|
88
87
|
selectedRowId = _React$useState2[0],
|
|
89
88
|
setSelectedRowId = _React$useState2[1];
|
|
90
89
|
|
|
90
|
+
var tableBodyRef = (0, _react.useRef)(null);
|
|
91
|
+
|
|
92
|
+
var _useState = (0, _react.useState)(DEFAULT_BODY_HEIGHT),
|
|
93
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
94
|
+
bodyClientHeight = _useState2[0],
|
|
95
|
+
setBodyClientHeight = _useState2[1];
|
|
96
|
+
|
|
97
|
+
(0, _react.useEffect)(function () {
|
|
98
|
+
if (tableBodyRef.current) {
|
|
99
|
+
setBodyClientHeight(tableBodyRef.current.clientHeight);
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
91
102
|
var newColumns = (0, _react.useMemo)(function () {
|
|
92
103
|
return columns.map(function (column) {
|
|
93
104
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
@@ -126,13 +137,29 @@ function Table(_ref) {
|
|
|
126
137
|
sortDirection = _React$useState4[0],
|
|
127
138
|
setSortDirection = _React$useState4[1];
|
|
128
139
|
|
|
140
|
+
var getInitSortBy = function getInitSortBy() {
|
|
141
|
+
if (!(sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.id)) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var sortColumn = newColumns.find(function (column) {
|
|
146
|
+
return column.accessor === sortDirection.id;
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
if (sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.sorter) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return [sortDirection];
|
|
154
|
+
};
|
|
155
|
+
|
|
129
156
|
var _useTable = (0, _reactTable.useTable)({
|
|
130
157
|
columns: newColumns,
|
|
131
158
|
data: data,
|
|
132
159
|
disableMultiSort: true,
|
|
133
160
|
disableSortBy: !sortable,
|
|
134
161
|
initialState: {
|
|
135
|
-
sortBy:
|
|
162
|
+
sortBy: getInitSortBy()
|
|
136
163
|
}
|
|
137
164
|
}, _reactTable.useBlockLayout, _reactTable.useSortBy, _reactTable.useRowSelect, _reactTable.useResizeColumns),
|
|
138
165
|
getTableProps = _useTable.getTableProps,
|
|
@@ -145,17 +172,6 @@ function Table(_ref) {
|
|
|
145
172
|
var theadRowWidthRef = _react.default.useRef(DEFAULT_ROW_WIDTH);
|
|
146
173
|
|
|
147
174
|
var prefixCls = (0, _usePrefixCls.default)('block-table');
|
|
148
|
-
|
|
149
|
-
function getTbodyStyle() {
|
|
150
|
-
if (scrollY) {
|
|
151
|
-
return {
|
|
152
|
-
height: "".concat(scrollY, "px")
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return {};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
175
|
var onRowClick = (0, _react.useCallback)(function (row) {
|
|
160
176
|
if (!onRowSelected) {
|
|
161
177
|
return;
|
|
@@ -178,7 +194,7 @@ function Table(_ref) {
|
|
|
178
194
|
if (!isItemLoaded(index)) {
|
|
179
195
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
180
196
|
style: style,
|
|
181
|
-
className: (0,
|
|
197
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-loading"))
|
|
182
198
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
183
199
|
type: "waiting",
|
|
184
200
|
size: 16
|
|
@@ -196,24 +212,24 @@ function Table(_ref) {
|
|
|
196
212
|
style: _objectSpread(_objectSpread(_objectSpread({}, style), rowStyle), {}, {
|
|
197
213
|
width: resizeColumn ? style === null || style === void 0 ? void 0 : style.width : '100%'
|
|
198
214
|
}),
|
|
199
|
-
className: (0,
|
|
215
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-row"), _defineProperty({}, "".concat(prefixCls, "-row-selected"), row.id === selectedRowId)),
|
|
200
216
|
onClick: function onClick() {
|
|
201
217
|
return onRowClick(row);
|
|
202
218
|
}
|
|
203
219
|
}), row.cells.map(function (cell) {
|
|
204
220
|
return /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
|
|
205
|
-
className: (0,
|
|
221
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-cell"))
|
|
206
222
|
}), cell.render('Cell'));
|
|
207
223
|
}));
|
|
208
224
|
};
|
|
209
225
|
|
|
210
226
|
var renderHeader = function renderHeader(len) {
|
|
211
227
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
-
className: (0,
|
|
228
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-header"))
|
|
213
229
|
}, renderHeaderLeft ? renderHeaderLeft() : /*#__PURE__*/_react.default.createElement("span", {
|
|
214
|
-
className: (0,
|
|
230
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-header-left"))
|
|
215
231
|
}, "\u5171\u8BA1", total || len, "\u6761"), /*#__PURE__*/_react.default.createElement("div", {
|
|
216
|
-
className: (0,
|
|
232
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-header-right"))
|
|
217
233
|
}, renderHeaderRight ? renderHeaderRight() : null));
|
|
218
234
|
};
|
|
219
235
|
|
|
@@ -317,10 +333,47 @@ function Table(_ref) {
|
|
|
317
333
|
});
|
|
318
334
|
};
|
|
319
335
|
|
|
336
|
+
var renderTableBody = function renderTableBody() {
|
|
337
|
+
if (!loading && !rows.length) {
|
|
338
|
+
return /*#__PURE__*/_react.default.createElement(_Empty.default, {
|
|
339
|
+
description: "\u5F53\u524D\u65E0\u6570\u636E"
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (loadMore && typeof loadMore === 'function') {
|
|
344
|
+
return /*#__PURE__*/_react.default.createElement(_reactWindowInfiniteLoader.default, {
|
|
345
|
+
isItemLoaded: isItemLoaded,
|
|
346
|
+
itemCount: itemCount,
|
|
347
|
+
loadMoreItems: loadMoreItems,
|
|
348
|
+
threshold: 3
|
|
349
|
+
}, function (_ref5) {
|
|
350
|
+
var onItemsRendered = _ref5.onItemsRendered,
|
|
351
|
+
ref = _ref5.ref;
|
|
352
|
+
return /*#__PURE__*/_react.default.createElement(_reactWindow.FixedSizeList, {
|
|
353
|
+
itemCount: itemCount,
|
|
354
|
+
onItemsRendered: onItemsRendered,
|
|
355
|
+
height: bodyClientHeight,
|
|
356
|
+
itemSize: DEFAULT_ROW_HEIGHT,
|
|
357
|
+
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
358
|
+
ref: ref,
|
|
359
|
+
className: "".concat(prefixCls, "-list")
|
|
360
|
+
}, RenderRow);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return /*#__PURE__*/_react.default.createElement(_reactWindow.FixedSizeList, {
|
|
365
|
+
itemCount: itemCount,
|
|
366
|
+
height: bodyClientHeight,
|
|
367
|
+
itemSize: DEFAULT_ROW_HEIGHT,
|
|
368
|
+
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
369
|
+
className: "".concat(prefixCls, "-list")
|
|
370
|
+
}, RenderRow);
|
|
371
|
+
};
|
|
372
|
+
|
|
320
373
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
321
374
|
className: prefixCls
|
|
322
375
|
}, showHeader && renderHeader(data.length), /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, getTableProps()), {}, {
|
|
323
|
-
className: (0,
|
|
376
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-table-wrap"), _defineProperty({}, "".concat(prefixCls, "-column-resizable"), resizeColumn))
|
|
324
377
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
325
378
|
className: "".concat(prefixCls, "-thead")
|
|
326
379
|
}, headerGroups.map(function (headerGroup) {
|
|
@@ -338,37 +391,19 @@ function Table(_ref) {
|
|
|
338
391
|
var barPorps = resizeColumn ? column.getResizerProps() : {};
|
|
339
392
|
return /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({
|
|
340
393
|
// {...column.getHeaderProps(column.getSortByToggleProps())}
|
|
341
|
-
className: (0,
|
|
394
|
+
className: (0, _classnames5.default)(_defineProperty({}, "".concat(prefixCls, "-cell-sorting"), column.id === sortDirection.id), "".concat(prefixCls, "-cell"))
|
|
342
395
|
}, getHeaderProps(column)), {}, {
|
|
343
396
|
key: column.id
|
|
344
397
|
}), column.render('Header'), /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, barPorps), {}, {
|
|
345
|
-
className: (0,
|
|
398
|
+
className: (0, _classnames5.default)(_defineProperty({}, "".concat(prefixCls, "-dragBar"), resizeColumn), "".concat(prefixCls, "-bar"))
|
|
346
399
|
})), /*#__PURE__*/_react.default.createElement(SortIcons, {
|
|
347
400
|
id: column.id
|
|
348
401
|
}));
|
|
349
402
|
}));
|
|
350
403
|
})), /*#__PURE__*/_react.default.createElement("div", _objectSpread(_objectSpread({}, getTableBodyProps()), {}, {
|
|
351
|
-
className: (0,
|
|
352
|
-
|
|
353
|
-
}),
|
|
354
|
-
description: "\u5F53\u524D\u65E0\u6570\u636E"
|
|
355
|
-
}), /*#__PURE__*/_react.default.createElement(_reactWindowInfiniteLoader.default, {
|
|
356
|
-
isItemLoaded: isItemLoaded,
|
|
357
|
-
itemCount: itemCount,
|
|
358
|
-
loadMoreItems: loadMoreItems
|
|
359
|
-
}, function (_ref5) {
|
|
360
|
-
var onItemsRendered = _ref5.onItemsRendered,
|
|
361
|
-
ref = _ref5.ref;
|
|
362
|
-
return /*#__PURE__*/_react.default.createElement(_reactWindow.FixedSizeList, {
|
|
363
|
-
itemCount: itemCount,
|
|
364
|
-
onItemsRendered: onItemsRendered,
|
|
365
|
-
height: scrollY || data.length * DEFAULT_ROW_HEIGHT,
|
|
366
|
-
itemSize: DEFAULT_ROW_HEIGHT,
|
|
367
|
-
width: resizeColumn ? theadRowWidthRef.current : '100%',
|
|
368
|
-
ref: ref,
|
|
369
|
-
className: "".concat(prefixCls, "-list")
|
|
370
|
-
}, RenderRow);
|
|
371
|
-
}))));
|
|
404
|
+
className: (0, _classnames5.default)("".concat(prefixCls, "-tbody")),
|
|
405
|
+
ref: tableBodyRef
|
|
406
|
+
}), renderTableBody())));
|
|
372
407
|
}
|
|
373
408
|
|
|
374
409
|
var _default = Table;
|
package/lib/Table/interface.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export interface ITableProps<T extends object> {
|
|
|
20
20
|
columns: IColumn<T>[];
|
|
21
21
|
data: T[];
|
|
22
22
|
total?: number;
|
|
23
|
-
scrollY?: number;
|
|
24
23
|
onRowSelected?: (row: T) => void;
|
|
25
24
|
loadMore?: (startIndex: number, stopIndex: number) => void | Promise<void>;
|
|
26
25
|
hasNextPage?: boolean;
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
@ald-prefix:ant;
|
|
4
|
-
@ald-iconfont-css-prefix:anticon;
|
|
5
|
-
@table-row-height:40px;
|
|
3
|
+
@ald-prefix: ant;
|
|
4
|
+
@ald-iconfont-css-prefix: anticon;
|
|
5
|
+
@table-row-height: 40px;
|
|
6
6
|
|
|
7
7
|
.ant-block-table {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
8
12
|
overflow: hidden;
|
|
9
13
|
user-select: none;
|
|
10
14
|
|
|
15
|
+
&-table-wrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex: 1;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
&-cell {
|
|
12
|
-
|
|
22
|
+
flex-grow: 1;
|
|
13
23
|
height: @table-row-height;
|
|
14
|
-
|
|
15
|
-
border-bottom: 1px solid @NL95;
|
|
16
|
-
text-align: left;
|
|
17
|
-
color: @NL0;
|
|
24
|
+
padding: 0 12px;
|
|
18
25
|
overflow: hidden;
|
|
26
|
+
color: @NL0;
|
|
27
|
+
line-height: @table-row-height;
|
|
19
28
|
white-space: nowrap;
|
|
29
|
+
text-align: left;
|
|
20
30
|
text-overflow: ellipsis;
|
|
21
|
-
|
|
31
|
+
border-bottom: 1px solid @NL95;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
&-row {
|
|
@@ -36,17 +46,17 @@
|
|
|
36
46
|
// border: 1px solid red;
|
|
37
47
|
|
|
38
48
|
.ant-block-table-bar {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
background: blue;
|
|
41
|
-
width: 1px;
|
|
42
|
-
height: 12px;
|
|
43
49
|
position: absolute;
|
|
44
50
|
top: 50%;
|
|
45
51
|
right: 0;
|
|
46
|
-
transform: translateY(-50%);
|
|
47
52
|
z-index: 1;
|
|
48
|
-
|
|
53
|
+
display: inline-block;
|
|
54
|
+
width: 1px;
|
|
55
|
+
height: 12px;
|
|
56
|
+
background: blue;
|
|
49
57
|
background-color: @NL95;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
touch-action: none;
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
&:last-child {
|
|
@@ -58,11 +68,11 @@
|
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
&-tbody {
|
|
71
|
+
flex: 1;
|
|
61
72
|
overflow: hidden;
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
overflow-y: overlay;
|
|
74
|
+
.ant-empty {
|
|
75
|
+
padding-top: 80px;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
.ant-block-table-row {
|
|
@@ -87,41 +97,55 @@
|
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
&-loading {
|
|
90
|
-
text-align: center;
|
|
91
|
-
line-height: @table-row-height;
|
|
92
100
|
color: @NL80;
|
|
101
|
+
line-height: @table-row-height;
|
|
102
|
+
text-align: center;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
105
|
&-header {
|
|
96
106
|
display: flex;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
padding: 0 10px;
|
|
99
107
|
align-items: center;
|
|
108
|
+
justify-content: space-between;
|
|
100
109
|
margin-bottom: 24px;
|
|
110
|
+
padding: 0 10px;
|
|
101
111
|
|
|
102
112
|
&-left {
|
|
113
|
+
color: @NL0;
|
|
103
114
|
font-weight: 500;
|
|
104
115
|
font-size: 14px;
|
|
105
|
-
color: @NL0;
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
&-right {
|
|
109
119
|
display: flex;
|
|
120
|
+
align-items: center;
|
|
110
121
|
justify-content: flex-end;
|
|
111
122
|
height: 28px;
|
|
112
|
-
align-items: center;
|
|
113
|
-
font-size: 14px;
|
|
114
123
|
color: @NL0;
|
|
124
|
+
font-size: 14px;
|
|
115
125
|
}
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
&-list {
|
|
119
129
|
overflow: overlay !important;
|
|
130
|
+
|
|
131
|
+
&::-webkit-scrollbar-thumb {
|
|
132
|
+
background: @NL90;
|
|
133
|
+
background-clip: padding-box;
|
|
134
|
+
border: 3px solid transparent;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&::-webkit-scrollbar {
|
|
139
|
+
width: 12px;
|
|
140
|
+
height: 12px;
|
|
141
|
+
min-height: 12px;
|
|
142
|
+
background-color: transparent;
|
|
143
|
+
}
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
&-sortIcon {
|
|
123
|
-
margin-left: 4px;
|
|
124
147
|
margin-top: -2px;
|
|
148
|
+
margin-left: 4px;
|
|
125
149
|
}
|
|
126
150
|
|
|
127
151
|
&-column-resizable {
|
|
@@ -148,4 +172,4 @@
|
|
|
148
172
|
}
|
|
149
173
|
}
|
|
150
174
|
}
|
|
151
|
-
}
|
|
175
|
+
}
|
package/lib/Tabs/index.js
CHANGED
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = Tabs;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
require("antd/es/tabs/style");
|
|
9
|
+
|
|
10
|
+
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
14
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
13
15
|
|
package/lib/Tabs/style/index.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { MenuClickEventHandler } from 'rc-menu/lib/interface';
|
|
|
7
7
|
export { default as Menu } from './Menu';
|
|
8
8
|
export type { IMenuProps as MenuProps } from './Menu';
|
|
9
9
|
export { default as Input } from './Input';
|
|
10
|
-
export type { IInputProps as InputProps, TSize } from './Input';
|
|
10
|
+
export type { IInputProps as InputProps, TSize, InputRef, TextAreaRef } from './Input';
|
|
11
11
|
export { default as Tabs } from './Tabs';
|
|
12
12
|
export type { ITabsProps as TabsProps, TabsSize } from './Tabs';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
package/lib/style/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'antd/
|
|
1
|
+
import 'antd/lib/style/compact.less';
|
|
2
2
|
import './index.less';
|
package/lib/style/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aloudata/aloudata-design",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.13",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"gh-pages": "^3.0.0",
|
|
88
88
|
"husky": "^3.0.9",
|
|
89
89
|
"lint-staged": "^10.0.7",
|
|
90
|
-
"postcss": "^8.4.
|
|
90
|
+
"postcss": "^8.4.12",
|
|
91
91
|
"postcss-import": "^14.1.0",
|
|
92
92
|
"postcss-less": "^6.0.0",
|
|
93
93
|
"prettier": "^2.2.1",
|