@aloudata/aloudata-design 0.3.3 → 0.3.4
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/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/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/Input/components/Group/index.d.ts +1 -0
- package/es/Input/components/Input/index.d.ts +1 -1
- package/es/Input/components/Input/index.js +0 -1
- 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 +78 -0
- package/es/InputNumber/index.d.ts +1 -0
- package/es/Menu/Divider.d.ts +1 -0
- package/es/Modal/style/index.less +3 -0
- package/es/Navigator/components/Header/index.d.ts +1 -0
- package/es/Navigator/components/Menu/index.d.ts +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 +72 -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/style/index.less +1 -0
- package/es/Steps/components/ProcessIcon/index.d.ts +1 -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 +17 -0
- package/es/Table/components/Loading/index.d.ts +3 -0
- package/es/Table/components/Loading/index.js +19 -0
- package/es/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/es/Table/components/TableBodyRowList/index.js +89 -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 +33 -30
- package/es/Table/utils.d.ts +15 -0
- package/es/Table/utils.js +131 -0
- package/es/_utils/hooks/useId.d.ts +4 -0
- package/es/_utils/hooks/useId.js +23 -0
- package/es/index.d.ts +1 -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/lib/Breadcrumb/index.d.ts +1 -0
- 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/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/Input/components/Group/index.d.ts +1 -0
- package/lib/Input/components/Input/index.d.ts +1 -1
- package/lib/Input/components/Input/index.js +0 -1
- 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 +78 -0
- package/lib/InputNumber/index.d.ts +1 -0
- package/lib/Menu/Divider.d.ts +1 -0
- package/lib/Modal/style/index.less +3 -0
- package/lib/Navigator/components/Header/index.d.ts +1 -0
- package/lib/Navigator/components/Menu/index.d.ts +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 +93 -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/style/index.less +1 -0
- package/lib/Steps/components/ProcessIcon/index.d.ts +1 -0
- package/lib/Table/Table.d.ts +2 -1
- package/lib/Table/Table.js +228 -332
- package/lib/Table/components/Empty/index.d.ts +3 -0
- package/lib/Table/components/Empty/index.js +30 -0
- package/lib/Table/components/Loading/index.d.ts +3 -0
- package/lib/Table/components/Loading/index.js +33 -0
- package/lib/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/lib/Table/components/TableBodyRowList/index.js +108 -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 +33 -30
- package/lib/Table/utils.d.ts +15 -0
- package/lib/Table/utils.js +147 -0
- package/lib/_utils/hooks/useId.d.ts +4 -0
- package/lib/_utils/hooks/useId.js +36 -0
- package/lib/index.d.ts +1 -1
- 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/package.json +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
@import '../../Empty/style/index.less';
|
|
3
|
+
@import '../../message/style/index.less';
|
|
4
|
+
|
|
3
5
|
@ald-iconfont-css-prefix: anticon;
|
|
4
|
-
@table-row-height: 48px;
|
|
6
|
+
@table-head-row-height: 48px;
|
|
7
|
+
@table-body-row-height: 68px;
|
|
5
8
|
|
|
6
9
|
.ald-table {
|
|
7
10
|
display: flex;
|
|
8
11
|
flex-direction: column;
|
|
9
12
|
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
13
|
overflow: hidden;
|
|
14
|
+
user-select: none;
|
|
12
15
|
|
|
13
16
|
&-page-loading {
|
|
14
17
|
opacity: 0;
|
|
@@ -21,6 +24,16 @@
|
|
|
21
24
|
overflow: hidden;
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
&-inner-wrap {
|
|
28
|
+
width: 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 {
|
|
@@ -103,7 +119,7 @@
|
|
|
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
125
|
padding: 24px;
|
|
@@ -124,10 +140,18 @@
|
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
142
|
|
|
143
|
+
&-tbody&-tbody-innerScroll {
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&-row-list-wrap {
|
|
148
|
+
overflow: unset;
|
|
149
|
+
}
|
|
150
|
+
|
|
127
151
|
&-loading {
|
|
128
|
-
height:
|
|
152
|
+
height: @table-body-row-height;
|
|
129
153
|
color: @NL80;
|
|
130
|
-
line-height: @table-row-height;
|
|
154
|
+
line-height: @table-body-row-height;
|
|
131
155
|
text-align: center;
|
|
132
156
|
|
|
133
157
|
&-icon {
|
|
@@ -145,6 +169,7 @@
|
|
|
145
169
|
align-items: center;
|
|
146
170
|
justify-content: center;
|
|
147
171
|
padding-top: 84px;
|
|
172
|
+
padding-bottom: 84px;
|
|
148
173
|
}
|
|
149
174
|
}
|
|
150
175
|
|
|
@@ -170,33 +195,11 @@
|
|
|
170
195
|
}
|
|
171
196
|
}
|
|
172
197
|
|
|
173
|
-
/* stylelint-disable-next-line selector-class-pattern */
|
|
174
|
-
&-list&-innerScroll {
|
|
175
|
-
height: 100%;
|
|
176
|
-
overflow: overlay !important;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
198
|
// 当出现多行的时候 会顶出一个滚动条 通过复写三方库的样式覆盖
|
|
180
199
|
&-list&-canNotInnerScroll {
|
|
181
200
|
overflow: hidden !important;
|
|
182
201
|
}
|
|
183
202
|
|
|
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
203
|
&-sortIcon {
|
|
201
204
|
margin-top: -2px;
|
|
202
205
|
margin-left: 4px;
|
|
@@ -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,131 @@
|
|
|
1
|
+
var ZERO = 0;
|
|
2
|
+
var NOT_SET = -1;
|
|
3
|
+
var COLUMN_MIN_WIDTH = 72;
|
|
4
|
+
var HUNDRED = 100; // TODO: 添加单侧
|
|
5
|
+
|
|
6
|
+
export function getColumnsWidthMap(columns, clientWidth, lastWidthMap) {
|
|
7
|
+
var settedTotalWidth = ZERO;
|
|
8
|
+
var unsetWidthIndex = [];
|
|
9
|
+
var widthMap = new Map();
|
|
10
|
+
var totalColumnWidth = ZERO;
|
|
11
|
+
columns.forEach(function (item, index) {
|
|
12
|
+
var _lastWidthMap$get;
|
|
13
|
+
|
|
14
|
+
var key = index.toString();
|
|
15
|
+
var width = getWidthByColumnsWidth(clientWidth, item.width); // 首先判断是否是否是容器宽度的变化
|
|
16
|
+
|
|
17
|
+
var isSpecific = lastWidthMap ? (_lastWidthMap$get = lastWidthMap.get(key)) === null || _lastWidthMap$get === void 0 ? void 0 : _lastWidthMap$get.isSpecific : isSpecificWidth(item.width);
|
|
18
|
+
|
|
19
|
+
if (lastWidthMap && isSpecific) {
|
|
20
|
+
var _lastWidthMap$get2;
|
|
21
|
+
|
|
22
|
+
width = (_lastWidthMap$get2 = lastWidthMap.get(key)) === null || _lastWidthMap$get2 === void 0 ? void 0 : _lastWidthMap$get2.width;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (width === NOT_SET) {
|
|
26
|
+
unsetWidthIndex.push(key);
|
|
27
|
+
} else {
|
|
28
|
+
settedTotalWidth += width;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
widthMap.set(key, {
|
|
32
|
+
width: width,
|
|
33
|
+
isSpecific: isSpecific
|
|
34
|
+
});
|
|
35
|
+
}); // 设定宽度大于容器宽度时
|
|
36
|
+
|
|
37
|
+
if (settedTotalWidth < clientWidth) {
|
|
38
|
+
unsetWidthIndex.map(function (item) {
|
|
39
|
+
var _widthMap$get;
|
|
40
|
+
|
|
41
|
+
return widthMap.set(item, {
|
|
42
|
+
isSpecific: (_widthMap$get = widthMap.get(item)) === null || _widthMap$get === void 0 ? void 0 : _widthMap$get.isSpecific,
|
|
43
|
+
width: 72
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
} // 设定宽度小于容器宽度时
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if (unsetWidthIndex.length > ZERO) {
|
|
50
|
+
var leftWidth = clientWidth - settedTotalWidth;
|
|
51
|
+
var average = getValidWidthByNumber(leftWidth / unsetWidthIndex.length);
|
|
52
|
+
unsetWidthIndex.map(function (item) {
|
|
53
|
+
var _widthMap$get2;
|
|
54
|
+
|
|
55
|
+
return widthMap.set(item, {
|
|
56
|
+
isSpecific: (_widthMap$get2 = widthMap.get(item)) === null || _widthMap$get2 === void 0 ? void 0 : _widthMap$get2.isSpecific,
|
|
57
|
+
width: average
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
columns.forEach(function (item, index) {
|
|
63
|
+
var _widthMap$get3;
|
|
64
|
+
|
|
65
|
+
var key = index.toString();
|
|
66
|
+
var width = (_widthMap$get3 = widthMap.get(key)) === null || _widthMap$get3 === void 0 ? void 0 : _widthMap$get3.width;
|
|
67
|
+
totalColumnWidth += width;
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
columnsWidthMap: widthMap,
|
|
71
|
+
totalColumnWidth: totalColumnWidth
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getWidthByColumnsWidth(clientWidth, width) {
|
|
76
|
+
if (width === undefined) {
|
|
77
|
+
return NOT_SET;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (typeof width === 'number') {
|
|
81
|
+
return getValidWidthByNumber(width);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (isPercentageWidth(width)) {
|
|
85
|
+
return getPercentageValue(width, clientWidth);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (isSpecificPxWidth(width)) {
|
|
89
|
+
var specificNum = getPxValue(width);
|
|
90
|
+
return getValidWidthByNumber(specificNum);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return NOT_SET;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function isPercentageWidth(width) {
|
|
97
|
+
return /[0-9]{1,}%$/.test(width);
|
|
98
|
+
}
|
|
99
|
+
export function isSpecificPxWidth(width) {
|
|
100
|
+
return /[0-9]{1,}(px)$/.test(width);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function isSpecificWidth(width) {
|
|
104
|
+
return typeof width === 'number' || !!(width && isSpecificPxWidth(width));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function getValidWidthByNumber(width) {
|
|
108
|
+
return width < COLUMN_MIN_WIDTH ? COLUMN_MIN_WIDTH : width;
|
|
109
|
+
}
|
|
110
|
+
export function getValidScrollThreshold(height, clientHeight) {
|
|
111
|
+
var scrollThreshold = ZERO;
|
|
112
|
+
|
|
113
|
+
if (typeof height === 'string') {
|
|
114
|
+
if (isPercentageWidth(height)) {
|
|
115
|
+
scrollThreshold = getPercentageValue(height, clientHeight);
|
|
116
|
+
} else {
|
|
117
|
+
scrollThreshold = getPxValue(height);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
scrollThreshold = height;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return scrollThreshold;
|
|
124
|
+
}
|
|
125
|
+
export function getPercentageValue(percentage, containerNum) {
|
|
126
|
+
var percent = Math.floor(Number(percentage.replace('%', '')) / HUNDRED);
|
|
127
|
+
return getValidWidthByNumber(containerNum * percent);
|
|
128
|
+
}
|
|
129
|
+
export function getPxValue(px) {
|
|
130
|
+
return Number(px.replace('px', ''));
|
|
131
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
|
3
|
+
var uuid = 0;
|
|
4
|
+
/** Is client side and not jsdom */
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6
|
+
|
|
7
|
+
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
|
8
|
+
/** Get unique id for accessibility usage */
|
|
9
|
+
|
|
10
|
+
export function getUUID() {
|
|
11
|
+
var retId; // Test never reach
|
|
12
|
+
|
|
13
|
+
/* istanbul ignore if */
|
|
14
|
+
|
|
15
|
+
if (isBrowserClient) {
|
|
16
|
+
retId = uuid;
|
|
17
|
+
uuid += 1;
|
|
18
|
+
} else {
|
|
19
|
+
retId = 'TEST_OR_SSR';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return retId;
|
|
23
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export type { DividerProps } from './Divider';
|
|
|
57
57
|
export { default as Drawer } from './Drawer';
|
|
58
58
|
export type { DrawerProps } from './Drawer';
|
|
59
59
|
export { default as Radio } from './Radio';
|
|
60
|
-
export type { RadioProps,
|
|
60
|
+
export type { RadioProps, RadioGroupProps } from './Radio';
|
|
61
61
|
export { default as Checkbox } from './Checkbox';
|
|
62
62
|
export type { CheckboxProps, CheckboxOptionType } from './Checkbox';
|
|
63
63
|
export { default as Modal } from './Modal';
|
|
@@ -4,10 +4,13 @@ import type { PickerLocale as DatePickerLocale } from 'antd/es/date-picker/gener
|
|
|
4
4
|
import type { TransferLocale as TransferLocaleForEmpty } from 'antd/es/empty';
|
|
5
5
|
import type { ModalLocale } from 'antd/es/modal/locale';
|
|
6
6
|
import type { PaginationLocale } from 'antd/es/pagination/Pagination';
|
|
7
|
-
import type { PopconfirmLocale } from 'antd/es/popconfirm';
|
|
8
7
|
import type { TableLocale } from 'antd/es/table/interface';
|
|
9
8
|
import type { TransferLocale } from 'antd/es/transfer';
|
|
10
9
|
import type { UploadLocale } from 'antd/es/upload/interface';
|
|
10
|
+
interface PopconfirmLocale {
|
|
11
|
+
okText: string;
|
|
12
|
+
cancelText: string;
|
|
13
|
+
}
|
|
11
14
|
export declare const ANT_MARK = "internalMark";
|
|
12
15
|
export interface Locale {
|
|
13
16
|
locale: string;
|
|
@@ -59,3 +62,4 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
|
|
59
62
|
};
|
|
60
63
|
render(): JSX.Element;
|
|
61
64
|
}
|
|
65
|
+
export {};
|
package/es/style/index.d.ts
CHANGED
package/es/style/index.js
CHANGED
package/es/style/index.less
CHANGED
package/lib/Checkbox/index.d.ts
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _Empty = _interopRequireDefault(require("../Empty"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
var defaultRenderEmpty = function defaultRenderEmpty(componentName) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(_.ConfigConsumer, null, function (_ref) {
|
|
24
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
25
|
+
var prefix = getPrefixCls('empty');
|
|
26
|
+
|
|
27
|
+
switch (componentName) {
|
|
28
|
+
case 'Table':
|
|
29
|
+
case 'List':
|
|
30
|
+
return /*#__PURE__*/React.createElement(_Empty.default, {
|
|
31
|
+
image: _Empty.default.PRESENTED_IMAGE_SIMPLE
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
case 'Select':
|
|
35
|
+
case 'TreeSelect':
|
|
36
|
+
case 'Cascader':
|
|
37
|
+
case 'Transfer':
|
|
38
|
+
case 'Mentions':
|
|
39
|
+
return /*#__PURE__*/React.createElement(_Empty.default, {
|
|
40
|
+
image: _Empty.default.PRESENTED_IMAGE_SIMPLE,
|
|
41
|
+
title: "\u65E0\u6570\u636E",
|
|
42
|
+
className: "".concat(prefix, "-small")
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/* istanbul ignore next */
|
|
46
|
+
|
|
47
|
+
default:
|
|
48
|
+
// Should never hit if we take all the component into consider.
|
|
49
|
+
return /*#__PURE__*/React.createElement(_Empty.default, null);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var _default = defaultRenderEmpty;
|
|
55
|
+
exports.default = _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
3
|
+
declare const SizeContext: React.Context<"small" | "large" | "middle" | undefined>;
|
|
4
|
+
export interface ISizeContextProps {
|
|
5
|
+
size?: SizeType;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const SizeContextProvider: React.FC<ISizeContextProps>;
|
|
9
|
+
export default SizeContext;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.SizeContextProvider = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
var SizeContext = /*#__PURE__*/React.createContext(undefined);
|
|
17
|
+
|
|
18
|
+
var SizeContextProvider = function SizeContextProvider(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
size = _ref.size;
|
|
21
|
+
return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (originSize) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(SizeContext.Provider, {
|
|
23
|
+
value: size || originSize
|
|
24
|
+
}, children);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.SizeContextProvider = SizeContextProvider;
|
|
29
|
+
var _default = SizeContext;
|
|
30
|
+
exports.default = _default;
|
|
@@ -7,7 +7,7 @@ interface IShowCountProps {
|
|
|
7
7
|
maxLength?: number;
|
|
8
8
|
}) => string;
|
|
9
9
|
}
|
|
10
|
-
export declare type TSize = '
|
|
10
|
+
export declare type TSize = 'small' | 'middle' | 'large';
|
|
11
11
|
export type { InputRef };
|
|
12
12
|
declare type ChangeEventHandler = (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
13
|
export interface IInputProps extends Omit<InputProps, 'size' | 'id' | 'prefix' | 'allowClear' | 'disabled' | 'showCount' | 'maxLength' | 'value' | 'defaultValue' | 'onPressEnter' | 'onChange'> {
|
|
@@ -35,7 +35,6 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
35
35
|
rest = _objectWithoutProperties(props, _excluded);
|
|
36
36
|
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement(_Input.default, Object.assign({}, rest, {
|
|
38
|
-
// @ts-ignore
|
|
39
38
|
ref: ref,
|
|
40
39
|
bordered: true,
|
|
41
40
|
className: (0, _classnames.default)('ald-input', "ald-input-".concat(getSizeType(size)), className),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextAreaProps, TextAreaRef } from 'antd/lib/input/TextArea';
|
|
3
|
+
import { TSize } from '../Input';
|
|
3
4
|
export type { TextAreaRef };
|
|
4
|
-
export interface ITextAreaProps extends Omit<TextAreaProps, 'onPressEnter'> {
|
|
5
|
+
export interface ITextAreaProps extends Omit<TextAreaProps, 'onPressEnter' | 'size'> {
|
|
5
6
|
/**
|
|
6
7
|
* @description 可以点击清除图标删除内容
|
|
7
8
|
* @default false
|
|
@@ -53,6 +54,12 @@ export interface ITextAreaProps extends Omit<TextAreaProps, 'onPressEnter'> {
|
|
|
53
54
|
* @type boolean
|
|
54
55
|
*/
|
|
55
56
|
border?: boolean;
|
|
57
|
+
className?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @description 尺寸大学
|
|
60
|
+
* @default middle
|
|
61
|
+
*/
|
|
62
|
+
size?: TSize;
|
|
56
63
|
}
|
|
57
64
|
declare const _default: React.ForwardRefExoticComponent<ITextAreaProps & React.RefAttributes<TextAreaRef>>;
|
|
58
65
|
export default _default;
|
|
@@ -9,7 +9,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _TextArea = _interopRequireDefault(require("antd/lib/input/TextArea"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _Input = require("../Input");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["bordered", "size", "className"];
|
|
13
17
|
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
|
|
@@ -20,9 +24,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
20
24
|
var _default = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
21
25
|
var _props$bordered = props.bordered,
|
|
22
26
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
27
|
+
_props$size = props.size,
|
|
28
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
29
|
+
_props$className = props.className,
|
|
30
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
23
31
|
rest = _objectWithoutProperties(props, _excluded);
|
|
24
32
|
|
|
25
33
|
return /*#__PURE__*/_react.default.createElement(_TextArea.default, Object.assign({}, rest, {
|
|
34
|
+
className: (0, _classnames.default)('ald-input-textarea', "ald-input-textarea-".concat((0, _Input.getSizeType)(size)), className),
|
|
26
35
|
ref: ref,
|
|
27
36
|
bordered: bordered
|
|
28
37
|
}));
|
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
color: @NL0;
|
|
121
121
|
background-color: @input-bg-color;
|
|
122
122
|
border-radius: 0;
|
|
123
|
+
box-shadow: none;
|
|
123
124
|
caret-color: @B60;
|
|
124
125
|
|
|
125
126
|
&::placeholder {
|
|
@@ -162,6 +163,10 @@
|
|
|
162
163
|
border-color: @input-active-border-color;
|
|
163
164
|
box-shadow: @input-box-shadow-active;
|
|
164
165
|
}
|
|
166
|
+
|
|
167
|
+
.ant-input:hover {
|
|
168
|
+
box-shadow: none;
|
|
169
|
+
}
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
.ald-input {
|
|
@@ -330,3 +335,76 @@
|
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
337
|
}
|
|
338
|
+
|
|
339
|
+
.ald-textarea-large {
|
|
340
|
+
padding: 5px 11px;
|
|
341
|
+
font-size: @font-size-large;
|
|
342
|
+
line-height: @line-height-large;
|
|
343
|
+
border-radius: @border-radius-large;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.ald-textarea-middle {
|
|
347
|
+
padding: 5px 11px;
|
|
348
|
+
font-size: @font-size-middle;
|
|
349
|
+
line-height: @line-height-middle;
|
|
350
|
+
border-radius: @border-radius-middle;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.ald-textarea-small {
|
|
354
|
+
padding: 5px 7px;
|
|
355
|
+
font-size: @font-size-small;
|
|
356
|
+
line-height: @line-height-small;
|
|
357
|
+
border-radius: @border-radius-small;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
textarea.ald-input-textarea-large,
|
|
361
|
+
.ald-input-textarea-large .ant-input {
|
|
362
|
+
.ald-textarea-large();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
textarea.ald-input-textarea-middle,
|
|
366
|
+
.ald-input-textarea-middle .ant-input {
|
|
367
|
+
.ald-textarea-middle();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
textarea.ald-input-textarea-small,
|
|
371
|
+
.ald-input-textarea-small .ant-input {
|
|
372
|
+
.ald-textarea-small();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
textarea.ald-input-textarea,
|
|
376
|
+
.ald-input-textarea .ant-input {
|
|
377
|
+
color: @NL0;
|
|
378
|
+
background: @BG97;
|
|
379
|
+
caret-color: @B60;
|
|
380
|
+
|
|
381
|
+
&:hover,
|
|
382
|
+
&:active,
|
|
383
|
+
&:focus {
|
|
384
|
+
border-color: @B60;
|
|
385
|
+
box-shadow: none;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
::placeholder {
|
|
389
|
+
color: @NL80;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&.ant-input-disabled {
|
|
393
|
+
color: @NL60;
|
|
394
|
+
background: @BG95;
|
|
395
|
+
cursor: initial;
|
|
396
|
+
|
|
397
|
+
&:hover,
|
|
398
|
+
&:active,
|
|
399
|
+
&:focus {
|
|
400
|
+
border-color: @NL90;
|
|
401
|
+
box-shadow: none;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.ant-input-textarea-show-count::after {
|
|
407
|
+
color: @NL50;
|
|
408
|
+
font-size: 11px;
|
|
409
|
+
line-height: 16px;
|
|
410
|
+
}
|