@@ -33,13 +33,13 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
3333 borderStyle = 'solid' ,
3434 color,
3535 fontFamily = 'Segoe UI' ,
36- fontSize = '14px ' ,
36+ fontSize = '25px ' ,
3737 fontWeight = '400' ,
3838 height,
3939 maxHeight,
4040 minHeight,
4141 textAlign = 'center' ,
42- ... rest
42+
4343 } = style || { } ;
4444
4545 const { layout, isDragger } = model ;
@@ -51,55 +51,60 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
5151 const storedFilesRendererBtnContainer = 'stored-files-renderer-btn-container' ;
5252 const storedFilesRendererNoFiles = 'stored-files-renderer-no-files' ;
5353
54+ const commonBorderStyles = css `
55+ border : ${ borderWidth } ${ borderStyle } ${ borderColor } ;
56+ border-top : ${ borderTopWidth || borderWidth } ${ borderTopStyle || borderStyle } ${ borderTopColor || borderColor } ;
57+ border-right : ${ borderRightWidth || borderWidth } ${ borderRightStyle || borderStyle } ${ borderRightColor || borderColor } ;
58+ border-left : ${ borderLeftWidth || borderWidth } ${ borderLeftStyle || borderStyle } ${ borderLeftColor || borderColor } ;
59+ border-bottom : ${ borderBottomWidth || borderWidth } ${ borderBottomStyle || borderStyle } ${ borderBottomColor || borderColor } ;
60+ box-shadow : ${ boxShadow } ;
61+ ` ;
62+
63+ const commonTextStyles = css `
64+ color : ${ color || token . colorPrimary } ;
65+ font-family : ${ fontFamily } ;
66+ font-size : ${ fontSize } ;
67+ font-weight : ${ fontWeight } ;
68+ text-align : ${ textAlign } ;
69+ ` ;
70+
5471 const shaStoredFilesRenderer = cx (
5572 'sha-stored-files-renderer' ,
5673 css `
5774 --thumbnail-width : ${ layout ? ( width ?? height ?? '54px' ) : '100%' } ;
5875 --thumbnail-height : ${ layout ? ( height ?? width ?? '54px' ) : '100%' } ;
59- --ant-border-radius-xs : ${ borderRadius ?? '8px' } !important ;
60- --ant-border-radius-sm : ${ borderRadius ?? '8px' } !important ;
61- --ant-border-radius-lg : ${ borderRadius ?? '8px' } !important ;
62- --ant-button-content-font-size : ${ fontSize ?? '14px' } !important ;
63- --ant-button-font-weight : ${ fontWeight ?? '400' } !important ;
64- --ant-font-family : ${ fontFamily ?? 'Segoe UI' } !important ;
65- --ant-button-font-weight : ${ fontWeight ?? '400' } !important ;
66- ${ rest }
67- max-height : auto;
76+ --ant-border-radius-xs : ${ borderRadius } !important ;
77+ --ant-border-radius-sm : ${ borderRadius } !important ;
78+ --ant-border-radius-lg : ${ borderRadius } !important ;
79+ --ant-button-content-font-size : ${ fontSize } !important ;
80+ --ant-button-font-weight : ${ fontWeight } !important ;
81+ --ant-font-family : ${ fontFamily } !important ;
6882 height : ${ height ?? '54px' } !important ;
6983 width : ${ width ?? '54px' } !important ;
84+ max-height : ${ maxHeight ?? 'auto' } !important ;
85+ min-height : ${ minHeight } !important ;
86+ max-width : ${ maxWidth } !important ;
87+ min-width : ${ minWidth } !important ;
7088
7189 .ant-upload-select-picture-card {
7290 width : var (--thumbnail-width ) !important ;
7391 height : var (--thumbnail-height ) !important ;
92+ background-position : ${ backgroundPosition } !important ;
93+ background-repeat : ${ backgroundRepeat } !important ;
94+ background-size : ${ backgroundSize } !important ;
7495 }
7596
76- .ant-upload-list-picture-card-container {
77- width : var (--thumbnail-width ) !important ;
78- height : var (--thumbnail-height ) !important ;
79- }
80-
81- .ant-upload-list-picture-card .ant-upload-list-item {
97+ .ant-upload-list-item {
8298 width : var (--thumbnail-width ) !important ;
83- height : var (--thumbnail-height ) !important ;
84-
85- img {
86- width : 100% !important ;
87- height : 100% !important ;
88- object-fit : contain !important ;
89- }
90- .ant-image .anticon {
91- border-radius : ${ borderRadius ?? '8px' } !important ;
92- display : block !important ;
93-
94- }
99+ height : calc (var (--thumbnail-height ) + 32px ) !important ;
100+ border-top : ${ borderTop } !important ;
101+ border-bottom : ${ borderBottom } !important ;
102+ border-right : ${ borderRight } !important ;
95103 }
96104
97- .ant-upload-list-picture-card .ant-upload-list-item-thumbnail {
98- img {
99- width : 100% !important ;
100- height : 100% !important ;
101- object-fit : contain !important ;
102- }
105+ .ant-upload-list-picture-card {
106+ height : calc (var (--thumbnail-height ) + ${ fontSize } * 2 + 32px ) !important ;
107+ padding-bottom : 1rem ;
103108 }
104109
105110 .ant-upload-list-item-image {
@@ -110,64 +115,42 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
110115
111116 .ant-upload : not (.ant-upload-disabled ) {
112117 .icon {
113- color : ${ token . colorPrimary } !important ;
118+ color : ${ color || token . colorPrimary } !important ;
114119 }
115120 }
116121
117122 .ant-upload-list-item {
118123 --ant-line-width : 0px !important ;
119124 --ant-padding-xs : 0px !important ;
120- --font-size : ${ fontSize ?? '14px' } !important ;
121- --ant-font-size : ${ fontSize ?? '14px' } !important ;
122- border-radius : ${ borderRadius ?? '8px' } !important ;
125+ --font-size : ${ fontSize } !important ;
126+ --ant-font-size : ${ fontSize } !important ;
127+ border-radius : ${ borderRadius } !important ;
123128 display : flex;
124129
125130 : before {
126131 top : 0 ;
127132 width : 100% !important ;
128- border-radius : ${ borderRadius ?? '8px' } !important ;
133+ border-radius : ${ borderRadius } !important ;
129134 height : 100% !important ;
130135 }
131136 }
132137
133138 .ant-upload-list-item-thumbnail {
134- border-radius : ${ borderRadius ?? '8px' } !important ;
139+ border-radius : ${ borderRadius } !important ;
135140 padding : 0 !important ;
136- background : ${ background ?? backgroundImage ?? ( backgroundColor || '#fff' ) } !important ;
137- border : ${ borderWidth } ${ borderStyle } ${ borderColor } ;
138- border-top : ${ borderTopWidth || borderWidth } ${ borderTopStyle || borderStyle } ${ borderTopColor || borderColor } ;
139- border-right : ${ borderRightWidth || borderWidth } ${ borderRightStyle || borderStyle }
140- ${ borderRightColor || borderColor } ;
141- border-left : ${ borderLeftWidth || borderWidth } ${ borderLeftStyle || borderStyle }
142- ${ borderLeftColor || borderColor } ;
143- border-bottom : ${ borderBottomWidth || borderWidth } ${ borderBottomStyle || borderStyle }
144- ${ borderBottomColor || borderColor } ;
145- box-shadow : ${ boxShadow } ;
146-
147- img {
148- width : var (--thumbnail-width , 54px ) !important ;
149- height : var (--thumbnail-height , 54px ) !important ;
150- border-radius : ${ borderRadius ?? '8px' } !important ;
151- object-fit : cover !important ;
152- display : flex !important ;
153- justify-content : center !important ;
154- }
155- .ant-image .anticon {
156- border-radius : ${ borderRadius ?? '8px' } !important ;
157- display : block !important ;
158- }
141+ background : ${ background ?? backgroundImage ?? backgroundColor } !important ;
142+ ${ commonBorderStyles }
159143 }
160144
161145 .ant-upload-list-item-name {
162- display : 'block' ;
163- color : ${ color ?? token . colorPrimary } ;
164- font-family : ${ fontFamily ?? 'Segoe UI' } ;
165- font-size : ${ fontSize ?? '14px' } ;
166- font-weight : ${ fontWeight ?? '400' } ;
167- text-align : ${ textAlign ?? 'center' } ;
146+ display : block;
147+ ${ commonTextStyles }
168148 padding : 0 8px !important ;
169149 width : ${ ( layout && width ) ?? '54px' } !important ;
170- font-size : var (--font-size , 14px ) !important ;
150+ white-space : nowrap;
151+ overflow : hidden;
152+ text-overflow : ellipsis;
153+ max-width : 100% ;
171154 }
172155
173156 .thumbnail-stub {
@@ -194,15 +177,14 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
194177 .${ prefixCls } -upload {
195178 ${ layout && ! isDragger && 'width: var(--thumbnail-width) !important;' } ;
196179 ${ layout && ! isDragger && 'height: var(--thumbnail-height) !important' } ;
197- bor der- radius: ${ borderRadius ?? '8px' } !important ;
180+ bor der- radius: ${ borderRadius } !important ;
198181 align- items: center;
199182
200183 & .${ prefixCls } -upload-btn {
201184 .${ prefixCls } -upload-drag-icon {
202185 margin : unset;
203186 }
204187
205-
206188 .ant-upload-select {
207189 align-content : center;
208190 }
@@ -212,16 +194,16 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
212194 .ant-btn {
213195 padding : 0 ;
214196 * {
215- font-size : ${ fontSize ?? '14px' } !important ;
216- font-weight : ${ fontWeight ?? '400' } !important ;
217- font-family : ${ fontFamily ?? 'Segoe UI' } !important ;
197+ font-size : ${ fontSize } !important ;
198+ font-weight : ${ fontWeight } !important ;
199+ font-family : ${ fontFamily } !important ;
218200 }
219201 }
220202
221203 .ant-upload-list-item-container {
222204 width : var (--thumbnail-width ) !important ;
223205 height : var (--thumbnail-height ) !important ;
224- border-radius : ${ borderRadius ?? '8px' } !important ;
206+ border-radius : ${ borderRadius } !important ;
225207 & .ant-upload-animate-inline-appear ,
226208 & .ant-upload-animate-inline-appear-active ,
227209 & .ant-upload-animate-inline {
@@ -251,11 +233,10 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
251233 css `
252234 width : var (--thumbnail-width , 54px ) !important ;
253235 height : var (--thumbnail-height , 54px ) !important ;
254- border-radius : ${ borderRadius ?? '8px' } !important ;
236+ border-radius : ${ borderRadius } !important ;
255237 object-fit : cover !important ;
256238 display : flex !important ;
257239 justify-content : center !important ;
258- border-radius : 8px ;
259240 `
260241 ) ;
261242
@@ -304,6 +285,23 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
304285 `
305286 ) ;
306287
288+ const styledFileControls = cx (
289+ 'styled-file-controls' ,
290+ css `
291+ ${ commonBorderStyles }
292+ ${ commonTextStyles }
293+ border-radius : ${ borderRadius } !important ;
294+ padding : 0 !important ;
295+ background : ${ background ?? backgroundImage ?? backgroundColor } !important ;
296+ width : ${ width || '90px' } !important ;
297+ height : ${ height || '90px' } !important ;
298+ display : flex !important ;
299+ align-items : center !important ;
300+ justify-content : center !important ;
301+ font-size : ${ fontSize || '14px' } !important ;
302+ `
303+ ) ;
304+
307305 return {
308306 shaStoredFilesRenderer,
309307 storedFilesRendererBtnContainer,
@@ -314,5 +312,6 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
314312 overlayThumbnailControls,
315313 antUploadText,
316314 antUploadHint,
315+ styledFileControls,
317316 } ;
318317} ) ;
0 commit comments