@douyinfe/semi-foundation 2.4.0 → 2.5.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 -0
- package/cascader/variables.scss +4 -2
- package/datePicker/foundation.ts +12 -0
- package/lib/cjs/autoComplete/constants.d.ts +1 -1
- package/lib/cjs/cascader/cascader.css +1 -0
- package/lib/cjs/cascader/cascader.scss +1 -0
- package/lib/cjs/cascader/variables.scss +4 -2
- package/lib/cjs/datePicker/foundation.d.ts +5 -0
- package/lib/cjs/datePicker/foundation.js +18 -0
- package/lib/cjs/dropdown/constants.d.ts +1 -1
- package/lib/cjs/select/constants.d.ts +1 -1
- package/lib/cjs/select/foundation.d.ts +1 -1
- package/lib/cjs/select/foundation.js +2 -1
- package/lib/cjs/select/optionFoundation.d.ts +1 -1
- package/lib/cjs/select/optionFoundation.js +3 -3
- package/lib/cjs/slider/foundation.js +2 -2
- package/lib/cjs/table/foundation.d.ts +2 -0
- package/lib/cjs/table/foundation.js +16 -4
- package/lib/cjs/table/utils.js +4 -1
- package/lib/cjs/tagInput/tagInput.css +1 -0
- package/lib/cjs/tagInput/tagInput.scss +3 -2
- package/lib/cjs/tagInput/variables.scss +8 -2
- package/lib/cjs/tooltip/constants.d.ts +1 -1
- package/lib/cjs/tooltip/constants.js +1 -1
- package/lib/cjs/tooltip/foundation.js +65 -4
- package/lib/cjs/tree/foundation.d.ts +4 -1
- package/lib/cjs/tree/foundation.js +69 -20
- package/lib/cjs/treeSelect/foundation.d.ts +3 -3
- package/lib/cjs/treeSelect/foundation.js +103 -35
- package/lib/cjs/upload/upload.css +49 -27
- package/lib/cjs/upload/upload.scss +66 -41
- package/lib/cjs/upload/variables.scss +3 -1
- package/lib/es/autoComplete/constants.d.ts +1 -1
- package/lib/es/cascader/cascader.css +1 -0
- package/lib/es/cascader/cascader.scss +1 -0
- package/lib/es/cascader/variables.scss +4 -2
- package/lib/es/datePicker/foundation.d.ts +5 -0
- package/lib/es/datePicker/foundation.js +18 -0
- package/lib/es/dropdown/constants.d.ts +1 -1
- package/lib/es/select/constants.d.ts +1 -1
- package/lib/es/select/foundation.d.ts +1 -1
- package/lib/es/select/foundation.js +2 -1
- package/lib/es/select/optionFoundation.d.ts +1 -1
- package/lib/es/select/optionFoundation.js +3 -3
- package/lib/es/slider/foundation.js +2 -2
- package/lib/es/table/foundation.d.ts +2 -0
- package/lib/es/table/foundation.js +16 -4
- package/lib/es/table/utils.js +4 -1
- package/lib/es/tagInput/tagInput.css +1 -0
- package/lib/es/tagInput/tagInput.scss +3 -2
- package/lib/es/tagInput/variables.scss +8 -2
- package/lib/es/tooltip/constants.d.ts +1 -1
- package/lib/es/tooltip/constants.js +1 -1
- package/lib/es/tooltip/foundation.js +65 -4
- package/lib/es/tree/foundation.d.ts +4 -1
- package/lib/es/tree/foundation.js +69 -20
- package/lib/es/treeSelect/foundation.d.ts +3 -3
- package/lib/es/treeSelect/foundation.js +102 -35
- package/lib/es/upload/upload.css +49 -27
- package/lib/es/upload/upload.scss +66 -41
- package/lib/es/upload/variables.scss +3 -1
- package/package.json +3 -3
- package/select/foundation.ts +3 -2
- package/select/optionFoundation.ts +3 -3
- package/slider/foundation.ts +2 -2
- package/table/foundation.ts +23 -10
- package/table/utils.ts +3 -1
- package/tagInput/tagInput.scss +3 -2
- package/tagInput/variables.scss +8 -2
- package/tooltip/constants.ts +2 -0
- package/tooltip/foundation.ts +52 -4
- package/tree/foundation.ts +56 -17
- package/treeSelect/foundation.ts +89 -41
- package/upload/upload.scss +66 -41
- package/upload/variables.scss +3 -1
package/cascader/cascader.scss
CHANGED
package/cascader/variables.scss
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
$radius-cascader: var(--semi-border-radius-small); // 级联选择菜单圆角
|
|
2
2
|
|
|
3
|
-
$color-cascader_default-border-default: transparent; // 级联选择描边颜色
|
|
3
|
+
$color-cascader_default-border-default: transparent; // 级联选择描边颜色 - 默认
|
|
4
|
+
$color-cascader_default-border-hover: transparent; // 级联选择描边颜色 - 悬浮
|
|
5
|
+
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
4
6
|
$color-cascader_default-bg-default: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 默认
|
|
5
7
|
$color-cascader_default-bg-hover: var(--semi-color-fill-1); // 级联选择菜单项背景颜色 - 悬浮
|
|
6
|
-
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
7
8
|
$color-cascader_option_list-border-default: var(--semi-color-fill-0); // 级联选择各级菜单分割线颜色
|
|
8
9
|
$color-cascader_option_main-text-default: var(--semi-color-text-0); // 级联选择菜单项文字颜色
|
|
9
10
|
$color-cascader_option-bg-hover: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 悬浮
|
|
@@ -83,6 +84,7 @@ $width-cascader: 80px; // 级联选择触发器最小宽度
|
|
|
83
84
|
$height-cascader_default: $height-control-default; // 级联选择触发器高度 - 默认
|
|
84
85
|
$height-cascader_small: $height-control-small; // 级联选择触发器高度 - 小尺寸
|
|
85
86
|
$height-cascader_large: $height-control-large; // 级联选择触发器高度 - 大尺寸
|
|
87
|
+
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
86
88
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
87
89
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
88
90
|
$width-cascader-icon: 16px; // 级联选择图标尺寸
|
package/datePicker/foundation.ts
CHANGED
|
@@ -384,6 +384,18 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
384
384
|
this._adapter.notifyBlur(e);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/**
|
|
388
|
+
* clear range input focus when open is controlled
|
|
389
|
+
* fixed github 1375
|
|
390
|
+
*/
|
|
391
|
+
clearRangeInputFocus = () => {
|
|
392
|
+
const { type } = this._adapter.getProps();
|
|
393
|
+
const { rangeInputFocus } = this._adapter.getStates();
|
|
394
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
395
|
+
this._adapter.setRangeInputFocus(false);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
387
399
|
/**
|
|
388
400
|
* Callback when the content of the input box changes
|
|
389
401
|
* Update the date panel if the changed value is a legal date, otherwise only update the input box
|
|
@@ -3,7 +3,7 @@ declare const cssClasses: {
|
|
|
3
3
|
};
|
|
4
4
|
declare const strings: {
|
|
5
5
|
readonly SIZE: readonly ["small", "large", "default"];
|
|
6
|
-
readonly POSITION: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
6
|
+
readonly POSITION: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
7
7
|
readonly OPTIONS: readonly ["children", "value"];
|
|
8
8
|
readonly STATUS: readonly ["default", "error", "warning", "success"];
|
|
9
9
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
$radius-cascader: var(--semi-border-radius-small); // 级联选择菜单圆角
|
|
2
2
|
|
|
3
|
-
$color-cascader_default-border-default: transparent; // 级联选择描边颜色
|
|
3
|
+
$color-cascader_default-border-default: transparent; // 级联选择描边颜色 - 默认
|
|
4
|
+
$color-cascader_default-border-hover: transparent; // 级联选择描边颜色 - 悬浮
|
|
5
|
+
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
4
6
|
$color-cascader_default-bg-default: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 默认
|
|
5
7
|
$color-cascader_default-bg-hover: var(--semi-color-fill-1); // 级联选择菜单项背景颜色 - 悬浮
|
|
6
|
-
$color-cascader_default-border-focus: var(--semi-color-focus-border); // 级联选择描边颜色 - 选中
|
|
7
8
|
$color-cascader_option_list-border-default: var(--semi-color-fill-0); // 级联选择各级菜单分割线颜色
|
|
8
9
|
$color-cascader_option_main-text-default: var(--semi-color-text-0); // 级联选择菜单项文字颜色
|
|
9
10
|
$color-cascader_option-bg-hover: var(--semi-color-fill-0); // 级联选择菜单项背景颜色 - 悬浮
|
|
@@ -83,6 +84,7 @@ $width-cascader: 80px; // 级联选择触发器最小宽度
|
|
|
83
84
|
$height-cascader_default: $height-control-default; // 级联选择触发器高度 - 默认
|
|
84
85
|
$height-cascader_small: $height-control-small; // 级联选择触发器高度 - 小尺寸
|
|
85
86
|
$height-cascader_large: $height-control-large; // 级联选择触发器高度 - 大尺寸
|
|
87
|
+
$width-cascader_hover-border: $width-cascader-border; // 级联选择触发器描边宽度 - 悬浮
|
|
86
88
|
$width-cascader_focus-border: $border-thickness-control-focus; // 级联选择触发器描边宽度 - 选中态
|
|
87
89
|
$width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
|
|
88
90
|
$width-cascader-icon: 16px; // 级联选择图标尺寸
|
|
@@ -221,6 +221,11 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
221
221
|
* @param {Date[]} dates
|
|
222
222
|
*/
|
|
223
223
|
closePanel(e?: any, inputValue?: string, dates?: Date[]): void;
|
|
224
|
+
/**
|
|
225
|
+
* clear range input focus when open is controlled
|
|
226
|
+
* fixed github 1375
|
|
227
|
+
*/
|
|
228
|
+
clearRangeInputFocus: () => void;
|
|
224
229
|
/**
|
|
225
230
|
* Callback when the content of the input box changes
|
|
226
231
|
* Update the date panel if the changed value is a legal date, otherwise only update the input box
|
|
@@ -76,6 +76,24 @@ var _constants2 = require("../input/constants");
|
|
|
76
76
|
class DatePickerFoundation extends _foundation.default {
|
|
77
77
|
constructor(adapter) {
|
|
78
78
|
super((0, _assign.default)({}, adapter));
|
|
79
|
+
/**
|
|
80
|
+
* clear range input focus when open is controlled
|
|
81
|
+
* fixed github 1375
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
this.clearRangeInputFocus = () => {
|
|
85
|
+
const {
|
|
86
|
+
type
|
|
87
|
+
} = this._adapter.getProps();
|
|
88
|
+
|
|
89
|
+
const {
|
|
90
|
+
rangeInputFocus
|
|
91
|
+
} = this._adapter.getStates();
|
|
92
|
+
|
|
93
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
94
|
+
this._adapter.setRangeInputFocus(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
79
97
|
|
|
80
98
|
this.getMergedMotion = motion => {
|
|
81
99
|
const mergedMotion = typeof motion === 'undefined' || motion ? (0, _assign.default)((0, _assign.default)({}, motion), {
|
|
@@ -4,7 +4,7 @@ declare const cssClasses: {
|
|
|
4
4
|
DISABLED: string;
|
|
5
5
|
};
|
|
6
6
|
declare const strings: {
|
|
7
|
-
POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
7
|
+
POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
8
8
|
TRIGGER_SET: string[];
|
|
9
9
|
DEFAULT_LEAVE_DELAY: number;
|
|
10
10
|
ITEM_TYPE: string[];
|
|
@@ -5,7 +5,7 @@ declare const cssClasses: {
|
|
|
5
5
|
};
|
|
6
6
|
declare const strings: {
|
|
7
7
|
readonly SIZE_SET: readonly ["small", "large", "default"];
|
|
8
|
-
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
8
|
+
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
9
9
|
readonly MODE_SELECT: "select";
|
|
10
10
|
readonly MODE_AUTOCOMPLETE: "autoComplete";
|
|
11
11
|
readonly STATUS: readonly ["default", "error", "warning", "success"];
|
|
@@ -36,7 +36,7 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
36
36
|
notifyMouseLeave(event: any): void;
|
|
37
37
|
notifyMouseEnter(event: any): void;
|
|
38
38
|
updateHovering(isHover: boolean): void;
|
|
39
|
-
updateScrollTop(): void;
|
|
39
|
+
updateScrollTop(index?: number): void;
|
|
40
40
|
}
|
|
41
41
|
declare type LabelValue = string | number;
|
|
42
42
|
declare type PropValue = LabelValue | Record<string, any>;
|
|
@@ -944,8 +944,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
944
944
|
} // console.log('new:' + index);
|
|
945
945
|
|
|
946
946
|
|
|
947
|
-
this._adapter.updateFocusIndex(index);
|
|
947
|
+
this._adapter.updateFocusIndex(index);
|
|
948
948
|
|
|
949
|
+
this._adapter.updateScrollTop(index);
|
|
949
950
|
}
|
|
950
951
|
|
|
951
952
|
_handleArrowKeyDown(offset) {
|
|
@@ -26,14 +26,14 @@ class OptionFoundation extends _foundation.default {
|
|
|
26
26
|
destroy() {}
|
|
27
27
|
|
|
28
28
|
onOptionClick(option) {
|
|
29
|
-
const
|
|
29
|
+
const isDisabled = this._isDisabled();
|
|
30
30
|
|
|
31
|
-
if (!
|
|
31
|
+
if (!isDisabled) {
|
|
32
32
|
this._adapter.notifyClick(option);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
_isDisabled() {
|
|
37
37
|
return this.getProp('disabled');
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -162,7 +162,7 @@ class SliderFoundation extends _foundation.default {
|
|
|
162
162
|
|
|
163
163
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
164
164
|
|
|
165
|
-
const scrollParent = node => !node || node === document.body ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
165
|
+
const scrollParent = node => !node || node === document.body || !(node instanceof Element) ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
166
166
|
|
|
167
167
|
return scrollParent(el);
|
|
168
168
|
};
|
|
@@ -286,7 +286,7 @@ class SliderFoundation extends _foundation.default {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
if (step !== 1) {
|
|
289
|
-
// Find nearest step point
|
|
289
|
+
// Find nearest step point
|
|
290
290
|
stepValue = Math.round(stepValue / step) * step;
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -8,6 +8,7 @@ export interface BaseColumnProps<RecordType> {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
colSpan?: number;
|
|
10
10
|
dataIndex?: string;
|
|
11
|
+
defaultFilteredValue?: any[];
|
|
11
12
|
defaultSortOrder?: BaseSortOrder;
|
|
12
13
|
filterChildrenRecord?: boolean;
|
|
13
14
|
filterDropdown?: any;
|
|
@@ -313,6 +314,7 @@ export interface BaseChangeInfoFilter<RecordType> {
|
|
|
313
314
|
filters?: BaseFilter[];
|
|
314
315
|
onFilter?: (filteredValue?: any, record?: RecordType) => boolean;
|
|
315
316
|
filteredValue?: any[];
|
|
317
|
+
defaultFilteredValue?: any[];
|
|
316
318
|
children?: BaseFilter[];
|
|
317
319
|
filterChildrenRecord?: boolean;
|
|
318
320
|
}
|
|
@@ -219,7 +219,17 @@ class TableFoundation extends _foundation.default {
|
|
|
219
219
|
|
|
220
220
|
|
|
221
221
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
222
|
-
const filteredDataSource = this.filterDataSource(dataSource, (0, _filter2.default)(queries).call(queries, query =>
|
|
222
|
+
const filteredDataSource = this.filterDataSource(dataSource, (0, _filter2.default)(queries).call(queries, query => {
|
|
223
|
+
/**
|
|
224
|
+
* 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
|
|
225
|
+
* 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
|
|
226
|
+
*
|
|
227
|
+
* There is no need to judge whether `filteredValue` is an array here, because it is `undefined` when initialized, and `[]` when you click to select empty
|
|
228
|
+
* When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
|
|
229
|
+
*/
|
|
230
|
+
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
231
|
+
return (0, _isFunction2.default)(query.onFilter) && (0, _isArray.default)(query.filters) && query.filters.length && (0, _isArray.default)(currentFilteredValue) && currentFilteredValue.length;
|
|
232
|
+
}));
|
|
223
233
|
const sortedDataSource = this.sortDataSource(filteredDataSource, (0, _filter2.default)(queries).call(queries, query => query && (0, _isFunction2.default)(query.sorter)));
|
|
224
234
|
return sortedDataSource;
|
|
225
235
|
}
|
|
@@ -375,10 +385,12 @@ class TableFoundation extends _foundation.default {
|
|
|
375
385
|
const {
|
|
376
386
|
onFilter,
|
|
377
387
|
filteredValue,
|
|
378
|
-
filterChildrenRecord
|
|
388
|
+
filterChildrenRecord,
|
|
389
|
+
defaultFilteredValue
|
|
379
390
|
} = filterObj;
|
|
391
|
+
const currentFilteredValue = (0, _isArray.default)(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
380
392
|
|
|
381
|
-
if (typeof onFilter === 'function' && (0, _isArray.default)(
|
|
393
|
+
if (typeof onFilter === 'function' && (0, _isArray.default)(currentFilteredValue) && currentFilteredValue.length) {
|
|
382
394
|
hasValidFilters = true;
|
|
383
395
|
|
|
384
396
|
if (filteredData === null) {
|
|
@@ -388,7 +400,7 @@ class TableFoundation extends _foundation.default {
|
|
|
388
400
|
filteredData = new _map.default();
|
|
389
401
|
}
|
|
390
402
|
|
|
391
|
-
(0, _each2.default)(
|
|
403
|
+
(0, _each2.default)(currentFilteredValue, value => {
|
|
392
404
|
(0, _each2.default)(dataSource, record => {
|
|
393
405
|
const childrenRecords = (0, _get2.default)(record, childrenRecordName);
|
|
394
406
|
const recordKey = this.getRecordKey(record);
|
package/lib/cjs/table/utils.js
CHANGED
|
@@ -384,7 +384,10 @@ function assignColumnKeys(columns) {
|
|
|
384
384
|
if (column.key == null) {
|
|
385
385
|
var _context4;
|
|
386
386
|
|
|
387
|
-
column
|
|
387
|
+
// if user give column a dataIndex, use it for backup
|
|
388
|
+
const _index = column.dataIndex || index;
|
|
389
|
+
|
|
390
|
+
column.key = (0, _concat.default)(_context4 = "".concat(level, "-")).call(_context4, _index);
|
|
388
391
|
}
|
|
389
392
|
|
|
390
393
|
if ((0, _isArray.default)(column[childrenColumnName]) && column[childrenColumnName].length) {
|
|
@@ -4,7 +4,7 @@ $module: #{$prefix}-tagInput;
|
|
|
4
4
|
|
|
5
5
|
.#{$module} {
|
|
6
6
|
background-color: $color-tagInput_default-bg-default;
|
|
7
|
-
border: $
|
|
7
|
+
border: $width-tagInput-border-default $color-tagInput-border-default solid;
|
|
8
8
|
border-radius: $radius-tagInput;
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
font-weight: $font-weight-regular;
|
|
@@ -13,11 +13,12 @@ $module: #{$prefix}-tagInput;
|
|
|
13
13
|
|
|
14
14
|
&-hover {
|
|
15
15
|
background-color: $color-tagInput_default-bg-hover;
|
|
16
|
+
border: $width-tagInput-border-hover $color-tagInput-border-hover solid;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
&-focus {
|
|
19
20
|
background-color: $color-tagInput_default-bg-focus;
|
|
20
|
-
border: $
|
|
21
|
+
border: $width-tagInput-border-focus $color-tagInput-border-focus solid;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
&-warning {
|
|
@@ -3,13 +3,16 @@ $color-tagInput-maxTagCount-default: var(--semi-color-text-0); // 标签输入
|
|
|
3
3
|
$color-tagInput-icon-hover: var(--semi-color-primary-hover); // 标签输入框图标颜色 - 悬浮
|
|
4
4
|
$color-tagInput_disabled-text-default: var(--semi-color-disabled-text); // 标签输入框禁用文字颜色
|
|
5
5
|
$color-tagInput_default-bg-focus: var(--semi-color-fill-0); // 标签输入框背景颜色 - 选中态
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
$color-tagInput-border-default: transparent; // 标签输入框描边颜色 - 默认
|
|
8
|
+
$color-tagInput-border-hover: transparent ; // 标签输入框描边颜色 - 悬浮
|
|
9
|
+
$color-tagInput-border-focus: var(--semi-color-focus-border); // 标签输入框描边颜色 - 选中态
|
|
7
10
|
$color-tagInput_prefix-default: var(--semi-color-text-2); // 标签输入框 prefix 颜色
|
|
8
11
|
$color-tagInput_suffix-default: var(--semi-color-text-1); // 标签输入框 suffix 颜色
|
|
9
12
|
|
|
10
13
|
$color-tagInput_default-bg-default: var(--semi-color-fill-0); // 标签输入框背景颜色 - 默认
|
|
11
14
|
$color-tagInput_default-bg-hover: var(--semi-color-fill-1); // 标签输入框背景颜色 - 悬浮
|
|
12
|
-
$color-textarea-border-default: transparent; // 标签输入框描边颜色 -
|
|
15
|
+
// $color-textarea-border-default: transparent; // 标签输入框描边颜色 - 默认,已废弃 deprecated-v2.4
|
|
13
16
|
|
|
14
17
|
$color-tagInput_warning-bg-default: var(--semi-color-warning-light-default); // 警告标签输入框背景颜色 - 默认
|
|
15
18
|
$color-tagInput_warning-border-default: var(--semi-color-warning-light-default); // 警告标签输入框描边颜色 - 默认
|
|
@@ -35,5 +38,8 @@ $height-tagInput-default: $height-control-default; // 默认尺寸标签输入
|
|
|
35
38
|
$height-tagInput-small: $height-control-small; // 小尺寸标签输入框高度
|
|
36
39
|
|
|
37
40
|
$width-tagInput-clear-medium: $width-icon-medium * 2; // 标签输入框清空按钮宽度
|
|
41
|
+
$width-tagInput-border-default: $border-thickness-control; // 标签输入框描边描边宽度 - 默认
|
|
42
|
+
$width-tagInput-border-hover: $width-tagInput-border-default; // 标签输入框描边描边宽度 - 悬浮
|
|
43
|
+
$width-tagInput-border-focus: $border-thickness-control-focus; // 标签输入框描边宽度 - 选中态
|
|
38
44
|
|
|
39
45
|
$radius-tagInput: var(--semi-border-radius-small); // 标签输入框圆角
|
|
@@ -2,7 +2,7 @@ declare const cssClasses: {
|
|
|
2
2
|
readonly PREFIX: "semi-tooltip";
|
|
3
3
|
};
|
|
4
4
|
declare const strings: {
|
|
5
|
-
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
5
|
+
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
6
6
|
readonly TRIGGER_SET: readonly ["hover", "focus", "click", "custom"];
|
|
7
7
|
readonly STATUS_DISABLED: "disabled";
|
|
8
8
|
readonly STATUS_LOADING: "loading";
|
|
@@ -15,7 +15,7 @@ const cssClasses = {
|
|
|
15
15
|
};
|
|
16
16
|
exports.cssClasses = cssClasses;
|
|
17
17
|
const strings = {
|
|
18
|
-
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver'],
|
|
18
|
+
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver', 'leftBottomOver', 'rightBottomOver'],
|
|
19
19
|
TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
|
|
20
20
|
STATUS_DISABLED: 'disabled',
|
|
21
21
|
STATUS_LOADING: 'loading'
|
|
@@ -548,6 +548,19 @@ class Tooltip extends _foundation.default {
|
|
|
548
548
|
translateX = -1;
|
|
549
549
|
break;
|
|
550
550
|
|
|
551
|
+
case 'leftBottomOver':
|
|
552
|
+
left = triggerRect.left;
|
|
553
|
+
top = triggerRect.bottom;
|
|
554
|
+
translateY = -1;
|
|
555
|
+
break;
|
|
556
|
+
|
|
557
|
+
case 'rightBottomOver':
|
|
558
|
+
left = triggerRect.right;
|
|
559
|
+
top = triggerRect.bottom;
|
|
560
|
+
translateX = -1;
|
|
561
|
+
translateY = -1;
|
|
562
|
+
break;
|
|
563
|
+
|
|
551
564
|
default:
|
|
552
565
|
break;
|
|
553
566
|
}
|
|
@@ -669,12 +682,16 @@ class Tooltip extends _foundation.default {
|
|
|
669
682
|
|
|
670
683
|
const shouldReverseTop = clientTop < wrapperRect.height + spacing && restClientBottom > wrapperRect.height + spacing;
|
|
671
684
|
const shouldReverseLeft = clientLeft < wrapperRect.width + spacing && restClientRight > wrapperRect.width + spacing;
|
|
672
|
-
const
|
|
685
|
+
const shouldReverseBottom = restClientBottom < wrapperRect.height + spacing && clientTop > wrapperRect.height + spacing;
|
|
673
686
|
const shouldReverseRight = restClientRight < wrapperRect.width + spacing && clientLeft > wrapperRect.width + spacing;
|
|
687
|
+
const shouldReverseTopOver = restClientTop < wrapperRect.height + spacing && clientBottom > wrapperRect.height + spacing;
|
|
688
|
+
const shouldReverseBottomOver = clientBottom < wrapperRect.height + spacing && restClientTop > wrapperRect.height + spacing;
|
|
674
689
|
const shouldReverseTopSide = restClientTop < wrapperRect.height && clientBottom > wrapperRect.height;
|
|
675
690
|
const shouldReverseBottomSide = clientBottom < wrapperRect.height && restClientTop > wrapperRect.height;
|
|
676
691
|
const shouldReverseLeftSide = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
677
692
|
const shouldReverseRightSide = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
693
|
+
const shouldReverseLeftOver = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
694
|
+
const shouldReverseRightOver = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
678
695
|
|
|
679
696
|
switch (position) {
|
|
680
697
|
case 'top':
|
|
@@ -736,14 +753,14 @@ class Tooltip extends _foundation.default {
|
|
|
736
753
|
break;
|
|
737
754
|
|
|
738
755
|
case 'bottom':
|
|
739
|
-
if (
|
|
756
|
+
if (shouldReverseBottom) {
|
|
740
757
|
position = this._reversePos(position, true);
|
|
741
758
|
}
|
|
742
759
|
|
|
743
760
|
break;
|
|
744
761
|
|
|
745
762
|
case 'bottomLeft':
|
|
746
|
-
if (
|
|
763
|
+
if (shouldReverseBottom) {
|
|
747
764
|
position = this._reversePos(position, true);
|
|
748
765
|
}
|
|
749
766
|
|
|
@@ -754,7 +771,7 @@ class Tooltip extends _foundation.default {
|
|
|
754
771
|
break;
|
|
755
772
|
|
|
756
773
|
case 'bottomRight':
|
|
757
|
-
if (
|
|
774
|
+
if (shouldReverseBottom) {
|
|
758
775
|
position = this._reversePos(position, true);
|
|
759
776
|
}
|
|
760
777
|
|
|
@@ -793,6 +810,50 @@ class Tooltip extends _foundation.default {
|
|
|
793
810
|
|
|
794
811
|
break;
|
|
795
812
|
|
|
813
|
+
case 'leftTopOver':
|
|
814
|
+
if (shouldReverseTopOver) {
|
|
815
|
+
position = this._reversePos(position, true);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (shouldReverseLeftOver) {
|
|
819
|
+
position = this._reversePos(position);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
break;
|
|
823
|
+
|
|
824
|
+
case 'leftBottomOver':
|
|
825
|
+
if (shouldReverseBottomOver) {
|
|
826
|
+
position = this._reversePos(position, true);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
if (shouldReverseLeftOver) {
|
|
830
|
+
position = this._reversePos(position);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
break;
|
|
834
|
+
|
|
835
|
+
case 'rightTopOver':
|
|
836
|
+
if (shouldReverseTopOver) {
|
|
837
|
+
position = this._reversePos(position, true);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
if (shouldReverseRightOver) {
|
|
841
|
+
position = this._reversePos(position);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
break;
|
|
845
|
+
|
|
846
|
+
case 'rightBottomOver':
|
|
847
|
+
if (shouldReverseBottomOver) {
|
|
848
|
+
position = this._reversePos(position, true);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (shouldReverseRightOver) {
|
|
852
|
+
position = this._reversePos(position);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
break;
|
|
856
|
+
|
|
796
857
|
default:
|
|
797
858
|
break;
|
|
798
859
|
}
|
|
@@ -128,6 +128,7 @@ export interface Virtualize {
|
|
|
128
128
|
height?: number | string;
|
|
129
129
|
width?: number | string;
|
|
130
130
|
}
|
|
131
|
+
export declare type CheckRelation = 'related' | 'unRelated';
|
|
131
132
|
export interface BasicTreeProps {
|
|
132
133
|
autoExpandParent?: boolean;
|
|
133
134
|
autoExpandWhenDragEnter?: boolean;
|
|
@@ -183,6 +184,7 @@ export interface BasicTreeProps {
|
|
|
183
184
|
value?: BasicValue;
|
|
184
185
|
virtualize?: Virtualize;
|
|
185
186
|
icon?: any;
|
|
187
|
+
checkRelation?: CheckRelation;
|
|
186
188
|
'aria-label'?: string;
|
|
187
189
|
}
|
|
188
190
|
export interface BasicTreeInnerData {
|
|
@@ -193,6 +195,7 @@ export interface BasicTreeInnerData {
|
|
|
193
195
|
selectedKeys: string[];
|
|
194
196
|
checkedKeys: Set<string>;
|
|
195
197
|
halfCheckedKeys: Set<string>;
|
|
198
|
+
realCheckedKeys: Set<string>;
|
|
196
199
|
motionKeys: Set<string>;
|
|
197
200
|
motionType: string;
|
|
198
201
|
expandedKeys: Set<string>;
|
|
@@ -242,7 +245,7 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
|
|
|
242
245
|
getCopyFromState(items: string[] | string): Partial<BasicTreeInnerData>;
|
|
243
246
|
getTreeNodeProps(key: string): BasicTreeNodeProps;
|
|
244
247
|
notifyJsonChange(key: string[] | string, e: any): void;
|
|
245
|
-
notifyMultipleChange(key: string[]
|
|
248
|
+
notifyMultipleChange(key: string[], e: any): void;
|
|
246
249
|
notifyChange(key: string[] | string, e: any): void;
|
|
247
250
|
handleInputChange(sugInput: string): void;
|
|
248
251
|
handleNodeSelect(e: any, treeNode: BasicTreeNodeProps): void;
|