@douyinfe/semi-foundation 2.34.1-alpha.2 → 2.34.1
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/breadcrumb/breadcrumb.scss +4 -4
- package/calendar/eventUtil.ts +9 -7
- package/calendar/foundation.ts +4 -4
- package/cascader/foundation.ts +24 -13
- package/lib/cjs/breadcrumb/breadcrumb.css +0 -3
- package/lib/cjs/breadcrumb/breadcrumb.scss +4 -4
- package/lib/cjs/calendar/eventUtil.d.ts +7 -6
- package/lib/cjs/calendar/eventUtil.js +8 -6
- package/lib/cjs/calendar/foundation.d.ts +2 -2
- package/lib/cjs/calendar/foundation.js +2 -2
- package/lib/cjs/cascader/foundation.d.ts +3 -1
- package/lib/cjs/cascader/foundation.js +26 -8
- package/lib/cjs/radio/radio.css +1 -0
- package/lib/cjs/radio/radio.scss +1 -0
- package/lib/cjs/steps/bacisSteps.scss +2 -2
- package/lib/cjs/steps/fillSteps.scss +3 -3
- package/lib/cjs/steps/steps.css +12 -12
- package/lib/cjs/table/foundation.d.ts +5 -0
- package/lib/cjs/table/table.css +23 -5
- package/lib/cjs/table/table.scss +25 -5
- package/lib/cjs/table/utils.d.ts +2 -0
- package/lib/cjs/table/utils.js +6 -0
- package/lib/cjs/timePicker/foundation.js +15 -1
- package/lib/cjs/typography/typography.css +8 -0
- package/lib/cjs/typography/typography.scss +13 -0
- package/lib/cjs/utils/date-fns-extra.d.ts +4 -0
- package/lib/cjs/utils/date-fns-extra.js +66 -3
- package/lib/es/breadcrumb/breadcrumb.css +0 -3
- package/lib/es/breadcrumb/breadcrumb.scss +4 -4
- package/lib/es/calendar/eventUtil.d.ts +7 -6
- package/lib/es/calendar/eventUtil.js +8 -6
- package/lib/es/calendar/foundation.d.ts +2 -2
- package/lib/es/calendar/foundation.js +2 -2
- package/lib/es/cascader/foundation.d.ts +3 -1
- package/lib/es/cascader/foundation.js +26 -8
- package/lib/es/radio/radio.css +1 -0
- package/lib/es/radio/radio.scss +1 -0
- package/lib/es/steps/bacisSteps.scss +2 -2
- package/lib/es/steps/fillSteps.scss +3 -3
- package/lib/es/steps/steps.css +12 -12
- package/lib/es/table/foundation.d.ts +5 -0
- package/lib/es/table/table.css +23 -5
- package/lib/es/table/table.scss +25 -5
- package/lib/es/table/utils.d.ts +2 -0
- package/lib/es/table/utils.js +5 -0
- package/lib/es/timePicker/foundation.js +14 -1
- package/lib/es/typography/typography.css +8 -0
- package/lib/es/typography/typography.scss +13 -0
- package/lib/es/utils/date-fns-extra.d.ts +4 -0
- package/lib/es/utils/date-fns-extra.js +61 -0
- package/package.json +2 -2
- package/radio/radio.scss +1 -0
- package/steps/bacisSteps.scss +2 -2
- package/steps/fillSteps.scss +3 -3
- package/table/foundation.ts +6 -2
- package/table/table.scss +25 -5
- package/table/utils.ts +6 -0
- package/timePicker/foundation.ts +12 -3
- package/typography/typography.scss +13 -0
- package/utils/date-fns-extra.ts +56 -0
package/lib/es/table/table.css
CHANGED
|
@@ -94,6 +94,10 @@
|
|
|
94
94
|
.semi-table-header-sticky .semi-table-thead > .semi-table-row > .semi-table-row-head {
|
|
95
95
|
background-color: var(--semi-color-bg-1);
|
|
96
96
|
}
|
|
97
|
+
.semi-table-operate-wrapper {
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: flex-start;
|
|
100
|
+
}
|
|
97
101
|
.semi-table-body {
|
|
98
102
|
overflow: auto;
|
|
99
103
|
width: 100%;
|
|
@@ -119,8 +123,7 @@
|
|
|
119
123
|
padding-top: 8px;
|
|
120
124
|
padding-bottom: 8px;
|
|
121
125
|
vertical-align: middle;
|
|
122
|
-
|
|
123
|
-
word-wrap: break-word;
|
|
126
|
+
overflow-wrap: break-word;
|
|
124
127
|
position: relative;
|
|
125
128
|
}
|
|
126
129
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left, .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right {
|
|
@@ -173,6 +176,16 @@
|
|
|
173
176
|
display: inline-flex;
|
|
174
177
|
align-items: center;
|
|
175
178
|
}
|
|
179
|
+
.semi-table-thead > .semi-table-row > .semi-table-row-head-ellipsis {
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
.semi-table-thead > .semi-table-row > .semi-table-row-head-ellipsis .semi-table-row-head-title {
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
text-overflow: ellipsis;
|
|
187
|
+
white-space: nowrap;
|
|
188
|
+
}
|
|
176
189
|
.semi-table-thead > .semi-table-row .react-resizable {
|
|
177
190
|
position: relative;
|
|
178
191
|
background-clip: padding-box;
|
|
@@ -223,8 +236,7 @@
|
|
|
223
236
|
}
|
|
224
237
|
.semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
225
238
|
display: table-cell;
|
|
226
|
-
|
|
227
|
-
word-break: break-all;
|
|
239
|
+
overflow-wrap: break-word;
|
|
228
240
|
border-left: none;
|
|
229
241
|
border-right: none;
|
|
230
242
|
border-bottom: 1px solid var(--semi-color-border);
|
|
@@ -236,6 +248,11 @@
|
|
|
236
248
|
.semi-table-tbody > .semi-table-row > .semi-table-row-cell.resizing {
|
|
237
249
|
border-right: 2px solid var(--semi-color-primary);
|
|
238
250
|
}
|
|
251
|
+
.semi-table-tbody > .semi-table-row > .semi-table-row-cell-ellipsis {
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
text-overflow: ellipsis;
|
|
254
|
+
white-space: nowrap;
|
|
255
|
+
}
|
|
239
256
|
.semi-table-tbody > .semi-table-row.semi-table-row-expand > .semi-table-row-cell {
|
|
240
257
|
background-color: var(--semi-color-fill-0);
|
|
241
258
|
}
|
|
@@ -336,9 +353,10 @@
|
|
|
336
353
|
text-align: center;
|
|
337
354
|
}
|
|
338
355
|
.semi-table .semi-table-column-sorter-wrapper {
|
|
339
|
-
display:
|
|
356
|
+
display: flex;
|
|
340
357
|
align-items: center;
|
|
341
358
|
cursor: pointer;
|
|
359
|
+
overflow: hidden;
|
|
342
360
|
}
|
|
343
361
|
.semi-table .semi-table-column-sorter-up, .semi-table .semi-table-column-sorter-down {
|
|
344
362
|
height: 0;
|
package/lib/es/table/table.scss
CHANGED
|
@@ -83,6 +83,11 @@ $module: #{$prefix}-table;
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
&-operate-wrapper {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: flex-start;
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
&-body {
|
|
87
92
|
overflow: auto;
|
|
88
93
|
width: 100%;
|
|
@@ -115,8 +120,9 @@ $module: #{$prefix}-table;
|
|
|
115
120
|
padding-top: $spacing-table_row_head-paddingY;
|
|
116
121
|
padding-bottom: $spacing-table_row_head-paddingY;
|
|
117
122
|
vertical-align: middle;
|
|
118
|
-
|
|
119
|
-
word-
|
|
123
|
+
overflow-wrap: break-word;
|
|
124
|
+
// word-break: break-all;
|
|
125
|
+
// word-wrap: break-word;
|
|
120
126
|
position: relative;
|
|
121
127
|
|
|
122
128
|
&.#{$module}-cell-fixed {
|
|
@@ -177,6 +183,14 @@ $module: #{$prefix}-table;
|
|
|
177
183
|
display: inline-flex;
|
|
178
184
|
align-items: center;
|
|
179
185
|
}
|
|
186
|
+
|
|
187
|
+
&-ellipsis {
|
|
188
|
+
@include text-overflow-hidden;
|
|
189
|
+
|
|
190
|
+
.#{$module}-row-head-title {
|
|
191
|
+
@include text-overflow-hidden;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
180
194
|
}
|
|
181
195
|
|
|
182
196
|
.react-resizable {
|
|
@@ -241,8 +255,9 @@ $module: #{$prefix}-table;
|
|
|
241
255
|
|
|
242
256
|
& > .#{$module}-row-cell {
|
|
243
257
|
display: table-cell;
|
|
244
|
-
|
|
245
|
-
word-
|
|
258
|
+
overflow-wrap: break-word;
|
|
259
|
+
// word-wrap: break-word;
|
|
260
|
+
// word-break: break-all;
|
|
246
261
|
border-left: none;
|
|
247
262
|
border-right: none;
|
|
248
263
|
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
@@ -254,6 +269,10 @@ $module: #{$prefix}-table;
|
|
|
254
269
|
&.resizing {
|
|
255
270
|
border-right: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
256
271
|
}
|
|
272
|
+
|
|
273
|
+
&-ellipsis {
|
|
274
|
+
@include text-overflow-hidden;
|
|
275
|
+
}
|
|
257
276
|
}
|
|
258
277
|
&.#{$module}-row {
|
|
259
278
|
&-expand {
|
|
@@ -401,9 +420,10 @@ $module: #{$prefix}-table;
|
|
|
401
420
|
text-align: center;
|
|
402
421
|
|
|
403
422
|
&-wrapper {
|
|
404
|
-
display:
|
|
423
|
+
display: flex;
|
|
405
424
|
align-items: center;
|
|
406
425
|
cursor: pointer;
|
|
426
|
+
overflow: hidden;
|
|
407
427
|
}
|
|
408
428
|
|
|
409
429
|
&-up,
|
package/lib/es/table/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { strings } from './constants';
|
|
2
|
+
import type { BaseEllipsis } from './foundation';
|
|
2
3
|
export declare function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean): boolean;
|
|
3
4
|
export declare function getColumnKey(column: any, keyPropNames: any[]): any;
|
|
4
5
|
/**
|
|
@@ -151,3 +152,4 @@ export declare function isTreeTable({ dataSource, childrenRecordName }: {
|
|
|
151
152
|
childrenRecordName?: string;
|
|
152
153
|
}): boolean;
|
|
153
154
|
export declare function getRTLAlign(align: typeof strings.ALIGNS[number], direction?: 'ltr' | 'rtl'): typeof strings.ALIGNS[number];
|
|
155
|
+
export declare function shouldShowEllipsisTitle(ellipsis: BaseEllipsis): any;
|
package/lib/es/table/utils.js
CHANGED
|
@@ -510,4 +510,9 @@ export function getRTLAlign(align, direction) {
|
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
return align;
|
|
513
|
+
}
|
|
514
|
+
export function shouldShowEllipsisTitle(ellipsis) {
|
|
515
|
+
const shouldShowTitle = ellipsis === true || _get(ellipsis, 'showTitle', true);
|
|
516
|
+
|
|
517
|
+
return shouldShowTitle;
|
|
513
518
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isUndefined from "lodash/isUndefined";
|
|
1
2
|
import _split from "lodash/split";
|
|
2
3
|
|
|
3
4
|
/* eslint-disable max-len */
|
|
@@ -359,7 +360,19 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
if (_dates && Array.isArray(_dates)) {
|
|
362
|
-
|
|
363
|
+
const result = _dates.map(date => {
|
|
364
|
+
let str;
|
|
365
|
+
|
|
366
|
+
if (_isUndefined(date)) {
|
|
367
|
+
str = '';
|
|
368
|
+
} else {
|
|
369
|
+
str = formatToString(date, validFormat, dateFnsLocale);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return str;
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
return result.join(rangeSeparator);
|
|
363
376
|
}
|
|
364
377
|
|
|
365
378
|
return undefined;
|
|
@@ -98,11 +98,19 @@
|
|
|
98
98
|
-webkit-box-orient: vertical;
|
|
99
99
|
overflow: hidden;
|
|
100
100
|
}
|
|
101
|
+
.semi-typography-ellipsis-multiple-line.semi-typography-ellipsis-multiple-line-text {
|
|
102
|
+
display: -webkit-inline-box;
|
|
103
|
+
}
|
|
101
104
|
.semi-typography-ellipsis-overflow-ellipsis {
|
|
102
105
|
display: block;
|
|
103
106
|
white-space: nowrap;
|
|
104
107
|
text-overflow: ellipsis;
|
|
105
108
|
}
|
|
109
|
+
.semi-typography-ellipsis-overflow-ellipsis.semi-typography-ellipsis-overflow-ellipsis-text {
|
|
110
|
+
display: inline-block;
|
|
111
|
+
max-width: 100%;
|
|
112
|
+
vertical-align: top;
|
|
113
|
+
}
|
|
106
114
|
.semi-typography-ellipsis-expand {
|
|
107
115
|
display: inline;
|
|
108
116
|
margin-left: 8px;
|
|
@@ -123,12 +123,25 @@ $module: #{$prefix}-typography;
|
|
|
123
123
|
display: -webkit-box;
|
|
124
124
|
-webkit-box-orient: vertical;
|
|
125
125
|
overflow: hidden;
|
|
126
|
+
|
|
127
|
+
&.#{$module}-ellipsis-multiple-line-text {
|
|
128
|
+
// inline-block only works in the Text component, keeping the original external inline performance
|
|
129
|
+
display: -webkit-inline-box;
|
|
130
|
+
}
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
&-ellipsis-overflow-ellipsis {
|
|
129
134
|
display: block;
|
|
130
135
|
white-space: nowrap;
|
|
131
136
|
text-overflow: ellipsis;
|
|
137
|
+
|
|
138
|
+
&.#{$module}-ellipsis-overflow-ellipsis-text {
|
|
139
|
+
// inline-block only works in the Text component, keeping the original external inline performance
|
|
140
|
+
display: inline-block;
|
|
141
|
+
// Ensure that Text component can be limited by the parent's width when no specific width is set
|
|
142
|
+
max-width: 100%;
|
|
143
|
+
vertical-align: top;
|
|
144
|
+
}
|
|
132
145
|
}
|
|
133
146
|
|
|
134
147
|
&-ellipsis-expand {
|
|
@@ -9,6 +9,10 @@ export declare const IANAOffsetMap: (number | string[])[][];
|
|
|
9
9
|
* @returns {number|undefined}
|
|
10
10
|
*/
|
|
11
11
|
export declare const toIANA: (tz: string | number) => any;
|
|
12
|
+
/**
|
|
13
|
+
* @see https://github.com/marnusw/date-fns-tz/blob/a92e0ad017d101a0c50e39a63ef5d322b4d849f6/src/_lib/tzParseTimezone/index.js#L137
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidTimezoneIANAString(timeZoneString: string): boolean;
|
|
12
16
|
/**
|
|
13
17
|
*
|
|
14
18
|
* @param {string | number | Date} date
|
|
@@ -8,6 +8,40 @@ import { parse as dateFnsParse } from 'date-fns';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export const IANAOffsetMap = [[-11, ['Pacific/Midway']], [-10, ['Pacific/Honolulu']], [-9.5, ['Pacific/Marquesas']], [-9, ['Pacific/Gambier']], [-8, ['Pacific/Pitcairn']], [-7, ['America/Phoenix']], [-6, ['America/Tegucigalpa']], [-5, ['America/Bogota']], [-4, ['America/Puerto_Rico']], [-3.5, ['America/St_Johns']], [-3, ['America/Montevideo']], [-2, ['Atlantic/South_Georgia']], [-1, ['Atlantic/Cape_Verde']], [0, ['Africa/Accra']], [1, ['Africa/Bangui']], [2, ['Africa/Cairo']], [3, ['Asia/Bahrain', 'Indian/Antananarivo']], [3.5, ['Asia/Tehran']], [4, ['Asia/Dubai', 'Asia/Muscat']], [4.5, ['Asia/Kabul']], [5, ['Asia/Samarkand', 'Asia/Karachi']], [5.5, ['Asia/Kolkata']], [5.75, ['Asia/Kathmandu']], [6, ['Asia/Dhaka']], [6.5, ['Asia/Rangoon', 'Asia/Rangoon']], [7, ['Asia/Jakarta', 'Asia/Phnom_Penh', 'Asia/Bangkok']], [8, ['Asia/Shanghai', 'Asia/Singapore']], [8.75, ['Australia/Eucla']], [9, ['Asia/Tokyo', 'Asia/Seoul', 'Asia/Pyongyang']], [9.5, ['Australia/Darwin']], [10, ['Pacific/Guam']], [10.5, ['Australia/Adelaide']], [11, ['Pacific/Guadalcanal']], [12, ['Pacific/Funafuti']], [13, ['Pacific/Enderbury']], [13.75, ['Pacific/Chatham']], [14, ['Pacific/Kiritimati']]];
|
|
11
|
+
/**
|
|
12
|
+
* Etc/GMT* no DST
|
|
13
|
+
* @see https://data.iana.org/time-zones/tzdb/etcetera
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const IANAEtcGMTOffsetMap = {
|
|
17
|
+
'0': 'Etc/GMT',
|
|
18
|
+
'1': 'Etc/GMT-1',
|
|
19
|
+
'2': 'Etc/GMT-2',
|
|
20
|
+
'3': 'Etc/GMT-3',
|
|
21
|
+
'4': 'Etc/GMT-4',
|
|
22
|
+
'5': 'Etc/GMT-5',
|
|
23
|
+
'6': 'Etc/GMT-6',
|
|
24
|
+
'7': 'Etc/GMT-7',
|
|
25
|
+
'8': 'Etc/GMT-8',
|
|
26
|
+
'9': 'Etc/GMT-9',
|
|
27
|
+
'10': 'Etc/GMT-10',
|
|
28
|
+
'11': 'Etc/GMT-11',
|
|
29
|
+
'12': 'Etc/GMT-12',
|
|
30
|
+
'13': 'Etc/GMT-13',
|
|
31
|
+
'14': 'Etc/GMT-14',
|
|
32
|
+
'-1': 'Etc/GMT+1',
|
|
33
|
+
'-2': 'Etc/GMT+2',
|
|
34
|
+
'-3': 'Etc/GMT+3',
|
|
35
|
+
'-4': 'Etc/GMT+4',
|
|
36
|
+
'-5': 'Etc/GMT+5',
|
|
37
|
+
'-6': 'Etc/GMT+6',
|
|
38
|
+
'-7': 'Etc/GMT+7',
|
|
39
|
+
'-8': 'Etc/GMT+8',
|
|
40
|
+
'-9': 'Etc/GMT+9',
|
|
41
|
+
'-10': 'Etc/GMT+10',
|
|
42
|
+
'-11': 'Etc/GMT+11',
|
|
43
|
+
'-12': 'Etc/GMT+12'
|
|
44
|
+
};
|
|
11
45
|
const GMTStringReg = /([\-\+]{1})(\d{2})\:(\d{2})/;
|
|
12
46
|
/**
|
|
13
47
|
*
|
|
@@ -33,10 +67,37 @@ export const toIANA = tz => {
|
|
|
33
67
|
}
|
|
34
68
|
|
|
35
69
|
if (typeof tz === 'number') {
|
|
70
|
+
// if tz can be transformed to a Etc/GMT* and browser supports it
|
|
71
|
+
if (tz in IANAEtcGMTOffsetMap) {
|
|
72
|
+
const etcGMTtimeZone = IANAEtcGMTOffsetMap[tz];
|
|
73
|
+
|
|
74
|
+
if (isValidTimezoneIANAString(etcGMTtimeZone)) {
|
|
75
|
+
return etcGMTtimeZone;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
36
79
|
const found = IANAOffsetMap.find(item => item[0] === tz);
|
|
37
80
|
return found && found[1][0];
|
|
38
81
|
}
|
|
39
82
|
};
|
|
83
|
+
const validIANATimezoneCache = {};
|
|
84
|
+
/**
|
|
85
|
+
* @see https://github.com/marnusw/date-fns-tz/blob/a92e0ad017d101a0c50e39a63ef5d322b4d849f6/src/_lib/tzParseTimezone/index.js#L137
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export function isValidTimezoneIANAString(timeZoneString) {
|
|
89
|
+
if (validIANATimezoneCache[timeZoneString]) return true;
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
new Intl.DateTimeFormat(undefined, {
|
|
93
|
+
timeZone: timeZoneString
|
|
94
|
+
});
|
|
95
|
+
validIANATimezoneCache[timeZoneString] = true;
|
|
96
|
+
return true;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
40
101
|
/**
|
|
41
102
|
*
|
|
42
103
|
* @param {string | number | Date} date
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.34.1
|
|
3
|
+
"version": "2.34.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"*.scss",
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "810c998a7c1db1cb824fb3c17353ca94c3df067e",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
29
29
|
"@babel/preset-env": "^7.15.8",
|
package/radio/radio.scss
CHANGED
package/steps/bacisSteps.scss
CHANGED
|
@@ -173,7 +173,7 @@ $basicType: #{$module}-basic;
|
|
|
173
173
|
|
|
174
174
|
transform:scale($transform_scale-step-item);
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
&-hover:hover {
|
|
177
177
|
|
|
178
178
|
.#{$item}-title {
|
|
179
179
|
color: $color-steps_item_title-text-hover;
|
|
@@ -267,7 +267,7 @@ $basicType: #{$module}-basic;
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
&-hover:hover {
|
|
271
271
|
.#{$item}-left {
|
|
272
272
|
|
|
273
273
|
.#{$item}-icon {
|
package/steps/fillSteps.scss
CHANGED
|
@@ -92,7 +92,7 @@ $module: #{$prefix}-steps;
|
|
|
92
92
|
color: $color-steps_success-text-default;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
&-hover:hover {
|
|
96
96
|
background-color: $color-steps-bg-hover;
|
|
97
97
|
|
|
98
98
|
.#{$prefix}-icon,
|
|
@@ -118,7 +118,7 @@ $module: #{$prefix}-steps;
|
|
|
118
118
|
color: $color-steps_danger-text-default;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
&-hover:hover {
|
|
122
122
|
background: $color-steps-bg-hover;
|
|
123
123
|
|
|
124
124
|
.#{$prefix}-icon,
|
|
@@ -144,7 +144,7 @@ $module: #{$prefix}-steps;
|
|
|
144
144
|
color: $color-steps_warning-text-default;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
&-hover:hover {
|
|
148
148
|
background: $color-steps-bg-hover;
|
|
149
149
|
|
|
150
150
|
.#{$module}-item-title,
|
package/table/foundation.ts
CHANGED
|
@@ -58,7 +58,8 @@ export interface BaseColumnProps<RecordType> {
|
|
|
58
58
|
sorter?: BaseSorter<RecordType>;
|
|
59
59
|
title?: any;
|
|
60
60
|
useFullRender?: boolean;
|
|
61
|
-
width?: string | number
|
|
61
|
+
width?: string | number;
|
|
62
|
+
ellipsis?: BaseEllipsis
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export interface TableAdapter<RecordType> extends DefaultAdapter {
|
|
@@ -103,7 +104,8 @@ export interface TableAdapter<RecordType> extends DefaultAdapter {
|
|
|
103
104
|
getNormalizeColumns: () => (columns: BaseColumnProps<RecordType>[], children: any) => BaseColumnProps<RecordType>[];
|
|
104
105
|
getHandleColumns: () => (queries: BaseColumnProps<RecordType>[], cachedColumns: BaseColumnProps<RecordType>[]) => BaseColumnProps<RecordType>[];
|
|
105
106
|
getMergePagination: () => (pagination: BasePagination) => BasePagination;
|
|
106
|
-
setBodyHasScrollbar: (bodyHasScrollBar: boolean) => void
|
|
107
|
+
setBodyHasScrollbar: (bodyHasScrollBar: boolean) => void;
|
|
108
|
+
getTableLayout: () => 'fixed' | 'auto'
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType>> {
|
|
@@ -1257,4 +1259,6 @@ export interface BaseChangeInfoSorter<RecordType> {
|
|
|
1257
1259
|
|
|
1258
1260
|
export type BaseIncludeGroupRecord<RecordType> = RecordType | { groupKey: string };
|
|
1259
1261
|
|
|
1262
|
+
export type BaseEllipsis = boolean | { showTitle: boolean };
|
|
1263
|
+
|
|
1260
1264
|
export default TableFoundation;
|
package/table/table.scss
CHANGED
|
@@ -83,6 +83,11 @@ $module: #{$prefix}-table;
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
&-operate-wrapper {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: flex-start;
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
&-body {
|
|
87
92
|
overflow: auto;
|
|
88
93
|
width: 100%;
|
|
@@ -115,8 +120,9 @@ $module: #{$prefix}-table;
|
|
|
115
120
|
padding-top: $spacing-table_row_head-paddingY;
|
|
116
121
|
padding-bottom: $spacing-table_row_head-paddingY;
|
|
117
122
|
vertical-align: middle;
|
|
118
|
-
|
|
119
|
-
word-
|
|
123
|
+
overflow-wrap: break-word;
|
|
124
|
+
// word-break: break-all;
|
|
125
|
+
// word-wrap: break-word;
|
|
120
126
|
position: relative;
|
|
121
127
|
|
|
122
128
|
&.#{$module}-cell-fixed {
|
|
@@ -177,6 +183,14 @@ $module: #{$prefix}-table;
|
|
|
177
183
|
display: inline-flex;
|
|
178
184
|
align-items: center;
|
|
179
185
|
}
|
|
186
|
+
|
|
187
|
+
&-ellipsis {
|
|
188
|
+
@include text-overflow-hidden;
|
|
189
|
+
|
|
190
|
+
.#{$module}-row-head-title {
|
|
191
|
+
@include text-overflow-hidden;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
180
194
|
}
|
|
181
195
|
|
|
182
196
|
.react-resizable {
|
|
@@ -241,8 +255,9 @@ $module: #{$prefix}-table;
|
|
|
241
255
|
|
|
242
256
|
& > .#{$module}-row-cell {
|
|
243
257
|
display: table-cell;
|
|
244
|
-
|
|
245
|
-
word-
|
|
258
|
+
overflow-wrap: break-word;
|
|
259
|
+
// word-wrap: break-word;
|
|
260
|
+
// word-break: break-all;
|
|
246
261
|
border-left: none;
|
|
247
262
|
border-right: none;
|
|
248
263
|
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
@@ -254,6 +269,10 @@ $module: #{$prefix}-table;
|
|
|
254
269
|
&.resizing {
|
|
255
270
|
border-right: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
256
271
|
}
|
|
272
|
+
|
|
273
|
+
&-ellipsis {
|
|
274
|
+
@include text-overflow-hidden;
|
|
275
|
+
}
|
|
257
276
|
}
|
|
258
277
|
&.#{$module}-row {
|
|
259
278
|
&-expand {
|
|
@@ -401,9 +420,10 @@ $module: #{$prefix}-table;
|
|
|
401
420
|
text-align: center;
|
|
402
421
|
|
|
403
422
|
&-wrapper {
|
|
404
|
-
display:
|
|
423
|
+
display: flex;
|
|
405
424
|
align-items: center;
|
|
406
425
|
cursor: pointer;
|
|
426
|
+
overflow: hidden;
|
|
407
427
|
}
|
|
408
428
|
|
|
409
429
|
&-up,
|
package/table/utils.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import { strings, numbers } from './constants';
|
|
19
19
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
20
20
|
import Logger from '../utils/Logger';
|
|
21
|
+
import type { BaseEllipsis } from './foundation';
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
export function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean) {
|
|
@@ -479,4 +480,9 @@ export function getRTLAlign(align: typeof strings.ALIGNS[number], direction?: 'l
|
|
|
479
480
|
}
|
|
480
481
|
}
|
|
481
482
|
return align;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export function shouldShowEllipsisTitle(ellipsis: BaseEllipsis) {
|
|
486
|
+
const shouldShowTitle = ellipsis === true || get(ellipsis, 'showTitle', true);
|
|
487
|
+
return shouldShowTitle;
|
|
482
488
|
}
|
package/timePicker/foundation.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
transformToArray,
|
|
11
11
|
isTimeFormatLike
|
|
12
12
|
} from './utils';
|
|
13
|
-
import { split } from 'lodash';
|
|
13
|
+
import { split, isUndefined } from 'lodash';
|
|
14
14
|
import { isValid, format, getHours } from 'date-fns';
|
|
15
15
|
import { utcToZonedTime, zonedTimeToUtc } from '../utils/date-fns-extra';
|
|
16
16
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
@@ -182,7 +182,7 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
182
182
|
isAM[index] = panelIsAM;
|
|
183
183
|
const inputValue = this.formatValue(value);
|
|
184
184
|
|
|
185
|
-
if (this.getState('isAM')[index] !== result.isAM){
|
|
185
|
+
if (this.getState('isAM')[index] !== result.isAM) {
|
|
186
186
|
this.setState({ isAM } as any);
|
|
187
187
|
}
|
|
188
188
|
if (!this._isControlledComponent('value')) {
|
|
@@ -369,7 +369,16 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
if (_dates && Array.isArray(_dates)) {
|
|
372
|
-
|
|
372
|
+
const result = _dates.map(date => {
|
|
373
|
+
let str;
|
|
374
|
+
if (isUndefined(date)) {
|
|
375
|
+
str = '';
|
|
376
|
+
} else {
|
|
377
|
+
str = formatToString(date, validFormat, dateFnsLocale);
|
|
378
|
+
}
|
|
379
|
+
return str;
|
|
380
|
+
});
|
|
381
|
+
return result.join(rangeSeparator);
|
|
373
382
|
}
|
|
374
383
|
return undefined;
|
|
375
384
|
}
|
|
@@ -123,12 +123,25 @@ $module: #{$prefix}-typography;
|
|
|
123
123
|
display: -webkit-box;
|
|
124
124
|
-webkit-box-orient: vertical;
|
|
125
125
|
overflow: hidden;
|
|
126
|
+
|
|
127
|
+
&.#{$module}-ellipsis-multiple-line-text {
|
|
128
|
+
// inline-block only works in the Text component, keeping the original external inline performance
|
|
129
|
+
display: -webkit-inline-box;
|
|
130
|
+
}
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
&-ellipsis-overflow-ellipsis {
|
|
129
134
|
display: block;
|
|
130
135
|
white-space: nowrap;
|
|
131
136
|
text-overflow: ellipsis;
|
|
137
|
+
|
|
138
|
+
&.#{$module}-ellipsis-overflow-ellipsis-text {
|
|
139
|
+
// inline-block only works in the Text component, keeping the original external inline performance
|
|
140
|
+
display: inline-block;
|
|
141
|
+
// Ensure that Text component can be limited by the parent's width when no specific width is set
|
|
142
|
+
max-width: 100%;
|
|
143
|
+
vertical-align: top;
|
|
144
|
+
}
|
|
132
145
|
}
|
|
133
146
|
|
|
134
147
|
&-ellipsis-expand {
|
package/utils/date-fns-extra.ts
CHANGED
|
@@ -52,6 +52,40 @@ export const IANAOffsetMap = [
|
|
|
52
52
|
[14, ['Pacific/Kiritimati']],
|
|
53
53
|
];
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Etc/GMT* no DST
|
|
57
|
+
* @see https://data.iana.org/time-zones/tzdb/etcetera
|
|
58
|
+
*/
|
|
59
|
+
const IANAEtcGMTOffsetMap = {
|
|
60
|
+
'0': 'Etc/GMT',
|
|
61
|
+
'1': 'Etc/GMT-1',
|
|
62
|
+
'2': 'Etc/GMT-2',
|
|
63
|
+
'3': 'Etc/GMT-3',
|
|
64
|
+
'4': 'Etc/GMT-4',
|
|
65
|
+
'5': 'Etc/GMT-5',
|
|
66
|
+
'6': 'Etc/GMT-6',
|
|
67
|
+
'7': 'Etc/GMT-7',
|
|
68
|
+
'8': 'Etc/GMT-8',
|
|
69
|
+
'9': 'Etc/GMT-9',
|
|
70
|
+
'10': 'Etc/GMT-10',
|
|
71
|
+
'11': 'Etc/GMT-11',
|
|
72
|
+
'12': 'Etc/GMT-12',
|
|
73
|
+
'13': 'Etc/GMT-13',
|
|
74
|
+
'14': 'Etc/GMT-14',
|
|
75
|
+
'-1': 'Etc/GMT+1',
|
|
76
|
+
'-2': 'Etc/GMT+2',
|
|
77
|
+
'-3': 'Etc/GMT+3',
|
|
78
|
+
'-4': 'Etc/GMT+4',
|
|
79
|
+
'-5': 'Etc/GMT+5',
|
|
80
|
+
'-6': 'Etc/GMT+6',
|
|
81
|
+
'-7': 'Etc/GMT+7',
|
|
82
|
+
'-8': 'Etc/GMT+8',
|
|
83
|
+
'-9': 'Etc/GMT+9',
|
|
84
|
+
'-10': 'Etc/GMT+10',
|
|
85
|
+
'-11': 'Etc/GMT+11',
|
|
86
|
+
'-12': 'Etc/GMT+12',
|
|
87
|
+
};
|
|
88
|
+
|
|
55
89
|
const GMTStringReg = /([\-\+]{1})(\d{2})\:(\d{2})/;
|
|
56
90
|
|
|
57
91
|
/**
|
|
@@ -74,11 +108,33 @@ export const toIANA = (tz: string | number) => {
|
|
|
74
108
|
}
|
|
75
109
|
|
|
76
110
|
if (typeof tz === 'number') {
|
|
111
|
+
// if tz can be transformed to a Etc/GMT* and browser supports it
|
|
112
|
+
if (tz in IANAEtcGMTOffsetMap) {
|
|
113
|
+
const etcGMTtimeZone = IANAEtcGMTOffsetMap[tz];
|
|
114
|
+
if (isValidTimezoneIANAString(etcGMTtimeZone)) {
|
|
115
|
+
return etcGMTtimeZone;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
77
118
|
const found = IANAOffsetMap.find(item => item[0] === tz);
|
|
78
119
|
return found && found[1][0];
|
|
79
120
|
}
|
|
80
121
|
};
|
|
81
122
|
|
|
123
|
+
const validIANATimezoneCache = {};
|
|
124
|
+
/**
|
|
125
|
+
* @see https://github.com/marnusw/date-fns-tz/blob/a92e0ad017d101a0c50e39a63ef5d322b4d849f6/src/_lib/tzParseTimezone/index.js#L137
|
|
126
|
+
*/
|
|
127
|
+
export function isValidTimezoneIANAString(timeZoneString: string) {
|
|
128
|
+
if (validIANATimezoneCache[timeZoneString]) return true;
|
|
129
|
+
try {
|
|
130
|
+
new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString });
|
|
131
|
+
validIANATimezoneCache[timeZoneString] = true;
|
|
132
|
+
return true;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
82
138
|
/**
|
|
83
139
|
*
|
|
84
140
|
* @param {string | number | Date} date
|