@douyinfe/semi-foundation 2.1.5 → 2.2.0
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/cascader/cascader.scss +1 -1
- package/cascader/constants.ts +4 -0
- package/cascader/foundation.ts +29 -15
- package/cascader/util.ts +13 -0
- package/datePicker/_utils/parser.ts +4 -3
- package/datePicker/datePicker.scss +18 -0
- package/datePicker/monthsGridFoundation.ts +101 -8
- package/gulpfile.js +3 -1
- package/lib/cjs/cascader/cascader.css +2 -2
- package/lib/cjs/cascader/cascader.scss +1 -1
- package/lib/cjs/cascader/constants.d.ts +3 -0
- package/lib/cjs/cascader/constants.js +6 -1
- package/lib/cjs/cascader/foundation.d.ts +4 -1
- package/lib/cjs/cascader/foundation.js +24 -11
- package/lib/cjs/cascader/util.d.ts +1 -0
- package/lib/cjs/cascader/util.js +17 -0
- package/lib/cjs/datePicker/_utils/parser.d.ts +6 -1
- package/lib/cjs/datePicker/_utils/parser.js +3 -1
- package/lib/cjs/datePicker/datePicker.css +6 -1
- package/lib/cjs/datePicker/datePicker.scss +18 -0
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +35 -3
- package/lib/cjs/datePicker/monthsGridFoundation.js +139 -6
- package/lib/cjs/navigation/navigation.css +0 -1
- package/lib/cjs/notification/notification.css +8 -4
- package/lib/cjs/notification/notification.scss +9 -5
- package/lib/cjs/notification/variables.scss +1 -0
- package/lib/cjs/select/foundation.d.ts +10 -1
- package/lib/cjs/select/foundation.js +11 -9
- package/lib/cjs/select/select.scss +1 -1
- package/lib/cjs/timeline/timeline.css +3 -0
- package/lib/cjs/timeline/timeline.scss +5 -1
- package/lib/cjs/tree/treeUtil.js +14 -14
- package/lib/cjs/upload/foundation.d.ts +1 -0
- package/lib/cjs/upload/foundation.js +106 -0
- package/lib/cjs/upload/rtl.scss +0 -4
- package/lib/cjs/upload/upload.css +30 -18
- package/lib/cjs/upload/upload.scss +31 -8
- package/lib/cjs/upload/variables.scss +5 -1
- package/lib/es/cascader/cascader.css +2 -2
- package/lib/es/cascader/cascader.scss +1 -1
- package/lib/es/cascader/constants.d.ts +3 -0
- package/lib/es/cascader/constants.js +6 -1
- package/lib/es/cascader/foundation.d.ts +4 -1
- package/lib/es/cascader/foundation.js +24 -12
- package/lib/es/cascader/util.d.ts +1 -0
- package/lib/es/cascader/util.js +14 -0
- package/lib/es/datePicker/_utils/parser.d.ts +6 -1
- package/lib/es/datePicker/_utils/parser.js +3 -1
- package/lib/es/datePicker/datePicker.css +6 -1
- package/lib/es/datePicker/datePicker.scss +18 -0
- package/lib/es/datePicker/monthsGridFoundation.d.ts +35 -3
- package/lib/es/datePicker/monthsGridFoundation.js +139 -6
- package/lib/es/navigation/navigation.css +0 -1
- package/lib/es/notification/notification.css +8 -4
- package/lib/es/notification/notification.scss +9 -5
- package/lib/es/notification/variables.scss +1 -0
- package/lib/es/select/foundation.d.ts +10 -1
- package/lib/es/select/foundation.js +12 -9
- package/lib/es/select/select.scss +1 -1
- package/lib/es/timeline/timeline.css +3 -0
- package/lib/es/timeline/timeline.scss +5 -1
- package/lib/es/tree/treeUtil.js +13 -12
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +107 -0
- package/lib/es/upload/rtl.scss +0 -4
- package/lib/es/upload/upload.css +30 -18
- package/lib/es/upload/upload.scss +31 -8
- package/lib/es/upload/variables.scss +5 -1
- package/notification/notification.scss +9 -5
- package/notification/variables.scss +1 -0
- package/package.json +4 -4
- package/select/foundation.ts +11 -9
- package/select/select.scss +1 -1
- package/timeline/timeline.scss +5 -1
- package/tree/treeUtil.ts +6 -2
- package/upload/foundation.ts +81 -0
- package/upload/rtl.scss +0 -4
- package/upload/upload.scss +31 -8
- package/upload/variables.scss +5 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
1
|
/* shadow */
|
|
3
2
|
/* sizing */
|
|
4
3
|
/* spacing */
|
|
@@ -72,6 +71,9 @@
|
|
|
72
71
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
73
72
|
min-height: 24px;
|
|
74
73
|
}
|
|
74
|
+
.semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
75
|
+
min-height: 216px;
|
|
76
|
+
}
|
|
75
77
|
.semi-datepicker-panel-yam {
|
|
76
78
|
max-width: 284px;
|
|
77
79
|
}
|
|
@@ -561,6 +563,9 @@
|
|
|
561
563
|
.semi-datepicker-compact .semi-datepicker-month-grid .semi-scrolllist-item-wheel .semi-scrolllist-shade-post {
|
|
562
564
|
margin-top: 17px;
|
|
563
565
|
}
|
|
566
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
567
|
+
min-height: 168px;
|
|
568
|
+
}
|
|
564
569
|
.semi-datepicker-compact.semi-datepicker-panel-yam .semi-scrolllist {
|
|
565
570
|
font-size: 12px;
|
|
566
571
|
line-height: 16px;
|
|
@@ -94,6 +94,15 @@ $module: #{$prefix}-datepicker;
|
|
|
94
94
|
min-height: $height-datepicker_timepicker_header_min;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
// 为了防止 scrollList 因为 weeks 变化高度发生变化导致年月可能发生滚动
|
|
99
|
+
// In order to prevent scrollList from scrolling due to changes in the height of weeks, the year and month may be scrolled
|
|
100
|
+
&[x-panel-yearandmonth-open-type="left"],
|
|
101
|
+
&[x-panel-yearandmonth-open-type="right"] {
|
|
102
|
+
.#{$module}-weeks {
|
|
103
|
+
min-height: 6 * $width-datepicker_day;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
// 年月选择器
|
|
@@ -833,6 +842,15 @@ $module: #{$prefix}-datepicker;
|
|
|
833
842
|
}
|
|
834
843
|
}
|
|
835
844
|
}
|
|
845
|
+
|
|
846
|
+
// 为了防止 scrollList 因为 weeks 变化高度发生变化导致年月可能发生滚动
|
|
847
|
+
// In order to prevent scrollList from scrolling due to changes in the height of weeks, the year and month may be scrolled
|
|
848
|
+
&[x-panel-yearandmonth-open-type="left"],
|
|
849
|
+
&[x-panel-yearandmonth-open-type="right"] {
|
|
850
|
+
.#{$module}-weeks {
|
|
851
|
+
min-height: 6 * $width-datepicker_day_compact;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
836
854
|
}
|
|
837
855
|
|
|
838
856
|
// 年月选择器
|
|
@@ -13,6 +13,7 @@ interface MonthsGridElementProps {
|
|
|
13
13
|
renderFullDate?: () => React.ReactNode;
|
|
14
14
|
}
|
|
15
15
|
export declare type PanelType = 'left' | 'right';
|
|
16
|
+
export declare type YearMonthChangeType = 'prevMonth' | 'nextMonth' | 'prevYear' | 'nextYear';
|
|
16
17
|
export interface MonthsGridFoundationProps extends MonthsGridElementProps {
|
|
17
18
|
type?: Type;
|
|
18
19
|
defaultValue?: ValueType;
|
|
@@ -104,11 +105,34 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
104
105
|
_initDateTimePickerFromValue(values: BaseValueType[]): void;
|
|
105
106
|
_initDateTimeRangePickerFormValue(values: BaseValueType[]): void;
|
|
106
107
|
destroy(): void;
|
|
108
|
+
/**
|
|
109
|
+
* sync change another panel month when change months from the else yam panel
|
|
110
|
+
* call it when
|
|
111
|
+
* - current change panel targe date month is same with another panel date
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
115
|
+
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
116
|
+
*/
|
|
117
|
+
handleSyncChangeMonths(options: {
|
|
118
|
+
panelType: PanelType;
|
|
119
|
+
target: Date;
|
|
120
|
+
}): void;
|
|
121
|
+
/**
|
|
122
|
+
* Get the target date based on the panel type and switch type
|
|
123
|
+
*/
|
|
124
|
+
getTargetChangeDate(options: {
|
|
125
|
+
panelType: PanelType;
|
|
126
|
+
switchType: YearMonthChangeType;
|
|
127
|
+
}): Date;
|
|
128
|
+
/**
|
|
129
|
+
* Change month by yam panel
|
|
130
|
+
*/
|
|
107
131
|
toMonth(panelType: PanelType, target: Date): void;
|
|
108
132
|
toYear(panelType: PanelType, target: Date): void;
|
|
109
133
|
toYearMonth(panelType: PanelType, target: Date): void;
|
|
110
134
|
isRangeType(type?: Type): boolean;
|
|
111
|
-
|
|
135
|
+
handleSwitchMonthOrYear(switchType: YearMonthChangeType, panelType: PanelType): void;
|
|
112
136
|
prevMonth(panelType: PanelType): void;
|
|
113
137
|
nextMonth(panelType: PanelType): void;
|
|
114
138
|
prevYear(panelType: PanelType): void;
|
|
@@ -158,13 +182,13 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
158
182
|
notifyValue: any;
|
|
159
183
|
notifyDate: any;
|
|
160
184
|
};
|
|
161
|
-
handleYearOrMonthChange(type:
|
|
185
|
+
handleYearOrMonthChange(type: YearMonthChangeType, panelType?: PanelType, step?: number, notSeparateInRange?: boolean): void;
|
|
162
186
|
/**
|
|
163
187
|
* You have chosen to switch the year and month in the future to directly update the Date without closing the date panel
|
|
164
188
|
* @param {*} type
|
|
165
189
|
* @param {*} targetDate
|
|
166
190
|
*/
|
|
167
|
-
updateDateAfterChangeYM(type:
|
|
191
|
+
updateDateAfterChangeYM(type: YearMonthChangeType, targetDate: Date): void;
|
|
168
192
|
_isMultiple(): boolean;
|
|
169
193
|
_isRange(): void;
|
|
170
194
|
handleDayClick(day: MonthDayInfo, panelType: PanelType): void;
|
|
@@ -214,5 +238,13 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
214
238
|
showYearPicker(panelType: PanelType): void;
|
|
215
239
|
showTimePicker(panelType: PanelType, opt?: boolean): void;
|
|
216
240
|
showDatePanel(panelType: PanelType): void;
|
|
241
|
+
/**
|
|
242
|
+
* Get year and month panel open type
|
|
243
|
+
*
|
|
244
|
+
* It is useful info to set minHeight of weeks.
|
|
245
|
+
* - When yam open type is 'left' or 'right', weeks minHeight should be set
|
|
246
|
+
* If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
|
|
247
|
+
*/
|
|
248
|
+
getYAMOpenType(): "left" | "right" | "none" | "both";
|
|
217
249
|
}
|
|
218
250
|
export {};
|
|
@@ -241,11 +241,99 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
destroy() {}
|
|
244
|
+
/**
|
|
245
|
+
* sync change another panel month when change months from the else yam panel
|
|
246
|
+
* call it when
|
|
247
|
+
* - current change panel targe date month is same with another panel date
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
251
|
+
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
handleSyncChangeMonths(options) {
|
|
256
|
+
const {
|
|
257
|
+
panelType,
|
|
258
|
+
target
|
|
259
|
+
} = options;
|
|
260
|
+
|
|
261
|
+
const {
|
|
262
|
+
type
|
|
263
|
+
} = this._adapter.getProps();
|
|
264
|
+
|
|
265
|
+
const {
|
|
266
|
+
monthLeft,
|
|
267
|
+
monthRight
|
|
268
|
+
} = this._adapter.getStates();
|
|
269
|
+
|
|
270
|
+
if (this.isRangeType(type)) {
|
|
271
|
+
if (panelType === 'right' && (0, _dateFns.differenceInCalendarMonths)(target, monthLeft.pickerDate) === 0) {
|
|
272
|
+
this.handleYearOrMonthChange('prevMonth', 'left', 1, true);
|
|
273
|
+
} else if (panelType === 'left' && (0, _dateFns.differenceInCalendarMonths)(monthRight.pickerDate, target) === 0) {
|
|
274
|
+
this.handleYearOrMonthChange('nextMonth', 'right', 1, true);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get the target date based on the panel type and switch type
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
getTargetChangeDate(options) {
|
|
284
|
+
const {
|
|
285
|
+
panelType,
|
|
286
|
+
switchType
|
|
287
|
+
} = options;
|
|
288
|
+
|
|
289
|
+
const {
|
|
290
|
+
monthRight,
|
|
291
|
+
monthLeft
|
|
292
|
+
} = this._adapter.getStates();
|
|
293
|
+
|
|
294
|
+
const currentDate = panelType === 'left' ? monthLeft.pickerDate : monthRight.pickerDate;
|
|
295
|
+
let target;
|
|
296
|
+
|
|
297
|
+
switch (switchType) {
|
|
298
|
+
case 'prevMonth':
|
|
299
|
+
target = (0, _dateFns.addMonths)(currentDate, -1);
|
|
300
|
+
break;
|
|
301
|
+
|
|
302
|
+
case 'nextMonth':
|
|
303
|
+
target = (0, _dateFns.addMonths)(currentDate, 1);
|
|
304
|
+
break;
|
|
305
|
+
|
|
306
|
+
case 'prevYear':
|
|
307
|
+
target = (0, _dateFns.addYears)(currentDate, -1);
|
|
308
|
+
break;
|
|
309
|
+
|
|
310
|
+
case 'nextYear':
|
|
311
|
+
target = (0, _dateFns.addYears)(currentDate, 1);
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return target;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Change month by yam panel
|
|
319
|
+
*/
|
|
320
|
+
|
|
244
321
|
|
|
245
322
|
toMonth(panelType, target) {
|
|
323
|
+
const {
|
|
324
|
+
type
|
|
325
|
+
} = this._adapter.getProps();
|
|
326
|
+
|
|
246
327
|
const diff = this._getDiff('month', target, panelType);
|
|
247
328
|
|
|
248
329
|
this.handleYearOrMonthChange(diff < 0 ? 'prevMonth' : 'nextMonth', panelType, Math.abs(diff), false);
|
|
330
|
+
|
|
331
|
+
if (this.isRangeType(type)) {
|
|
332
|
+
this.handleSyncChangeMonths({
|
|
333
|
+
panelType,
|
|
334
|
+
target
|
|
335
|
+
});
|
|
336
|
+
}
|
|
249
337
|
}
|
|
250
338
|
|
|
251
339
|
toYear(panelType, target) {
|
|
@@ -267,34 +355,51 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
267
355
|
return typeof realType === 'string' && /range/i.test(realType);
|
|
268
356
|
}
|
|
269
357
|
|
|
270
|
-
|
|
358
|
+
handleSwitchMonthOrYear(switchType, panelType) {
|
|
271
359
|
const {
|
|
272
360
|
type,
|
|
273
361
|
syncSwitchMonth
|
|
274
362
|
} = this.getProps();
|
|
363
|
+
const rangeType = this.isRangeType(type); // range type and syncSwitchMonth, we should change panels at same time
|
|
275
364
|
|
|
276
|
-
if (
|
|
365
|
+
if (rangeType && syncSwitchMonth) {
|
|
277
366
|
this.handleYearOrMonthChange(switchType, 'left', 1, true);
|
|
278
367
|
this.handleYearOrMonthChange(switchType, 'right', 1, true);
|
|
279
368
|
} else {
|
|
280
369
|
this.handleYearOrMonthChange(switchType, panelType);
|
|
370
|
+
/**
|
|
371
|
+
* default behavior (v2.2.0)
|
|
372
|
+
* In order to prevent the two panels from being the same month, this will confuse the user when selecting the range
|
|
373
|
+
* https://github.com/DouyinFE/semi-design/issues/260
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
if (rangeType) {
|
|
377
|
+
const target = this.getTargetChangeDate({
|
|
378
|
+
panelType,
|
|
379
|
+
switchType
|
|
380
|
+
});
|
|
381
|
+
this.handleSyncChangeMonths({
|
|
382
|
+
panelType,
|
|
383
|
+
target
|
|
384
|
+
});
|
|
385
|
+
}
|
|
281
386
|
}
|
|
282
387
|
}
|
|
283
388
|
|
|
284
389
|
prevMonth(panelType) {
|
|
285
|
-
this.
|
|
390
|
+
this.handleSwitchMonthOrYear('prevMonth', panelType);
|
|
286
391
|
}
|
|
287
392
|
|
|
288
393
|
nextMonth(panelType) {
|
|
289
|
-
this.
|
|
394
|
+
this.handleSwitchMonthOrYear('nextMonth', panelType);
|
|
290
395
|
}
|
|
291
396
|
|
|
292
397
|
prevYear(panelType) {
|
|
293
|
-
this.
|
|
398
|
+
this.handleSwitchMonthOrYear('prevYear', panelType);
|
|
294
399
|
}
|
|
295
400
|
|
|
296
401
|
nextYear(panelType) {
|
|
297
|
-
this.
|
|
402
|
+
this.handleSwitchMonthOrYear('nextYear', panelType);
|
|
298
403
|
}
|
|
299
404
|
/**
|
|
300
405
|
* Calculate the year and month difference
|
|
@@ -948,6 +1053,34 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
948
1053
|
isYearPickerOpen: false
|
|
949
1054
|
});
|
|
950
1055
|
}
|
|
1056
|
+
/**
|
|
1057
|
+
* Get year and month panel open type
|
|
1058
|
+
*
|
|
1059
|
+
* It is useful info to set minHeight of weeks.
|
|
1060
|
+
* - When yam open type is 'left' or 'right', weeks minHeight should be set
|
|
1061
|
+
* If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
|
|
1062
|
+
*/
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
getYAMOpenType() {
|
|
1066
|
+
const {
|
|
1067
|
+
monthLeft,
|
|
1068
|
+
monthRight
|
|
1069
|
+
} = this._adapter.getStates();
|
|
1070
|
+
|
|
1071
|
+
const leftYearPickerOpen = monthLeft.isYearPickerOpen;
|
|
1072
|
+
const rightYearPickerOpen = monthRight.isYearPickerOpen;
|
|
1073
|
+
|
|
1074
|
+
if (leftYearPickerOpen && rightYearPickerOpen) {
|
|
1075
|
+
return 'both';
|
|
1076
|
+
} else if (leftYearPickerOpen) {
|
|
1077
|
+
return 'left';
|
|
1078
|
+
} else if (rightYearPickerOpen) {
|
|
1079
|
+
return 'right';
|
|
1080
|
+
} else {
|
|
1081
|
+
return 'none';
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
951
1084
|
|
|
952
1085
|
}
|
|
953
1086
|
|
|
@@ -79,19 +79,23 @@
|
|
|
79
79
|
color: var(--semi-color-success);
|
|
80
80
|
}
|
|
81
81
|
.semi-notification-notice-light.semi-notification-notice-warning {
|
|
82
|
-
background-
|
|
82
|
+
background-image: linear-gradient(0deg, var(--semi-color-warning-light-default), var(--semi-color-warning-light-default));
|
|
83
|
+
background-color: var(--semi-color-bg-0);
|
|
83
84
|
border: 1px solid var(--semi-color-warning);
|
|
84
85
|
}
|
|
85
86
|
.semi-notification-notice-light.semi-notification-notice-success {
|
|
86
|
-
background-
|
|
87
|
+
background-image: linear-gradient(0deg, var(--semi-color-success-light-default), var(--semi-color-success-light-default));
|
|
88
|
+
background-color: var(--semi-color-bg-0);
|
|
87
89
|
border: 1px solid var(--semi-color-success);
|
|
88
90
|
}
|
|
89
91
|
.semi-notification-notice-light.semi-notification-notice-info, .semi-notification-notice-light.semi-notification-notice-default {
|
|
90
|
-
background-
|
|
92
|
+
background-image: linear-gradient(0deg, var(--semi-color-info-light-default), var(--semi-color-info-light-default));
|
|
93
|
+
background-color: var(--semi-color-bg-0);
|
|
91
94
|
border: 1px solid var(--semi-color-info);
|
|
92
95
|
}
|
|
93
96
|
.semi-notification-notice-light.semi-notification-notice-error {
|
|
94
|
-
background-
|
|
97
|
+
background-image: linear-gradient(0deg, var(--semi-color-danger-light-default), var(--semi-color-danger-light-default));
|
|
98
|
+
background-color: var(--semi-color-bg-0);
|
|
95
99
|
border: 1px solid var(--semi-color-danger);
|
|
96
100
|
}
|
|
97
101
|
.semi-notification-notice-title {
|
|
@@ -93,23 +93,27 @@ $module: #{$prefix}-notification;
|
|
|
93
93
|
|
|
94
94
|
&-light {
|
|
95
95
|
&.#{$module}-notice-warning {
|
|
96
|
-
background-
|
|
96
|
+
background-image: linear-gradient(0deg, $color-notification_warning_light-bg, $color-notification_warning_light-bg);
|
|
97
|
+
background-color: $color-notification_ambient-bg;
|
|
97
98
|
border: $width-notification_notice-border solid $color-notification_warning_light-border;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&.#{$module}-notice-success {
|
|
101
|
-
background-
|
|
102
|
+
background-image: linear-gradient(0deg, $color-notification_success_light-bg, $color-notification_success_light-bg);
|
|
103
|
+
background-color: $color-notification_ambient-bg;
|
|
102
104
|
border: $width-notification_notice-border solid $color-notification_success_light-border;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
&.#{$module}-notice-info,
|
|
106
108
|
&.#{$module}-notice-default {
|
|
107
|
-
background-
|
|
109
|
+
background-image: linear-gradient(0deg, $color-notification_info_light-bg, $color-notification_info_light-bg);
|
|
110
|
+
background-color: $color-notification_ambient-bg;
|
|
108
111
|
border: $width-notification_notice-border solid $color-notification_info_light-border;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
&.#{$module}-notice-error {
|
|
112
|
-
background-
|
|
115
|
+
background-image: linear-gradient(0deg, $color-notification_danger_light-bg, $color-notification_danger_light-bg);
|
|
116
|
+
background-color: $color-notification_ambient-bg;
|
|
113
117
|
border: $width-notification_notice-border solid $color-notification_danger_light-border;
|
|
114
118
|
}
|
|
115
119
|
}
|
|
@@ -165,4 +169,4 @@ $module: #{$prefix}-notification;
|
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
@import "./rtl.scss";
|
|
172
|
+
@import "./rtl.scss";
|
|
@@ -15,6 +15,7 @@ $color-notification_info_light-bg: var(--semi-color-info-light-default); // 彩
|
|
|
15
15
|
$color-notification_info_light-border: var(--semi-color-info); // 彩色通知信息描边色
|
|
16
16
|
$color-notification_danger_light-bg: var(--semi-color-danger-light-default); // 彩色通知危险背景色
|
|
17
17
|
$color-notification_danger_light-border: var(--semi-color-danger); // 彩色通知危险描边色
|
|
18
|
+
$color-notification_ambient-bg: var(--semi-color-bg-0); // 透明背景色叠加层(与bg0保持一致不建议修改)
|
|
18
19
|
|
|
19
20
|
// Width/Height
|
|
20
21
|
$width-notification_notice: auto; // 通知宽度
|
|
@@ -82,7 +82,16 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
82
82
|
_handleEnterKeyDown(event: KeyboardEvent): void;
|
|
83
83
|
_handleBackspaceKeyDown(): void;
|
|
84
84
|
_notifyChange(selections: Map<any, any>): void;
|
|
85
|
-
_removeInternalKey(option: BasicOptionProps):
|
|
85
|
+
_removeInternalKey(option: BasicOptionProps): {
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
value?: string | number;
|
|
88
|
+
label?: unknown;
|
|
89
|
+
children?: unknown;
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
showTick?: boolean;
|
|
92
|
+
className?: string;
|
|
93
|
+
style?: Record<string, any>;
|
|
94
|
+
};
|
|
86
95
|
_notifySelect(value: BasicOptionProps['value'], option: BasicOptionProps): void;
|
|
87
96
|
_notifyDeselect(value: BasicOptionProps['value'], option: BasicOptionProps): void;
|
|
88
97
|
_diffSelections(selections: Map<any, any>, oldSelections: Map<any, any>, isMultiple: boolean): boolean;
|
|
@@ -1038,17 +1038,19 @@ class SelectFoundation extends _foundation.default {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
_removeInternalKey(option) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
delete
|
|
1044
|
-
delete
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1041
|
+
// eslint-disable-next-line
|
|
1042
|
+
let newOption = (0, _assign.default)({}, option);
|
|
1043
|
+
delete newOption._parentGroup;
|
|
1044
|
+
delete newOption._show;
|
|
1045
|
+
delete newOption._selected;
|
|
1046
|
+
delete newOption._scrollIndex;
|
|
1047
|
+
|
|
1048
|
+
if ('_keyInOptionList' in newOption) {
|
|
1049
|
+
newOption.key = newOption._keyInOptionList;
|
|
1050
|
+
delete newOption._keyInOptionList;
|
|
1049
1051
|
}
|
|
1050
1052
|
|
|
1051
|
-
return
|
|
1053
|
+
return newOption;
|
|
1052
1054
|
}
|
|
1053
1055
|
|
|
1054
1056
|
_notifySelect(value, option) {
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
.semi-timeline-alternate .semi-timeline-item-tail, .semi-timeline-alternate .semi-timeline-item-head, .semi-timeline-alternate .semi-timeline-item-head-custom, .semi-timeline-right .semi-timeline-item-tail, .semi-timeline-right .semi-timeline-item-head, .semi-timeline-right .semi-timeline-item-head-custom, .semi-timeline-center .semi-timeline-item-tail, .semi-timeline-center .semi-timeline-item-head, .semi-timeline-center .semi-timeline-item-head-custom {
|
|
97
97
|
left: 50%;
|
|
98
98
|
}
|
|
99
|
+
.semi-timeline-alternate .semi-timeline-item-head.semi-timeline-item-head-custom, .semi-timeline-right .semi-timeline-item-head.semi-timeline-item-head-custom, .semi-timeline-center .semi-timeline-item-head.semi-timeline-item-head-custom {
|
|
100
|
+
margin-left: 0;
|
|
101
|
+
}
|
|
99
102
|
.semi-timeline-alternate .semi-timeline-item-head, .semi-timeline-right .semi-timeline-item-head, .semi-timeline-center .semi-timeline-item-head {
|
|
100
103
|
margin-left: -4px;
|
|
101
104
|
}
|
|
@@ -120,7 +120,11 @@ $module: #{$prefix}-timeline;
|
|
|
120
120
|
&-head-custom {
|
|
121
121
|
left: $spacing-timeline_item_head_custom-left;
|
|
122
122
|
}
|
|
123
|
-
|
|
123
|
+
&-head{
|
|
124
|
+
&.#{$module}-item-head-custom{
|
|
125
|
+
margin-left: 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
124
128
|
&-head {
|
|
125
129
|
margin-left: $spacing-timeline_item_head-marginLeft;
|
|
126
130
|
}
|
package/lib/cjs/tree/treeUtil.js
CHANGED
|
@@ -57,12 +57,10 @@ var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stab
|
|
|
57
57
|
|
|
58
58
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
59
59
|
|
|
60
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
61
|
-
|
|
62
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
63
|
-
|
|
64
60
|
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
65
61
|
|
|
62
|
+
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
63
|
+
|
|
66
64
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
|
67
65
|
|
|
68
66
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
@@ -557,7 +555,7 @@ function normalizedArr(val) {
|
|
|
557
555
|
|
|
558
556
|
function normalizeKeyList(keyList, keyEntities) {
|
|
559
557
|
let leafOnly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
560
|
-
|
|
558
|
+
const res = [];
|
|
561
559
|
const keyListSet = new _set.default(keyList);
|
|
562
560
|
|
|
563
561
|
if (!leafOnly) {
|
|
@@ -577,9 +575,11 @@ function normalizeKeyList(keyList, keyEntities) {
|
|
|
577
575
|
res.push(key);
|
|
578
576
|
});
|
|
579
577
|
} else {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
(0, _forEach.default)(keyList).call(keyList, key => {
|
|
579
|
+
if (keyEntities[key] && !isValid(keyEntities[key].children)) {
|
|
580
|
+
res.push(key);
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
return res;
|
|
@@ -589,9 +589,9 @@ function getMotionKeys(eventKey, expandedKeys, keyEntities) {
|
|
|
589
589
|
const res = [];
|
|
590
590
|
|
|
591
591
|
const getChild = itemKey => {
|
|
592
|
-
var
|
|
592
|
+
var _context8;
|
|
593
593
|
|
|
594
|
-
keyEntities[itemKey].children && (0, _forEach.default)(
|
|
594
|
+
keyEntities[itemKey].children && (0, _forEach.default)(_context8 = keyEntities[itemKey].children).call(_context8, item => {
|
|
595
595
|
const {
|
|
596
596
|
key
|
|
597
597
|
} = item;
|
|
@@ -707,7 +707,7 @@ function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedK
|
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
function filterTreeData(info) {
|
|
710
|
-
var
|
|
710
|
+
var _context9, _context10;
|
|
711
711
|
|
|
712
712
|
const {
|
|
713
713
|
showFilteredOnly,
|
|
@@ -719,7 +719,7 @@ function filterTreeData(info) {
|
|
|
719
719
|
prevExpandedKeys
|
|
720
720
|
} = info;
|
|
721
721
|
let filteredOptsKeys = [];
|
|
722
|
-
filteredOptsKeys = (0, _map.default)(
|
|
722
|
+
filteredOptsKeys = (0, _map.default)(_context9 = (0, _filter.default)(_context10 = (0, _values.default)(keyEntities)).call(_context10, item => filter(inputValue, item.data, filterTreeNode, filterProps))).call(_context9, item => item.key);
|
|
723
723
|
let expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
|
|
724
724
|
|
|
725
725
|
if (prevExpandedKeys.length) {
|
|
@@ -763,9 +763,9 @@ function updateKeys(keySet, keyEntities) {
|
|
|
763
763
|
}
|
|
764
764
|
|
|
765
765
|
function calcDisabledKeys(keyEntities) {
|
|
766
|
-
var
|
|
766
|
+
var _context11;
|
|
767
767
|
|
|
768
|
-
const disabledKeys = (0, _filter.default)(
|
|
768
|
+
const disabledKeys = (0, _filter.default)(_context11 = (0, _keys.default)(keyEntities)).call(_context11, key => keyEntities[key].data.disabled);
|
|
769
769
|
const {
|
|
770
770
|
checkedKeys
|
|
771
771
|
} = calcCheckedKeys(disabledKeys, keyEntities);
|
|
@@ -119,6 +119,7 @@ declare class UploadFoundation<P = Record<string, any>, S = Record<string, any>>
|
|
|
119
119
|
buildFileItem(fileInstance: CustomFile, uploadTrigger: string): BaseFileItem;
|
|
120
120
|
replaceFileList(files: Array<CustomFile>): void;
|
|
121
121
|
addFilesToList(files: Array<CustomFile>): void;
|
|
122
|
+
insertFileToList(files: Array<CustomFile>, index: number): void;
|
|
122
123
|
manualUpload(): void;
|
|
123
124
|
startUpload(fileList: Array<BaseFileItem>): void;
|
|
124
125
|
upload(file: BaseFileItem): void;
|