@douyinfe/semi-foundation 2.22.3 → 2.23.0-alpha.2
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 +15 -0
- package/cascader/variables.scss +1 -0
- package/checkbox/variables.scss +1 -1
- package/form/form.scss +3 -4
- package/form/interface.ts +8 -4
- package/form/rtl.scss +0 -1
- package/form/variables.scss +38 -35
- package/image/imageFoundation.ts +1 -1
- package/image/previewFooterFoundation.ts +2 -2
- package/image/previewImageFoundation.ts +0 -1
- package/image/previewInnerFoundation.ts +2 -2
- package/lib/cjs/cascader/cascader.css +12 -0
- package/lib/cjs/cascader/cascader.scss +15 -0
- package/lib/cjs/cascader/variables.scss +1 -0
- package/lib/cjs/checkbox/variables.scss +1 -1
- package/lib/cjs/form/form.css +0 -2
- package/lib/cjs/form/form.scss +3 -4
- package/lib/cjs/form/interface.d.ts +8 -6
- package/lib/cjs/form/rtl.scss +0 -1
- package/lib/cjs/form/variables.scss +38 -35
- package/lib/cjs/image/imageFoundation.js +1 -1
- package/lib/cjs/image/previewFooterFoundation.js +2 -2
- package/lib/cjs/image/previewInnerFoundation.d.ts +1 -1
- package/lib/cjs/image/previewInnerFoundation.js +1 -1
- package/lib/cjs/navigation/navigation.css +6 -0
- package/lib/cjs/navigation/navigation.scss +9 -0
- package/lib/cjs/table/constants.d.ts +1 -0
- package/lib/cjs/table/constants.js +4 -2
- package/lib/cjs/table/table.css +2 -1
- package/lib/cjs/table/table.scss +2 -1
- package/lib/cjs/tabs/tabs.css +40 -0
- package/lib/cjs/tabs/tabs.scss +43 -2
- package/lib/cjs/tabs/variables.scss +20 -0
- package/lib/cjs/tooltip/constants.d.ts +1 -0
- package/lib/cjs/tooltip/constants.js +2 -2
- package/lib/cjs/tooltip/foundation.d.ts +21 -2
- package/lib/cjs/tooltip/foundation.js +352 -77
- package/lib/cjs/transfer/foundation.d.ts +1 -1
- package/lib/cjs/transfer/foundation.js +3 -4
- package/lib/es/cascader/cascader.css +12 -0
- package/lib/es/cascader/cascader.scss +15 -0
- package/lib/es/cascader/variables.scss +1 -0
- package/lib/es/checkbox/variables.scss +1 -1
- package/lib/es/form/form.css +0 -2
- package/lib/es/form/form.scss +3 -4
- package/lib/es/form/interface.d.ts +8 -6
- package/lib/es/form/rtl.scss +0 -1
- package/lib/es/form/variables.scss +38 -35
- package/lib/es/image/imageFoundation.js +1 -1
- package/lib/es/image/previewFooterFoundation.js +2 -2
- package/lib/es/image/previewInnerFoundation.d.ts +1 -1
- package/lib/es/image/previewInnerFoundation.js +1 -1
- package/lib/es/navigation/navigation.css +6 -0
- package/lib/es/navigation/navigation.scss +9 -0
- package/lib/es/table/constants.d.ts +1 -0
- package/lib/es/table/constants.js +4 -2
- package/lib/es/table/table.css +2 -1
- package/lib/es/table/table.scss +2 -1
- package/lib/es/tabs/tabs.css +40 -0
- package/lib/es/tabs/tabs.scss +43 -2
- package/lib/es/tabs/variables.scss +20 -0
- package/lib/es/tooltip/constants.d.ts +1 -0
- package/lib/es/tooltip/constants.js +2 -2
- package/lib/es/tooltip/foundation.d.ts +21 -2
- package/lib/es/tooltip/foundation.js +352 -77
- package/lib/es/transfer/foundation.d.ts +1 -1
- package/lib/es/transfer/foundation.js +3 -4
- package/navigation/navigation.scss +9 -0
- package/package.json +2 -2
- package/table/constants.ts +2 -0
- package/table/table.scss +2 -1
- package/tabs/tabs.scss +43 -2
- package/tabs/variables.scss +20 -0
- package/tooltip/constants.ts +1 -0
- package/tooltip/foundation.ts +318 -78
- package/transfer/foundation.ts +3 -3
|
@@ -36,7 +36,7 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
|
|
|
36
36
|
_generateGroupedData(dataSource: any[]): any[];
|
|
37
37
|
_generateTreeData(dataSource: any[]): any[];
|
|
38
38
|
_generatePath(item: BasicResolvedDataItem): any;
|
|
39
|
-
handleInputChange(inputVal: string): void;
|
|
39
|
+
handleInputChange(inputVal: string, notify: boolean): void;
|
|
40
40
|
handleAll(wantAllChecked: boolean): void;
|
|
41
41
|
handleClear(): void;
|
|
42
42
|
handleSelectOrRemove(item: BasicResolvedDataItem): void;
|
|
@@ -38,7 +38,7 @@ class TransferFoundation extends _foundation.default {
|
|
|
38
38
|
return path.map(p => p.label).join(' > ');
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
handleInputChange(inputVal) {
|
|
41
|
+
handleInputChange(inputVal, notify) {
|
|
42
42
|
const {
|
|
43
43
|
data
|
|
44
44
|
} = this.getStates();
|
|
@@ -52,7 +52,7 @@ class TransferFoundation extends _foundation.default {
|
|
|
52
52
|
|
|
53
53
|
this._adapter.searchTree(inputVal);
|
|
54
54
|
|
|
55
|
-
this._adapter.notifySearch(inputVal);
|
|
55
|
+
notify && this._adapter.notifySearch(inputVal);
|
|
56
56
|
|
|
57
57
|
this._adapter.updateInput(inputVal);
|
|
58
58
|
|
|
@@ -64,8 +64,7 @@ class TransferFoundation extends _foundation.default {
|
|
|
64
64
|
const filterFunc = typeof filter === 'function' ? item => filter(inputVal, item) : item => typeof item.label === 'string' && item.label.includes(inputVal);
|
|
65
65
|
const searchData = data.filter(filterFunc);
|
|
66
66
|
const searchResult = new Set(searchData.map(item => item.key));
|
|
67
|
-
|
|
68
|
-
this._adapter.notifySearch(inputVal);
|
|
67
|
+
notify && this._adapter.notifySearch(inputVal);
|
|
69
68
|
|
|
70
69
|
this._adapter.updateInput(inputVal);
|
|
71
70
|
|
|
@@ -337,6 +337,18 @@
|
|
|
337
337
|
.semi-cascader-option-lists .semi-cascader-option-icon-active, .semi-cascader-option-lists .semi-cascader-option-icon-empty {
|
|
338
338
|
margin-right: 8px;
|
|
339
339
|
}
|
|
340
|
+
.semi-cascader-option-lists .semi-cascader-option-icon-left {
|
|
341
|
+
margin-left: 8px;
|
|
342
|
+
}
|
|
343
|
+
.semi-cascader-option-lists .semi-cascader-option-spin-icon {
|
|
344
|
+
width: 16px;
|
|
345
|
+
height: 16px;
|
|
346
|
+
line-height: 0;
|
|
347
|
+
}
|
|
348
|
+
.semi-cascader-option-lists .semi-cascader-option-spin-icon svg {
|
|
349
|
+
width: 16px;
|
|
350
|
+
height: 16px;
|
|
351
|
+
}
|
|
340
352
|
.semi-cascader-option-lists .semi-cascader-option-label {
|
|
341
353
|
display: flex;
|
|
342
354
|
align-items: center;
|
|
@@ -408,6 +408,21 @@ $module: #{$prefix}-cascader;
|
|
|
408
408
|
&-empty {
|
|
409
409
|
margin-right: $spacing-cascader_empty_icon-marginRight;
|
|
410
410
|
}
|
|
411
|
+
|
|
412
|
+
&-left {
|
|
413
|
+
margin-left: $spacing-cascader_option-icon-marginLeft;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
&-spin-icon {
|
|
418
|
+
width: $width-cascader-icon;
|
|
419
|
+
height: $width-cascader-icon;
|
|
420
|
+
line-height: 0;
|
|
421
|
+
|
|
422
|
+
& svg {
|
|
423
|
+
width: $width-cascader-icon;
|
|
424
|
+
height: $width-cascader-icon;
|
|
425
|
+
}
|
|
411
426
|
}
|
|
412
427
|
|
|
413
428
|
&-label {
|
|
@@ -51,6 +51,7 @@ $spacing-cascader_selection_tagInput-marginLeft: - $spacing-extra-tight; // 级
|
|
|
51
51
|
$spacing-cascader_selection_input-marginLeft: $spacing-extra-tight; // 级联选择触发器多选搜索时输入框的左外边距
|
|
52
52
|
$spacing-cascader_selection_n-marginRight: $spacing-extra-tight; // 超出 maxTagCount 后,+n 的右外边距
|
|
53
53
|
$spacing-cascader_clearBtn-marginRight: 12px; // 级联选择触发器清空按钮右侧外边距
|
|
54
|
+
$spacing-cascader_option-icon-marginLeft: 8px; // 级联选择菜单项图标左侧外边距
|
|
54
55
|
|
|
55
56
|
$color-cascader_selection_n-text-default: var(--semi-color-text-0); // 超出 maxTagCount 后,+n 的文字默认颜色
|
|
56
57
|
$color-cascader_selection_n-text-disabled: var(--semi-color-disabled-text); // 超出 maxTagCount 后,+n 的文字disabled颜色
|
|
@@ -52,7 +52,7 @@ $spacing-checkbox_extra-marginTop: $spacing-extra-tight; // extra 副标题顶
|
|
|
52
52
|
$spacing-checkbox_cardType-paddingX: $spacing-base; // 卡片类型复选框的水平内间距
|
|
53
53
|
$spacing-checkbox_cardType-paddingY: $spacing-base-tight; // 卡片类型复选框的垂直内间距
|
|
54
54
|
$spacing-checkbox_cardType_inner-marginRight: $spacing-tight; // 卡片类型复选框 inner 的右外边距
|
|
55
|
-
$spacing-checkbox_card_group_vertical-marginBottom: $spacing-base; //
|
|
55
|
+
$spacing-checkbox_card_group_vertical-marginBottom: $spacing-base; // 卡片样式复选框的下间距
|
|
56
56
|
|
|
57
57
|
$color-checkbox_extra-text-default: var(--semi-color-text-2); // extra 副标题文字颜色
|
|
58
58
|
|
package/lib/es/form/form.css
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
.semi-form-field-label {
|
|
47
47
|
box-sizing: border-box;
|
|
48
|
-
padding-right: 16px;
|
|
49
48
|
font-weight: 600;
|
|
50
49
|
color: var(--semi-color-text-0);
|
|
51
50
|
margin-bottom: 4px;
|
|
@@ -232,7 +231,6 @@
|
|
|
232
231
|
.semi-rtl .semi-form-field-label,
|
|
233
232
|
.semi-portal-rtl .semi-form-field-label {
|
|
234
233
|
padding-right: 0;
|
|
235
|
-
padding-left: 16px;
|
|
236
234
|
}
|
|
237
235
|
.semi-rtl .semi-form-field-label-with-extra .semi-form-field-label-extra,
|
|
238
236
|
.semi-portal-rtl .semi-form-field-label-with-extra .semi-form-field-label-extra {
|
package/lib/es/form/form.scss
CHANGED
|
@@ -88,9 +88,7 @@ $rating: #{$prefix}-rating;
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
&-field-label {
|
|
91
|
-
// padding-left: $spacing-base;
|
|
92
91
|
box-sizing: border-box;
|
|
93
|
-
padding-right: $spacing-form_label-paddingRight;
|
|
94
92
|
font-weight: $font-form_label-fontWeight;
|
|
95
93
|
color: $color-form_label-text-default;
|
|
96
94
|
margin-bottom: $spacing-form_label-marginBottom;
|
|
@@ -146,6 +144,7 @@ $rating: #{$prefix}-rating;
|
|
|
146
144
|
@include font-size-regular;
|
|
147
145
|
display: flex;
|
|
148
146
|
align-items: center;
|
|
147
|
+
// TODO help text margin token?
|
|
149
148
|
margin-top: $spacing-form_message-marginTop;
|
|
150
149
|
.#{$prefix}-icon-alert_triangle {
|
|
151
150
|
color: $color-form_alertIcon-icon-default;
|
|
@@ -204,8 +203,8 @@ $rating: #{$prefix}-rating;
|
|
|
204
203
|
.#{$switch},
|
|
205
204
|
.#{$rating} {
|
|
206
205
|
vertical-align: middle;
|
|
207
|
-
margin-top: $spacing-
|
|
208
|
-
margin-bottom: $spacing-
|
|
206
|
+
margin-top: $spacing-form_switch_rating_marginY;
|
|
207
|
+
margin-bottom: $spacing-form_switch_rating_marginY;
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
210
|
|
|
@@ -3,25 +3,27 @@ import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
|
|
3
3
|
export declare type BasicTriggerType = 'blur' | 'change' | 'custom' | 'mount';
|
|
4
4
|
export declare type FieldValidateTriggerType = BasicTriggerType | Array<BasicTriggerType>;
|
|
5
5
|
export declare type CommonFieldError = boolean | string | Array<any> | undefined | unknown;
|
|
6
|
-
export
|
|
6
|
+
export declare type BasicFieldError = Array<any>;
|
|
7
|
+
export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>, Values extends object = any> extends DefaultAdapter<P, S> {
|
|
7
8
|
cloneDeep: (val: any, ...rest: any[]) => any;
|
|
8
9
|
notifySubmit: (values: any) => void;
|
|
9
|
-
notifySubmitFail: (errors: Record<
|
|
10
|
+
notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>) => void;
|
|
10
11
|
forceUpdate: (callback?: () => void) => void;
|
|
11
12
|
notifyChange: (formState: FormState) => void;
|
|
12
13
|
notifyValueChange: (values: any, changedValues: any) => void;
|
|
13
14
|
notifyReset: () => void;
|
|
14
|
-
getInitValues: () =>
|
|
15
|
+
getInitValues: () => Partial<Values>;
|
|
15
16
|
getFormProps: (keys: undefined | string | Array<string>) => any;
|
|
16
17
|
getAllErrorDOM: () => NodeList;
|
|
17
18
|
getFieldDOM: (field: string) => Node;
|
|
18
19
|
initFormId: () => void;
|
|
19
20
|
}
|
|
21
|
+
export declare type AllErrors<T> = T extends Record<string, any> ? {
|
|
22
|
+
[K in keyof T]?: string;
|
|
23
|
+
} : Record<string, any>;
|
|
20
24
|
export interface FormState<T extends Record<string, any> = any> {
|
|
21
25
|
values?: T extends Record<string, any> ? T : Record<string, any>;
|
|
22
|
-
errors?: T
|
|
23
|
-
[K in keyof T]?: string;
|
|
24
|
-
} : Record<string, any>;
|
|
26
|
+
errors?: AllErrors<T>;
|
|
25
27
|
touched?: T extends Record<string, any> ? {
|
|
26
28
|
[K in keyof T]?: boolean;
|
|
27
29
|
} : Record<string, any>;
|
package/lib/es/form/rtl.scss
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
$spacing-
|
|
3
|
-
|
|
4
|
-
$spacing-form_field_horizontal-paddingRight: $spacing-base; // 水平布局表单标题右侧内边距
|
|
1
|
+
// form field
|
|
2
|
+
$spacing-form_field_horizontal-paddingRight: $spacing-base; // 水平布局表单项右侧内边距
|
|
5
3
|
$spacing-form_field_group_horizontal-paddingRight: $spacing-base; // 水平布局表单组标题右侧内边距
|
|
6
|
-
|
|
7
|
-
$spacing-form_field_vertical-
|
|
8
|
-
$spacing-form_field_vertical-paddingBottom: $spacing-base-tight; // 垂直布局表单底部内边距
|
|
9
|
-
|
|
4
|
+
$spacing-form_field_vertical-paddingTop: $spacing-base-tight; // 表单项顶部内边距(垂直布局)
|
|
5
|
+
$spacing-form_field_vertical-paddingBottom: $spacing-base-tight; // 表单项底部内边距(垂直布局)
|
|
10
6
|
$spacing-form_field_group_vertical-paddingTop: $spacing-base-tight; // 垂直布局表单组顶部内边距
|
|
11
7
|
$spacing-form_field_group_vertical-paddingBottom: $spacing-base-tight; // 垂直布局表单组底部内边距
|
|
12
|
-
$spacing-form_section-marginTop: $spacing-super-loose - $spacing-base-tight; // 表单分组顶部内边距
|
|
13
|
-
$spacing-form_section_text-paddingBottom: $spacing-tight; // 表单分组标题底部内边距
|
|
14
|
-
$spacing-form_section_text-marginBottom: $spacing-extra-tight; // 表单分组标题底部外边距
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
$spacing-form_label-
|
|
18
|
-
$spacing-
|
|
19
|
-
$spacing-
|
|
20
|
-
$spacing-
|
|
21
|
-
$spacing-form_label_posLeft-
|
|
22
|
-
$spacing-
|
|
23
|
-
$spacing-form_label_posTop-
|
|
24
|
-
$spacing-
|
|
25
|
-
$spacing-form_label_extra_posMid-
|
|
26
|
-
$spacing-
|
|
27
|
-
$spacing-
|
|
9
|
+
// form label
|
|
10
|
+
$spacing-form_label-paddingTop: ($height-control-default - 20px) * 0.5; // 表单项标签顶部内边距(水平布局)
|
|
11
|
+
$spacing-form_label-marginBottom: $spacing-extra-tight; // 表单项标签底部外边距
|
|
12
|
+
$spacing-form_label_extra-marginLeft: $spacing-extra-tight; // 表单项标签额外信息左侧边距
|
|
13
|
+
$spacing-form_label_required-marginLeft: $spacing-extra-tight; // 表单项标签必填标志左侧边距
|
|
14
|
+
$spacing-form_label_posLeft-marginRight: 0; // 表单项左侧标签右侧外边距
|
|
15
|
+
$spacing-form_label_posLeft-marginBottom: 0; // 表单项左侧标签底部外边距
|
|
16
|
+
$spacing-form_label_posTop-paddingTop: $spacing-extra-tight; // 表单项顶部标签顶部边距
|
|
17
|
+
$spacing-form_label_posTop-paddingBottom: $spacing-extra-tight; // 表单项顶部标签底部边距
|
|
18
|
+
$spacing-form_label_extra_posMid-marginTop: $spacing-extra-tight; // 表单项标签 图标/可选标记 顶部外边距
|
|
19
|
+
$spacing-form_label_extra_posMid-marginBottom: $spacing-extra-tight; // 表单项标签 图标/可选标记 底部外边距 - 居中
|
|
20
|
+
$spacing-form_label_extra_posBottom-marginTop: $spacing-extra-tight; // 表单项标签 图标/可选标记 顶部外边距 - 底部
|
|
21
|
+
|
|
22
|
+
// form switch rating需要额外margin以对齐高度 32px
|
|
23
|
+
$spacing-form_switch_rating_marginY: ($height-control-default - 24px) * 0.5; // Switch / Rating 表单项顶部内边距(水平布局)
|
|
28
24
|
|
|
29
|
-
$
|
|
25
|
+
$color-form_requiredMark_disabled-text-default: var(--semi-color-danger); // 禁用表单项必填标记颜色
|
|
26
|
+
$color-form_label_disabled-text-default: var(--semi-color-disabled-text); // 禁用表单项标签文字颜色
|
|
27
|
+
$font-form_label-fontWeight: $font-weight-bold; // 表单项标签字重
|
|
30
28
|
|
|
31
|
-
$
|
|
29
|
+
$color-form_label-text-default: var(--semi-color-text-0); // 表单项标签文字颜色
|
|
30
|
+
$color-form_label_optional-text-default: var(--semi-color-tertiary); // 表单项标签可选标记颜色
|
|
31
|
+
$color-form_label_extra-text-default: var(--semi-color-tertiary); // 表单项标签图标颜色
|
|
32
|
+
$color-form_requiredMark-text-default: var(--semi-color-danger); // 必填标记颜色
|
|
32
33
|
$font-form_requiredMark-fontWeight: $font-weight-bold; // 表单必填标识字重
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
$color-
|
|
36
|
-
$color-
|
|
35
|
+
// form errormessage
|
|
36
|
+
$color-form_message_error-text-default: var(--semi-color-danger); // 错误提示颜色
|
|
37
|
+
$color-form_alertIcon-icon-default: var(--semi-color-warning); // 警告图标颜色
|
|
38
|
+
$spacing-form_statusIcon-marginRight: $spacing-extra-tight; // 表单校验状态图标右侧外边距
|
|
39
|
+
$spacing-form_message-marginTop: $spacing-extra-tight; // 表单错误信息、辅助文字顶部外边距
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
$color-form_requiredMark-text-default: var(--semi-color-danger); // 必填标记颜色
|
|
40
|
-
$color-form_requiredMark_disabled-text-default: var(--semi-color-danger); // 禁用表单项必填标记颜色
|
|
41
|
-
$color-form_alertIcon-icon-default: var(--semi-color-warning); // 警告表单项图标颜色
|
|
42
|
-
$color-form_message_error-text-default: var(--semi-color-danger); // 错误表单项图标颜色
|
|
41
|
+
// form section
|
|
43
42
|
$color-form_section-text-default: var(--semi-color-text-0); // 表单分组标题文字颜色
|
|
44
|
-
$color-form_section-border-default: var(--semi-color-border); //
|
|
45
|
-
$width-form_section-border: $border-thickness-control; //
|
|
43
|
+
$color-form_section-border-default: var(--semi-color-border); // 表单分组标题底部描边颜色
|
|
44
|
+
$width-form_section-border: $border-thickness-control; // 表单分组标题底部描边宽度
|
|
45
|
+
$spacing-form_section-marginTop: $spacing-super-loose - $spacing-base-tight; // 表单分组顶部内边距
|
|
46
|
+
$spacing-form_section_text-paddingBottom: $spacing-tight; // 表单分组标题底部内边距
|
|
47
|
+
$spacing-form_section_text-marginBottom: $spacing-extra-tight; // 表单分组标题底部外边距
|
|
48
|
+
|
|
@@ -60,7 +60,7 @@ export default class ImageFoundation extends BaseFoundation {
|
|
|
60
60
|
} = preview;
|
|
61
61
|
onVisibleChange && onVisibleChange(newVisible);
|
|
62
62
|
|
|
63
|
-
if (!("visible" in
|
|
63
|
+
if (!("visible" in preview)) {
|
|
64
64
|
this.setState({
|
|
65
65
|
previewVisible: newVisible
|
|
66
66
|
});
|
|
@@ -29,9 +29,9 @@ export default class PreviewFooterFoundation extends BaseFoundation {
|
|
|
29
29
|
} = this.getProps();
|
|
30
30
|
|
|
31
31
|
if (value > zoom) {
|
|
32
|
-
onZoomIn(value / 100);
|
|
32
|
+
onZoomIn(Number((value / 100).toFixed(2)));
|
|
33
33
|
} else {
|
|
34
|
-
onZoomOut(value / 100);
|
|
34
|
+
onZoomOut(Number((value / 100).toFixed(2)));
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
this._adapter.setStartMouseOffset(value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
2
2
|
export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
3
3
|
getIsInGroup: () => boolean;
|
|
4
|
-
notifyChange: (index: number) => void;
|
|
4
|
+
notifyChange: (index: number, direction: string) => void;
|
|
5
5
|
notifyZoom: (zoom: number, increase: boolean) => void;
|
|
6
6
|
notifyClose: () => void;
|
|
7
7
|
notifyVisibleChange: (visible: boolean) => void;
|
|
@@ -87,6 +87,12 @@
|
|
|
87
87
|
align-items: center;
|
|
88
88
|
justify-content: flex-start;
|
|
89
89
|
}
|
|
90
|
+
.semi-navigation-item-has-link {
|
|
91
|
+
padding: 0;
|
|
92
|
+
}
|
|
93
|
+
.semi-navigation-item-has-link .semi-navigation-item-link {
|
|
94
|
+
padding: 8px 12px;
|
|
95
|
+
}
|
|
90
96
|
.semi-navigation-item-sub {
|
|
91
97
|
padding: 0;
|
|
92
98
|
}
|
|
@@ -113,6 +113,15 @@ $module: #{$prefix}-navigation;
|
|
|
113
113
|
justify-content: flex-start;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
// when item has link, add the padding to link instead of item
|
|
117
|
+
&-item-has-link {
|
|
118
|
+
padding: 0;
|
|
119
|
+
|
|
120
|
+
.#{$module}-item-link {
|
|
121
|
+
padding: $spacing-navigation_item-paddingY $spacing-navigation_item-paddingX;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
116
125
|
&-item-sub {
|
|
117
126
|
padding: $spacing-navigation_item_sub-padding;
|
|
118
127
|
}
|
|
@@ -73,5 +73,6 @@ declare const numbers: {
|
|
|
73
73
|
readonly DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: number;
|
|
74
74
|
readonly DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT: number;
|
|
75
75
|
readonly DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT: number;
|
|
76
|
+
readonly DEFAULT_EMPTYSLOT_HEIGHT: 52;
|
|
76
77
|
};
|
|
77
78
|
export { cssClasses, strings, numbers };
|
|
@@ -56,7 +56,8 @@ const DEFAULT_CELL_MIDDLE_PADDING_TOP = 12;
|
|
|
56
56
|
const DEFAULT_CELL_MIDDLE_PADDING_BOTTOM = 12;
|
|
57
57
|
const DEFAULT_CELL_SMALL_PADDING_TOP = 8;
|
|
58
58
|
const DEFAULT_CELL_SMALL_PADDING_BOTTOM = 8;
|
|
59
|
-
const DEFAULT_CELL_LINE_HEIGHT = 20;
|
|
59
|
+
const DEFAULT_CELL_LINE_HEIGHT = 20;
|
|
60
|
+
const DEFAULT_EMPTYSLOT_HEIGHT = 52; // normal size
|
|
60
61
|
|
|
61
62
|
const DEFAULT_VIRTUALIZED_ROW_HEIGHT = DEFAULT_CELL_LINE_HEIGHT + DEFAULT_CELL_BORDER_WITH_BOTTOM + DEFAULT_CELL_BORDER_WITH_TOP + DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM;
|
|
62
63
|
const DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT = DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM + DEFAULT_CELL_BORDER_WITH_BOTTOM; // middle size
|
|
@@ -92,6 +93,7 @@ const numbers = {
|
|
|
92
93
|
DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT,
|
|
93
94
|
DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
|
|
94
95
|
DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
|
|
95
|
-
DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT
|
|
96
|
+
DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT,
|
|
97
|
+
DEFAULT_EMPTYSLOT_HEIGHT
|
|
96
98
|
};
|
|
97
99
|
export { cssClasses, strings, numbers };
|
package/lib/es/table/table.css
CHANGED
package/lib/es/table/table.scss
CHANGED
|
@@ -481,7 +481,8 @@ $module: #{$prefix}-table;
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
&-placeholder {
|
|
484
|
-
position:
|
|
484
|
+
position: sticky;
|
|
485
|
+
left: 0px;
|
|
485
486
|
z-index: 1;
|
|
486
487
|
padding: #{$spacing-table-paddingY} #{$spacing-table-paddingX};
|
|
487
488
|
color: $color-table_placeholder-text-default;
|
package/lib/es/tabs/tabs.css
CHANGED
|
@@ -103,12 +103,52 @@
|
|
|
103
103
|
outline: 2px solid var(--semi-color-primary-light-active);
|
|
104
104
|
outline-offset: -2px;
|
|
105
105
|
}
|
|
106
|
+
.semi-tabs-bar-collapse .semi-overflow-list > .semi-button-disabled {
|
|
107
|
+
color: var(--semi-color-disabled-text);
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
}
|
|
110
|
+
.semi-tabs-bar-collapse .semi-overflow-list > .semi-button-disabled:hover {
|
|
111
|
+
color: var(--semi-color-disabled-text);
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
}
|
|
106
114
|
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-start {
|
|
107
115
|
margin-right: 4px;
|
|
108
116
|
}
|
|
117
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-start > .semi-button {
|
|
118
|
+
color: var(--semi-color-primary);
|
|
119
|
+
padding: 8px;
|
|
120
|
+
border: 0px solid transparent;
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
}
|
|
123
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-start > .semi-button:hover {
|
|
124
|
+
background-color: var(--semi-color-fill-0);
|
|
125
|
+
color: var(--semi-color-primary);
|
|
126
|
+
border-color: transparent;
|
|
127
|
+
}
|
|
128
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-start > .semi-button:active {
|
|
129
|
+
background-color: var(--semi-color-fill-1);
|
|
130
|
+
color: var(--semi-color-primary);
|
|
131
|
+
border-color: transparent;
|
|
132
|
+
}
|
|
109
133
|
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-end {
|
|
110
134
|
margin-left: 4px;
|
|
111
135
|
}
|
|
136
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-end > .semi-button {
|
|
137
|
+
color: var(--semi-color-primary);
|
|
138
|
+
padding: 8px;
|
|
139
|
+
border: 0px solid transparent;
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-end > .semi-button:hover {
|
|
143
|
+
background-color: var(--semi-color-fill-0);
|
|
144
|
+
color: var(--semi-color-primary);
|
|
145
|
+
border-color: transparent;
|
|
146
|
+
}
|
|
147
|
+
.semi-tabs-bar-collapse .semi-tabs-bar-arrow-end > .semi-button:active {
|
|
148
|
+
background-color: var(--semi-color-fill-1);
|
|
149
|
+
color: var(--semi-color-primary);
|
|
150
|
+
border-color: transparent;
|
|
151
|
+
}
|
|
112
152
|
.semi-tabs-bar-dropdown {
|
|
113
153
|
max-height: 300px;
|
|
114
154
|
overflow-y: auto;
|
package/lib/es/tabs/tabs.scss
CHANGED
|
@@ -134,14 +134,55 @@ $module: #{$prefix}-tabs;
|
|
|
134
134
|
outline-offset: $width-tabs-outline-offset;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
& > .#{$prefix}-button-disabled{
|
|
138
|
+
color: $color-tabs_tab-pane_arrow_disabled-text-default;
|
|
139
|
+
background-color: $color-tabs_tab-pane_arrow_disabled-bg-default;
|
|
140
|
+
&:hover{
|
|
141
|
+
color: $color-tabs_tab-pane_arrow_disabled-text-hover;
|
|
142
|
+
background-color: $color-tabs_tab-pane_arrow_disabled-bg-hover;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
137
145
|
}
|
|
138
146
|
|
|
139
147
|
.#{$module}-bar-arrow-start {
|
|
140
148
|
margin-right: $spacing-tabs_overflow_icon-marginRight;
|
|
149
|
+
& > .#{$prefix}-button{
|
|
150
|
+
color: $color-tabs_tab-pane_arrow-text-default;
|
|
151
|
+
padding: $spacing-tabs_tab-pane_arrow;
|
|
152
|
+
border: $width-tabs_tab-pane_arrow-border solid $color-tabs_tab-pane_arrow-border-default;
|
|
153
|
+
background-color: $color-tabs_tab-pane_arrow-bg-default;
|
|
154
|
+
&:hover{
|
|
155
|
+
background-color: var(--semi-color-fill-0);
|
|
156
|
+
color: $color-tabs_tab-pane_arrow-text-hover;
|
|
157
|
+
border-color: $color-tabs_tab-pane_arrow-border-hover;
|
|
158
|
+
}
|
|
159
|
+
&:active{
|
|
160
|
+
background-color: var(--semi-color-fill-1);
|
|
161
|
+
color: $color-tabs_tab-pane_arrow-text-active;
|
|
162
|
+
border-color: $color-tabs_tab-pane_arrow-border-active;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
141
166
|
}
|
|
142
167
|
|
|
143
168
|
.#{$module}-bar-arrow-end {
|
|
144
169
|
margin-left: $spacing-tabs_overflow_icon-marginLeft;
|
|
170
|
+
& > .#{$prefix}-button{
|
|
171
|
+
color: $color-tabs_tab-pane_arrow-text-default;
|
|
172
|
+
padding: $spacing-tabs_tab-pane_arrow;
|
|
173
|
+
border: $width-tabs_tab-pane_arrow-border solid $color-tabs_tab-pane_arrow-border-default;
|
|
174
|
+
background-color: $color-tabs_tab-pane_arrow-bg-default;
|
|
175
|
+
&:hover{
|
|
176
|
+
background-color: var(--semi-color-fill-0);
|
|
177
|
+
color: $color-tabs_tab-pane_arrow-text-hover;
|
|
178
|
+
border-color: $color-tabs_tab-pane_arrow-border-hover;
|
|
179
|
+
}
|
|
180
|
+
&:active{
|
|
181
|
+
background-color: var(--semi-color-fill-1);
|
|
182
|
+
color: $color-tabs_tab-pane_arrow-text-active;
|
|
183
|
+
border-color: $color-tabs_tab-pane_arrow-border-active;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
145
186
|
}
|
|
146
187
|
}
|
|
147
188
|
|
|
@@ -160,13 +201,13 @@ $module: #{$prefix}-tabs;
|
|
|
160
201
|
&-bar-line {
|
|
161
202
|
&.#{$module}-bar-top {
|
|
162
203
|
border-bottom: $width-tabs_bar_line-border solid $color-tabs_tab_line_default-border-default;
|
|
163
|
-
transition: color $transition_duration-tabs_tab_line-text $transition_function-tabs_tab_line-text $transition_delay-tabs_tab_line-text
|
|
204
|
+
transition: color $transition_duration-tabs_tab_line-text $transition_function-tabs_tab_line-text $transition_delay-tabs_tab_line-text; //线条式tabs的 color的transition
|
|
164
205
|
transform:scale($transform_scale-tabs_tab_line-item);
|
|
165
206
|
|
|
166
207
|
.#{$module}-tab {
|
|
167
208
|
padding: $spacing-tabs_bar_line_tab-paddingTop $spacing-tabs_bar_line_tab-paddingRight $spacing-tabs_bar_line_tab-paddingBottom $spacing-tabs_bar_line_tab-paddingLeft;
|
|
168
209
|
transition: border-bottom-color $transition_duration-tabs_tab_line-border $transition_function-tabs_tab_line-border $transition_delay-tabs_tab_line-border,
|
|
169
|
-
color $transition_duration-tabs_tab_line-text $transition_function-tabs_tab_line-text $transition_delay-tabs_tab_line-text
|
|
210
|
+
color $transition_duration-tabs_tab_line-text $transition_function-tabs_tab_line-text $transition_delay-tabs_tab_line-text; //线条式tabs的border-color 的 transition
|
|
170
211
|
&:nth-of-type(1) {
|
|
171
212
|
padding-left: 0;
|
|
172
213
|
}
|
|
@@ -48,6 +48,23 @@ $color-tabs_tab-outline-focus: var(--semi-color-primary-light-active); // 页签
|
|
|
48
48
|
|
|
49
49
|
$color-tabs_tab-pane-text-default: var(--semi-color-text-0); // 标签页内容文本颜色 - 默认
|
|
50
50
|
|
|
51
|
+
$color-tabs_tab-pane_arrow-text-default: var(--semi-color-primary); // 滚动折叠箭头颜色 - 默认
|
|
52
|
+
$color-tabs_tab-pane_arrow-border-default: transparent; // 滚动折叠箭头边框颜色 - 默认
|
|
53
|
+
$color-tabs_tab-pane_arrow-bg-default:transparent; // 滚动折叠箭头背景色 - 默认
|
|
54
|
+
|
|
55
|
+
$color-tabs_tab-pane_arrow-text-hover: var(--semi-color-primary); // 滚动折叠箭头颜色 - 悬浮
|
|
56
|
+
$color-tabs_tab-pane_arrow-border-hover: transparent; // 滚动折叠箭头边框颜色 - 悬浮
|
|
57
|
+
$color-tabs_tab-pane_arrow-bg-hover: var(--semi-color-fill-0); // 滚动折叠箭头背景色 - 悬浮
|
|
58
|
+
|
|
59
|
+
$color-tabs_tab-pane_arrow-text-active: var(--semi-color-primary); // 滚动折叠箭头颜色 - 按下
|
|
60
|
+
$color-tabs_tab-pane_arrow-border-active: transparent; // 滚动折叠箭头边框颜色 - 按下
|
|
61
|
+
$color-tabs_tab-pane_arrow-bg-active: var(--semi-color-fill-1); // 滚动折叠箭头背景色 - 按下
|
|
62
|
+
|
|
63
|
+
$color-tabs_tab-pane_arrow_disabled-bg-default: transparent;
|
|
64
|
+
$color-tabs_tab-pane_arrow_disabled-bg-hover: transparent;
|
|
65
|
+
$color-tabs_tab-pane_arrow_disabled-text-default: var(--semi-color-disabled-text);
|
|
66
|
+
$color-tabs_tab-pane_arrow_disabled-text-hover: var(--semi-color-disabled-text);
|
|
67
|
+
|
|
51
68
|
$font-tabs_tab-fontWeight: $font-weight-regular; // 页签文本字重 - 默认
|
|
52
69
|
$font-tabs_tab_active-fontWeight: $font-weight-bold; // 页签文本字重 - 选中
|
|
53
70
|
|
|
@@ -60,6 +77,7 @@ $width-tabs_bar_card-border: $border-thickness-control; // 卡片式页签底部
|
|
|
60
77
|
$width-tabs-outline: 2px; // 聚焦轮廓宽度
|
|
61
78
|
$width-tabs-outline-offset: -2px; // 聚焦轮廓偏移宽度
|
|
62
79
|
$width-tabs_bar_line-outline-offset: -1px; // 线条式页签聚焦轮廓偏移宽度
|
|
80
|
+
$width-tabs_tab-pane_arrow-border:0px; // 滚动折叠箭头边框宽度
|
|
63
81
|
|
|
64
82
|
$height-tabs_bar_extra_large: 50px; // 大尺寸页签高度
|
|
65
83
|
$font-tabs_bar_extra_large-lineHeight: $height-tabs_bar_extra_large; // 大尺寸页签文字行高
|
|
@@ -67,6 +85,7 @@ $font-tabs_bar_extra_large-lineHeight: $height-tabs_bar_extra_large; // 大尺
|
|
|
67
85
|
$height-tabs_bar_extra_small: 36px; // 小尺寸页签高度
|
|
68
86
|
$font-tabs_bar_extra_small-lineHeight: $height-tabs_bar_extra_small; // 小尺寸页签文字行高
|
|
69
87
|
|
|
88
|
+
$spacing-tabs_tab-pane_arrow: 8px; //滚动折叠箭头内边距
|
|
70
89
|
$spacing-tabs_bar_extra-paddingY: 0px; // 附加操作垂直内边距
|
|
71
90
|
$spacing-tabs_bar_extra-paddingX: 5px; // 附加操作水平内边距
|
|
72
91
|
$spacing-tabs_tab_icon-marginRight: $spacing-tight; // 附加操作垂直内边距
|
|
@@ -119,3 +138,4 @@ $spacing-tabs_bar_button_tab-paddingX: $spacing-base-tight; // 按钮式页签
|
|
|
119
138
|
$radius-tabs_tab_card: var(--semi-border-radius-small) var(--semi-border-radius-small) 0 0; // 卡片式页签四向圆角
|
|
120
139
|
$radius-tabs_tab_card_left: var(--semi-border-radius-small) 0 0 var(--semi-border-radius-small); // 垂直卡片式页签四向圆角
|
|
121
140
|
$radius-tabs_tab_button: var(--semi-border-radius-small); // 按钮式页签圆角
|
|
141
|
+
|
|
@@ -65,7 +65,10 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
65
65
|
_bindResizeEvent(): void;
|
|
66
66
|
unBindResizeEvent(): void;
|
|
67
67
|
removePortal: () => void;
|
|
68
|
+
_adjustPos(position?: string, isVertical?: boolean, adjustType?: string, concatPos?: any): string;
|
|
68
69
|
_reversePos(position?: string, isVertical?: boolean): string;
|
|
70
|
+
_expandPos(position: string, concatPos: string): string;
|
|
71
|
+
_reducePos(position?: string): string;
|
|
69
72
|
clearDelayTimer(): void;
|
|
70
73
|
_generateEvent(types: ArrayElement<typeof strings.TRIGGER_SET>): {
|
|
71
74
|
triggerEventSet: {
|
|
@@ -80,7 +83,14 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
80
83
|
_togglePortalVisible(isVisible: boolean): void;
|
|
81
84
|
_roundPixel(pixel: number): number;
|
|
82
85
|
calcTransformOrigin(position: Position, triggerRect: DOMRect, translateX: number, translateY: number): string;
|
|
83
|
-
calcPosStyle(
|
|
86
|
+
calcPosStyle(props: {
|
|
87
|
+
triggerRect: DOMRect;
|
|
88
|
+
wrapperRect: DOMRect;
|
|
89
|
+
containerRect: PopupContainerDOMRect;
|
|
90
|
+
position?: Position;
|
|
91
|
+
spacing?: number;
|
|
92
|
+
isOverFlow?: [boolean, boolean];
|
|
93
|
+
}): Record<string, string | number>;
|
|
84
94
|
/**
|
|
85
95
|
* 耦合的东西比较多,稍微罗列一下:
|
|
86
96
|
*
|
|
@@ -97,7 +107,16 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
97
107
|
calcPosition: (triggerRect?: DOMRect, wrapperRect?: DOMRect, containerRect?: PopupContainerDOMRect, shouldUpdatePos?: boolean) => Record<string, string | number>;
|
|
98
108
|
isLR(position?: string): boolean;
|
|
99
109
|
isTB(position?: string): boolean;
|
|
100
|
-
|
|
110
|
+
isReverse(rowSpace: number, reverseSpace: number, size: number): boolean;
|
|
111
|
+
isOverFlow(rowSpace: number, reverseSpace: number, size: number): boolean;
|
|
112
|
+
isHalfOverFlow(posSpace: number, negSpace: number, size: number): boolean;
|
|
113
|
+
isHalfAllEnough(posSpace: number, negSpace: number, size: number): boolean;
|
|
114
|
+
getReverse(viewOverFlow: boolean, containerOverFlow: boolean, shouldReverseView: boolean, shouldReverseContainer: boolean): boolean;
|
|
115
|
+
adjustPosIfNeed(position: Position | string, style: Record<string, any>, triggerRect: DOMRect, wrapperRect: DOMRect, containerRect: PopupContainerDOMRect): {
|
|
116
|
+
position: string;
|
|
117
|
+
isHeightOverFlow: boolean;
|
|
118
|
+
isWidthOverFlow: boolean;
|
|
119
|
+
};
|
|
101
120
|
delayHide: () => void;
|
|
102
121
|
hide: () => void;
|
|
103
122
|
_bindScrollEvent(): void;
|