@douyinfe/semi-ui 2.41.2 → 2.42.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/README.md +115 -10
- package/dist/css/semi.css +28 -7
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1450 -1744
- 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/button/splitButtonGroup.d.ts +2 -0
- package/lib/cjs/button/splitButtonGroup.js +14 -0
- package/lib/cjs/collapse/item.d.ts +2 -1
- package/lib/cjs/collapse/item.js +4 -1
- package/lib/cjs/form/baseForm.d.ts +12 -10
- package/lib/cjs/form/baseForm.js +17 -13
- package/lib/cjs/form/hoc/withField.js +13 -11
- package/lib/cjs/form/interface.d.ts +5 -3
- package/lib/cjs/inputNumber/index.js +1 -1
- package/lib/cjs/modal/confirm.d.ts +1 -1
- package/lib/cjs/table/ResizableHeaderCell.d.ts +2 -0
- package/lib/cjs/table/ResizableHeaderCell.js +6 -4
- package/lib/cjs/table/TableHeader.d.ts +2 -2
- package/lib/cjs/table/TableHeaderRow.d.ts +2 -1
- package/lib/cjs/table/TableHeaderRow.js +3 -0
- package/lib/cjs/table/interface.d.ts +2 -1
- package/lib/cjs/toast/index.d.ts +18 -0
- package/lib/cjs/toast/index.js +49 -4
- package/lib/cjs/toast/toast.d.ts +11 -0
- package/lib/cjs/toast/toast.js +22 -2
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/tooltip/index.js +2 -1
- package/lib/cjs/tree/treeNode.js +1 -2
- package/lib/cjs/typography/base.js +1 -3
- package/lib/cjs/upload/fileCard.d.ts +13 -2
- package/lib/cjs/upload/fileCard.js +52 -11
- package/lib/cjs/upload/index.d.ts +4 -0
- package/lib/cjs/upload/index.js +16 -4
- package/lib/es/button/splitButtonGroup.d.ts +2 -0
- package/lib/es/button/splitButtonGroup.js +14 -0
- package/lib/es/collapse/item.d.ts +2 -1
- package/lib/es/collapse/item.js +4 -1
- package/lib/es/form/baseForm.d.ts +12 -10
- package/lib/es/form/baseForm.js +17 -13
- package/lib/es/form/hoc/withField.js +14 -12
- package/lib/es/form/interface.d.ts +5 -3
- package/lib/es/inputNumber/index.js +1 -1
- package/lib/es/modal/confirm.d.ts +1 -1
- package/lib/es/table/ResizableHeaderCell.d.ts +2 -0
- package/lib/es/table/ResizableHeaderCell.js +6 -4
- package/lib/es/table/TableHeader.d.ts +2 -2
- package/lib/es/table/TableHeaderRow.d.ts +2 -1
- package/lib/es/table/TableHeaderRow.js +3 -0
- package/lib/es/table/interface.d.ts +2 -1
- package/lib/es/toast/index.d.ts +18 -0
- package/lib/es/toast/index.js +49 -4
- package/lib/es/toast/toast.d.ts +11 -0
- package/lib/es/toast/toast.js +22 -2
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/tooltip/index.js +2 -1
- package/lib/es/tree/treeNode.js +1 -2
- package/lib/es/typography/base.js +1 -3
- package/lib/es/upload/fileCard.d.ts +13 -2
- package/lib/es/upload/fileCard.js +52 -9
- package/lib/es/upload/index.d.ts +4 -0
- package/lib/es/upload/index.js +16 -4
- package/package.json +12 -8
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export interface UploadProps {
|
|
|
56
56
|
previewFile?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
57
57
|
prompt?: ReactNode;
|
|
58
58
|
promptPosition?: PromptPositionType;
|
|
59
|
+
picHeight?: string | number;
|
|
60
|
+
picWidth?: string | number;
|
|
59
61
|
renderFileItem?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
60
62
|
renderPicInfo?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
61
63
|
renderThumbnail?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
@@ -129,6 +131,8 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
129
131
|
previewFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
130
132
|
prompt: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
131
133
|
promptPosition: PropTypes.Requireable<"left" | "right" | "bottom">;
|
|
134
|
+
picWidth: PropTypes.Requireable<NonNullable<string | number>>;
|
|
135
|
+
picHeight: PropTypes.Requireable<NonNullable<string | number>>;
|
|
132
136
|
renderFileItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
133
137
|
renderPicPreviewIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
134
138
|
renderFileOperation: PropTypes.Requireable<(...args: any[]) => any>;
|
package/lib/es/upload/index.js
CHANGED
|
@@ -109,7 +109,9 @@ class Upload extends BaseComponent {
|
|
|
109
109
|
renderFileItem,
|
|
110
110
|
renderThumbnail,
|
|
111
111
|
disabled,
|
|
112
|
-
onPreviewClick
|
|
112
|
+
onPreviewClick,
|
|
113
|
+
picWidth,
|
|
114
|
+
picHeight
|
|
113
115
|
} = this.props;
|
|
114
116
|
const onRemove = () => this.remove(file);
|
|
115
117
|
const onRetry = () => {
|
|
@@ -133,7 +135,9 @@ class Upload extends BaseComponent {
|
|
|
133
135
|
renderFileOperation,
|
|
134
136
|
renderThumbnail,
|
|
135
137
|
onReplace,
|
|
136
|
-
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined
|
|
138
|
+
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined,
|
|
139
|
+
picWidth,
|
|
140
|
+
picHeight
|
|
137
141
|
});
|
|
138
142
|
if (status === strings.FILE_STATUS_UPLOAD_FAIL && !validateMessage) {
|
|
139
143
|
fileCardProps.validateMessage = locale.fail;
|
|
@@ -166,7 +170,9 @@ class Upload extends BaseComponent {
|
|
|
166
170
|
disabled,
|
|
167
171
|
children,
|
|
168
172
|
draggable,
|
|
169
|
-
hotSpotLocation
|
|
173
|
+
hotSpotLocation,
|
|
174
|
+
picHeight,
|
|
175
|
+
picWidth
|
|
170
176
|
} = this.props;
|
|
171
177
|
const {
|
|
172
178
|
fileList: stateFileList,
|
|
@@ -190,7 +196,11 @@ class Upload extends BaseComponent {
|
|
|
190
196
|
const addContentProps = {
|
|
191
197
|
role: 'button',
|
|
192
198
|
className: uploadAddCls,
|
|
193
|
-
onClick: this.onClick
|
|
199
|
+
onClick: this.onClick,
|
|
200
|
+
style: {
|
|
201
|
+
height: picHeight,
|
|
202
|
+
width: picWidth
|
|
203
|
+
}
|
|
194
204
|
};
|
|
195
205
|
const containerProps = {
|
|
196
206
|
className: fileListCls
|
|
@@ -571,6 +581,8 @@ Upload.propTypes = {
|
|
|
571
581
|
previewFile: PropTypes.func,
|
|
572
582
|
prompt: PropTypes.node,
|
|
573
583
|
promptPosition: PropTypes.oneOf(strings.PROMPT_POSITION),
|
|
584
|
+
picWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
585
|
+
picHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
574
586
|
renderFileItem: PropTypes.func,
|
|
575
587
|
renderPicPreviewIcon: PropTypes.func,
|
|
576
588
|
renderFileOperation: PropTypes.func,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"date-fns-tz": "^1.3.8",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"prop-types": "^15.7.2",
|
|
36
|
-
"react-resizable": "^
|
|
36
|
+
"react-resizable": "^3.0.5",
|
|
37
37
|
"react-window": "^1.8.2",
|
|
38
38
|
"resize-observer-polyfill": "^1.5.1",
|
|
39
39
|
"scroll-into-view-if-needed": "^2.2.24",
|
|
@@ -50,11 +50,15 @@
|
|
|
50
50
|
"./index.ts"
|
|
51
51
|
],
|
|
52
52
|
"keywords": [
|
|
53
|
-
"semi",
|
|
54
|
-
"react component library",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"dark mode"
|
|
53
|
+
"semi design to any design",
|
|
54
|
+
"a11y react component library",
|
|
55
|
+
"design to code",
|
|
56
|
+
"2700+ design token",
|
|
57
|
+
"dark mode",
|
|
58
|
+
"semi design",
|
|
59
|
+
"design ops",
|
|
60
|
+
"modern design system",
|
|
61
|
+
"figma ui kit"
|
|
58
62
|
],
|
|
59
63
|
"homepage": "https://semi.design",
|
|
60
64
|
"bugs": {
|
|
@@ -71,7 +75,7 @@
|
|
|
71
75
|
],
|
|
72
76
|
"author": "",
|
|
73
77
|
"license": "MIT",
|
|
74
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "9474987ca295598b41cde7fefbe4a464748e947b",
|
|
75
79
|
"devDependencies": {
|
|
76
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
77
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|