@douyinfe/semi-ui 2.43.0-alpha.0 → 2.43.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/dist/umd/semi-ui.js +26654 -26612
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/cascader/index.js +2 -4
- package/lib/cjs/cascader/item.d.ts +1 -5
- package/lib/cjs/cascader/item.js +55 -92
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/image/preview.js +1 -1
- package/lib/cjs/modal/confirm.d.ts +3 -3
- package/lib/cjs/tree/treeNode.js +3 -1
- package/lib/cjs/upload/index.d.ts +6 -0
- package/lib/cjs/upload/index.js +19 -0
- package/lib/es/cascader/index.js +2 -4
- package/lib/es/cascader/item.d.ts +1 -5
- package/lib/es/cascader/item.js +55 -92
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/image/preview.js +1 -1
- package/lib/es/modal/confirm.d.ts +3 -3
- package/lib/es/tree/treeNode.js +3 -1
- package/lib/es/upload/index.d.ts +6 -0
- package/lib/es/upload/index.js +19 -0
- package/package.json +8 -8
- package/lib/cjs/cascader/virtualRow.d.ts +0 -8
- package/lib/cjs/cascader/virtualRow.js +0 -21
- package/lib/es/cascader/virtualRow.d.ts +0 -8
- package/lib/es/cascader/virtualRow.js +0 -14
package/lib/es/image/preview.js
CHANGED
|
@@ -37,8 +37,8 @@ export default class Preview extends BaseComponent {
|
|
|
37
37
|
if (item.isIntersecting && src) {
|
|
38
38
|
item.target.src = src;
|
|
39
39
|
item.target.removeAttribute("data-src");
|
|
40
|
+
this.previewObserver.unobserve(item.target);
|
|
40
41
|
}
|
|
41
|
-
this.previewObserver.unobserve(item.target);
|
|
42
42
|
});
|
|
43
43
|
}, {
|
|
44
44
|
root: document.querySelector(`#${this.previewGroupId}`),
|
|
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
|
|
|
145
145
|
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
146
146
|
style?: React.CSSProperties;
|
|
147
147
|
className?: string;
|
|
148
|
+
motion?: boolean;
|
|
148
149
|
getPopupContainer?: () => HTMLElement;
|
|
149
150
|
footer?: React.ReactNode;
|
|
150
151
|
header?: React.ReactNode;
|
|
151
152
|
direction?: any;
|
|
152
|
-
motion?: boolean;
|
|
153
153
|
mask?: boolean;
|
|
154
154
|
visible?: boolean;
|
|
155
155
|
zIndex?: number;
|
|
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
204
204
|
title?: string;
|
|
205
205
|
name?: string;
|
|
206
206
|
value?: string | number | readonly string[];
|
|
207
|
-
form?: string;
|
|
208
|
-
slot?: string;
|
|
209
207
|
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
210
208
|
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
|
+
form?: string;
|
|
210
|
+
slot?: string;
|
|
211
211
|
prefix?: string;
|
|
212
212
|
dangerouslySetInnerHTML?: {
|
|
213
213
|
__html: string | TrustedHTML;
|
package/lib/es/tree/treeNode.js
CHANGED
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface UploadProps {
|
|
|
28
28
|
dragMainText?: ReactNode;
|
|
29
29
|
dragSubText?: ReactNode;
|
|
30
30
|
draggable?: boolean;
|
|
31
|
+
addOnPasting?: boolean;
|
|
31
32
|
fileList?: Array<FileItem>;
|
|
32
33
|
fileName?: string;
|
|
33
34
|
headers?: Record<string, any> | ((file: File) => Record<string, string>);
|
|
@@ -44,6 +45,7 @@ export interface UploadProps {
|
|
|
44
45
|
onClear?: () => void;
|
|
45
46
|
onDrop?: (e: Event, files: Array<File>, fileList: Array<FileItem>) => void;
|
|
46
47
|
onError?: (e: CustomError, file: File, fileList: Array<FileItem>, xhr: XMLHttpRequest) => void;
|
|
48
|
+
onPastingError?: (error: Error | PermissionStatus) => void;
|
|
47
49
|
onExceed?: (fileList: Array<File>) => void;
|
|
48
50
|
onFileChange?: (files: Array<File>) => void;
|
|
49
51
|
onOpenFileDialog?: () => void;
|
|
@@ -88,6 +90,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
88
90
|
static propTypes: {
|
|
89
91
|
accept: PropTypes.Requireable<string>;
|
|
90
92
|
action: PropTypes.Validator<string>;
|
|
93
|
+
addOnPasting: PropTypes.Requireable<boolean>;
|
|
91
94
|
afterUpload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
95
|
beforeClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
93
96
|
beforeRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -128,6 +131,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
128
131
|
onRetry: PropTypes.Requireable<(...args: any[]) => any>;
|
|
129
132
|
onSizeError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
130
133
|
onSuccess: PropTypes.Requireable<(...args: any[]) => any>;
|
|
134
|
+
onPastingError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
131
135
|
previewFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
132
136
|
prompt: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
133
137
|
promptPosition: PropTypes.Requireable<"left" | "right" | "bottom">;
|
|
@@ -168,6 +172,8 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
168
172
|
foundation: UploadFoundation;
|
|
169
173
|
inputRef: RefObject<HTMLInputElement>;
|
|
170
174
|
replaceInputRef: RefObject<HTMLInputElement>;
|
|
175
|
+
pastingCb: null | ((params: any) => void);
|
|
176
|
+
componentDidMount(): void;
|
|
171
177
|
componentWillUnmount(): void;
|
|
172
178
|
onClick: () => void;
|
|
173
179
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
package/lib/es/upload/index.js
CHANGED
|
@@ -439,6 +439,19 @@ class Upload extends BaseComponent {
|
|
|
439
439
|
replaceInputKey: Math.random()
|
|
440
440
|
}));
|
|
441
441
|
},
|
|
442
|
+
isMac: () => {
|
|
443
|
+
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
|
444
|
+
},
|
|
445
|
+
registerPastingHandler: cb => {
|
|
446
|
+
document.body.addEventListener('keydown', cb);
|
|
447
|
+
this.pastingCb = cb;
|
|
448
|
+
},
|
|
449
|
+
unRegisterPastingHandler: () => {
|
|
450
|
+
if (this.pastingCb) {
|
|
451
|
+
document.body.removeEventListener('keydown', this.pastingCb);
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
notifyPastingError: error => this.props.onPastingError(error),
|
|
442
455
|
updateDragAreaStatus: dragAreaStatus => this.setState({
|
|
443
456
|
dragAreaStatus
|
|
444
457
|
}),
|
|
@@ -463,6 +476,9 @@ class Upload extends BaseComponent {
|
|
|
463
476
|
notifyBeforeClear: fileList => this.props.beforeClear(fileList)
|
|
464
477
|
});
|
|
465
478
|
}
|
|
479
|
+
componentDidMount() {
|
|
480
|
+
this.foundation.init();
|
|
481
|
+
}
|
|
466
482
|
componentWillUnmount() {
|
|
467
483
|
this.foundation.destroy();
|
|
468
484
|
}
|
|
@@ -538,6 +554,7 @@ class Upload extends BaseComponent {
|
|
|
538
554
|
Upload.propTypes = {
|
|
539
555
|
accept: PropTypes.string,
|
|
540
556
|
action: PropTypes.string.isRequired,
|
|
557
|
+
addOnPasting: PropTypes.bool,
|
|
541
558
|
afterUpload: PropTypes.func,
|
|
542
559
|
beforeClear: PropTypes.func,
|
|
543
560
|
beforeRemove: PropTypes.func,
|
|
@@ -578,6 +595,7 @@ Upload.propTypes = {
|
|
|
578
595
|
onRetry: PropTypes.func,
|
|
579
596
|
onSizeError: PropTypes.func,
|
|
580
597
|
onSuccess: PropTypes.func,
|
|
598
|
+
onPastingError: PropTypes.func,
|
|
581
599
|
previewFile: PropTypes.func,
|
|
582
600
|
prompt: PropTypes.node,
|
|
583
601
|
promptPosition: PropTypes.oneOf(strings.PROMPT_POSITION),
|
|
@@ -622,6 +640,7 @@ Upload.defaultProps = {
|
|
|
622
640
|
onRetry: _noop,
|
|
623
641
|
onSizeError: _noop,
|
|
624
642
|
onSuccess: _noop,
|
|
643
|
+
onPastingError: _noop,
|
|
625
644
|
promptPosition: 'right',
|
|
626
645
|
showClear: true,
|
|
627
646
|
showPicInfo: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.43.0
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.43.0
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.43.0
|
|
25
|
-
"@douyinfe/semi-foundation": "2.43.0
|
|
26
|
-
"@douyinfe/semi-icons": "2.43.0
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.43.0
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.43.0
|
|
23
|
+
"@douyinfe/semi-animation": "2.43.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.43.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.43.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.43.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.43.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.43.0",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "aa918000b24c716c67439b47d1e7fdf5707d30ff",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
const VirtualRow = _ref => {
|
|
8
|
-
let {
|
|
9
|
-
index,
|
|
10
|
-
data,
|
|
11
|
-
style
|
|
12
|
-
} = _ref;
|
|
13
|
-
const {
|
|
14
|
-
visibleOptions,
|
|
15
|
-
renderOption
|
|
16
|
-
} = data;
|
|
17
|
-
const option = visibleOptions[index];
|
|
18
|
-
return renderOption(option, index, style);
|
|
19
|
-
};
|
|
20
|
-
var _default = VirtualRow;
|
|
21
|
-
exports.default = _default;
|