@@ -30,7 +30,7 @@ public partial class CardUpload<TValue>
3030
3131 private bool ShowPreviewList => Files . Count != 0 ;
3232
33- private List < string ? > PreviewList => Files . Select ( i => i . PrevUrl ) . ToList ( ) ;
33+ private List < string ? > PreviewList => [ .. Files . Select ( i => i . PrevUrl ) ] ;
3434
3535 private string ? GetDeleteButtonDisabledString ( UploadFile item ) => ( ! IsDisabled && item . Uploaded ) ? null : "disabled" ;
3636
@@ -72,24 +72,12 @@ public partial class CardUpload<TValue>
7272 [ Parameter ]
7373 public string ? StatusIcon { get ; set ; }
7474
75- /// <summary>
76- /// 获得/设置 删除图标
77- /// </summary>
78- [ Parameter ]
79- public string ? DeleteIcon { get ; set ; }
80-
8175 /// <summary>
8276 /// 获得/设置 移除图标
8377 /// </summary>
8478 [ Parameter ]
8579 public string ? RemoveIcon { get ; set ; }
8680
87- /// <summary>
88- /// 获得/设置 下载图标
89- /// </summary>
90- [ Parameter ]
91- public string ? DownloadIcon { get ; set ; }
92-
9381 /// <summary>
9482 /// 获得/设置 放大图标
9583 /// </summary>
@@ -110,124 +98,24 @@ public partial class CardUpload<TValue>
11098 [ ExcludeFromCodeCoverage ]
11199 public bool ShowDeletedButton { get ; set ; } = true ;
112100
113- /// <summary>
114- /// 获得/设置 是否显示删除按钮 默认 true 显示
115- /// </summary>
116- [ Parameter ]
117- public bool ShowDeleteButton { get ; set ; } = true ;
118-
119101 /// <summary>
120102 /// 获得/设置 继续上传按钮是否在列表前 默认 false
121103 /// </summary>
122104 [ Parameter ]
123105 public bool IsUploadButtonAtFirst { get ; set ; }
124106
125- /// <summary>
126- /// 获得/设置 是否显示下载按钮 默认 false
127- /// </summary>
128- [ Parameter ]
129- public bool ShowDownloadButton { get ; set ; }
130-
131- /// <summary>
132- /// 获得/设置 点击下载按钮回调方法 默认 null
133- /// </summary>
134- [ Parameter ]
135- public Func < UploadFile , Task > ? OnDownload { get ; set ; }
136-
137- /// <summary>
138- /// 获得/设置 点击取消按钮回调此方法 默认 null
139- /// </summary>
140- [ Parameter ]
141- public Func < UploadFile , Task > ? OnCancel { get ; set ; }
142-
143107 /// <summary>
144108 /// 获得/设置 点击 Zoom 图标回调方法
145109 /// </summary>
146110 [ Parameter ]
147111 public Func < UploadFile , Task > ? OnZoomAsync { get ; set ; }
148112
149- /// <summary>
150- /// 获得/设置 取消图标
151- /// </summary>
152- [ Parameter ]
153- public string ? CancelIcon { get ; set ; }
154-
155113 /// <summary>
156114 /// 获得/设置 图标文件扩展名集合 ".png"
157115 /// </summary>
158116 [ Parameter ]
159117 public List < string > ? AllowExtensions { get ; set ; }
160118
161- /// <summary>
162- /// 获得/设置 Excel 类型文件图标
163- /// </summary>
164- [ Parameter ]
165- public string ? FileIconExcel { get ; set ; }
166-
167- /// <summary>
168- /// 获得/设置 Docx 类型文件图标
169- /// </summary>
170- [ Parameter ]
171- public string ? FileIconDocx { get ; set ; }
172-
173- /// <summary>
174- /// 获得/设置 PPT 类型文件图标
175- /// </summary>
176- [ Parameter ]
177- public string ? FileIconPPT { get ; set ; }
178-
179- /// <summary>
180- /// 获得/设置 Audio 类型文件图标
181- /// </summary>
182- [ Parameter ]
183- public string ? FileIconAudio { get ; set ; }
184-
185- /// <summary>
186- /// 获得/设置 Video 类型文件图标
187- /// </summary>
188- [ Parameter ]
189- public string ? FileIconVideo { get ; set ; }
190-
191- /// <summary>
192- /// 获得/设置 File 类型文件图标
193- /// </summary>
194- [ Parameter ]
195- public string ? FileIconCode { get ; set ; }
196-
197- /// <summary>
198- /// 获得/设置 Pdf 类型文件图标
199- /// </summary>
200- [ Parameter ]
201- public string ? FileIconPdf { get ; set ; }
202-
203- /// <summary>
204- /// 获得/设置 Zip 类型文件图标
205- /// </summary>
206- [ Parameter ]
207- public string ? FileIconZip { get ; set ; }
208-
209- /// <summary>
210- /// 获得/设置 Archive 类型文件图标
211- /// </summary>
212- [ Parameter ]
213- public string ? FileIconArchive { get ; set ; }
214-
215- /// <summary>
216- /// 获得/设置 Image 类型文件图标
217- /// </summary>
218- [ Parameter ]
219- public string ? FileIconImage { get ; set ; }
220-
221- /// <summary>
222- /// 获得/设置 File 类型文件图标
223- /// </summary>
224- [ Parameter ]
225- public string ? FileIconFile { get ; set ; }
226-
227- [ Inject ]
228- [ NotNull ]
229- private IIconTheme ? IconTheme { get ; set ; }
230-
231119 private string ? ActionClassString => CssBuilder . Default ( "upload-item-actions" )
232120 . AddClass ( "btn-browser" , IsDisabled == false )
233121 . Build ( ) ;
@@ -241,23 +129,8 @@ protected override void OnParametersSet()
241129
242130 AddIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadAddIcon ) ;
243131 StatusIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadStatusIcon ) ;
244- DeleteIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadDeleteIcon ) ;
245- RemoveIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadRemoveIcon ) ;
246- DownloadIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadDownloadIcon ) ;
247132 ZoomIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadZoomIcon ) ;
248-
249- CancelIcon ??= IconTheme . GetIconByKey ( ComponentIcons . UploadCancelIcon ) ;
250- FileIconExcel ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconExcel ) ;
251- FileIconDocx ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconDocx ) ;
252- FileIconPPT ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconPPT ) ;
253- FileIconAudio ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconAudio ) ;
254- FileIconVideo ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconVideo ) ;
255- FileIconCode ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconCode ) ;
256- FileIconPdf ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconPdf ) ;
257- FileIconZip ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconZip ) ;
258- FileIconArchive ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconArchive ) ;
259- FileIconImage ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconImage ) ;
260- FileIconFile ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconFile ) ;
133+ RemoveIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadRemoveIcon ) ;
261134 }
262135
263136 private async Task OnCardFileDelete ( UploadFile item )
0 commit comments