@douyinfe/semi-foundation 2.63.2-alpha.0 → 2.64.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/calendar/foundation.ts +20 -0
- package/colorPicker/AlphaSliderFoundation.ts +62 -0
- package/colorPicker/ColorChooseAreaFoundation.ts +86 -0
- package/colorPicker/ColorSliderFoundation.ts +61 -0
- package/colorPicker/DataPartFoundation.ts +113 -0
- package/colorPicker/colorPicker.scss +113 -0
- package/colorPicker/constants.ts +11 -0
- package/colorPicker/foundation.ts +206 -0
- package/colorPicker/interface.ts +51 -0
- package/colorPicker/utils/convert.ts +228 -0
- package/colorPicker/utils/round.ts +3 -0
- package/colorPicker/utils/split.ts +40 -0
- package/colorPicker/variables.scss +28 -0
- package/image/previewImageFoundation.ts +22 -17
- package/lib/cjs/calendar/foundation.js +18 -0
- package/lib/cjs/colorPicker/AlphaSliderFoundation.d.ts +27 -0
- package/lib/cjs/colorPicker/AlphaSliderFoundation.js +40 -0
- package/lib/cjs/colorPicker/ColorChooseAreaFoundation.d.ts +42 -0
- package/lib/cjs/colorPicker/ColorChooseAreaFoundation.js +62 -0
- package/lib/cjs/colorPicker/ColorSliderFoundation.d.ts +26 -0
- package/lib/cjs/colorPicker/ColorSliderFoundation.js +40 -0
- package/lib/cjs/colorPicker/DataPartFoundation.d.ts +28 -0
- package/lib/cjs/colorPicker/DataPartFoundation.js +115 -0
- package/lib/cjs/colorPicker/colorPicker.css +84 -0
- package/lib/cjs/colorPicker/colorPicker.scss +113 -0
- package/lib/cjs/colorPicker/constants.d.ts +4 -0
- package/lib/cjs/colorPicker/constants.js +11 -0
- package/lib/cjs/colorPicker/foundation.d.ts +66 -0
- package/lib/cjs/colorPicker/foundation.js +150 -0
- package/lib/cjs/colorPicker/interface.d.ts +40 -0
- package/lib/cjs/colorPicker/interface.js +5 -0
- package/lib/cjs/colorPicker/utils/convert.d.ts +28 -0
- package/lib/cjs/colorPicker/utils/convert.js +306 -0
- package/lib/cjs/colorPicker/utils/round.d.ts +1 -0
- package/lib/cjs/colorPicker/utils/round.js +12 -0
- package/lib/cjs/colorPicker/utils/split.d.ts +18 -0
- package/lib/cjs/colorPicker/utils/split.js +40 -0
- package/lib/cjs/colorPicker/variables.scss +28 -0
- package/lib/cjs/image/previewImageFoundation.js +22 -18
- package/lib/cjs/slider/foundation.d.ts +1 -0
- package/lib/cjs/slider/foundation.js +15 -0
- package/lib/cjs/tabs/constants.d.ts +0 -1
- package/lib/cjs/tabs/constants.js +1 -2
- package/lib/cjs/tabs/tabs.css +199 -28
- package/lib/cjs/tabs/tabs.scss +297 -336
- package/lib/cjs/tabs/variables.scss +2 -21
- package/lib/cjs/tooltip/foundation.js +2 -1
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/cjs/upload/foundation.d.ts +1 -0
- package/lib/cjs/upload/foundation.js +30 -14
- package/lib/es/calendar/foundation.js +18 -0
- package/lib/es/colorPicker/AlphaSliderFoundation.d.ts +27 -0
- package/lib/es/colorPicker/AlphaSliderFoundation.js +33 -0
- package/lib/es/colorPicker/ColorChooseAreaFoundation.d.ts +42 -0
- package/lib/es/colorPicker/ColorChooseAreaFoundation.js +55 -0
- package/lib/es/colorPicker/ColorSliderFoundation.d.ts +26 -0
- package/lib/es/colorPicker/ColorSliderFoundation.js +33 -0
- package/lib/es/colorPicker/DataPartFoundation.d.ts +28 -0
- package/lib/es/colorPicker/DataPartFoundation.js +108 -0
- package/lib/es/colorPicker/colorPicker.css +84 -0
- package/lib/es/colorPicker/colorPicker.scss +113 -0
- package/lib/es/colorPicker/constants.d.ts +4 -0
- package/lib/es/colorPicker/constants.js +6 -0
- package/lib/es/colorPicker/foundation.d.ts +66 -0
- package/lib/es/colorPicker/foundation.js +143 -0
- package/lib/es/colorPicker/interface.d.ts +40 -0
- package/lib/es/colorPicker/interface.js +1 -0
- package/lib/es/colorPicker/utils/convert.d.ts +28 -0
- package/lib/es/colorPicker/utils/convert.js +277 -0
- package/lib/es/colorPicker/utils/round.d.ts +1 -0
- package/lib/es/colorPicker/utils/round.js +5 -0
- package/lib/es/colorPicker/utils/split.d.ts +18 -0
- package/lib/es/colorPicker/utils/split.js +34 -0
- package/lib/es/colorPicker/variables.scss +28 -0
- package/lib/es/image/previewImageFoundation.js +22 -18
- package/lib/es/slider/foundation.d.ts +1 -0
- package/lib/es/slider/foundation.js +15 -0
- package/lib/es/tabs/constants.d.ts +0 -1
- package/lib/es/tabs/constants.js +1 -2
- package/lib/es/tabs/tabs.css +199 -28
- package/lib/es/tabs/tabs.scss +297 -336
- package/lib/es/tabs/variables.scss +2 -21
- package/lib/es/tooltip/foundation.js +2 -1
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/upload/constants.d.ts +1 -1
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +30 -14
- package/package.json +3 -3
- package/slider/foundation.ts +13 -0
- package/tabs/constants.ts +1 -2
- package/tabs/tabs.scss +297 -336
- package/tabs/variables.scss +2 -21
- package/tooltip/foundation.ts +1 -1
- package/upload/foundation.ts +19 -3
package/tabs/variables.scss
CHANGED
|
@@ -26,13 +26,9 @@ $color-tabs_tab_line_disabled-text-hover: var(--semi-color-disabled-text); //
|
|
|
26
26
|
|
|
27
27
|
$color-tabs_tab_card_default-border-default: var(--semi-color-border); // 卡片式页签描边颜色 - 默认
|
|
28
28
|
|
|
29
|
-
$color-tabs_tab_button-bg-default: transparent; // 按钮式页签背景颜色 - 默认
|
|
30
29
|
$color-tabs_tab_button_selected-bg-default: var(--semi-color-primary-light-default); // 按钮式页签背景颜色 - 选中
|
|
31
30
|
$color-tabs_tab_button_selected-text-default: var(--semi-color-primary); // 按钮式页签文本颜色 - 选中
|
|
32
31
|
$color-tabs_tab_button-text-default: var(--semi-color-text-2); // 按钮式页签文本颜色 - 默认
|
|
33
|
-
$color-tabs_tab_button-text-active: var(--semi-color-text-0); // 按钮式页签文本颜色 - 按下
|
|
34
|
-
$color-tabs_tab_button-text-hover: var(--semi-color-text-0); // 按钮式页签文本颜色 - 按下
|
|
35
|
-
|
|
36
32
|
$color-tabs_tab_button-bg-hover: var(--semi-color-fill-0); // 按钮式页签背景颜色 - 悬浮
|
|
37
33
|
$color-tabs_tab_button-bg-active: var(--semi-color-fill-1); // 按钮式页签背景颜色 - 按下
|
|
38
34
|
|
|
@@ -69,10 +65,6 @@ $color-tabs_tab-pane_arrow_disabled-bg-hover: transparent;
|
|
|
69
65
|
$color-tabs_tab-pane_arrow_disabled-text-default: var(--semi-color-disabled-text);
|
|
70
66
|
$color-tabs_tab-pane_arrow_disabled-text-hover: var(--semi-color-disabled-text);
|
|
71
67
|
|
|
72
|
-
$color-tabs_tab_slash_line: var(--semi-color-text-2); //斜线式页签分割线字体颜色
|
|
73
|
-
// $font-tabs_tab_slash_line-fontWeight: $font-weight-regular; //斜线式页签分割线字重
|
|
74
|
-
$font-tabs_tab_slash_line-fontSize: $font-size-regular; //斜线式页签分割线字体大小
|
|
75
|
-
|
|
76
68
|
$font-tabs_tab-fontWeight: $font-weight-regular; // 页签文本字重 - 默认
|
|
77
69
|
$font-tabs_tab_active-fontWeight: $font-weight-bold; // 页签文本字重 - 选中
|
|
78
70
|
|
|
@@ -126,11 +118,6 @@ $spacing-tabs_bar_line_tab_left-padding: 12px; // 垂直线条式页签左侧内
|
|
|
126
118
|
$spacing-tabs_bar_line_tab_left_small-padding: $spacing-tight - 2px; // 小尺寸垂直线条式页签左侧内边距
|
|
127
119
|
$spacing-tabs_bar_line_tab_left_medium-padding: $spacing-base-tight - 2px; // 中等尺寸垂直线条式页签左侧内边距
|
|
128
120
|
|
|
129
|
-
$spacing-tabs_bar_slash_tab-paddingY: 12px; // 斜线式页签上下内边距
|
|
130
|
-
$spacing-tabs_bar_slash_tab-paddingX: 4px; // 斜线式页签水平内边距
|
|
131
|
-
$spacing-tabs_bar_slash-marginRight: 16px; // 斜线式页签右侧外边距
|
|
132
|
-
$spacing-tabs_bar_slash_line_marginLeft: 16px; // 斜线式页签斜线左侧外边距
|
|
133
|
-
|
|
134
121
|
$spacing-tabs_content-paddingY: 5px; // 页签内容区垂直方向内边距
|
|
135
122
|
$spacing-tabs_content-paddingX: 0; // 页签内容区水平方向内边距
|
|
136
123
|
|
|
@@ -161,11 +148,5 @@ $radius-tabs_tab_button: var(--semi-border-radius-small); // 按钮式页签圆
|
|
|
161
148
|
$font-tabs_bar_large-fontSize: $font-size-regular; // 大号模式 字体大小
|
|
162
149
|
$font-tabs_bar_small-fontSize: $font-size-regular; // 小号模式 字体大小
|
|
163
150
|
$font-tabs_bar_medium-fontSize: $font-size-regular; // 中等模式 字体大小
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
$font-tabs_bar_large-lineHeight: 20px; // 线条式页签大号模式 行高
|
|
168
|
-
$font-tabs_bar_small-lineHeight: 20px; // 线条式页签小号模式 行高
|
|
169
|
-
$font-tabs_bar_medium-lineHeight: 20px; // 线条式页签中等模式 行高
|
|
170
|
-
$font-tabs_bar_button-lineHeight: 20px; // 按钮式页签 行高
|
|
171
|
-
$font-tabs_bar_slash-lineHeight: 20px; // 卡片式页签 行高
|
|
151
|
+
|
|
152
|
+
|
package/tooltip/foundation.ts
CHANGED
|
@@ -337,7 +337,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
337
337
|
if (trigger==="hover") {
|
|
338
338
|
const checkTriggerIsHover = () => {
|
|
339
339
|
const triggerDOM = this._adapter.getTriggerDOM();
|
|
340
|
-
if (trigger && !triggerDOM
|
|
340
|
+
if (trigger && !triggerDOM?.matches?.(":hover")) {
|
|
341
341
|
this.hide();
|
|
342
342
|
}
|
|
343
343
|
this._adapter.off("portalInserted", checkTriggerIsHover);
|
package/upload/foundation.ts
CHANGED
|
@@ -94,6 +94,7 @@ export interface UploadAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<UploadAdapter<P, S>, P, S> {
|
|
97
|
+
destroyState: boolean = false;
|
|
97
98
|
constructor(adapter: UploadAdapter<P, S>) {
|
|
98
99
|
super({ ...adapter });
|
|
99
100
|
}
|
|
@@ -111,6 +112,7 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
|
|
|
111
112
|
if (!disabled) {
|
|
112
113
|
this.unbindPastingHandler();
|
|
113
114
|
}
|
|
115
|
+
this.destroyState = true;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
getError({ action, xhr, message, fileName }: { action: string;xhr: XMLHttpRequest;message?: string;fileName: string }): XhrError {
|
|
@@ -569,13 +571,27 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
|
|
|
569
571
|
}
|
|
570
572
|
|
|
571
573
|
if (xhr.upload) {
|
|
572
|
-
xhr.upload.onprogress = (e: ProgressEvent): void =>
|
|
574
|
+
xhr.upload.onprogress = (e: ProgressEvent): void => {
|
|
575
|
+
if (!this.destroyState) {
|
|
576
|
+
this.handleProgress({ e, fileInstance });
|
|
577
|
+
} else {
|
|
578
|
+
xhr.abort();
|
|
579
|
+
}
|
|
580
|
+
};
|
|
573
581
|
}
|
|
574
582
|
|
|
575
583
|
// Callback function after upload is completed
|
|
576
|
-
xhr.onload = (e: ProgressEvent): void =>
|
|
584
|
+
xhr.onload = (e: ProgressEvent): void => {
|
|
585
|
+
if (!this.destroyState) {
|
|
586
|
+
this.handleOnLoad({ e, xhr, fileInstance });
|
|
587
|
+
}
|
|
588
|
+
};
|
|
577
589
|
|
|
578
|
-
xhr.onerror = (e: ProgressEvent): void =>
|
|
590
|
+
xhr.onerror = (e: ProgressEvent): void => {
|
|
591
|
+
if (!this.destroyState) {
|
|
592
|
+
this.handleError({ e, xhr, fileInstance });
|
|
593
|
+
}
|
|
594
|
+
};
|
|
579
595
|
|
|
580
596
|
// add headers
|
|
581
597
|
let headers = option.headers || {};
|