@douyinfe/semi-ui 2.42.2 → 2.43.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/dist/umd/semi-ui.js +111 -15
- 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/dropdown/dropdownItem.js +5 -1
- package/lib/cjs/table/Body/BaseRow.js +2 -2
- package/lib/cjs/table/ResizableTable.js +12 -7
- package/lib/cjs/tree/treeNode.js +3 -1
- package/lib/cjs/typography/base.d.ts +25 -4
- package/lib/cjs/typography/base.js +4 -4
- package/lib/cjs/typography/paragraph.d.ts +21 -0
- package/lib/cjs/typography/text.d.ts +21 -0
- package/lib/cjs/typography/title.d.ts +21 -0
- package/lib/cjs/upload/index.d.ts +6 -0
- package/lib/cjs/upload/index.js +19 -0
- package/lib/es/dropdown/dropdownItem.js +5 -1
- package/lib/es/table/Body/BaseRow.js +2 -2
- package/lib/es/table/ResizableTable.js +12 -7
- package/lib/es/tree/treeNode.js +3 -1
- package/lib/es/typography/base.d.ts +25 -4
- package/lib/es/typography/base.js +4 -4
- package/lib/es/typography/paragraph.d.ts +21 -0
- package/lib/es/typography/text.d.ts +21 -0
- package/lib/es/typography/title.d.ts +21 -0
- package/lib/es/upload/index.d.ts +6 -0
- package/lib/es/upload/index.js +19 -0
- package/package.json +8 -8
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.
|
|
3
|
+
"version": "2.43.0-beta.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.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.
|
|
26
|
-
"@douyinfe/semi-icons": "2.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.
|
|
23
|
+
"@douyinfe/semi-animation": "2.43.0-beta.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.43.0-beta.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.43.0-beta.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.43.0-beta.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.43.0-beta.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.43.0-beta.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": "48acb39a658ce8078194ef761a655f7c2215e2b2",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|