@douyinfe/semi-foundation 2.63.0 → 2.64.0-beta.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/chat/foundation.ts +18 -23
- 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/datePicker/foundation.ts +1 -1
- package/image/image.scss +6 -1
- package/image/previewImageFoundation.ts +233 -150
- package/image/previewInnerFoundation.ts +11 -6
- package/lib/cjs/calendar/foundation.js +18 -0
- package/lib/cjs/chat/foundation.d.ts +1 -2
- package/lib/cjs/chat/foundation.js +2 -7
- 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/datePicker/foundation.js +1 -1
- package/lib/cjs/image/image.css +5 -1
- package/lib/cjs/image/image.scss +6 -1
- package/lib/cjs/image/previewImageFoundation.d.ts +46 -13
- package/lib/cjs/image/previewImageFoundation.js +207 -181
- package/lib/cjs/image/previewInnerFoundation.d.ts +4 -3
- package/lib/cjs/image/previewInnerFoundation.js +5 -2
- 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/chat/foundation.d.ts +1 -2
- package/lib/es/chat/foundation.js +2 -7
- 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/datePicker/foundation.js +1 -1
- package/lib/es/image/image.css +5 -1
- package/lib/es/image/image.scss +6 -1
- package/lib/es/image/previewImageFoundation.d.ts +46 -13
- package/lib/es/image/previewImageFoundation.js +207 -181
- package/lib/es/image/previewInnerFoundation.d.ts +4 -3
- package/lib/es/image/previewInnerFoundation.js +5 -2
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +30 -14
- package/package.json +3 -3
- package/upload/foundation.ts +19 -3
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 || {};
|