@uploadcare/file-uploader 1.15.0-alpha.8 → 1.15.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/abstract/ActivityBlock.d.ts +5 -5
- package/abstract/ActivityBlock.d.ts.map +1 -1
- package/abstract/ActivityBlock.js +0 -3
- package/abstract/Block.d.ts +3 -9
- package/abstract/Block.d.ts.map +1 -1
- package/abstract/Block.js +1 -1
- package/abstract/CTX.d.ts +6 -6
- package/abstract/CTX.d.ts.map +1 -1
- package/abstract/LocaleManager.d.ts +3 -3
- package/abstract/LocaleManager.d.ts.map +1 -1
- package/abstract/ModalManager.d.ts +26 -17
- package/abstract/ModalManager.d.ts.map +1 -1
- package/abstract/ModalManager.js +31 -18
- package/abstract/SecureUploadsManager.d.ts +2 -2
- package/abstract/SecureUploadsManager.d.ts.map +1 -1
- package/abstract/SolutionBlock.d.ts +2 -2
- package/abstract/SolutionBlock.d.ts.map +1 -1
- package/abstract/TypedCollection.d.ts +44 -44
- package/abstract/TypedCollection.d.ts.map +1 -1
- package/abstract/TypedCollection.js +53 -33
- package/abstract/TypedData.d.ts +71 -25
- package/abstract/TypedData.d.ts.map +1 -1
- package/abstract/TypedData.js +74 -17
- package/abstract/UploaderBlock.d.ts +10 -10
- package/abstract/UploaderBlock.d.ts.map +1 -1
- package/abstract/UploaderBlock.js +22 -10
- package/abstract/UploaderPublicApi.d.ts +24 -23
- package/abstract/UploaderPublicApi.d.ts.map +1 -1
- package/abstract/UploaderPublicApi.js +21 -10
- package/abstract/ValidationManager.d.ts +125 -6
- package/abstract/ValidationManager.d.ts.map +1 -1
- package/abstract/ValidationManager.js +1 -1
- package/abstract/a11y.d.ts +2 -2
- package/abstract/a11y.d.ts.map +1 -1
- package/abstract/buildOutputCollectionState.d.ts +1 -1
- package/abstract/buildOutputCollectionState.d.ts.map +1 -1
- package/abstract/defineComponents.d.ts.map +1 -1
- package/abstract/l10nProcessor.d.ts.map +1 -1
- package/abstract/loadFileUploaderFrom.d.ts +1 -1
- package/abstract/loadFileUploaderFrom.d.ts.map +1 -1
- package/abstract/localeRegistry.d.ts.map +1 -1
- package/abstract/sharedConfigKey.d.ts.map +1 -1
- package/abstract/uploadEntrySchema.d.ts +123 -63
- package/abstract/uploadEntrySchema.d.ts.map +1 -1
- package/abstract/uploadEntrySchema.js +66 -81
- package/blocks/CameraSource/CameraSource.d.ts +9 -9
- package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
- package/blocks/CameraSource/calcCameraModes.d.ts +1 -1
- package/blocks/CameraSource/constants.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CropFrame.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorFilterControl.js +1 -1
- package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +3 -3
- package/blocks/CloudImageEditor/src/EditorImageCropper.js +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/EditorImageFader.js +1 -1
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +1 -1
- package/blocks/CloudImageEditor/src/EditorToolbar.js +1 -1
- package/blocks/CloudImageEditor/src/crop-utils.d.ts +14 -14
- package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/cropper-constants.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +1 -1
- package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +1 -1
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +3 -3
- package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/state.d.ts +4 -4
- package/blocks/CloudImageEditor/src/svg-sprite.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/types.d.ts +8 -58
- package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +5 -2
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
- package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +7 -3
- package/blocks/Config/Config.d.ts +3 -12
- package/blocks/Config/Config.d.ts.map +1 -1
- package/blocks/Config/assertions.d.ts +1 -1
- package/blocks/Config/initialConfig.d.ts +1 -1
- package/blocks/Config/initialConfig.d.ts.map +1 -1
- package/blocks/Config/initialConfig.js +1 -1
- package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
- package/blocks/Config/side-effects.d.ts.map +1 -1
- package/blocks/Config/validatorsType.d.ts +1 -1
- package/blocks/Config/validatorsType.d.ts.map +1 -1
- package/blocks/DropArea/DropArea.d.ts +2 -2
- package/blocks/DropArea/DropArea.d.ts.map +1 -1
- package/blocks/DropArea/addDropzone.d.ts.map +1 -1
- package/blocks/DropArea/drop-area.css +4 -2
- package/blocks/DropArea/getDropItems.d.ts +2 -2
- package/blocks/DropArea/getDropItems.d.ts.map +1 -1
- package/blocks/ExternalSource/ExternalSource.d.ts +3 -3
- package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
- package/blocks/ExternalSource/MessageBridge.d.ts +3 -3
- package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -1
- package/blocks/ExternalSource/query-string.d.ts.map +1 -1
- package/blocks/ExternalSource/types.d.ts +64 -64
- package/blocks/ExternalSource/types.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.d.ts +13 -40
- package/blocks/FileItem/FileItem.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.js +119 -172
- package/blocks/FileItem/FileItemConfig.d.ts +28 -0
- package/blocks/FileItem/FileItemConfig.d.ts.map +1 -0
- package/blocks/FileItem/FileItemConfig.js +74 -0
- package/blocks/FileItem/file-item.css +21 -6
- package/blocks/Img/ImgBase.d.ts +3 -3
- package/blocks/Img/ImgBase.d.ts.map +1 -1
- package/blocks/Img/ImgBase.js +9 -9
- package/blocks/Img/ImgConfig.d.ts.map +1 -1
- package/blocks/Img/configurations.d.ts.map +1 -1
- package/blocks/Modal/Modal.d.ts +21 -0
- package/blocks/Modal/Modal.d.ts.map +1 -1
- package/blocks/Modal/Modal.js +37 -16
- package/blocks/ProgressBar/ProgressBar.d.ts +6 -1
- package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/blocks/ProgressBar/ProgressBar.js +41 -44
- package/blocks/ProgressBar/progress-bar.css +8 -6
- package/blocks/Range/Range.d.ts.map +1 -1
- package/blocks/SimpleBtn/SimpleBtn.d.ts +2 -2
- package/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -1
- package/blocks/SourceBtn/SourceBtn.d.ts +2 -5
- package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
- package/blocks/SourceBtn/SourceBtn.js +5 -5
- package/blocks/SourceList/SourceList.js +2 -2
- package/blocks/Spinner/Spinner.d.ts.map +1 -1
- package/blocks/Thumb/Thumb.d.ts +30 -4
- package/blocks/Thumb/Thumb.d.ts.map +1 -1
- package/blocks/Thumb/Thumb.js +197 -12
- package/blocks/UploadCtxProvider/EventEmitter.d.ts +20 -20
- package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +4 -4
- package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -1
- package/blocks/UploadList/UploadList.d.ts +3 -3
- package/blocks/UploadList/UploadList.d.ts.map +1 -1
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts +3 -3
- package/blocks/svg-backgrounds/svg-backgrounds.d.ts.map +1 -1
- package/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -1
- package/blocks/utils/UploadSource.d.ts.map +1 -1
- package/blocks/utils/debounce.d.ts +3 -1
- package/blocks/utils/debounce.d.ts.map +1 -1
- package/blocks/{CloudImageEditor/src/lib → utils}/preloadImage.js +1 -1
- package/blocks/utils/resizeImage.d.ts +1 -1
- package/blocks/utils/resizeImage.d.ts.map +1 -1
- package/blocks/utils/throttle.d.ts +3 -1
- package/blocks/utils/throttle.d.ts.map +1 -1
- package/blocks/utils/userAgent.d.ts +1 -1
- package/blocks/utils/userAgent.d.ts.map +1 -1
- package/env.d.ts +1 -1
- package/env.d.ts.map +1 -1
- package/env.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.ssr.d.ts +9 -1
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +17 -11
- package/locales/file-uploader/ar.d.ts +1 -0
- package/locales/file-uploader/ar.js +1 -0
- package/locales/file-uploader/az.d.ts +1 -0
- package/locales/file-uploader/az.js +1 -0
- package/locales/file-uploader/ca.d.ts +1 -0
- package/locales/file-uploader/ca.js +1 -0
- package/locales/file-uploader/cs.d.ts +1 -0
- package/locales/file-uploader/cs.js +1 -0
- package/locales/file-uploader/da.d.ts +1 -0
- package/locales/file-uploader/da.js +1 -0
- package/locales/file-uploader/de.d.ts +1 -0
- package/locales/file-uploader/de.js +1 -0
- package/locales/file-uploader/el.d.ts +1 -0
- package/locales/file-uploader/el.js +1 -0
- package/locales/file-uploader/en.d.ts +1 -0
- package/locales/file-uploader/en.js +1 -0
- package/locales/file-uploader/es.d.ts +1 -0
- package/locales/file-uploader/es.js +1 -0
- package/locales/file-uploader/et.d.ts +1 -0
- package/locales/file-uploader/et.js +1 -0
- package/locales/file-uploader/fi.d.ts +1 -0
- package/locales/file-uploader/fi.js +1 -0
- package/locales/file-uploader/fr.d.ts +1 -0
- package/locales/file-uploader/fr.js +1 -0
- package/locales/file-uploader/he.d.ts +1 -0
- package/locales/file-uploader/he.js +1 -0
- package/locales/file-uploader/hy.d.ts +1 -0
- package/locales/file-uploader/hy.js +1 -0
- package/locales/file-uploader/is.d.ts +1 -0
- package/locales/file-uploader/is.js +1 -0
- package/locales/file-uploader/it.d.ts +1 -0
- package/locales/file-uploader/it.js +1 -0
- package/locales/file-uploader/ja.d.ts +1 -0
- package/locales/file-uploader/ja.js +1 -0
- package/locales/file-uploader/ka.d.ts +1 -0
- package/locales/file-uploader/ka.js +1 -0
- package/locales/file-uploader/kk.d.ts +1 -0
- package/locales/file-uploader/kk.js +1 -0
- package/locales/file-uploader/ko.d.ts +1 -0
- package/locales/file-uploader/ko.js +1 -0
- package/locales/file-uploader/lv.d.ts +1 -0
- package/locales/file-uploader/lv.js +1 -0
- package/locales/file-uploader/nb.d.ts +1 -0
- package/locales/file-uploader/nb.js +1 -0
- package/locales/file-uploader/nl.d.ts +1 -0
- package/locales/file-uploader/nl.js +1 -0
- package/locales/file-uploader/pl.d.ts +1 -0
- package/locales/file-uploader/pl.js +1 -0
- package/locales/file-uploader/pt.d.ts +1 -0
- package/locales/file-uploader/pt.js +1 -0
- package/locales/file-uploader/ro.d.ts +1 -0
- package/locales/file-uploader/ro.js +1 -0
- package/locales/file-uploader/ru.d.ts +1 -0
- package/locales/file-uploader/ru.js +1 -0
- package/locales/file-uploader/sk.d.ts +1 -0
- package/locales/file-uploader/sk.js +1 -0
- package/locales/file-uploader/sr.d.ts +1 -0
- package/locales/file-uploader/sr.js +1 -0
- package/locales/file-uploader/sv.d.ts +1 -0
- package/locales/file-uploader/sv.js +1 -0
- package/locales/file-uploader/tr.d.ts +1 -0
- package/locales/file-uploader/tr.js +1 -0
- package/locales/file-uploader/uk.d.ts +1 -0
- package/locales/file-uploader/uk.js +1 -0
- package/locales/file-uploader/vi.d.ts +1 -0
- package/locales/file-uploader/vi.js +1 -0
- package/locales/file-uploader/zh-TW.d.ts +1 -0
- package/locales/file-uploader/zh-TW.js +1 -0
- package/locales/file-uploader/zh.d.ts +1 -0
- package/locales/file-uploader/zh.js +1 -0
- package/package.json +7 -8
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts +2 -2
- package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +18 -2
- package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
- package/solutions/file-uploader/minimal/FileUploaderMinimal.js +46 -35
- package/solutions/file-uploader/minimal/index.css +5 -23
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
- package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
- package/types/jsx.d.ts +1 -1
- package/utils/browser-info.d.ts +13 -0
- package/utils/browser-info.d.ts.map +1 -0
- package/utils/browser-info.js +22 -0
- package/utils/browser-info.test.d.ts +2 -0
- package/utils/browser-info.test.d.ts.map +1 -0
- package/utils/browser-info.test.js +109 -0
- package/utils/cdn-utils.d.ts +3 -3
- package/utils/cdn-utils.d.ts.map +1 -1
- package/utils/fileTypes.d.ts +5 -1
- package/utils/fileTypes.d.ts.map +1 -1
- package/utils/fileTypes.js +18 -2
- package/utils/getPluralForm.d.ts.map +1 -1
- package/utils/isSecureTokenExpired.d.ts +1 -1
- package/utils/memoize.d.ts.map +1 -1
- package/utils/mixinClass.d.ts +3 -1
- package/utils/mixinClass.d.ts.map +1 -1
- package/utils/prettyBytes.d.ts.map +1 -1
- package/utils/template-utils.d.ts +1 -1
- package/utils/template-utils.d.ts.map +1 -1
- package/utils/toKebabCase.d.ts.map +1 -1
- package/utils/transparentPixelSrc.d.ts.map +1 -1
- package/utils/uniqueArray.d.ts.map +1 -1
- package/utils/validators/collection/validateCollectionUploadError.d.ts +1 -1
- package/utils/validators/collection/validateMultiple.d.ts +1 -1
- package/utils/validators/file/validateFileType.d.ts +1 -1
- package/utils/validators/file/validateIsImage.d.ts +1 -1
- package/utils/validators/file/validateMaxSizeLimit.d.ts +1 -1
- package/utils/validators/file/validateUploadError.d.ts +1 -1
- package/utils/waitForAttribute.d.ts +1 -1
- package/utils/waitForAttribute.d.ts.map +1 -1
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.js +4 -4
- package/web/uc-basic.min.css +1 -1
- package/web/uc-cloud-image-editor.min.js +2 -2
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.css +1 -1
- package/web/uc-file-uploader-minimal.min.js +4 -4
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-img.min.js +2 -2
- package/blocks/utils/supportCapture.d.ts +0 -2
- package/blocks/utils/supportCapture.d.ts.map +0 -1
- package/blocks/utils/supportCapture.js +0 -3
- /package/blocks/{CloudImageEditor/src/lib → utils}/preloadImage.d.ts +0 -0
- /package/blocks/{CloudImageEditor/src/lib → utils}/preloadImage.d.ts.map +0 -0
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
export class FileItem extends
|
|
2
|
-
/** @private */
|
|
3
|
-
private _entrySubs;
|
|
4
|
-
/**
|
|
5
|
-
* @private
|
|
6
|
-
* @type {any} TODO: Add types for upload entry
|
|
7
|
-
*/
|
|
8
|
-
private _entry;
|
|
9
|
-
/** @private */
|
|
10
|
-
private _isIntersecting;
|
|
11
|
-
/** @private */
|
|
12
|
-
private _debouncedGenerateThumb;
|
|
13
|
-
/** @private */
|
|
14
|
-
private _debouncedCalculateState;
|
|
1
|
+
export class FileItem extends FileItemConfig {
|
|
15
2
|
/** @private */
|
|
16
3
|
private _renderedOnce;
|
|
17
4
|
init$: {
|
|
@@ -28,17 +15,17 @@ export class FileItem extends UploaderBlock {
|
|
|
28
15
|
isUploading: boolean;
|
|
29
16
|
isFocused: boolean;
|
|
30
17
|
isEditable: boolean;
|
|
31
|
-
|
|
18
|
+
showFileNames: boolean;
|
|
32
19
|
state: symbol;
|
|
33
20
|
ariaLabelStatusFile: string;
|
|
34
|
-
onEdit: () => void;
|
|
21
|
+
onEdit: (...args: any[]) => void;
|
|
35
22
|
onRemove: () => void;
|
|
36
23
|
onUpload: () => void;
|
|
37
24
|
'*commonProgress': number;
|
|
38
25
|
'*uploadList': never[];
|
|
39
26
|
'*uploadQueue': import("@uploadcare/upload-client").Queue;
|
|
40
|
-
'*collectionErrors':
|
|
41
|
-
'*collectionState': import("../../index.js").OutputCollectionState
|
|
27
|
+
'*collectionErrors': ReturnType<import("../../index.js").OutputErrorCollection>[];
|
|
28
|
+
'*collectionState': import("../../index.js").OutputCollectionState | null;
|
|
42
29
|
'*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
|
|
43
30
|
'*uploadTrigger': Set<string>;
|
|
44
31
|
'*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
|
|
@@ -48,33 +35,26 @@ export class FileItem extends UploaderBlock {
|
|
|
48
35
|
'*historyBack': null;
|
|
49
36
|
'*closeModal': () => void;
|
|
50
37
|
};
|
|
51
|
-
_reset(): void;
|
|
52
38
|
/**
|
|
53
39
|
* @private
|
|
54
40
|
* @param {IntersectionObserverEntry[]} entries
|
|
55
41
|
*/
|
|
56
42
|
private _observerCallback;
|
|
43
|
+
_isIntersecting: boolean | undefined;
|
|
57
44
|
_thumbRect: DOMRectReadOnly | undefined;
|
|
58
45
|
/** @private */
|
|
59
46
|
private _calculateState;
|
|
60
47
|
/** @private */
|
|
61
|
-
private
|
|
62
|
-
|
|
63
|
-
* @private
|
|
64
|
-
* @param {string} prop
|
|
65
|
-
* @param {(value: any) => void} handler
|
|
66
|
-
*/
|
|
67
|
-
private _subEntry;
|
|
68
|
-
_updateHint: (() => void) & {
|
|
69
|
-
readonly cancel: () => void;
|
|
70
|
-
};
|
|
48
|
+
private _debouncedCalculateState;
|
|
49
|
+
_updateHint: (...args: any[]) => void;
|
|
71
50
|
/**
|
|
72
51
|
* @private
|
|
73
52
|
* @param {String} id
|
|
74
53
|
*/
|
|
75
54
|
private _handleEntryId;
|
|
76
|
-
/** @param {
|
|
77
|
-
|
|
55
|
+
/** @param {boolean} value */
|
|
56
|
+
_updateShowFileNames(value: boolean): void;
|
|
57
|
+
_handleState: (...args: any[]) => void;
|
|
78
58
|
/** @private */
|
|
79
59
|
private _observer;
|
|
80
60
|
_settingsOfShrink(): {
|
|
@@ -86,18 +66,11 @@ export class FileItem extends UploaderBlock {
|
|
|
86
66
|
* @param {File} file
|
|
87
67
|
*/
|
|
88
68
|
private _processShrink;
|
|
89
|
-
upload(
|
|
69
|
+
upload: (...args: any[]) => Promise<void>;
|
|
90
70
|
}
|
|
91
71
|
export namespace FileItem {
|
|
92
72
|
let template: string;
|
|
93
73
|
let activeInstances: Set<any>;
|
|
94
74
|
}
|
|
95
|
-
import {
|
|
96
|
-
declare const FileItemState: Readonly<{
|
|
97
|
-
FINISHED: symbol;
|
|
98
|
-
FAILED: symbol;
|
|
99
|
-
UPLOADING: symbol;
|
|
100
|
-
IDLE: symbol;
|
|
101
|
-
}>;
|
|
102
|
-
export {};
|
|
75
|
+
import { FileItemConfig } from './FileItemConfig.js';
|
|
103
76
|
//# sourceMappingURL=FileItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAiBA;IAIE,eAAe;IACf,sBAAsB;IAKpB;;;;;;;;;;;;;;;;;;;;;;;+CAVoB,gBAAU;mCAIlB,gBACR;6BAMM,2BAET;;wCAMC,wCACK;;;;;;MAqBN;IAQH;;;OAGG;IACH,0BAUC;IAPC,qCAA2C;IAC3C,wCAA0C;IAQ5C,eAAe;IACf,wBAYG;IAEH,eAAe;IACf,iCAA0E;IAE1E,sCA4BE;IAEF;;;OAGG;IACH,uBAqCC;IAED,6BAA6B;IAC7B,4BADY,OAAO,QASlB;IAgDD,uCA+BE;IAaA,eAAe;IACf,kBAEE;IAUJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,0CAwGG;CACJ;;;;;+BA5Y8B,qBAAqB"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import { CancelError, uploadFile } from '@uploadcare/upload-client';
|
|
3
2
|
import { shrinkFile } from '@uploadcare/image-shrink';
|
|
3
|
+
import { CancelError, UploadcareError, uploadFile } from '@uploadcare/upload-client';
|
|
4
4
|
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
|
|
5
|
-
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
|
|
6
|
-
import { createCdnUrl, createCdnUrlModifiers, createOriginalUrl } from '../../utils/cdn-utils.js';
|
|
7
|
-
import { fileCssBg } from '../svg-backgrounds/svg-backgrounds.js';
|
|
8
5
|
import { debounce } from '../utils/debounce.js';
|
|
9
|
-
import { generateThumb } from '../utils/resizeImage.js';
|
|
10
6
|
import { parseShrink } from '../../utils/parseShrink.js';
|
|
11
7
|
import { UploadSource } from '../utils/UploadSource.js';
|
|
12
8
|
import { throttle } from '../utils/throttle.js';
|
|
9
|
+
import { FileItemConfig } from './FileItemConfig.js';
|
|
13
10
|
|
|
14
11
|
const FileItemState = Object.freeze({
|
|
15
12
|
FINISHED: Symbol('FINISHED'),
|
|
@@ -18,24 +15,10 @@ const FileItemState = Object.freeze({
|
|
|
18
15
|
IDLE: Symbol('IDLE'),
|
|
19
16
|
});
|
|
20
17
|
|
|
21
|
-
export class FileItem extends
|
|
18
|
+
export class FileItem extends FileItemConfig {
|
|
22
19
|
couldBeCtxOwner = true;
|
|
23
20
|
pauseRender = true;
|
|
24
21
|
|
|
25
|
-
/** @private */
|
|
26
|
-
_entrySubs = new Set();
|
|
27
|
-
/**
|
|
28
|
-
* @private
|
|
29
|
-
* @type {any} TODO: Add types for upload entry
|
|
30
|
-
*/
|
|
31
|
-
_entry = null;
|
|
32
|
-
/** @private */
|
|
33
|
-
_isIntersecting = false;
|
|
34
|
-
/** @private */
|
|
35
|
-
_debouncedGenerateThumb = debounce(this._generateThumbnail.bind(this), 100);
|
|
36
|
-
/** @private */
|
|
37
|
-
_debouncedCalculateState = debounce(this._calculateState.bind(this), 100);
|
|
38
|
-
|
|
39
22
|
/** @private */
|
|
40
23
|
_renderedOnce = false;
|
|
41
24
|
|
|
@@ -57,16 +40,16 @@ export class FileItem extends UploaderBlock {
|
|
|
57
40
|
isUploading: false,
|
|
58
41
|
isFocused: false,
|
|
59
42
|
isEditable: false,
|
|
60
|
-
|
|
43
|
+
showFileNames: false,
|
|
61
44
|
state: FileItemState.IDLE,
|
|
62
45
|
ariaLabelStatusFile: '',
|
|
63
|
-
onEdit: () => {
|
|
46
|
+
onEdit: this._withEntry((entry) => {
|
|
64
47
|
this.$['*currentActivityParams'] = {
|
|
65
|
-
internalId:
|
|
48
|
+
internalId: entry.uid,
|
|
66
49
|
};
|
|
67
50
|
this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
|
|
68
51
|
this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
|
|
69
|
-
},
|
|
52
|
+
}),
|
|
70
53
|
onRemove: () => {
|
|
71
54
|
this.uploadCollection.remove(this.$.uid);
|
|
72
55
|
},
|
|
@@ -77,14 +60,8 @@ export class FileItem extends UploaderBlock {
|
|
|
77
60
|
}
|
|
78
61
|
|
|
79
62
|
_reset() {
|
|
80
|
-
|
|
81
|
-
sub.remove();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
this._debouncedGenerateThumb.cancel();
|
|
63
|
+
super._reset();
|
|
85
64
|
this._debouncedCalculateState.cancel();
|
|
86
|
-
this._entrySubs = new Set();
|
|
87
|
-
this._entry = null;
|
|
88
65
|
}
|
|
89
66
|
|
|
90
67
|
/**
|
|
@@ -101,19 +78,10 @@ export class FileItem extends UploaderBlock {
|
|
|
101
78
|
this.render();
|
|
102
79
|
this._renderedOnce = true;
|
|
103
80
|
}
|
|
104
|
-
if (entry.intersectionRatio === 0) {
|
|
105
|
-
this._debouncedGenerateThumb.cancel();
|
|
106
|
-
} else {
|
|
107
|
-
this._debouncedGenerateThumb();
|
|
108
|
-
}
|
|
109
81
|
}
|
|
110
82
|
|
|
111
83
|
/** @private */
|
|
112
|
-
_calculateState() {
|
|
113
|
-
if (!this._entry) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
let entry = this._entry;
|
|
84
|
+
_calculateState = this._withEntry((entry) => {
|
|
117
85
|
let state = FileItemState.IDLE;
|
|
118
86
|
|
|
119
87
|
if (entry.getValue('errors').length > 0) {
|
|
@@ -125,81 +93,40 @@ export class FileItem extends UploaderBlock {
|
|
|
125
93
|
}
|
|
126
94
|
|
|
127
95
|
this.$.state = state;
|
|
128
|
-
}
|
|
96
|
+
});
|
|
129
97
|
|
|
130
98
|
/** @private */
|
|
131
|
-
|
|
132
|
-
if (!this._entry) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
let entry = this._entry;
|
|
136
|
-
|
|
137
|
-
if (entry.getValue('fileInfo') && entry.getValue('isImage')) {
|
|
138
|
-
let size = Math.max(
|
|
139
|
-
parseInt(String(this?._thumbRect?.height || 0)),
|
|
140
|
-
parseInt(String(this?._thumbRect?.width || 0)),
|
|
141
|
-
this.cfg.thumbSize,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
let thumbUrl = await this.proxyUrl(
|
|
145
|
-
createCdnUrl(
|
|
146
|
-
createOriginalUrl(this.cfg.cdnCname, this._entry.getValue('uuid')),
|
|
147
|
-
createCdnUrlModifiers(entry.getValue('cdnUrlModifiers'), `scale_crop/${size}x${size}/center`),
|
|
148
|
-
),
|
|
149
|
-
);
|
|
150
|
-
let currentThumbUrl = entry.getValue('thumbUrl');
|
|
151
|
-
if (currentThumbUrl !== thumbUrl) {
|
|
152
|
-
entry.setValue('thumbUrl', thumbUrl);
|
|
153
|
-
currentThumbUrl?.startsWith('blob:') && URL.revokeObjectURL(currentThumbUrl);
|
|
154
|
-
}
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
99
|
+
_debouncedCalculateState = debounce(this._calculateState.bind(this), 100);
|
|
157
100
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
101
|
+
_updateHint = this._withEntry(
|
|
102
|
+
throttle((entry) => {
|
|
103
|
+
const source = entry.getValue('source');
|
|
104
|
+
const externalUrl = entry.getValue('externalUrl');
|
|
105
|
+
const noErrors = entry.getValue('errors').length === 0;
|
|
106
|
+
const noProgress = this.$.progressValue === 0;
|
|
107
|
+
const isUploading = this.$.state === FileItemState.UPLOADING;
|
|
108
|
+
const isQueued = entry.getValue('isQueued');
|
|
109
|
+
|
|
110
|
+
if (!noErrors || !isUploading || !noProgress) {
|
|
111
|
+
this.$.hint = '';
|
|
112
|
+
return;
|
|
165
113
|
}
|
|
166
|
-
} else {
|
|
167
|
-
let color = window.getComputedStyle(this).getPropertyValue('--uc-muted-foreground');
|
|
168
|
-
entry.setValue('thumbUrl', fileCssBg(color));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @private
|
|
174
|
-
* @param {string} prop
|
|
175
|
-
* @param {(value: any) => void} handler
|
|
176
|
-
*/
|
|
177
|
-
_subEntry(prop, handler) {
|
|
178
|
-
let sub = this._entry.subscribe(
|
|
179
|
-
prop,
|
|
180
|
-
/** @param {any} value */ (value) => {
|
|
181
|
-
if (this.isConnected) {
|
|
182
|
-
handler(value);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
);
|
|
186
|
-
this._entrySubs.add(sub);
|
|
187
|
-
}
|
|
188
114
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this._entry.getValue('errors').length === 0 &&
|
|
195
|
-
this.$.progressValue === 0;
|
|
115
|
+
if (isQueued) {
|
|
116
|
+
const hint = this.l10n('queued');
|
|
117
|
+
this.$.hint = hint;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
196
120
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
121
|
+
if (externalUrl && source && source !== UploadSource.URL) {
|
|
122
|
+
const hint = this.l10n('waiting-for', { source: this.l10n(`src-type-${source}`) });
|
|
123
|
+
this.$.hint = hint;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
200
126
|
|
|
201
|
-
|
|
202
|
-
|
|
127
|
+
this.$.hint = '';
|
|
128
|
+
}, 100),
|
|
129
|
+
);
|
|
203
130
|
|
|
204
131
|
/**
|
|
205
132
|
* @private
|
|
@@ -208,7 +135,6 @@ export class FileItem extends UploaderBlock {
|
|
|
208
135
|
_handleEntryId(id) {
|
|
209
136
|
this._reset();
|
|
210
137
|
|
|
211
|
-
/** @type {import('../../abstract/TypedData.js').TypedData} */
|
|
212
138
|
let entry = this.uploadCollection?.read(id);
|
|
213
139
|
this._entry = entry;
|
|
214
140
|
|
|
@@ -221,6 +147,10 @@ export class FileItem extends UploaderBlock {
|
|
|
221
147
|
this._updateHint();
|
|
222
148
|
});
|
|
223
149
|
|
|
150
|
+
this._subEntry('isQueued', () => {
|
|
151
|
+
this._updateHint();
|
|
152
|
+
});
|
|
153
|
+
|
|
224
154
|
this._subEntry('fileName', (name) => {
|
|
225
155
|
this.$.itemName = name || entry.getValue('externalUrl') || this.l10n('file-no-name');
|
|
226
156
|
this._debouncedCalculateState();
|
|
@@ -230,21 +160,8 @@ export class FileItem extends UploaderBlock {
|
|
|
230
160
|
this.$.itemName = entry.getValue('fileName') || externalUrl || this.l10n('file-no-name');
|
|
231
161
|
});
|
|
232
162
|
|
|
233
|
-
this._subEntry('fileInfo', (
|
|
163
|
+
this._subEntry('fileInfo', () => {
|
|
234
164
|
this._debouncedCalculateState();
|
|
235
|
-
if (fileInfo && this._isIntersecting) {
|
|
236
|
-
this._debouncedGenerateThumb();
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
this._subEntry('cdnUrlModifiers', () => {
|
|
241
|
-
if (this._isIntersecting) {
|
|
242
|
-
this._debouncedGenerateThumb();
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
this._subEntry('thumbUrl', (thumbUrl) => {
|
|
247
|
-
this.$.thumbUrl = thumbUrl ? `url(${thumbUrl})` : '';
|
|
248
165
|
});
|
|
249
166
|
|
|
250
167
|
this._subEntry('errors', () => this._debouncedCalculateState());
|
|
@@ -252,10 +169,17 @@ export class FileItem extends UploaderBlock {
|
|
|
252
169
|
this._subEntry('fileSize', () => this._debouncedCalculateState());
|
|
253
170
|
this._subEntry('mimeType', () => this._debouncedCalculateState());
|
|
254
171
|
this._subEntry('isImage', () => this._debouncedCalculateState());
|
|
172
|
+
}
|
|
255
173
|
|
|
256
|
-
|
|
257
|
-
|
|
174
|
+
/** @param {boolean} value */
|
|
175
|
+
_updateShowFileNames(value) {
|
|
176
|
+
const isListMode = this.cfg.filesViewMode === 'list';
|
|
177
|
+
if (isListMode) {
|
|
178
|
+
this.$.showFileNames = true;
|
|
179
|
+
return;
|
|
258
180
|
}
|
|
181
|
+
|
|
182
|
+
this.$.showFileNames = value;
|
|
259
183
|
}
|
|
260
184
|
|
|
261
185
|
initCallback() {
|
|
@@ -270,16 +194,17 @@ export class FileItem extends UploaderBlock {
|
|
|
270
194
|
});
|
|
271
195
|
|
|
272
196
|
this.subConfigValue('useCloudImageEditor', () => this._debouncedCalculateState());
|
|
197
|
+
|
|
273
198
|
this.subConfigValue('filesViewMode', (mode) => {
|
|
274
|
-
|
|
275
|
-
this.subConfigValue('gridShowFileNames', (value) => (this.$.isFileName = !value));
|
|
276
|
-
} else {
|
|
277
|
-
this.$.isFileName = false;
|
|
278
|
-
}
|
|
199
|
+
this._updateShowFileNames(this.cfg.gridShowFileNames);
|
|
279
200
|
|
|
280
201
|
this.setAttribute('mode', mode);
|
|
281
202
|
});
|
|
282
203
|
|
|
204
|
+
this.subConfigValue('gridShowFileNames', (value) => {
|
|
205
|
+
this._updateShowFileNames(value);
|
|
206
|
+
});
|
|
207
|
+
|
|
283
208
|
this.onclick = () => {
|
|
284
209
|
FileItem.activeInstances.forEach((inst) => {
|
|
285
210
|
if (inst === this) {
|
|
@@ -294,7 +219,7 @@ export class FileItem extends UploaderBlock {
|
|
|
294
219
|
'*uploadTrigger',
|
|
295
220
|
/** @param {Set<string>} itemsToUpload */
|
|
296
221
|
(itemsToUpload) => {
|
|
297
|
-
if (!itemsToUpload.has(this._entry.uid)) {
|
|
222
|
+
if (this._entry && !itemsToUpload.has(this._entry.uid)) {
|
|
298
223
|
return;
|
|
299
224
|
}
|
|
300
225
|
setTimeout(() => this.isConnected && this.upload());
|
|
@@ -303,33 +228,38 @@ export class FileItem extends UploaderBlock {
|
|
|
303
228
|
FileItem.activeInstances.add(this);
|
|
304
229
|
}
|
|
305
230
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
if (state === FileItemState.UPLOADING) {
|
|
315
|
-
this.$.isFocused = false;
|
|
316
|
-
}
|
|
231
|
+
_handleState = this._withEntry(
|
|
232
|
+
/** @param {(typeof FileItemState)[keyof typeof FileItemState]} state */
|
|
233
|
+
(entry, state) => {
|
|
234
|
+
if (state === FileItemState.FAILED) {
|
|
235
|
+
this.$.badgeIcon = 'badge-error';
|
|
236
|
+
} else if (state === FileItemState.FINISHED) {
|
|
237
|
+
this.$.badgeIcon = 'badge-success';
|
|
238
|
+
}
|
|
317
239
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
240
|
+
if (state === FileItemState.UPLOADING) {
|
|
241
|
+
this.$.isFocused = false;
|
|
242
|
+
}
|
|
243
|
+
const fileName = entry.getValue('fileName');
|
|
244
|
+
|
|
245
|
+
this.set$({
|
|
246
|
+
isFailed: state === FileItemState.FAILED,
|
|
247
|
+
isUploading: state === FileItemState.UPLOADING,
|
|
248
|
+
isFinished: state === FileItemState.FINISHED,
|
|
249
|
+
progressVisible: state === FileItemState.UPLOADING,
|
|
250
|
+
isEditable: this.cfg.useCloudImageEditor && this._entry?.getValue('isImage') && this._entry?.getValue('cdnUrl'),
|
|
251
|
+
errorText: entry.getValue('errors')?.[0]?.message,
|
|
252
|
+
ariaLabelStatusFile:
|
|
253
|
+
fileName &&
|
|
254
|
+
this.l10n('a11y-file-item-status', {
|
|
255
|
+
fileName,
|
|
256
|
+
status: this.l10n(state?.description?.toLocaleLowerCase() ?? '').toLocaleLowerCase(),
|
|
257
|
+
}),
|
|
258
|
+
});
|
|
330
259
|
|
|
331
|
-
|
|
332
|
-
|
|
260
|
+
this._updateHint();
|
|
261
|
+
},
|
|
262
|
+
);
|
|
333
263
|
|
|
334
264
|
destroyCallback() {
|
|
335
265
|
super.destroyCallback();
|
|
@@ -352,7 +282,6 @@ export class FileItem extends UploaderBlock {
|
|
|
352
282
|
disconnectedCallback() {
|
|
353
283
|
super.disconnectedCallback();
|
|
354
284
|
|
|
355
|
-
this._debouncedGenerateThumb.cancel();
|
|
356
285
|
this._observer?.disconnect();
|
|
357
286
|
}
|
|
358
287
|
|
|
@@ -368,9 +297,7 @@ export class FileItem extends UploaderBlock {
|
|
|
368
297
|
return shrinkFile(file, this._settingsOfShrink());
|
|
369
298
|
}
|
|
370
299
|
|
|
371
|
-
async
|
|
372
|
-
let entry = this._entry;
|
|
373
|
-
|
|
300
|
+
upload = this._withEntry(async (entry) => {
|
|
374
301
|
if (!this.uploadCollection.read(entry.uid)) {
|
|
375
302
|
return;
|
|
376
303
|
}
|
|
@@ -384,26 +311,35 @@ export class FileItem extends UploaderBlock {
|
|
|
384
311
|
}
|
|
385
312
|
|
|
386
313
|
this._debouncedCalculateState();
|
|
387
|
-
|
|
388
|
-
entry.
|
|
314
|
+
|
|
315
|
+
entry.setMultipleValues({
|
|
316
|
+
isUploading: true,
|
|
317
|
+
errors: [],
|
|
318
|
+
isQueued: true,
|
|
319
|
+
});
|
|
389
320
|
|
|
390
321
|
try {
|
|
391
322
|
let abortController = new AbortController();
|
|
392
323
|
entry.setValue('abortController', abortController);
|
|
393
324
|
|
|
394
325
|
const uploadTask = async () => {
|
|
326
|
+
entry.setValue('isQueued', false);
|
|
327
|
+
/** @type {Blob | File | null} */
|
|
395
328
|
let file = entry.getValue('file');
|
|
396
329
|
if (file && this.cfg.imageShrink) {
|
|
397
|
-
file = await this._processShrink(file).catch(() => file);
|
|
330
|
+
file = await this._processShrink(/** @type {File} */ (file)).catch(() => file);
|
|
398
331
|
}
|
|
399
332
|
|
|
400
333
|
const fileInput = file || entry.getValue('externalUrl') || entry.getValue('uuid');
|
|
334
|
+
if (!fileInput) {
|
|
335
|
+
throw new Error('No file input');
|
|
336
|
+
}
|
|
401
337
|
const baseUploadClientOptions = await this.getUploadClientOptions();
|
|
402
338
|
/** @type {import('@uploadcare/upload-client').FileFromOptions} */
|
|
403
339
|
const uploadClientOptions = {
|
|
404
340
|
...baseUploadClientOptions,
|
|
405
|
-
fileName: entry.getValue('fileName'),
|
|
406
|
-
source: entry.getValue('source'),
|
|
341
|
+
fileName: entry.getValue('fileName') ?? undefined,
|
|
342
|
+
source: entry.getValue('source') ?? undefined,
|
|
407
343
|
onProgress: (progress) => {
|
|
408
344
|
if (progress.isComputable) {
|
|
409
345
|
let percentage = progress.value * 100;
|
|
@@ -421,10 +357,11 @@ export class FileItem extends UploaderBlock {
|
|
|
421
357
|
let fileInfo = await this.$['*uploadQueue'].add(uploadTask);
|
|
422
358
|
entry.setMultipleValues({
|
|
423
359
|
fileInfo,
|
|
360
|
+
isQueued: false,
|
|
424
361
|
isUploading: false,
|
|
425
362
|
fileName: fileInfo.originalFilename,
|
|
426
363
|
fileSize: fileInfo.size,
|
|
427
|
-
isImage: fileInfo.isImage,
|
|
364
|
+
isImage: fileInfo.isImage ?? false,
|
|
428
365
|
mimeType: fileInfo.contentInfo?.mime?.mime ?? fileInfo.mimeType,
|
|
429
366
|
uuid: fileInfo.uuid,
|
|
430
367
|
cdnUrl: entry.getValue('cdnUrl') ?? fileInfo.cdnUrl,
|
|
@@ -442,27 +379,37 @@ export class FileItem extends UploaderBlock {
|
|
|
442
379
|
isUploading: false,
|
|
443
380
|
uploadProgress: 0,
|
|
444
381
|
});
|
|
445
|
-
} else {
|
|
382
|
+
} else if (cause instanceof UploadcareError) {
|
|
446
383
|
entry.setMultipleValues({
|
|
447
384
|
isUploading: false,
|
|
448
385
|
uploadProgress: 0,
|
|
449
386
|
uploadError: cause,
|
|
450
387
|
});
|
|
388
|
+
} else {
|
|
389
|
+
console.error('Unknown upload error', cause);
|
|
390
|
+
entry.setMultipleValues({
|
|
391
|
+
isUploading: false,
|
|
392
|
+
uploadProgress: 0,
|
|
393
|
+
// TODO: Add translation?
|
|
394
|
+
uploadError: new Error('Something went wrong', {
|
|
395
|
+
cause,
|
|
396
|
+
}),
|
|
397
|
+
});
|
|
451
398
|
}
|
|
452
399
|
|
|
453
400
|
if (entry === this._entry) {
|
|
454
401
|
this._debouncedCalculateState();
|
|
455
402
|
}
|
|
456
403
|
}
|
|
457
|
-
}
|
|
404
|
+
});
|
|
458
405
|
}
|
|
459
406
|
|
|
460
407
|
FileItem.template = /* HTML */ `
|
|
461
408
|
<div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">
|
|
462
|
-
<uc-thumb set="
|
|
409
|
+
<uc-thumb set="uid:uid;badgeIcon:badgeIcon"></uc-thumb>
|
|
463
410
|
|
|
464
411
|
<div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
|
|
465
|
-
<span class="uc-file-name" set="@hidden:
|
|
412
|
+
<span class="uc-file-name" set="@hidden: !showFileNames">{{itemName}}</span>
|
|
466
413
|
<span class="uc-file-error" set="@hidden: !errorText;">{{errorText}}</span>
|
|
467
414
|
<span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>
|
|
468
415
|
</div>
|
|
@@ -489,7 +436,7 @@ FileItem.template = /* HTML */ `
|
|
|
489
436
|
</div>
|
|
490
437
|
<uc-progress-bar
|
|
491
438
|
class="uc-progress-bar"
|
|
492
|
-
set="value: progressValue; visible: progressVisible; @hasFileName:
|
|
439
|
+
set="value: progressValue; visible: progressVisible; @hasFileName: showFileNames;"
|
|
493
440
|
>
|
|
494
441
|
</uc-progress-bar>
|
|
495
442
|
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class FileItemConfig extends UploaderBlock {
|
|
2
|
+
/** @protected */
|
|
3
|
+
protected _entrySubs: Set<any>;
|
|
4
|
+
/**
|
|
5
|
+
* @type {import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData | null}
|
|
6
|
+
* @protected
|
|
7
|
+
*/
|
|
8
|
+
protected _entry: import("../../abstract/uploadEntrySchema.js").UploadEntryTypedData | null;
|
|
9
|
+
/**
|
|
10
|
+
* @template {any[]} A
|
|
11
|
+
* @template {(entry: import('../../abstract/uploadEntrySchema.js').UploadEntryTypedData, ...args: A) => any} T
|
|
12
|
+
* @param {T} fn
|
|
13
|
+
* @returns {(...args: A) => ReturnType<T>}
|
|
14
|
+
* @protected
|
|
15
|
+
*/
|
|
16
|
+
protected _withEntry<A extends any[], T extends (entry: import("../../abstract/uploadEntrySchema.js").UploadEntryTypedData, ...args: A) => any>(fn: T): (...args: A) => ReturnType<T>;
|
|
17
|
+
/**
|
|
18
|
+
* @template {import('../../abstract/uploadEntrySchema.js').UploadEntryKeys} K
|
|
19
|
+
* @param {K} prop_
|
|
20
|
+
* @param {(value: import('../../abstract/uploadEntrySchema.js').UploadEntryData[K]) => void} handler_
|
|
21
|
+
* @protected
|
|
22
|
+
*/
|
|
23
|
+
protected _subEntry: (prop_: K, handler_: (value: import("../../abstract/uploadEntrySchema.js").UploadEntryData[K]) => void) => void;
|
|
24
|
+
/** @protected */
|
|
25
|
+
protected _reset(): void;
|
|
26
|
+
}
|
|
27
|
+
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
|
|
28
|
+
//# sourceMappingURL=FileItemConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItemConfig.d.ts","sourceRoot":"","sources":["FileItemConfig.js"],"names":[],"mappings":"AAIA;IACE,iBAAiB;IACjB,+BAAuB;IAEvB;;;OAGG;IACH,kBAHU,OAAO,qCAAqC,EAAE,oBAAoB,GAAG,IAAI,CAGrE;IAEd;;;;;;OAMG;IACH,qBANqB,CAAC,SAAR,GAAG,EAAG,EAC0F,CAAC,SAAlG,CAAE,KAAK,EAAE,OAAO,qCAAqC,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,GAAI,MAClG,CAAC,GACC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAezC;IAED;;;;;OAKG;IACH,sBAAa,OAJF,CAIO,EAAE,UAHT,CAAC,KAAK,EAAE,OAAO,qCAAqC,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAG5D,UAgBP;IAErB,iBAAiB;IACjB,yBAOC;CAMF;8BAvE6B,iCAAiC"}
|