@aloudata/aloudata-design 0.4.0-beta.1 → 0.4.0-beta.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/es/Avatar/component/Avatar/index.d.ts +84 -0
- package/es/Avatar/component/Avatar/index.js +42 -0
- package/es/Avatar/index.d.ts +1 -13
- package/es/Avatar/index.js +1 -30
- package/es/Avatar/style/index.less +1 -1
- package/es/Breadcrumb/index.d.ts +5 -2
- package/es/Breadcrumb/index.js +17 -7
- package/es/Button/index.d.ts +1 -1
- package/es/Button/index.js +3 -8
- package/es/Button/style/index.less +7 -1
- package/es/Button/style/variables.less +26 -26
- package/es/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
- package/es/Checkbox/component/CheckboxGroup/index.js +27 -0
- package/es/Checkbox/index.d.ts +4 -5
- package/es/Checkbox/index.js +3 -12
- package/es/Checkbox/style/index.less +36 -16
- package/es/Checkbox/type.d.ts +94 -0
- package/es/Checkbox/type.js +6 -0
- package/es/Divider/index.d.ts +40 -2
- package/es/Divider/index.js +10 -1
- package/es/Divider/style/index.less +4 -0
- package/es/Divider/style/index.less.d.ts +183 -0
- package/es/Dropdown/Button.d.ts +4 -4
- package/es/Dropdown/Button.js +5 -5
- package/es/Dropdown/index.d.ts +5 -5
- package/es/Dropdown/index.js +5 -5
- package/es/Icon/icons.d.ts +9 -0
- package/es/Icon/icons.js +1590 -0
- package/es/Input/components/Input/index.d.ts +13 -1
- package/es/Input/components/Input/index.js +1 -3
- package/es/Input/components/Password/index.d.ts +6 -1
- package/es/Input/components/Password/index.js +11 -3
- package/es/Input/components/TextArea/index.d.ts +1 -1
- package/es/Input/style/index.less +139 -59
- package/es/InputNumber/index.d.ts +3 -3
- package/es/InputNumber/style/index.less +66 -26
- package/es/InputNumber/type.d.ts +161 -0
- package/es/InputNumber/type.js +1 -0
- package/es/Menu/index.d.ts +2 -0
- package/es/Popconfirm/index.d.ts +3 -0
- package/es/Popconfirm/index.js +2 -0
- package/es/Popconfirm/style/index.d.ts +2 -0
- package/es/Popconfirm/style/index.js +2 -0
- package/es/Popconfirm/style/index.less +1 -0
- package/es/Progress/index.d.ts +3 -0
- package/es/Progress/index.js +2 -0
- package/es/Progress/style/index.d.ts +2 -0
- package/es/Progress/style/index.js +2 -0
- package/es/Progress/style/index.less +1 -0
- package/es/Select/style/variables.less.d.ts +6 -0
- package/es/Steps/style/index.less +10 -4
- package/es/Table/Table.js +51 -29
- package/es/Table/components/TableHead/index.d.ts +0 -1
- package/es/Table/components/TableHead/index.js +1 -2
- package/es/Table/interface.d.ts +2 -0
- package/es/Table/style/index.less +6 -1
- package/es/Table/style/variable.less +0 -5
- package/es/Table/style/variable.less.d.ts +1 -1
- package/es/Table/utils.js +16 -9
- package/es/Tabs/index.js +2 -2
- package/es/Tabs/style/index.less +1 -1
- package/es/Tooltip/index.d.ts +2 -2
- package/es/Tooltip/index.js +4 -4
- package/es/index.d.ts +7 -3
- package/es/index.js +3 -1
- package/es/style/themes/default/scrollBar.less +10 -7
- package/es/style/themes/default/themeColor.module.less +176 -166
- package/es/style/themes/default/themeColor.module.less.d.ts +6 -0
- package/lib/Avatar/component/Avatar/index.d.ts +84 -0
- package/lib/Avatar/component/Avatar/index.js +61 -0
- package/lib/Avatar/index.d.ts +1 -13
- package/lib/Avatar/index.js +3 -44
- package/lib/Avatar/style/index.less +1 -1
- package/lib/Breadcrumb/index.d.ts +5 -2
- package/lib/Breadcrumb/index.js +17 -8
- package/lib/Button/index.d.ts +1 -1
- package/lib/Button/index.js +3 -8
- package/lib/Button/style/index.less +7 -1
- package/lib/Button/style/variables.less +26 -26
- package/lib/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
- package/lib/Checkbox/component/CheckboxGroup/index.js +42 -0
- package/lib/Checkbox/index.d.ts +4 -5
- package/lib/Checkbox/index.js +4 -13
- package/lib/Checkbox/style/index.less +36 -16
- package/lib/Checkbox/type.d.ts +94 -0
- package/lib/Checkbox/type.js +13 -0
- package/lib/Divider/index.d.ts +40 -2
- package/lib/Divider/index.js +11 -1
- package/lib/Divider/style/index.less +4 -0
- package/lib/Divider/style/index.less.d.ts +183 -0
- package/lib/Dropdown/Button.d.ts +4 -4
- package/lib/Dropdown/Button.js +5 -5
- package/lib/Dropdown/index.d.ts +5 -5
- package/lib/Dropdown/index.js +5 -5
- package/lib/Icon/icons.d.ts +9 -0
- package/lib/Icon/icons.js +1597 -0
- package/lib/Input/components/Input/index.d.ts +13 -1
- package/lib/Input/components/Input/index.js +1 -3
- package/lib/Input/components/Password/index.d.ts +6 -1
- package/lib/Input/components/Password/index.js +14 -4
- package/lib/Input/components/TextArea/index.d.ts +1 -1
- package/lib/Input/style/index.less +139 -59
- package/lib/InputNumber/index.d.ts +3 -3
- package/lib/InputNumber/style/index.less +66 -26
- package/lib/InputNumber/type.d.ts +161 -0
- package/lib/InputNumber/type.js +5 -0
- package/lib/Menu/index.d.ts +2 -0
- package/lib/Popconfirm/index.d.ts +3 -0
- package/lib/Popconfirm/index.js +13 -0
- package/lib/Popconfirm/style/index.d.ts +2 -0
- package/lib/Popconfirm/style/index.js +5 -0
- package/lib/Popconfirm/style/index.less +1 -0
- package/lib/Progress/index.d.ts +3 -0
- package/lib/Progress/index.js +13 -0
- package/lib/Progress/style/index.d.ts +2 -0
- package/lib/Progress/style/index.js +5 -0
- package/lib/Progress/style/index.less +1 -0
- package/lib/Select/style/variables.less.d.ts +6 -0
- package/lib/Steps/style/index.less +10 -4
- package/lib/Table/Table.js +51 -30
- package/lib/Table/components/TableHead/index.d.ts +0 -1
- package/lib/Table/components/TableHead/index.js +1 -2
- package/lib/Table/interface.d.ts +2 -0
- package/lib/Table/style/index.less +6 -1
- package/lib/Table/style/variable.less +0 -5
- package/lib/Table/style/variable.less.d.ts +1 -1
- package/lib/Table/utils.js +16 -9
- package/lib/Tabs/index.js +2 -2
- package/lib/Tabs/style/index.less +1 -1
- package/lib/Tooltip/index.d.ts +2 -2
- package/lib/Tooltip/index.js +4 -4
- package/lib/index.d.ts +7 -3
- package/lib/index.js +16 -0
- package/lib/style/themes/default/scrollBar.less +10 -7
- package/lib/style/themes/default/themeColor.module.less +176 -166
- package/lib/style/themes/default/themeColor.module.less.d.ts +6 -0
- package/package.json +3 -3
- package/es/Icon/icons.json +0 -418
- package/es/Table/hooks/useTableColumn.d.ts +0 -28
- package/es/Table/hooks/useTableColumn.js +0 -53
- package/es/Table/style/index.less.d.ts +0 -126
- package/lib/Icon/icons.json +0 -418
- package/lib/Table/hooks/useTableColumn.d.ts +0 -28
- package/lib/Table/hooks/useTableColumn.js +0 -66
- package/lib/Table/style/index.less.d.ts +0 -126
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputNumberProps } from 'antd';
|
|
3
|
+
export interface IInputNumberProps extends InputNumberProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 带标签的Input,设置后置标签
|
|
6
|
+
* @type ReactNode
|
|
7
|
+
* @default --
|
|
8
|
+
*/
|
|
9
|
+
addonBefore?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* @description 带标签的Input,设置前置标签
|
|
12
|
+
* @type ReactNode
|
|
13
|
+
* @default --
|
|
14
|
+
*/
|
|
15
|
+
addonAfter?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* @description 自动获取焦点
|
|
18
|
+
* @type boolean
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
autoFocus?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @description 是否有边框
|
|
24
|
+
* @type boolean
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
bordered?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @description 是否显示增减按钮,也可以设置自定义箭头图标
|
|
30
|
+
* @type boolean
|
|
31
|
+
| {
|
|
32
|
+
upIcon?: React.ReactNode;
|
|
33
|
+
downIcon?: React.ReactNode;
|
|
34
|
+
};
|
|
35
|
+
* @default -
|
|
36
|
+
*/
|
|
37
|
+
controls?: boolean | {
|
|
38
|
+
upIcon?: React.ReactNode;
|
|
39
|
+
downIcon?: React.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @description 小数点
|
|
43
|
+
* @type string
|
|
44
|
+
* @default -
|
|
45
|
+
*/
|
|
46
|
+
decimalSeparator?: string;
|
|
47
|
+
/**
|
|
48
|
+
* @description 初始值
|
|
49
|
+
* @type number
|
|
50
|
+
* @default -
|
|
51
|
+
*/
|
|
52
|
+
defaultValue?: number;
|
|
53
|
+
/**
|
|
54
|
+
* @description 禁用
|
|
55
|
+
* @type boolean
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @description 制定输入框展示值的格式
|
|
61
|
+
* @type (value: number | string | undefined, info: { userTyping: boolean; input: string }) => string
|
|
62
|
+
* @default -
|
|
63
|
+
*/
|
|
64
|
+
formatter?: (value: number | string | undefined, info: {
|
|
65
|
+
userTyping: boolean;
|
|
66
|
+
input: string;
|
|
67
|
+
}) => string;
|
|
68
|
+
/**
|
|
69
|
+
* @description 是否启用键盘快捷行为
|
|
70
|
+
* @type boolean
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
keyboard?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @description 最大值
|
|
76
|
+
* @type number
|
|
77
|
+
* @default Number.MAX_SAFE_INTEGER
|
|
78
|
+
*/
|
|
79
|
+
max?: number;
|
|
80
|
+
/**
|
|
81
|
+
* @description 最小值
|
|
82
|
+
* @type number
|
|
83
|
+
* @default Number.MIN_SAFE_INTEGER
|
|
84
|
+
*/
|
|
85
|
+
min?: number;
|
|
86
|
+
/**
|
|
87
|
+
* @description 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用
|
|
88
|
+
* @type (value: string) => number
|
|
89
|
+
* @default -
|
|
90
|
+
*/
|
|
91
|
+
parser?: (value: string | undefined) => number;
|
|
92
|
+
/**
|
|
93
|
+
* @description 数值精度,配置 formatter 时会以 formatter 为准
|
|
94
|
+
* @type number
|
|
95
|
+
* @default -
|
|
96
|
+
*/
|
|
97
|
+
precision?: number;
|
|
98
|
+
/**
|
|
99
|
+
* @description 只读
|
|
100
|
+
* @type boolean
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
readonly?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* @description 设置校验状态
|
|
106
|
+
* @type 'warning' | 'error'
|
|
107
|
+
* @default -
|
|
108
|
+
*/
|
|
109
|
+
status?: 'warning' | 'error';
|
|
110
|
+
/**
|
|
111
|
+
* @description 带有前缀图标的input
|
|
112
|
+
* @type ReactNode
|
|
113
|
+
* @default -
|
|
114
|
+
*/
|
|
115
|
+
prefix?: React.ReactNode;
|
|
116
|
+
/**
|
|
117
|
+
* @description 输入框大小
|
|
118
|
+
* @type 'small' | 'middle' | 'large'
|
|
119
|
+
* @default -
|
|
120
|
+
*/
|
|
121
|
+
size?: 'small' | 'middle' | 'large';
|
|
122
|
+
/**
|
|
123
|
+
* @description 每次改变步数,可以为小数
|
|
124
|
+
* @type number | string
|
|
125
|
+
* @default 1
|
|
126
|
+
*/
|
|
127
|
+
step?: number | string;
|
|
128
|
+
/**
|
|
129
|
+
* @description 字符值模式,开启后支持高精度小数。同时 onChange 将返回 string 类型
|
|
130
|
+
* @type boolean
|
|
131
|
+
* @default false
|
|
132
|
+
*/
|
|
133
|
+
stringMode?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* @description 当前值
|
|
136
|
+
* @type number
|
|
137
|
+
* @default -
|
|
138
|
+
*/
|
|
139
|
+
value?: number;
|
|
140
|
+
/**
|
|
141
|
+
* @description 变化回调
|
|
142
|
+
* @type (value: number | string | null) => void
|
|
143
|
+
* @default -
|
|
144
|
+
*/
|
|
145
|
+
onChange?: (value: number | string | null) => void;
|
|
146
|
+
/**
|
|
147
|
+
* @description 按下回车的回调
|
|
148
|
+
* @type (e: React.KeyboardEvent) => void
|
|
149
|
+
* @default -
|
|
150
|
+
*/
|
|
151
|
+
onPressEnter?: (e: React.KeyboardEvent) => void;
|
|
152
|
+
/**
|
|
153
|
+
* @description 点击上下箭头的回调
|
|
154
|
+
* @type (value: number|string, info: { offset: number|string, type: 'up' | 'down' }) => void
|
|
155
|
+
* @default -
|
|
156
|
+
*/
|
|
157
|
+
onStep?: (value: number | string, info: {
|
|
158
|
+
offset: number | string;
|
|
159
|
+
type: 'up' | 'down';
|
|
160
|
+
}) => void;
|
|
161
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/Menu/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MenuProps } from 'antd';
|
|
3
|
+
import { ItemType as antdItemType } from 'antd/lib/menu/hooks/useItems';
|
|
3
4
|
import MenuItem from './MenuItem';
|
|
4
5
|
import type { MenuClickEventHandler } from 'rc-menu/lib/interface';
|
|
5
6
|
export interface IMenuProps extends MenuProps {
|
|
@@ -12,6 +13,7 @@ export interface IMenuProps extends MenuProps {
|
|
|
12
13
|
className?: string;
|
|
13
14
|
children?: React.ReactNode | React.ReactNode[];
|
|
14
15
|
}
|
|
16
|
+
export declare type ItemType = antdItemType;
|
|
15
17
|
declare function Menu(props: IMenuProps): JSX.Element;
|
|
16
18
|
declare namespace Menu {
|
|
17
19
|
var Item: typeof MenuItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
@@ -90,7 +90,13 @@ interface CssExports {
|
|
|
90
90
|
'SELECTOR_PADDING_HORIZONTAL_MIDDLE': string;
|
|
91
91
|
'SELECTOR_PADDING_HORIZONTAL_MINI': string;
|
|
92
92
|
'SELECTOR_PADDING_HORIZONTAL_SMALL': string;
|
|
93
|
+
'SHADOW_BODY_TOP_LEFT': string;
|
|
93
94
|
'SHADOW_L': string;
|
|
95
|
+
'SHADOW_LG': string;
|
|
96
|
+
'SHADOW_MD': string;
|
|
97
|
+
'SHADOW_SM': string;
|
|
98
|
+
'SHADOW_XL': string;
|
|
99
|
+
'SHADOW_XS': string;
|
|
94
100
|
'TA10': string;
|
|
95
101
|
'TA20': string;
|
|
96
102
|
'TA30': string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
.ant-steps-item-icon {
|
|
4
|
-
|
|
5
|
-
height: 24px;
|
|
6
|
-
margin: 6px 8px -2px 0;
|
|
3
|
+
.ald-steps .ant-steps-item .ant-steps-item-container .ant-steps-item-icon {
|
|
4
|
+
margin: 6px 8px -2px 42px;
|
|
7
5
|
font-size: 12px;
|
|
8
6
|
line-height: 24px;
|
|
9
7
|
text-align: center;
|
|
@@ -15,6 +13,10 @@
|
|
|
15
13
|
.ant-steps.ald-steps {
|
|
16
14
|
padding: 24px;
|
|
17
15
|
|
|
16
|
+
.ant-steps-item-container {
|
|
17
|
+
height: 49px;
|
|
18
|
+
}
|
|
19
|
+
|
|
18
20
|
.ant-steps-item-content {
|
|
19
21
|
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
@@ -34,12 +36,16 @@
|
|
|
34
36
|
// 常规step
|
|
35
37
|
.ant-steps-item {
|
|
36
38
|
.ant-steps-item-tail {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
height: 30px;
|
|
37
42
|
margin-left: 50px;
|
|
38
43
|
padding: 3.5px 7px;
|
|
39
44
|
|
|
40
45
|
&::after {
|
|
41
46
|
height: 2px;
|
|
42
47
|
background-color: @NL90;
|
|
48
|
+
content: '';
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
|
package/es/Table/Table.js
CHANGED
|
@@ -31,14 +31,15 @@ import Empty from './components/Empty';
|
|
|
31
31
|
import TableHead from './components/TableHead';
|
|
32
32
|
import TableBodyRowList from './components/TableBodyRowList';
|
|
33
33
|
import { useTimeoutLock } from './hooks/useFrame';
|
|
34
|
-
|
|
34
|
+
var tableHeadRowHeight = 44;
|
|
35
35
|
var SCROLLBAR_SIZE = 15;
|
|
36
36
|
var ZERO = 0;
|
|
37
37
|
|
|
38
38
|
function Table(props, ref) {
|
|
39
39
|
var _classnames3;
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var tableKey = props.key,
|
|
42
|
+
columns = props.columns,
|
|
42
43
|
data = props.data,
|
|
43
44
|
onRowSelected = props.onRowSelected,
|
|
44
45
|
loadMore = props.loadMore,
|
|
@@ -61,12 +62,12 @@ function Table(props, ref) {
|
|
|
61
62
|
rowKey = props.rowKey,
|
|
62
63
|
height = props.height;
|
|
63
64
|
|
|
64
|
-
var _useState = useState(
|
|
65
|
+
var _useState = useState(undefined),
|
|
65
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
67
|
tableClientWidth = _useState2[0],
|
|
67
68
|
setTableClientWidth = _useState2[1];
|
|
68
69
|
|
|
69
|
-
var _useState3 = useState(
|
|
70
|
+
var _useState3 = useState(undefined),
|
|
70
71
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
72
|
tableClientHeight = _useState4[0],
|
|
72
73
|
setTableClientHeight = _useState4[1];
|
|
@@ -75,7 +76,6 @@ function Table(props, ref) {
|
|
|
75
76
|
var tableRef = useRef(null);
|
|
76
77
|
var tableHeadRef = useRef(null);
|
|
77
78
|
var tableBodyRef = useRef(null);
|
|
78
|
-
var columnsRef = useRef([]);
|
|
79
79
|
var columnsWidthMapRef = useRef();
|
|
80
80
|
var columnsTotalWidthRef = useRef(ZERO);
|
|
81
81
|
|
|
@@ -90,12 +90,7 @@ function Table(props, ref) {
|
|
|
90
90
|
var _useTimeoutLock = useTimeoutLock(),
|
|
91
91
|
_useTimeoutLock2 = _slicedToArray(_useTimeoutLock, 2),
|
|
92
92
|
setScrollTarget = _useTimeoutLock2[0],
|
|
93
|
-
getScrollTarget = _useTimeoutLock2[1]; //
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (columns && columnsRef.current.length === ZERO) {
|
|
97
|
-
columnsRef.current = columns;
|
|
98
|
-
} // 初始化进入时 渲染表格容器宽度
|
|
93
|
+
getScrollTarget = _useTimeoutLock2[1]; // 初始化进入时 渲染表格容器宽度
|
|
99
94
|
|
|
100
95
|
|
|
101
96
|
useEffect(function () {
|
|
@@ -105,18 +100,22 @@ function Table(props, ref) {
|
|
|
105
100
|
}, []); // 转换外部传入的columns
|
|
106
101
|
|
|
107
102
|
var newColumns = useMemo(function () {
|
|
108
|
-
|
|
103
|
+
if (!tableClientWidth) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var _getColumnsWidthMap = getColumnsWidthMap(columns, tableClientWidth, columnsWidthMapRef.current),
|
|
109
108
|
columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
|
|
110
109
|
totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
|
|
111
110
|
|
|
112
111
|
columnsWidthMapRef.current = columnsWidthMap;
|
|
113
112
|
columnsTotalWidthRef.current = totalColumnWidth;
|
|
114
|
-
return
|
|
113
|
+
return columns.map(function (column, index) {
|
|
115
114
|
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
116
115
|
|
|
117
116
|
var key = index.toString(); // 不设置dataIndex同时进行排序 则报错
|
|
118
117
|
|
|
119
|
-
if (
|
|
118
|
+
if (column.dataIndex === undefined && sortable) {
|
|
120
119
|
message.error('不支持未设置dataIndex时进行排序设置');
|
|
121
120
|
}
|
|
122
121
|
|
|
@@ -134,7 +133,7 @@ function Table(props, ref) {
|
|
|
134
133
|
}
|
|
135
134
|
});
|
|
136
135
|
});
|
|
137
|
-
}, [sortable, tableClientWidth]); // 将rowId转为React Table支持的值
|
|
136
|
+
}, [columns, sortable, tableClientWidth]); // 将rowId转为React Table支持的值
|
|
138
137
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
138
|
|
|
140
139
|
var transformRowId = function transformRowId(row, relativeIndex, parent) {
|
|
@@ -149,10 +148,23 @@ function Table(props, ref) {
|
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
return relativeIndex.toString();
|
|
152
|
-
};
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* 计算初始传递给 React Table的排序字段
|
|
154
|
+
* 1. 不存在 sortable 或者存在loadMore(内部滚动时),不进行排序操作防止内部滚动时冲突;
|
|
155
|
+
* 2. 存在默认排序以及默认排序规则,以默认为准
|
|
156
|
+
* 3. 如果给了排序但没有默认,则按第一行排序
|
|
157
|
+
* @returns
|
|
158
|
+
*/
|
|
153
159
|
|
|
154
160
|
|
|
155
161
|
var getTableInitSort = function getTableInitSort() {
|
|
162
|
+
var EMPTY_SIZE = 0;
|
|
163
|
+
|
|
164
|
+
if (!sortable || loadMore || newColumns.length === EMPTY_SIZE) {
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
|
|
156
168
|
if (defaultSort && defaultSort.id) {
|
|
157
169
|
return [defaultSort];
|
|
158
170
|
}
|
|
@@ -204,7 +216,7 @@ function Table(props, ref) {
|
|
|
204
216
|
var tableHeadNode = /*#__PURE__*/React.createElement(TableHead, {
|
|
205
217
|
canResizeColumn: resizeColumn,
|
|
206
218
|
headerGroups: headerGroups,
|
|
207
|
-
tableContentWidth
|
|
219
|
+
// tableContentWidth={columnsTotalWidthRef.current}
|
|
208
220
|
defaultSort: defaultSort,
|
|
209
221
|
sortable: sortable,
|
|
210
222
|
columns: newColumns,
|
|
@@ -263,10 +275,15 @@ function Table(props, ref) {
|
|
|
263
275
|
}, []); // 内部滚动时 纵向的滚动
|
|
264
276
|
|
|
265
277
|
var onBodyVerticalScroll = useCallback(function (target) {
|
|
278
|
+
if (!tableClientHeight) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
266
282
|
var scrollHeight = target.scrollHeight,
|
|
267
283
|
clientHeight = target.clientHeight,
|
|
268
284
|
scrollTop = target.scrollTop;
|
|
269
|
-
var currentPosToBottomGap = scrollHeight - clientHeight - scrollTop;
|
|
285
|
+
var currentPosToBottomGap = scrollHeight - clientHeight - scrollTop; // 当前滚动条到底部的距离
|
|
286
|
+
|
|
270
287
|
var scrollThresholdValue = getValidScrollThreshold(scrollThreshold, tableClientHeight);
|
|
271
288
|
|
|
272
289
|
if (currentPosToBottomGap < scrollThresholdValue && hasNextPage && !loadMoreLoading) {
|
|
@@ -315,6 +332,10 @@ function Table(props, ref) {
|
|
|
315
332
|
}, [hasNextPage]); // 渲染有设置高度的表格
|
|
316
333
|
|
|
317
334
|
var renderTableWithHeight = function renderTableWithHeight() {
|
|
335
|
+
if (!tableClientWidth || !tableClientHeight) {
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
|
|
318
339
|
var renderNoHeightTableBody = function renderNoHeightTableBody() {
|
|
319
340
|
if (loading && !rows.length) {
|
|
320
341
|
return /*#__PURE__*/React.createElement(Loading, null);
|
|
@@ -328,7 +349,7 @@ function Table(props, ref) {
|
|
|
328
349
|
style: {
|
|
329
350
|
overflow: 'overlay',
|
|
330
351
|
overflowX: tableClientWidth + SCROLLBAR_SIZE > columnsTotalWidthRef.current ? 'hidden' : 'unset',
|
|
331
|
-
height: tableClientHeight -
|
|
352
|
+
height: tableClientHeight - tableHeadRowHeight
|
|
332
353
|
},
|
|
333
354
|
ref: tableBodyRef,
|
|
334
355
|
onScroll: onBodyScroll
|
|
@@ -336,29 +357,30 @@ function Table(props, ref) {
|
|
|
336
357
|
};
|
|
337
358
|
|
|
338
359
|
return /*#__PURE__*/React.createElement("div", {
|
|
339
|
-
className: classnames("".concat(prefixCls, "-inner-wrap"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), height))
|
|
360
|
+
className: classnames("".concat(prefixCls, "-inner-wrap"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), !!height))
|
|
340
361
|
}, /*#__PURE__*/React.createElement("div", {
|
|
341
362
|
ref: tableHeadRef,
|
|
342
363
|
className: "".concat(prefixCls, "-tableHeadScrollWrap")
|
|
343
364
|
}, tableHeadNode), /*#__PURE__*/React.createElement("div", Object.assign({}, getTableBodyProps(), {
|
|
344
|
-
className: classnames("".concat(prefixCls, "-tbody"), _defineProperty({}, "".concat(prefixCls, "-tbody-innerScroll"), height))
|
|
365
|
+
className: classnames("".concat(prefixCls, "-tbody"), _defineProperty({}, "".concat(prefixCls, "-tbody-innerScroll"), !!height))
|
|
345
366
|
}), renderNoHeightTableBody()));
|
|
346
367
|
};
|
|
347
368
|
|
|
348
|
-
return /*#__PURE__*/React.createElement(
|
|
369
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
370
|
+
key: tableKey,
|
|
371
|
+
className: prefixCls,
|
|
372
|
+
ref: tableRef,
|
|
373
|
+
style: {
|
|
374
|
+
height: !height ? 'unset' : height
|
|
375
|
+
}
|
|
376
|
+
}, /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
349
377
|
onResize: function onResize(_ref2) {
|
|
350
378
|
var clientWidth = _ref2.width,
|
|
351
379
|
clientHeight = _ref2.height;
|
|
352
380
|
setTableClientWidth(clientWidth);
|
|
353
381
|
setTableClientHeight(clientHeight);
|
|
354
382
|
}
|
|
355
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
356
|
-
className: prefixCls,
|
|
357
|
-
ref: tableRef,
|
|
358
|
-
style: {
|
|
359
|
-
height: !height ? 'unset' : height
|
|
360
|
-
}
|
|
361
|
-
}, /*#__PURE__*/React.createElement("div", Object.assign({}, getTableProps(), {
|
|
383
|
+
}, !tableClientWidth ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null)) : /*#__PURE__*/React.createElement("div", Object.assign({}, getTableProps(), {
|
|
362
384
|
className: classnames("".concat(prefixCls, "-table-wrap"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefixCls, "-init-loading"), data.length === ZERO && loading), _defineProperty(_classnames3, "".concat(prefixCls, "-empty"), data.length === ZERO && loading), _classnames3))
|
|
363
385
|
}), height ? renderTableWithHeight() : renderTableWithoutHeight())));
|
|
364
386
|
}
|
|
@@ -4,7 +4,6 @@ import { ISort, TSortOrder } from '../../interface';
|
|
|
4
4
|
import { IWidthDetail } from '../../utils';
|
|
5
5
|
interface ITableWithoutHeightProps<T extends object = {}> {
|
|
6
6
|
headerGroups: HeaderGroup<T>[];
|
|
7
|
-
tableContentWidth: number;
|
|
8
7
|
canResizeColumn?: boolean;
|
|
9
8
|
defaultSort?: ISort<T>;
|
|
10
9
|
sortable?: boolean;
|
|
@@ -36,7 +36,6 @@ var ARRAY_FIRST_INDEX = 0;
|
|
|
36
36
|
|
|
37
37
|
function TableHead(props) {
|
|
38
38
|
var headerGroups = props.headerGroups,
|
|
39
|
-
tableContentWidth = props.tableContentWidth,
|
|
40
39
|
canResizeColumn = props.canResizeColumn,
|
|
41
40
|
defaultSort = props.defaultSort,
|
|
42
41
|
_props$sortable = props.sortable,
|
|
@@ -228,7 +227,7 @@ function TableHead(props) {
|
|
|
228
227
|
return /*#__PURE__*/React.createElement("div", {
|
|
229
228
|
className: "".concat(prefixCls, "-thead"),
|
|
230
229
|
style: {
|
|
231
|
-
width:
|
|
230
|
+
width: columnsTotalWidthRef.current
|
|
232
231
|
}
|
|
233
232
|
}, headerGroups.map(function (headerGroup) {
|
|
234
233
|
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(),
|
package/es/Table/interface.d.ts
CHANGED
|
@@ -11,12 +11,14 @@ export interface IColumn<RecordType> {
|
|
|
11
11
|
render?: (value: any, row: RecordType, index: number) => React.ReactNode;
|
|
12
12
|
width?: number | string;
|
|
13
13
|
minWidth?: number;
|
|
14
|
+
widthFlex?: boolean;
|
|
14
15
|
sorter?: boolean | 'string' | 'number' | 'basic' | 'datetime' | 'alphanumeric';
|
|
15
16
|
sortOrder?: TSortOrder;
|
|
16
17
|
sortDirections?: Array<'ascend' | 'descend'>;
|
|
17
18
|
selected?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export interface ITableProps<RecordType> {
|
|
21
|
+
key?: React.Key;
|
|
20
22
|
columns: IColumn<RecordType>[];
|
|
21
23
|
data: RecordType[];
|
|
22
24
|
onRowSelected?: (row: RecordType) => void;
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&-tableHeadScrollWrap {
|
|
33
|
+
display: flex;
|
|
33
34
|
width: 100%;
|
|
34
35
|
overflow-x: hidden;
|
|
35
36
|
}
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
&-cell {
|
|
38
39
|
flex-grow: 1;
|
|
39
40
|
height: unset;
|
|
40
|
-
color:
|
|
41
|
+
color: inherit;
|
|
41
42
|
text-align: left;
|
|
42
43
|
word-break: break-all;
|
|
43
44
|
border-bottom: 1px solid @NL95;
|
|
@@ -125,6 +126,10 @@
|
|
|
125
126
|
display: flex;
|
|
126
127
|
align-items: center;
|
|
127
128
|
padding-left: 24px;
|
|
129
|
+
|
|
130
|
+
.ald-table-cell-container {
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
&:hover {
|
package/es/Table/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ZERO = 0;
|
|
2
2
|
var NOT_SET = -1;
|
|
3
|
-
var COLUMN_MIN_WIDTH =
|
|
3
|
+
var COLUMN_MIN_WIDTH = 80;
|
|
4
4
|
var HUNDRED = 100; // TODO: 添加单侧
|
|
5
5
|
|
|
6
6
|
export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
@@ -9,12 +9,19 @@ export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
|
9
9
|
var widthMap = new Map();
|
|
10
10
|
var totalColumnWidth = ZERO;
|
|
11
11
|
columns.forEach(function (item, index) {
|
|
12
|
-
var _lastWidthMap$get;
|
|
13
|
-
|
|
14
12
|
var key = index.toString();
|
|
15
|
-
var
|
|
13
|
+
var widthFlex = item.widthFlex;
|
|
14
|
+
var width = getWidthByColumnsWidth(clientWidth, item.width, widthFlex); // 首先判断是否是否是容器宽度的变化
|
|
15
|
+
|
|
16
|
+
var isSpecific;
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
if (widthFlex) {
|
|
19
|
+
isSpecific = false;
|
|
20
|
+
} else {
|
|
21
|
+
var _lastWidthMap$get;
|
|
22
|
+
|
|
23
|
+
isSpecific = lastWidthMap ? (_lastWidthMap$get = lastWidthMap.get(key)) === null || _lastWidthMap$get === void 0 ? void 0 : _lastWidthMap$get.isSpecific : isSpecificWidth(item.width);
|
|
24
|
+
}
|
|
18
25
|
|
|
19
26
|
if (lastWidthMap && isSpecific) {
|
|
20
27
|
var _lastWidthMap$get2;
|
|
@@ -40,7 +47,7 @@ export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
|
40
47
|
|
|
41
48
|
return widthMap.set(item, {
|
|
42
49
|
isSpecific: (_widthMap$get = widthMap.get(item)) === null || _widthMap$get === void 0 ? void 0 : _widthMap$get.isSpecific,
|
|
43
|
-
width:
|
|
50
|
+
width: COLUMN_MIN_WIDTH
|
|
44
51
|
});
|
|
45
52
|
});
|
|
46
53
|
} // 设定宽度小于容器宽度时
|
|
@@ -72,8 +79,8 @@ export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
function getWidthByColumnsWidth(clientWidth, width) {
|
|
76
|
-
if (width === undefined) {
|
|
82
|
+
function getWidthByColumnsWidth(clientWidth, width, widthFlex) {
|
|
83
|
+
if (width === undefined || widthFlex) {
|
|
77
84
|
return NOT_SET;
|
|
78
85
|
}
|
|
79
86
|
|
|
@@ -123,7 +130,7 @@ export function getValidScrollThreshold(height, clientHeight) {
|
|
|
123
130
|
return scrollThreshold;
|
|
124
131
|
}
|
|
125
132
|
export function getPercentageValue(percentage, containerNum) {
|
|
126
|
-
var percent =
|
|
133
|
+
var percent = Number(percentage.replace('%', '')) / HUNDRED;
|
|
127
134
|
return getValidWidthByNumber(containerNum * percent);
|
|
128
135
|
}
|
|
129
136
|
export function getPxValue(px) {
|
package/es/Tabs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@aloudata/icons-react/styles/index.less";
|
|
2
|
-
import
|
|
2
|
+
import _MoreFill from "@aloudata/icons-react/es/icons/MoreFill";
|
|
3
3
|
import "antd/es/tabs/style";
|
|
4
4
|
import _Tabs from "antd/es/tabs";
|
|
5
5
|
var _excluded = ["size", "className", "popupClassName", "adaptHeight"];
|
|
@@ -34,7 +34,7 @@ export default function Tabs(props) {
|
|
|
34
34
|
return /*#__PURE__*/React.createElement(_Tabs, Object.assign({
|
|
35
35
|
moreIcon: /*#__PURE__*/React.createElement("div", {
|
|
36
36
|
className: "ald-tabs-moreIcon"
|
|
37
|
-
}, /*#__PURE__*/React.createElement(
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_MoreFill, {
|
|
38
38
|
color: "currentColor"
|
|
39
39
|
})),
|
|
40
40
|
tabBarGutter: 24,
|
package/es/Tabs/style/index.less
CHANGED
package/es/Tooltip/index.d.ts
CHANGED
|
@@ -46,12 +46,12 @@ export interface ITooltipProps {
|
|
|
46
46
|
* @description 用于手动控制浮层显隐
|
|
47
47
|
* @default -
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
open?: boolean;
|
|
50
50
|
/**
|
|
51
51
|
* @description 显示隐藏的回调
|
|
52
52
|
* @default -
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
onOpenChange?: (open: boolean) => void;
|
|
55
55
|
/**
|
|
56
56
|
* @description 卡片类名
|
|
57
57
|
* @default -
|