codexly-ui 0.4.2 → 0.4.3
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/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -4954,7 +4954,8 @@ class ClxUploadComponent {
|
|
|
4954
4954
|
const existing = this.existingFiles().map(f => ({
|
|
4955
4955
|
kind: 'existing',
|
|
4956
4956
|
key: `existing:${f.id}`,
|
|
4957
|
-
name: f.name ??
|
|
4957
|
+
name: f.name ?? this._nameFromUrl(f.url),
|
|
4958
|
+
size: f.size,
|
|
4958
4959
|
isImage: true,
|
|
4959
4960
|
thumbUrl: f.url,
|
|
4960
4961
|
fileIcon: '',
|
|
@@ -5185,6 +5186,14 @@ class ClxUploadComponent {
|
|
|
5185
5186
|
: (files[0] ?? null);
|
|
5186
5187
|
this._onChange(value);
|
|
5187
5188
|
}
|
|
5189
|
+
_nameFromUrl(url) {
|
|
5190
|
+
try {
|
|
5191
|
+
return decodeURIComponent(url.split('/').pop() ?? url);
|
|
5192
|
+
}
|
|
5193
|
+
catch {
|
|
5194
|
+
return url;
|
|
5195
|
+
}
|
|
5196
|
+
}
|
|
5188
5197
|
_formatSize(bytes) {
|
|
5189
5198
|
if (bytes === 0)
|
|
5190
5199
|
return '0 B';
|