@douyinfe/semi-foundation 2.1.4 → 2.2.0-beta.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/cascader/cascader.scss +1 -1
- package/cascader/constants.ts +4 -0
- package/cascader/foundation.ts +29 -15
- package/cascader/util.ts +13 -0
- package/checkbox/checkboxFoundation.ts +1 -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/checkbox/checkboxFoundation.d.ts +1 -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/modal/modal.css +1 -1
- package/lib/cjs/modal/modalFoundation.d.ts +2 -2
- package/lib/cjs/modal/variables.scss +1 -1
- 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/sideSheet/sideSheet.css +1 -1
- package/lib/cjs/sideSheet/variables.scss +1 -1
- package/lib/cjs/table/table.css +2 -2
- package/lib/cjs/table/table.scss +2 -2
- package/lib/cjs/table/variables.scss +3 -0
- 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 +31 -19
- package/lib/cjs/upload/upload.scss +31 -8
- package/lib/cjs/upload/variables.scss +6 -2
- 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/checkbox/checkboxFoundation.d.ts +1 -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/modal/modal.css +1 -1
- package/lib/es/modal/modalFoundation.d.ts +2 -2
- package/lib/es/modal/variables.scss +1 -1
- 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/sideSheet/sideSheet.css +1 -1
- package/lib/es/sideSheet/variables.scss +1 -1
- package/lib/es/table/table.css +2 -2
- package/lib/es/table/table.scss +2 -2
- package/lib/es/table/variables.scss +3 -0
- 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 +31 -19
- package/lib/es/upload/upload.scss +31 -8
- package/lib/es/upload/variables.scss +6 -2
- package/modal/modalFoundation.ts +2 -2
- package/modal/variables.scss +1 -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/sideSheet/variables.scss +1 -1
- package/table/table.scss +2 -2
- package/table/variables.scss +3 -0
- 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 +6 -2
|
@@ -37,7 +37,9 @@ function compatiableParse(value, formatToken, baseDate, locale) {
|
|
|
37
37
|
result = new Date(Date.parse(value));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
const yearInvalid = (0, _dateFns.isValid)(result) && String(result.getFullYear()).length > 4;
|
|
41
|
+
|
|
42
|
+
if (!(0, _dateFns.isValid)(result) || yearInvalid) {
|
|
41
43
|
result = null;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -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
|
|
package/lib/cjs/modal/modal.css
CHANGED
|
@@ -26,7 +26,7 @@ export interface ModalProps {
|
|
|
26
26
|
footer?: any;
|
|
27
27
|
hasCancel?: boolean;
|
|
28
28
|
header?: any;
|
|
29
|
-
height?: number;
|
|
29
|
+
height?: string | number;
|
|
30
30
|
mask?: boolean;
|
|
31
31
|
maskClosable?: boolean;
|
|
32
32
|
maskStyle?: Record<string, any>;
|
|
@@ -40,7 +40,7 @@ export interface ModalProps {
|
|
|
40
40
|
style?: Record<string, any>;
|
|
41
41
|
title?: any;
|
|
42
42
|
visible?: boolean;
|
|
43
|
-
width?: number;
|
|
43
|
+
width?: string | number;
|
|
44
44
|
zIndex?: number;
|
|
45
45
|
icon?: any;
|
|
46
46
|
getPopupContainer?: () => HTMLElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Color
|
|
2
2
|
$color-modal-bg: var(--semi-color-bg-2); // 模态框背景颜色
|
|
3
|
-
$color-modal_mask-bg: var(--semi-overlay-bg); // 模态框蒙层颜色
|
|
3
|
+
$color-modal_mask-bg: var(--semi-color-overlay-bg); // 模态框蒙层颜色
|
|
4
4
|
$color-modal_main-text: var(--semi-color-text-0); // 模态框文字颜色
|
|
5
5
|
$color-modal_info-icon: var(--semi-color-info); // 模态框信息图标颜色
|
|
6
6
|
$color-modal_primary-icon: var(--semi-color-primary); // 模态框主要图标颜色
|
|
@@ -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) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Color
|
|
2
|
-
$color-sideSheet_mask-bg: var(--semi-overlay-bg); // 侧边栏打开后蒙层颜色
|
|
2
|
+
$color-sideSheet_mask-bg: var(--semi-color-overlay-bg); // 侧边栏打开后蒙层颜色
|
|
3
3
|
$color-sideSheet-bg: var(--semi-color-bg-2); // 侧边栏背景颜色
|
|
4
4
|
$color-sideSheet_main-text: var(--semi-color-text-0); // 侧边栏默认文本颜色
|
|
5
5
|
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
user-select: none;
|
|
112
112
|
}
|
|
113
113
|
.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 {
|
|
114
|
-
z-index:
|
|
114
|
+
z-index: 101;
|
|
115
115
|
position: sticky;
|
|
116
116
|
background-color: var(--semi-color-bg-2);
|
|
117
117
|
}
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
background-color: var(--semi-color-fill-0);
|
|
226
226
|
}
|
|
227
227
|
.semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left, .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right {
|
|
228
|
-
z-index:
|
|
228
|
+
z-index: 101;
|
|
229
229
|
position: sticky;
|
|
230
230
|
background-color: var(--semi-color-bg-2);
|
|
231
231
|
}
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -104,7 +104,7 @@ $module: #{$prefix}-table;
|
|
|
104
104
|
|
|
105
105
|
&-left,
|
|
106
106
|
&-right {
|
|
107
|
-
z-index:
|
|
107
|
+
z-index: $z-table_fixed_column;
|
|
108
108
|
position: sticky;
|
|
109
109
|
background-color: $color-table-bg-default;
|
|
110
110
|
|
|
@@ -247,7 +247,7 @@ $module: #{$prefix}-table;
|
|
|
247
247
|
|
|
248
248
|
&-left,
|
|
249
249
|
&-right {
|
|
250
|
-
z-index:
|
|
250
|
+
z-index: $z-table_fixed_column;;
|
|
251
251
|
position: sticky;
|
|
252
252
|
background-color: $color-table-bg-default;
|
|
253
253
|
}
|
|
@@ -82,3 +82,6 @@ $shadow-table_right: 3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动
|
|
|
82
82
|
$border-table: #{$width-table_base_border} #{$border-table_base-borderStyle} $color-table-border-default; // 表格默认描边
|
|
83
83
|
$border-table_head-bottom: #{$width-table_header_border} #{$border-table_base-borderStyle} $color-table_th-border-default; // 表头单元格描边 - 底部
|
|
84
84
|
$border-table_resizer: $width-table_resizer_border solid $color-table_resizer-bg-default; // 表格拉伸标识描边
|
|
85
|
+
|
|
86
|
+
$z-table-fixed: 101!default; // fixed列的zIndex值
|
|
87
|
+
$z-table_fixed_column: $z-table-fixed; // fixed列的zIndex值
|
|
@@ -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
|
}
|