@aloudata/aloudata-design 0.3.1 → 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.
Files changed (264) hide show
  1. package/README.md +15 -5
  2. package/es/Breadcrumb/index.d.ts +1 -0
  3. package/es/Button/index.js +3 -2
  4. package/es/Button/style/index.less +135 -126
  5. package/es/Button/style/variables.less +53 -53
  6. package/es/Card/index.d.ts +3 -0
  7. package/es/Card/index.js +3 -0
  8. package/es/Card/style/index.d.ts +2 -0
  9. package/es/Card/style/index.js +2 -0
  10. package/es/Card/style/index.less +1 -0
  11. package/es/Checkbox/index.d.ts +1 -0
  12. package/es/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
  13. package/es/ConfigProvider/defaultRenderEmpty.js +37 -0
  14. package/es/ConfigProvider/sizeContext.d.ts +9 -0
  15. package/es/ConfigProvider/sizeContext.js +12 -0
  16. package/es/Dropdown/Button.js +4 -3
  17. package/es/Empty/image/Authority.d.ts +1 -0
  18. package/es/Empty/image/Dataspace.d.ts +1 -0
  19. package/es/Empty/image/Search.d.ts +1 -0
  20. package/es/Empty/image/Simple.d.ts +1 -0
  21. package/es/Empty/image/Worksheet.d.ts +1 -0
  22. package/es/Empty/image/empty.d.ts +1 -0
  23. package/es/Icon/icons/CheckLine.d.ts +13 -0
  24. package/es/Icon/icons/CheckLine.js +73 -0
  25. package/es/Icon/icons.json +410 -0
  26. package/es/Input/components/Group/index.d.ts +3 -1
  27. package/es/Input/components/Group/index.js +6 -12
  28. package/es/Input/components/Input/index.d.ts +3 -2
  29. package/es/Input/components/Input/index.js +11 -23
  30. package/es/Input/components/Password/index.js +11 -16
  31. package/es/Input/components/TextArea/index.d.ts +8 -1
  32. package/es/Input/components/TextArea/index.js +8 -1
  33. package/es/Input/style/index.less +180 -102
  34. package/es/InputNumber/index.d.ts +1 -0
  35. package/es/InputNumber/style/index.less +69 -69
  36. package/es/Menu/Divider.d.ts +1 -0
  37. package/es/Modal/index.js +20 -16
  38. package/es/Modal/locale.d.ts +7 -0
  39. package/es/Modal/locale.js +20 -0
  40. package/es/Modal/style/index.less +48 -45
  41. package/es/Navigator/components/Header/index.d.ts +1 -0
  42. package/es/Navigator/components/Menu/index.d.ts +1 -0
  43. package/es/Navigator/components/MenuItem/index.d.ts +1 -1
  44. package/es/Navigator/index.d.ts +1 -1
  45. package/es/PageHeader/index.d.ts +3 -0
  46. package/es/PageHeader/index.js +3 -0
  47. package/es/PageHeader/style/index.d.ts +2 -0
  48. package/es/PageHeader/style/index.js +2 -0
  49. package/es/PageHeader/style/index.less +1 -0
  50. package/es/Popover/index.d.ts +1 -0
  51. package/es/Radio/components/Group/index.d.ts +6 -0
  52. package/es/Radio/components/Group/index.js +72 -0
  53. package/es/Radio/components/Radio/index.d.ts +3 -0
  54. package/es/Radio/components/Radio/index.js +95 -0
  55. package/es/Radio/index.d.ts +9 -2
  56. package/es/Radio/index.js +5 -3
  57. package/es/Radio/interface/radio.d.ts +24 -0
  58. package/es/Radio/interface/radio.js +1 -0
  59. package/es/Radio/interface/radioGroup.d.ts +42 -0
  60. package/es/Radio/interface/radioGroup.js +1 -0
  61. package/es/Radio/style/index.less +348 -0
  62. package/es/Select/index.js +1 -1
  63. package/es/Select/rc-select/OptionList.js +4 -4
  64. package/es/Select/rc-select/Selector/MultipleSelector.js +11 -1
  65. package/es/Select/rc-select/hooks/useOptions.d.ts +1 -1
  66. package/es/Select/style/index.less +70 -45
  67. package/es/Select/style/variables.less +45 -45
  68. package/es/Select/utils/iconUtil.d.ts +2 -2
  69. package/es/Select/utils/iconUtil.js +9 -5
  70. package/es/Steps/components/ProcessIcon/index.d.ts +6 -0
  71. package/es/Steps/components/ProcessIcon/index.js +8 -0
  72. package/es/Steps/components/Step/index.d.ts +20 -0
  73. package/es/Steps/components/Step/index.js +45 -0
  74. package/es/Steps/index.d.ts +36 -2
  75. package/es/Steps/index.js +30 -1
  76. package/es/Steps/matchMedia.mock.d.ts +1 -0
  77. package/es/Steps/matchMedia.mock.js +17 -0
  78. package/es/Steps/style/index.less +251 -0
  79. package/es/Switch/index.d.ts +46 -2
  80. package/es/Switch/index.js +71 -1
  81. package/es/Switch/style/index.less +129 -0
  82. package/es/Table/Table.d.ts +2 -1
  83. package/es/Table/Table.js +223 -330
  84. package/es/Table/components/Empty/index.d.ts +3 -0
  85. package/es/Table/components/Empty/index.js +17 -0
  86. package/es/Table/components/Loading/index.d.ts +3 -0
  87. package/es/Table/components/Loading/index.js +19 -0
  88. package/es/Table/components/TableBodyRowList/index.d.ts +13 -0
  89. package/es/Table/components/TableBodyRowList/index.js +89 -0
  90. package/es/Table/components/TableHead/index.d.ts +23 -0
  91. package/es/Table/components/TableHead/index.js +262 -0
  92. package/es/Table/constant.d.ts +1 -0
  93. package/es/Table/constant.js +1 -0
  94. package/es/Table/hooks/useFrame.d.ts +7 -0
  95. package/es/Table/hooks/useFrame.js +90 -0
  96. package/es/Table/hooks/useTableColumn.d.ts +28 -0
  97. package/es/Table/hooks/useTableColumn.js +53 -0
  98. package/es/Table/interface.d.ts +3 -2
  99. package/es/Table/style/index.less +33 -30
  100. package/es/Table/utils.d.ts +15 -0
  101. package/es/Table/utils.js +131 -0
  102. package/es/Tabs/index.js +7 -9
  103. package/es/Tabs/style/index.less +57 -25
  104. package/es/_utils/hooks/useId.d.ts +4 -0
  105. package/es/_utils/hooks/useId.js +23 -0
  106. package/es/index.d.ts +9 -5
  107. package/es/index.js +3 -1
  108. package/es/locale/default.d.ts +2 -0
  109. package/es/locale/default.js +2 -0
  110. package/es/locale/en_US.d.ts +3 -0
  111. package/es/locale/en_US.js +132 -0
  112. package/es/locale/zh_CN.d.ts +3 -2
  113. package/es/locale/zh_CN.js +131 -2
  114. package/es/locale-provider/LocaleReceiver.d.ts +4 -0
  115. package/es/locale-provider/LocaleReceiver.js +3 -0
  116. package/es/locale-provider/context.d.ts +7 -0
  117. package/es/locale-provider/context.js +3 -0
  118. package/es/locale-provider/default.d.ts +2 -0
  119. package/es/locale-provider/default.js +2 -0
  120. package/es/locale-provider/en_US.d.ts +2 -0
  121. package/es/locale-provider/en_US.js +2 -0
  122. package/es/locale-provider/index.d.ts +65 -0
  123. package/es/locale-provider/index.js +102 -0
  124. package/es/locale-provider/style/index.d.ts +1 -0
  125. package/es/locale-provider/style/index.js +1 -0
  126. package/es/locale-provider/style/index.less +2 -0
  127. package/es/locale-provider/zh_CN.d.ts +2 -0
  128. package/es/locale-provider/zh_CN.js +2 -0
  129. package/es/style/index.d.ts +0 -1
  130. package/es/style/index.js +0 -1
  131. package/es/style/index.less +2 -2
  132. package/es/style/themes/default/index.less +30 -30
  133. package/lib/Breadcrumb/index.d.ts +1 -0
  134. package/lib/Button/index.js +5 -3
  135. package/lib/Button/style/index.less +135 -126
  136. package/lib/Button/style/variables.less +53 -53
  137. package/lib/Card/index.d.ts +3 -0
  138. package/lib/Card/index.js +15 -0
  139. package/lib/Card/style/index.d.ts +2 -0
  140. package/lib/Card/style/index.js +5 -0
  141. package/lib/Card/style/index.less +1 -0
  142. package/lib/Checkbox/index.d.ts +1 -0
  143. package/lib/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
  144. package/lib/ConfigProvider/defaultRenderEmpty.js +55 -0
  145. package/lib/ConfigProvider/sizeContext.d.ts +9 -0
  146. package/lib/ConfigProvider/sizeContext.js +30 -0
  147. package/lib/Dropdown/Button.js +8 -6
  148. package/lib/Empty/image/Authority.d.ts +1 -0
  149. package/lib/Empty/image/Dataspace.d.ts +1 -0
  150. package/lib/Empty/image/Search.d.ts +1 -0
  151. package/lib/Empty/image/Simple.d.ts +1 -0
  152. package/lib/Empty/image/Worksheet.d.ts +1 -0
  153. package/lib/Empty/image/empty.d.ts +1 -0
  154. package/lib/Icon/icons/CheckLine.d.ts +13 -0
  155. package/lib/Icon/icons/CheckLine.js +90 -0
  156. package/lib/Icon/icons.json +410 -0
  157. package/lib/Input/components/Group/index.d.ts +3 -1
  158. package/lib/Input/components/Group/index.js +7 -12
  159. package/lib/Input/components/Input/index.d.ts +3 -2
  160. package/lib/Input/components/Input/index.js +13 -23
  161. package/lib/Input/components/Password/index.js +13 -17
  162. package/lib/Input/components/TextArea/index.d.ts +8 -1
  163. package/lib/Input/components/TextArea/index.js +10 -1
  164. package/lib/Input/style/index.less +180 -102
  165. package/lib/InputNumber/index.d.ts +1 -0
  166. package/lib/InputNumber/style/index.less +69 -69
  167. package/lib/Menu/Divider.d.ts +1 -0
  168. package/lib/Modal/index.js +25 -18
  169. package/lib/Modal/locale.d.ts +7 -0
  170. package/lib/Modal/locale.js +31 -0
  171. package/lib/Modal/style/index.less +48 -45
  172. package/lib/Navigator/components/Header/index.d.ts +1 -0
  173. package/lib/Navigator/components/Menu/index.d.ts +1 -0
  174. package/lib/Navigator/components/MenuItem/index.d.ts +1 -1
  175. package/lib/Navigator/index.d.ts +1 -1
  176. package/lib/PageHeader/index.d.ts +3 -0
  177. package/lib/PageHeader/index.js +15 -0
  178. package/lib/PageHeader/style/index.d.ts +2 -0
  179. package/lib/PageHeader/style/index.js +5 -0
  180. package/lib/PageHeader/style/index.less +1 -0
  181. package/lib/Popover/index.d.ts +1 -0
  182. package/lib/Radio/components/Group/index.d.ts +6 -0
  183. package/lib/Radio/components/Group/index.js +93 -0
  184. package/lib/Radio/components/Radio/index.d.ts +3 -0
  185. package/lib/Radio/components/Radio/index.js +115 -0
  186. package/lib/Radio/index.d.ts +9 -2
  187. package/lib/Radio/index.js +5 -3
  188. package/lib/Radio/interface/radio.d.ts +24 -0
  189. package/lib/Radio/interface/radio.js +5 -0
  190. package/lib/Radio/interface/radioGroup.d.ts +42 -0
  191. package/lib/Radio/interface/radioGroup.js +5 -0
  192. package/lib/Radio/style/index.less +348 -0
  193. package/lib/Select/index.js +1 -1
  194. package/lib/Select/rc-select/OptionList.js +8 -7
  195. package/lib/Select/rc-select/Selector/MultipleSelector.js +11 -1
  196. package/lib/Select/rc-select/hooks/useOptions.d.ts +1 -1
  197. package/lib/Select/style/index.less +70 -45
  198. package/lib/Select/style/variables.less +45 -45
  199. package/lib/Select/utils/iconUtil.d.ts +2 -2
  200. package/lib/Select/utils/iconUtil.js +13 -7
  201. package/lib/Steps/components/ProcessIcon/index.d.ts +6 -0
  202. package/lib/Steps/components/ProcessIcon/index.js +19 -0
  203. package/lib/Steps/components/Step/index.d.ts +20 -0
  204. package/lib/Steps/components/Step/index.js +61 -0
  205. package/lib/Steps/index.d.ts +36 -2
  206. package/lib/Steps/index.js +34 -1
  207. package/lib/Steps/matchMedia.mock.d.ts +1 -0
  208. package/lib/Steps/matchMedia.mock.js +17 -0
  209. package/lib/Steps/style/index.less +251 -0
  210. package/lib/Switch/index.d.ts +46 -2
  211. package/lib/Switch/index.js +78 -1
  212. package/lib/Switch/style/index.less +129 -0
  213. package/lib/Table/Table.d.ts +2 -1
  214. package/lib/Table/Table.js +228 -332
  215. package/lib/Table/components/Empty/index.d.ts +3 -0
  216. package/lib/Table/components/Empty/index.js +30 -0
  217. package/lib/Table/components/Loading/index.d.ts +3 -0
  218. package/lib/Table/components/Loading/index.js +33 -0
  219. package/lib/Table/components/TableBodyRowList/index.d.ts +13 -0
  220. package/lib/Table/components/TableBodyRowList/index.js +108 -0
  221. package/lib/Table/components/TableHead/index.d.ts +23 -0
  222. package/lib/Table/components/TableHead/index.js +286 -0
  223. package/lib/Table/constant.d.ts +1 -0
  224. package/lib/Table/constant.js +1 -0
  225. package/lib/Table/hooks/useFrame.d.ts +7 -0
  226. package/lib/Table/hooks/useFrame.js +98 -0
  227. package/lib/Table/hooks/useTableColumn.d.ts +28 -0
  228. package/lib/Table/hooks/useTableColumn.js +66 -0
  229. package/lib/Table/interface.d.ts +3 -2
  230. package/lib/Table/style/index.less +33 -30
  231. package/lib/Table/utils.d.ts +15 -0
  232. package/lib/Table/utils.js +147 -0
  233. package/lib/Tabs/index.js +9 -11
  234. package/lib/Tabs/style/index.less +57 -25
  235. package/lib/_utils/hooks/useId.d.ts +4 -0
  236. package/lib/_utils/hooks/useId.js +36 -0
  237. package/lib/index.d.ts +9 -5
  238. package/lib/index.js +16 -0
  239. package/lib/locale/default.d.ts +2 -0
  240. package/lib/locale/default.js +13 -0
  241. package/lib/locale/en_US.d.ts +3 -0
  242. package/lib/locale/en_US.js +146 -0
  243. package/lib/locale/zh_CN.d.ts +3 -2
  244. package/lib/locale/zh_CN.js +134 -2
  245. package/lib/locale-provider/LocaleReceiver.d.ts +4 -0
  246. package/lib/locale-provider/LocaleReceiver.js +23 -0
  247. package/lib/locale-provider/context.d.ts +7 -0
  248. package/lib/locale-provider/context.js +12 -0
  249. package/lib/locale-provider/default.d.ts +2 -0
  250. package/lib/locale-provider/default.js +13 -0
  251. package/lib/locale-provider/en_US.d.ts +2 -0
  252. package/lib/locale-provider/en_US.js +13 -0
  253. package/lib/locale-provider/index.d.ts +65 -0
  254. package/lib/locale-provider/index.js +116 -0
  255. package/lib/locale-provider/style/index.d.ts +1 -0
  256. package/lib/locale-provider/style/index.js +3 -0
  257. package/lib/locale-provider/style/index.less +2 -0
  258. package/lib/locale-provider/zh_CN.d.ts +2 -0
  259. package/lib/locale-provider/zh_CN.js +13 -0
  260. package/lib/style/index.d.ts +0 -1
  261. package/lib/style/index.js +0 -2
  262. package/lib/style/index.less +2 -2
  263. package/lib/style/themes/default/index.less +30 -30
  264. package/package.json +11 -8
@@ -1,14 +1,17 @@
1
1
  @import '../../style/index.less';
2
+ @import '../../Empty/style/index.less';
3
+ @import '../../message/style/index.less';
2
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
- max-width: 100%;
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
- height: 48px;
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: 68px;
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: 48px;
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
+ }
package/es/Tabs/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import "@aloudata/icons-react/styles/index.less";
2
+ import _More from "@aloudata/icons-react/es/icons/More";
1
3
  import "antd/es/tabs/style";
2
4
  import _Tabs from "antd/es/tabs";
3
5
  var _excluded = ["size", "className", "popupClassName", "adaptHeight"];
@@ -14,8 +16,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
14
16
 
15
17
  import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
16
18
 
17
- import Icon from '../Icon';
18
- import Button from '../Button';
19
19
  import TabPane from './TabPane';
20
20
  import classNames from 'classnames';
21
21
  export default function Tabs(props) {
@@ -32,13 +32,11 @@ export default function Tabs(props) {
32
32
  }
33
33
 
34
34
  return /*#__PURE__*/React.createElement(_Tabs, Object.assign({
35
- moreIcon: /*#__PURE__*/React.createElement(Button, {
36
- size: "default",
37
- type: "text",
38
- icon: /*#__PURE__*/React.createElement(Icon, {
39
- type: "more"
40
- })
41
- }),
35
+ moreIcon: /*#__PURE__*/React.createElement("div", {
36
+ className: "ald-tabs-moreIcon"
37
+ }, /*#__PURE__*/React.createElement(_More, {
38
+ color: "currentColor"
39
+ })),
42
40
  tabBarGutter: 24,
43
41
  popupClassName: classNames(popupClassName, 'ald-tabs-dropdown'),
44
42
  className: classNames('ald-tabs', className, {
@@ -1,21 +1,22 @@
1
+ /* stylelint-disable no-descending-specificity */
1
2
  @import '../../style/index.less';
2
3
  @import '../../Button/style/index.less';
3
4
  //status- default
4
- @Tabs-color: @NL30;
5
- @Tabs-fontWeight: 400;
5
+ @tabs-color: @NL30;
6
+ @tabs-fontWeight: 400;
6
7
  //active
7
- @Tabs-color-active: @B60;
8
- @Tabs-fontWeight-active: 600;
8
+ @tabs-color-active: @B60;
9
+ @tabs-fontWeight-active: 600;
9
10
 
10
11
  //middle - default
11
- @Tabs-fontSize: 14px;
12
- @Tabs-lineHeight: 20px;
13
- @Tabs-ink-link-bar-height: 2px;
12
+ @tabs-font-size: 14px;
13
+ @tabs-line-height: 20px;
14
+ @tabs-ink-link-bar-height: 2px;
14
15
  //large
15
- @Tabs-fontSize-large: 16px;
16
- @Tabs-lineHeight-large: 24px;
17
- @Tabs-ink-link-bar-height-large: 3px;
18
- // @Tabs-
16
+ @tabs-font-size-large: 16px;
17
+ @tabs-line-height-large: 24px;
18
+ @tabs-ink-link-bar-height-large: 3px;
19
+ // @tabs-
19
20
  .ant-tabs.ald-tabs {
20
21
  &.ant-tabs {
21
22
  color: @NL30;
@@ -23,29 +24,29 @@
23
24
 
24
25
  .ant-tabs-tab {
25
26
  padding: 8px 0;
26
- color: @Tabs-color;
27
- font-weight: @Tabs-fontWeight;
28
- font-size: @Tabs-fontSize;
29
- line-height: @Tabs-lineHeight;
27
+ color: @tabs-color;
28
+ font-weight: @tabs-fontWeight;
29
+ font-size: @tabs-font-size;
30
+ line-height: @tabs-line-height;
30
31
 
31
32
  &:hover {
32
33
  color: inherit;
33
34
  }
34
35
 
35
36
  &.ant-tabs-tab-active {
36
- font-weight: @Tabs-fontWeight-active;
37
+ font-weight: @tabs-fontWeight-active;
37
38
  }
38
39
  }
39
40
 
40
41
  .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
41
- color: @Tabs-color-active;
42
- font-weight: @Tabs-fontWeight-active;
42
+ color: @tabs-color-active;
43
+ font-weight: @tabs-fontWeight-active;
43
44
  text-shadow: none;
44
45
  }
45
46
 
46
47
  .ant-tabs-ink-bar {
47
- height: @Tabs-ink-link-bar-height;
48
- background: @Tabs-color-active;
48
+ height: @tabs-ink-link-bar-height;
49
+ background: @tabs-color-active;
49
50
  border-top-left-radius: 2px;
50
51
  border-top-right-radius: 2px;
51
52
  }
@@ -53,24 +54,55 @@
53
54
  /* large size */
54
55
  &.ant-tabs-large {
55
56
  .ant-tabs-tab {
56
- font-size: @Tabs-fontSize-large;
57
- line-height: @Tabs-lineHeight-large;
57
+ font-size: @tabs-font-size-large;
58
+ line-height: @tabs-line-height-large;
58
59
  }
59
60
 
60
61
  .ant-tabs-ink-bar {
61
- height: @Tabs-ink-link-bar-height-large;
62
+ height: @tabs-ink-link-bar-height-large;
63
+ }
64
+
65
+ .ald-tabs-moreIcon {
66
+ width: 36px;
67
+ height: 36px;
68
+ border-radius: 8px;
62
69
  }
63
70
  }
64
71
 
65
72
  &.ald-tabs-default {
66
73
  .ant-tabs-tab {
67
- font-size: @Tabs-fontSize;
68
- line-height: @Tabs-lineHeight;
74
+ font-size: @tabs-font-size;
75
+ line-height: @tabs-line-height;
76
+ }
77
+
78
+ .ald-tabs-moreIcon {
79
+ width: 32px;
80
+ height: 32px;
81
+ border-radius: 6px;
69
82
  }
70
83
  }
71
84
 
72
85
  .ant-tabs-nav-more {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ justify-content: center;
73
89
  margin: 0 !important;
90
+ padding: 2px;
91
+
92
+ .ald-tabs-moreIcon {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ color: inherit;
97
+ font-size: inherit;
98
+ }
99
+
100
+ &.ant-tabs-dropdown-open {
101
+ .ald-tabs-moreIcon {
102
+ color: @B60;
103
+ background-color: @NL97;
104
+ }
105
+ }
74
106
  }
75
107
 
76
108
  /* body自适应高度 */
@@ -0,0 +1,4 @@
1
+ /** Is client side and not jsdom */
2
+ export declare const isBrowserClient: boolean;
3
+ /** Get unique id for accessibility usage */
4
+ export declare function getUUID(): number | string;
@@ -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
@@ -1,13 +1,13 @@
1
1
  /// <reference path="../typings.d.ts" />
2
2
  export { default as Button } from './Button';
3
- export type { IButtonProps as ButtonProps, Size, ButtonType } from './Button';
3
+ export type { IButtonProps as ButtonProps, ButtonType } from './Button';
4
4
  export { default as Dropdown } from './Dropdown';
5
5
  export type { ActionType, IDropdownProps as DropdownProps, PlacementType } from './Dropdown';
6
6
  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, InputRef, TextAreaRef } from './Input';
10
+ export type { IInputProps as InputProps, 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';
@@ -20,6 +20,8 @@ export { default as Navigator } from './Navigator';
20
20
  export type { INavigatorProps as NavigatorProps, IMenuItem as NavigatorMenu, ISelectedMenuInfo as SelectedMenuInfo, } from './Navigator';
21
21
  export { default as Alert } from './Alert';
22
22
  export type { AlertProps } from './Alert';
23
+ export { default as Card } from './Card';
24
+ export type { CardProps } from './Card';
23
25
  export { default as Col } from './Col';
24
26
  export type { ColProps } from './Col';
25
27
  export type { TypographyProps } from './Typography';
@@ -44,9 +46,9 @@ export type { SpaceProps } from './Space';
44
46
  export { default as Space } from './Space';
45
47
  export type { SpinProps } from './Spin';
46
48
  export { default as Spin } from './Spin';
47
- export type { SwitchProps } from './Switch';
49
+ export type { ISwitchProps as SwitchProps } from './Switch';
48
50
  export { default as Switch } from './Switch';
49
- export type { StepProps, StepsProps } from './Steps';
51
+ export type { IStepProps as StepProps, IStepsProps as StepsProps } from './Steps';
50
52
  export { default as Steps } from './Steps';
51
53
  export { default as Form } from './Form';
52
54
  export type { FormInstance, FormProps, FormItemProps } from './Form';
@@ -55,7 +57,7 @@ export type { DividerProps } from './Divider';
55
57
  export { default as Drawer } from './Drawer';
56
58
  export type { DrawerProps } from './Drawer';
57
59
  export { default as Radio } from './Radio';
58
- export type { RadioProps, RadioChangeEvent, RadioGroupProps } from './Radio';
60
+ export type { RadioProps, RadioGroupProps } from './Radio';
59
61
  export { default as Checkbox } from './Checkbox';
60
62
  export type { CheckboxProps, CheckboxOptionType } from './Checkbox';
61
63
  export { default as Modal } from './Modal';
@@ -71,3 +73,5 @@ export type { IEmptyProps as EmptyProps } from './Empty';
71
73
  export { default as Avatar } from './Avatar';
72
74
  export type { IAvatarProps as AvatarProps } from './Avatar';
73
75
  export { default as Icon } from './Icon';
76
+ export type { PageHeaderProps } from './PageHeader';
77
+ export { default as PageHeader } from './PageHeader';
package/es/index.js CHANGED
@@ -9,6 +9,7 @@ export { default as Select } from './Select';
9
9
  export { default as Table } from './Table';
10
10
  export { default as Navigator } from './Navigator';
11
11
  export { default as Alert } from './Alert';
12
+ export { default as Card } from './Card';
12
13
  export { default as Col } from './Col';
13
14
  export { default as Typography } from './Typography';
14
15
  export { default as Upload } from './Upload';
@@ -35,4 +36,5 @@ export { default as InputNumber } from './InputNumber';
35
36
  export { default as Breadcrumb } from './Breadcrumb';
36
37
  export { default as Empty } from './Empty';
37
38
  export { default as Avatar } from './Avatar';
38
- export { default as Icon } from './Icon';
39
+ export { default as Icon } from './Icon';
40
+ export { default as PageHeader } from './PageHeader';
@@ -0,0 +1,2 @@
1
+ import defaultLocale from './zh_CN';
2
+ export default defaultLocale;
@@ -0,0 +1,2 @@
1
+ import defaultLocale from './zh_CN';
2
+ export default defaultLocale;
@@ -0,0 +1,3 @@
1
+ import type { Locale } from '../locale-provider';
2
+ declare const localeValues: Locale;
3
+ export default localeValues;
@@ -0,0 +1,132 @@
1
+ /* eslint-disable no-template-curly-in-string */
2
+ import Pagination from 'rc-pagination/lib/locale/en_US';
3
+ import Calendar from 'antd/es/calendar/locale/en_US';
4
+ import DatePicker from 'antd/es/date-picker/locale/en_US';
5
+ import TimePicker from 'antd/es/time-picker/locale/en_US';
6
+ var typeTemplate = '${label} is not a valid ${type}';
7
+ var localeValues = {
8
+ locale: 'en',
9
+ Pagination: Pagination,
10
+ DatePicker: DatePicker,
11
+ TimePicker: TimePicker,
12
+ Calendar: Calendar,
13
+ global: {
14
+ placeholder: 'Please select'
15
+ },
16
+ Table: {
17
+ filterTitle: 'Filter menu',
18
+ filterConfirm: 'OK',
19
+ filterReset: 'Reset',
20
+ filterEmptyText: 'No filters',
21
+ filterCheckall: 'Select all items',
22
+ filterSearchPlaceholder: 'Search in filters',
23
+ emptyText: 'No data',
24
+ selectAll: 'Select current page',
25
+ selectInvert: 'Invert current page',
26
+ selectNone: 'Clear all data',
27
+ selectionAll: 'Select all data',
28
+ sortTitle: 'Sort',
29
+ expand: 'Expand row',
30
+ collapse: 'Collapse row',
31
+ triggerDesc: 'Click to sort descending',
32
+ triggerAsc: 'Click to sort ascending',
33
+ cancelSort: 'Click to cancel sorting'
34
+ },
35
+ Modal: {
36
+ okText: 'OK',
37
+ cancelText: 'Cancel',
38
+ justOkText: 'OK'
39
+ },
40
+ Popconfirm: {
41
+ okText: 'OK',
42
+ cancelText: 'Cancel'
43
+ },
44
+ Transfer: {
45
+ titles: ['', ''],
46
+ searchPlaceholder: 'Search here',
47
+ itemUnit: 'item',
48
+ itemsUnit: 'items',
49
+ remove: 'Remove',
50
+ selectCurrent: 'Select current page',
51
+ removeCurrent: 'Remove current page',
52
+ selectAll: 'Select all data',
53
+ removeAll: 'Remove all data',
54
+ selectInvert: 'Invert current page'
55
+ },
56
+ Upload: {
57
+ uploading: 'Uploading...',
58
+ removeFile: 'Remove file',
59
+ uploadError: 'Upload error',
60
+ previewFile: 'Preview file',
61
+ downloadFile: 'Download file'
62
+ },
63
+ Empty: {
64
+ description: 'No Data'
65
+ },
66
+ Icon: {
67
+ icon: 'icon'
68
+ },
69
+ Text: {
70
+ edit: 'Edit',
71
+ copy: 'Copy',
72
+ copied: 'Copied',
73
+ expand: 'Expand'
74
+ },
75
+ PageHeader: {
76
+ back: 'Back'
77
+ },
78
+ Form: {
79
+ optional: '(optional)',
80
+ defaultValidateMessages: {
81
+ default: 'Field validation error for ${label}',
82
+ required: 'Please enter ${label}',
83
+ enum: '${label} must be one of [${enum}]',
84
+ whitespace: '${label} cannot be a blank character',
85
+ date: {
86
+ format: '${label} date format is invalid',
87
+ parse: '${label} cannot be converted to a date',
88
+ invalid: '${label} is an invalid date'
89
+ },
90
+ types: {
91
+ string: typeTemplate,
92
+ method: typeTemplate,
93
+ array: typeTemplate,
94
+ object: typeTemplate,
95
+ number: typeTemplate,
96
+ date: typeTemplate,
97
+ boolean: typeTemplate,
98
+ integer: typeTemplate,
99
+ float: typeTemplate,
100
+ regexp: typeTemplate,
101
+ email: typeTemplate,
102
+ url: typeTemplate,
103
+ hex: typeTemplate
104
+ },
105
+ string: {
106
+ len: '${label} must be ${len} characters',
107
+ min: '${label} must be at least ${min} characters',
108
+ max: '${label} must be up to ${max} characters',
109
+ range: '${label} must be between ${min}-${max} characters'
110
+ },
111
+ number: {
112
+ len: '${label} must be equal to ${len}',
113
+ min: '${label} must be minimum ${min}',
114
+ max: '${label} must be maximum ${max}',
115
+ range: '${label} must be between ${min}-${max}'
116
+ },
117
+ array: {
118
+ len: 'Must be ${len} ${label}',
119
+ min: 'At least ${min} ${label}',
120
+ max: 'At most ${max} ${label}',
121
+ range: 'The amount of ${label} must be between ${min}-${max}'
122
+ },
123
+ pattern: {
124
+ mismatch: '${label} does not match the pattern ${pattern}'
125
+ }
126
+ }
127
+ },
128
+ Image: {
129
+ preview: 'Preview'
130
+ }
131
+ };
132
+ export default localeValues;