@libs-ui/components-inputs-upload 0.2.161

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.
@@ -0,0 +1,646 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Pipe, model, input, output, Optional, Inject, ChangeDetectionStrategy, Component, signal, computed, viewChild, inject, effect, untracked } from '@angular/core';
3
+ import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
4
+ import { LibsUiComponentsImageEditorComponent } from '@libs-ui/components-image-editor';
5
+ import { LibsUiComponentsLabelComponent } from '@libs-ui/components-label';
6
+ import { LibsUiComponentsScrollOverlayDirective } from '@libs-ui/components-scroll-overlay';
7
+ import { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';
8
+ import { LibsUiNotificationService } from '@libs-ui/services-notification';
9
+ import { getLabelBySizeFile, LINK_IMAGE_ERROR_TOKEN_INJECT, uuid, convertFileToBase64_ObjectUrl, convertBlobToFile, ERROR_MESSAGE_EMPTY_VALID, downloadFileByUrl } from '@libs-ui/utils';
10
+ import * as i1 from '@ngx-translate/core';
11
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
12
+ import { Subject, fromEvent } from 'rxjs';
13
+ import { tap, takeUntil } from 'rxjs/operators';
14
+ import { NgComponentOutlet, AsyncPipe } from '@angular/common';
15
+ import { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';
16
+ import { LibsUiIconsGetIconComponentPipe } from '@libs-ui/icons';
17
+ import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
18
+ import { LibsUiComponentsPreviewFileComponent } from '@libs-ui/components-preview-file';
19
+ import { LibsUiComponentsGalleryViewerComponent } from '@libs-ui/components-gallery';
20
+
21
+ class LibsUiPipesInputsUploadCalcDurationVideoPipe {
22
+ transform(duration) {
23
+ if (!duration) {
24
+ return '0:0';
25
+ }
26
+ duration = Math.round(duration);
27
+ if (duration >= 3600) {
28
+ const hour = Math.floor(duration / 3600);
29
+ const minute = Math.floor((duration - (hour * 3600)) / 60);
30
+ const second = duration - (hour * 3600 + minute * 60);
31
+ return `${hour}:${minute < 10 ? `0${minute}` : minute}:${second < 10 ? `0${second}` : second}`;
32
+ }
33
+ if (duration >= 60) {
34
+ const minute = Math.floor(duration / 60);
35
+ const second = duration - (minute * 60);
36
+ return `${minute}:${second < 10 ? `0${second}` : second}`;
37
+ }
38
+ return `0:${duration}`;
39
+ }
40
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCalcDurationVideoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
41
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCalcDurationVideoPipe, isStandalone: true, name: "LibsUiPipesInputsUploadCalcDurationVideoPipe" });
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCalcDurationVideoPipe, decorators: [{
44
+ type: Pipe,
45
+ args: [{
46
+ name: 'LibsUiPipesInputsUploadCalcDurationVideoPipe',
47
+ standalone: true
48
+ }]
49
+ }] });
50
+
51
+ const getDescriptionFormatAndSizeFileDefault = (type, maxImageSize, maxVideoSize, maxDocumentSize, maxAudioSize) => {
52
+ const image = {
53
+ message: 'i18n_note_upload_image_volume',
54
+ interpolateParams: { value: getLabelBySizeFile(maxImageSize, 0) }
55
+ };
56
+ const video = {
57
+ message: 'i18n_note_upload_video_volume',
58
+ interpolateParams: { value: getLabelBySizeFile(maxVideoSize, 0) }
59
+ };
60
+ const document = {
61
+ message: 'i18n_note_upload_file_volume',
62
+ interpolateParams: { value: getLabelBySizeFile(maxDocumentSize, 0) }
63
+ };
64
+ const audio = {
65
+ message: 'i18n_note_upload_audio_volume',
66
+ interpolateParams: { value: getLabelBySizeFile(maxAudioSize, 0) }
67
+ };
68
+ const typeSplit = type.split('_');
69
+ const description = [];
70
+ if (typeSplit.includes('image')) {
71
+ description.push(image);
72
+ }
73
+ if (typeSplit.includes('audio')) {
74
+ description.push(audio);
75
+ }
76
+ if (typeSplit.includes('video')) {
77
+ description.push(video);
78
+ }
79
+ if (typeSplit.includes('document')) {
80
+ description.push(document);
81
+ }
82
+ return description;
83
+ };
84
+ const getFileExtension = (file) => {
85
+ const fileName = file.name;
86
+ if (!fileName) {
87
+ return;
88
+ }
89
+ const dots = fileName.split(".");
90
+ if (dots.length <= 0) {
91
+ return;
92
+ }
93
+ const extension = dots[dots.length - 1];
94
+ return extension.toLowerCase();
95
+ };
96
+
97
+ const DocumentExtList = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'json', 'xml'];
98
+ const ImageExtList = ['gif', 'jpg', 'jpeg', 'png'];
99
+ const VideoExtList = ['mp4', 'mov', 'mpg', 'avi', 'wmv'];
100
+ const AudioExtList = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'wma'];
101
+
102
+ class LibsUiPipesInputsUploadCheckFileExtensionPipe {
103
+ transform(file, type) {
104
+ const fileExtension = getFileExtension(file);
105
+ if (!fileExtension) {
106
+ return false;
107
+ }
108
+ switch (type) {
109
+ case 'image':
110
+ return ImageExtList.includes(fileExtension);
111
+ case 'video':
112
+ return VideoExtList.includes(fileExtension);
113
+ case 'word':
114
+ return ['doc', 'docx'].includes(fileExtension);
115
+ case 'xlsx':
116
+ return ['xls', 'xlsx'].includes(fileExtension);
117
+ case 'pdf':
118
+ return ['pdf'].includes(fileExtension);
119
+ case 'pptx':
120
+ return ['ppt', 'pptx'].includes(fileExtension);
121
+ case 'other':
122
+ return ![...ImageExtList, ...VideoExtList, ...DocumentExtList].includes(fileExtension);
123
+ }
124
+ }
125
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCheckFileExtensionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
126
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCheckFileExtensionPipe, isStandalone: true, name: "LibsUiPipesInputsUploadCheckFileExtensionPipe" });
127
+ }
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiPipesInputsUploadCheckFileExtensionPipe, decorators: [{
129
+ type: Pipe,
130
+ args: [{
131
+ name: 'LibsUiPipesInputsUploadCheckFileExtensionPipe',
132
+ standalone: true
133
+ }]
134
+ }] });
135
+
136
+ class LibsUiComponentsInputsUploadAvatarComponent {
137
+ linkImageError;
138
+ item = model.required();
139
+ showVideoDuration = input();
140
+ disable = input();
141
+ size = input();
142
+ outOpenPreview = output();
143
+ constructor(linkImageError) {
144
+ this.linkImageError = linkImageError;
145
+ }
146
+ async handlerImageError(event) {
147
+ if (!this.linkImageError) {
148
+ return;
149
+ }
150
+ event.target.src = this.linkImageError;
151
+ }
152
+ handlerImageClick(event) {
153
+ event.stopPropagation();
154
+ this.outOpenPreview.emit(this.item());
155
+ }
156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadAvatarComponent, deps: [{ token: LINK_IMAGE_ERROR_TOKEN_INJECT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
157
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsInputsUploadAvatarComponent, isStandalone: true, selector: "libs_ui-components-inputs-upload-avatar", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, showVideoDuration: { classPropertyName: "showVideoDuration", publicName: "showVideoDuration", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { item: "itemChange", outOpenPreview: "outOpenPreview" }, ngImport: i0, template: "<div class=\"flex mr-[12px] bg-[#ffffff] rounded-[4px]\"\n [class.mo-lib-disable]=\"disable() || item().isUploading || item().error\">\n @if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'image') {\n <div [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"relative\">\n @if (item().url || item().origin_url; as url) {\n <img [src]=\"url\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"rounded-[4px] cursor-pointer\"\n alt\n (error)=\"handlerImageError($event)\"\n (click)=\"handlerImageClick($event)\" />\n } @else {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'video') {\n <div class=\"relative\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\">\n @if (item().url || item().origin_url) {\n <video #videoRef\n [style.width.px]=\"size || 32\"\n [style.height.px]=\"size || 32\"\n class=\"rounded-[4px]\"\n preload=\"metadata\"\n [src]=\"(item().url || item().origin_url || '') | LibsUiPipesSecurityTrustPipe:'resourceUrl'\"></video>\n <div class=\"absolute w-full h-full top-0 bg-[#001433] opacity-40 rounded-[4px]\">\n </div>\n <div class=\"absolute w-full h-full flex items-center justify-center top-0\">\n <i class=\"text-[#ffffff] libs-ui-icon-play-solid before:!text-[10px]\"></i>\n </div>\n @if (showVideoDuration()) {\n <div\n class=\"flex text-[5px] absolute bottom-0 right-0 py-[2px] px-[4px] rounded-[4px] bg-[#000000] text-[#ffffff]\">\n {{ videoRef.duration | LibsUiPipesInputsUploadCalcDurationVideoPipe }}\n </div>\n }\n } @else {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'pdf') {\n <ng-container *ngComponentOutlet=\"'pdf'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'word') {\n <ng-container *ngComponentOutlet=\"'word'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'pptx') {\n <ng-container *ngComponentOutlet=\"'pptx'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'xlsx') {\n <ng-container *ngComponentOutlet=\"'xlsx'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else {\n <div [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"flex items-center justify-center\">\n <i class=\"libs-ui-icon-file before:!text-[19px]\"\n [class.text-[#6a7383]]=\"!item().isUploading && !item().error\"\n [class.text-[#071631]]=\"disable() || item().isUploading || item().error\"></i>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "pipe", type: LibsUiPipesInputsUploadCalcDurationVideoPipe, name: "LibsUiPipesInputsUploadCalcDurationVideoPipe" }, { kind: "pipe", type: LibsUiPipesInputsUploadCheckFileExtensionPipe, name: "LibsUiPipesInputsUploadCheckFileExtensionPipe" }, { kind: "pipe", type: LibsUiIconsGetIconComponentPipe, name: "LibsUiIconsGetIconComponentPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
158
+ }
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadAvatarComponent, decorators: [{
160
+ type: Component,
161
+ args: [{ selector: 'libs_ui-components-inputs-upload-avatar', standalone: true, imports: [
162
+ NgComponentOutlet, AsyncPipe, TranslateModule,
163
+ LibsUiComponentsSpinnerComponent,
164
+ LibsUiPipesSecurityTrustPipe,
165
+ LibsUiPipesInputsUploadCalcDurationVideoPipe,
166
+ LibsUiPipesInputsUploadCheckFileExtensionPipe,
167
+ LibsUiIconsGetIconComponentPipe,
168
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex mr-[12px] bg-[#ffffff] rounded-[4px]\"\n [class.mo-lib-disable]=\"disable() || item().isUploading || item().error\">\n @if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'image') {\n <div [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"relative\">\n @if (item().url || item().origin_url; as url) {\n <img [src]=\"url\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"rounded-[4px] cursor-pointer\"\n alt\n (error)=\"handlerImageError($event)\"\n (click)=\"handlerImageClick($event)\" />\n } @else {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'video') {\n <div class=\"relative\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\">\n @if (item().url || item().origin_url) {\n <video #videoRef\n [style.width.px]=\"size || 32\"\n [style.height.px]=\"size || 32\"\n class=\"rounded-[4px]\"\n preload=\"metadata\"\n [src]=\"(item().url || item().origin_url || '') | LibsUiPipesSecurityTrustPipe:'resourceUrl'\"></video>\n <div class=\"absolute w-full h-full top-0 bg-[#001433] opacity-40 rounded-[4px]\">\n </div>\n <div class=\"absolute w-full h-full flex items-center justify-center top-0\">\n <i class=\"text-[#ffffff] libs-ui-icon-play-solid before:!text-[10px]\"></i>\n </div>\n @if (showVideoDuration()) {\n <div\n class=\"flex text-[5px] absolute bottom-0 right-0 py-[2px] px-[4px] rounded-[4px] bg-[#000000] text-[#ffffff]\">\n {{ videoRef.duration | LibsUiPipesInputsUploadCalcDurationVideoPipe }}\n </div>\n }\n } @else {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'pdf') {\n <ng-container *ngComponentOutlet=\"'pdf'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'word') {\n <ng-container *ngComponentOutlet=\"'word'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'pptx') {\n <ng-container *ngComponentOutlet=\"'pptx'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe:'xlsx') {\n <ng-container *ngComponentOutlet=\"'xlsx'|LibsUiIconsGetIconComponentPipe|async\" />\n }\n @else {\n <div [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"flex items-center justify-center\">\n <i class=\"libs-ui-icon-file before:!text-[19px]\"\n [class.text-[#6a7383]]=\"!item().isUploading && !item().error\"\n [class.text-[#071631]]=\"disable() || item().isUploading || item().error\"></i>\n </div>\n }\n</div>\n" }]
169
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
170
+ type: Optional
171
+ }, {
172
+ type: Inject,
173
+ args: [LINK_IMAGE_ERROR_TOKEN_INJECT]
174
+ }] }] });
175
+
176
+ class LibsUiComponentsInputsUploadComponent {
177
+ // #region PROPERTIES
178
+ imageEditorComponentRef;
179
+ previewFileComponentRef;
180
+ previewFileImageComponentRef;
181
+ isDragOver = signal(false);
182
+ fileList = signal([]);
183
+ accessFiles = signal('');
184
+ messageError = signal(undefined);
185
+ descriptionFormatAndSizeFileComputed = computed(() => {
186
+ if (this.descriptionFormatAndSizeFile()?.length) {
187
+ return this.descriptionFormatAndSizeFile();
188
+ }
189
+ return getDescriptionFormatAndSizeFileDefault(this.fileType(), this.maxImageSize(), this.maxVideoSize(), this.maxDocumentSize(), this.maxAudioSize());
190
+ });
191
+ onDestroy = new Subject();
192
+ // #endregion
193
+ // #region INPUTS
194
+ originFiles = input([], { transform: val => val ?? [] });
195
+ fileType = input('image_video_document', { transform: val => val ?? 'image_video_document' });
196
+ multiple = input();
197
+ canUploadIfHasExistFile = input(false, { transform: val => val ?? false });
198
+ canSetAvatar = input(false);
199
+ limitFile = input(10, { transform: val => val ?? 10 });
200
+ maxTotalSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
201
+ maxImageSize = input(5 * 1024 * 1024, { transform: val => val ?? 5 * 1024 * 1024 });
202
+ maxVideoSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
203
+ maxDocumentSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
204
+ maxAudioSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
205
+ imageExtList = input(ImageExtList, { transform: val => val ?? ImageExtList });
206
+ videoExtList = input(VideoExtList, { transform: val => val ?? VideoExtList });
207
+ documentExtList = input(DocumentExtList, { transform: val => val ?? DocumentExtList });
208
+ audioExtList = input(AudioExtList, { transform: val => val ?? AudioExtList });
209
+ classIncludeListItem = input();
210
+ validRequired = input();
211
+ disable = input(false, { transform: val => val ?? false });
212
+ aspectRatio = input();
213
+ zIndex = input(1200, { transform: val => val ?? 1200 });
214
+ ignoreShowSizeFile = input(false, { transform: val => val ?? false });
215
+ allowShowPushMessageMaxSizeError = input(false, { transform: val => val ?? false });
216
+ messageTypeFileError = input('i18n_the_file_support_format_is_not_correct', { transform: val => val || 'i18n_the_file_support_format_is_not_correct' });
217
+ messageMaxSizeError = input('i18n_file_size_exceeds_the_allowed_limit', { transform: val => val || 'i18n_file_size_exceeds_the_allowed_limit' });
218
+ messageFileUploadError = input('i18n_invalid_file_upload', { transform: val => val || 'i18n_invalid_file_upload' });
219
+ messageTotalFileExceedsError = input('i18n_file_number_exceeds_the_allowed_limit_please_delete_the_file', { transform: val => val || 'i18n_file_number_exceeds_the_allowed_limit_please_delete_the_file' });
220
+ configDescriptionInputUpload = input({ message: 'i18n_drag_file_here_to_upload_or_select_file' }, {
221
+ transform: val => val ?? { message: 'i18n_drag_file_here_to_upload_or_select_file' }
222
+ });
223
+ modeDisplayFile = input('full', { transform: val => val || 'full' });
224
+ descriptionFormatAndSizeFile = input();
225
+ showVideoDuration = input(false, { transform: val => val ?? false });
226
+ labelConfig = input();
227
+ showBlockUploadWhenHasFileAndModeSingle = input(true, { transform: val => val ?? true });
228
+ ignoreIconRemove = input(false, { transform: val => val ?? false });
229
+ ignoreIconEdit = input(false, { transform: val => val ?? false });
230
+ ignoreIconPreview = input(true, { transform: val => val ?? true });
231
+ classIncludeFileContent = input();
232
+ showBorderErrorAllItemWhenError = input(false, { transform: val => val ?? false });
233
+ configDownloadSampleFile = input();
234
+ // #endregion
235
+ // #region OUTPUTS
236
+ outClose = output();
237
+ outFileChanged = output();
238
+ outFileRemoved = output();
239
+ outFunctionsControl = output();
240
+ // #endregion
241
+ // #region VIEW CHILDREN
242
+ uploadRef = viewChild('upload');
243
+ uploadInputRef = viewChild('uploadInput');
244
+ // #endregion
245
+ // #region INJECTIONS
246
+ dynamicComponentService = inject(LibsUiDynamicComponentService);
247
+ translateService = inject(TranslateService);
248
+ notificationService = inject(LibsUiNotificationService);
249
+ // #endregion
250
+ constructor() {
251
+ effect(() => {
252
+ if (this.originFiles()) {
253
+ untracked(() => {
254
+ this.fileList.set([...this.originFiles()]);
255
+ });
256
+ }
257
+ });
258
+ }
259
+ // #region LIFECYCLE HOOKS
260
+ ngOnInit() {
261
+ this.outFunctionsControl.emit({
262
+ valid: this.validate.bind(this),
263
+ removeAll: this.removeAllFile.bind(this),
264
+ uploading: async (process, id) => {
265
+ const fileUploading = this.fileList().find(file => file().id === id);
266
+ if (fileUploading) {
267
+ fileUploading.update(file => ({ ...file, percentUploading: process.percent, isUploading: process.percent !== 100 }));
268
+ }
269
+ },
270
+ setMessageError: async (message, id) => {
271
+ this.messageError.set(message);
272
+ if (id) {
273
+ const fileError = this.fileList().find(file => file().id === id);
274
+ if (fileError) {
275
+ fileError.update(file => ({ ...file, error: message }));
276
+ }
277
+ }
278
+ },
279
+ handlerUploadFile: async () => {
280
+ this.uploadInputRef()?.nativeElement.click();
281
+ this.uploadInputRef()?.nativeElement.setAttribute('accept', this.accessFiles());
282
+ }
283
+ });
284
+ }
285
+ ngAfterViewInit() {
286
+ setTimeout(() => {
287
+ this.initAccessFiles();
288
+ if (this.uploadRef()) {
289
+ this.initUploadEvent();
290
+ }
291
+ }, 0);
292
+ }
293
+ // #endregion
294
+ // #region INITIALIZATION
295
+ async initAccessFiles() {
296
+ const accessExts = [];
297
+ const typeSplit = this.fileType().split('_');
298
+ if (typeSplit.includes('image')) {
299
+ accessExts.push(...this.imageExtList());
300
+ }
301
+ if (typeSplit.includes('document')) {
302
+ accessExts.push(...this.documentExtList());
303
+ }
304
+ if (typeSplit.includes('video')) {
305
+ accessExts.push(...this.videoExtList());
306
+ }
307
+ if (typeSplit.includes('audio')) {
308
+ accessExts.push(...this.audioExtList());
309
+ }
310
+ this.accessFiles.set(accessExts.map(ext => `.${ext}`).join(','));
311
+ }
312
+ async initUploadEvent() {
313
+ const uploadRef = this.uploadRef()?.nativeElement;
314
+ const inputUploadRef = this.uploadInputRef()?.nativeElement;
315
+ this.initEvent(inputUploadRef, 'change', this.handlerUploadFile.bind(this)).subscribe();
316
+ this.initEvent(uploadRef, 'click', this.handlerUploadFileClick.bind(this)).subscribe();
317
+ this.initEvent(uploadRef, 'dragover', this.handlerDragOver.bind(this)).subscribe();
318
+ this.initEvent(uploadRef, 'dragleave', this.handlerDragEnd.bind(this)).subscribe();
319
+ this.initEvent(uploadRef, 'drop', this.handlerDragDrop.bind(this)).subscribe();
320
+ }
321
+ // #endregion
322
+ // #region EVENT HANDLING
323
+ initEvent(element, eventName, callBack) {
324
+ return fromEvent(element, eventName).pipe(tap(e => {
325
+ e.stopPropagation();
326
+ callBack(e);
327
+ }), takeUntil(this.onDestroy));
328
+ }
329
+ async handlerUploadFileClick(event) {
330
+ event.stopPropagation();
331
+ if (!this.multiple() && this.fileList().length && !this.canUploadIfHasExistFile()) {
332
+ return;
333
+ }
334
+ this.uploadInputRef()?.nativeElement.click();
335
+ this.uploadInputRef()?.nativeElement.setAttribute('accept', this.accessFiles());
336
+ }
337
+ async handlerUploadFile(event) {
338
+ await this.handleUploadFiles(event);
339
+ const inputUploadRef = this.uploadInputRef()?.nativeElement;
340
+ if (inputUploadRef) {
341
+ inputUploadRef.value = null;
342
+ }
343
+ }
344
+ async handlerDragOver(event) {
345
+ event.preventDefault();
346
+ event.stopPropagation();
347
+ this.uploadRef()?.nativeElement.classList.toggle('libs-ui-components-inputs-upload-drag-over', true);
348
+ }
349
+ async handlerDragEnd(event) {
350
+ event.preventDefault();
351
+ event.stopPropagation();
352
+ this.uploadRef()?.nativeElement.classList.toggle('libs-ui-components-inputs-upload-drag-over', false);
353
+ }
354
+ async handlerDragDrop(event) {
355
+ event.preventDefault();
356
+ event.stopPropagation();
357
+ this.uploadRef()?.nativeElement.classList.toggle('libs-ui-components-inputs-upload-drag-over', false);
358
+ await this.handleUploadFiles(event);
359
+ }
360
+ // #endregion
361
+ // #region FILE OPERATIONS
362
+ async handleUploadFiles(event) {
363
+ const files = event.dataTransfer?.files || event.target?.files;
364
+ if (this.maxTotalSize()) {
365
+ let total = 0;
366
+ for (let i = 0; i < files.length; i++) {
367
+ total += files[i].size;
368
+ }
369
+ if (this.maxTotalSize() < total) {
370
+ this.notificationService.showCompTypeTextError(this.translateService.instant('i18n_size_not_number_mb', { number: this.maxTotalSize() / 1024 / 1024 }), { timeRemove: 3000 });
371
+ return;
372
+ }
373
+ }
374
+ let errorExceedsMaxFile = false;
375
+ if (!files || !files.length) {
376
+ return;
377
+ }
378
+ if (!this.multiple() && this.fileList().length && !this.canUploadIfHasExistFile()) {
379
+ return;
380
+ }
381
+ const remainFileTotal = this.limitFile() - this.fileList().length;
382
+ if (files.length > remainFileTotal) {
383
+ errorExceedsMaxFile = true;
384
+ this.messageError.set(this.messageTotalFileExceedsError());
385
+ }
386
+ for (let i = 0; i < files.length; i++) {
387
+ const file = files[i];
388
+ const isImage = file.type.match(/image.*/) ? true : false;
389
+ const isVideo = file.type.match(/video.*/) ? true : false;
390
+ const isAudio = file.type.match(/audio.*/) ? true : false;
391
+ const newFile = {
392
+ name: file.name,
393
+ file: file,
394
+ size: getLabelBySizeFile(file.size),
395
+ type: isImage ? 'image' : isVideo ? 'video' : isAudio ? 'audio' : 'document',
396
+ id: uuid()
397
+ };
398
+ if (!(await this.checkValidFileExtension(file))) {
399
+ if (!errorExceedsMaxFile) {
400
+ this.messageError.set(this.multiple() ? this.messageFileUploadError() : this.messageTypeFileError());
401
+ }
402
+ newFile.error = this.messageTypeFileError();
403
+ await this.pushFileInList(file, newFile);
404
+ continue;
405
+ }
406
+ if (!(await this.checkValidFileSize(file))) {
407
+ if (!errorExceedsMaxFile) {
408
+ this.messageError.set(this.multiple() ? this.messageFileUploadError() : this.messageMaxSizeError());
409
+ }
410
+ newFile.error = this.messageMaxSizeError();
411
+ if (!this.multiple() && this.allowShowPushMessageMaxSizeError()) {
412
+ this.notificationService.showCompTypeTextError(this.messageMaxSizeError());
413
+ return;
414
+ }
415
+ await this.pushFileInList(file, newFile);
416
+ continue;
417
+ }
418
+ await this.pushFileInList(file, newFile);
419
+ }
420
+ if (this.canSetAvatar() && this.fileList().length && !this.fileList().find(file => file().isAvatar)) {
421
+ this.fileList.update(fileList => {
422
+ const itemImage = fileList.find(file => file().type === 'image');
423
+ if (itemImage) {
424
+ itemImage.update(file => ({ ...file, isAvatar: true }));
425
+ }
426
+ return [...fileList];
427
+ });
428
+ }
429
+ this.outFileChanged.emit(this.fileList());
430
+ this.validate();
431
+ }
432
+ async pushFileInList(file, newFile) {
433
+ newFile.url = await convertFileToBase64_ObjectUrl(file);
434
+ this.fileList.update(fileList => {
435
+ fileList.splice(0, this.canUploadIfHasExistFile() ? 1 : 0, signal(newFile));
436
+ return [...fileList];
437
+ });
438
+ }
439
+ async handlerOpenPreviewFile(item) {
440
+ if (item.type === 'document') {
441
+ this.previewFileDocument(item);
442
+ return;
443
+ }
444
+ this.previewFileImage(item);
445
+ }
446
+ async previewFileDocument(item) {
447
+ if (this.previewFileComponentRef) {
448
+ return;
449
+ }
450
+ this.previewFileComponentRef = this.dynamicComponentService.resolveComponentFactory(LibsUiComponentsPreviewFileComponent);
451
+ this.previewFileComponentRef.setInput('data', item);
452
+ this.previewFileComponentRef.setInput('zIndex', this.zIndex() + 1);
453
+ this.previewFileComponentRef.instance.outClose.subscribe(() => {
454
+ this.dynamicComponentService.remove(this.previewFileComponentRef);
455
+ this.previewFileComponentRef = undefined;
456
+ });
457
+ this.dynamicComponentService.addToBody(this.previewFileComponentRef);
458
+ }
459
+ async previewFileImage(item) {
460
+ if (this.previewFileImageComponentRef) {
461
+ return;
462
+ }
463
+ this.previewFileImageComponentRef = this.dynamicComponentService.resolveComponentFactory(LibsUiComponentsGalleryViewerComponent);
464
+ const url = item.url || item.origin_url;
465
+ this.previewFileImageComponentRef.setInput('images', [{ url }]);
466
+ this.previewFileImageComponentRef.setInput('imageSelected', { url });
467
+ this.previewFileImageComponentRef.setInput('fieldDisplaySrcImage', 'url');
468
+ this.previewFileImageComponentRef.setInput('singleImage', true);
469
+ this.previewFileImageComponentRef.instance.outClose.subscribe(() => {
470
+ this.dynamicComponentService.remove(this.previewFileImageComponentRef);
471
+ this.previewFileImageComponentRef = undefined;
472
+ });
473
+ this.dynamicComponentService.addToBody(this.previewFileImageComponentRef);
474
+ }
475
+ async handlerEditImage(event, item) {
476
+ event.stopPropagation();
477
+ this.showEditModal(item);
478
+ }
479
+ async handlerRemoveFile(event, item) {
480
+ event.stopPropagation();
481
+ this.removeFile(item);
482
+ if (this.originFiles().find(file => file().url === item().url)) {
483
+ this.outFileRemoved.emit(item);
484
+ }
485
+ this.validate();
486
+ if (!this.multiple() && !this.showBlockUploadWhenHasFileAndModeSingle()) {
487
+ setTimeout(() => {
488
+ this.initUploadEvent();
489
+ }, 0);
490
+ }
491
+ }
492
+ async removeFile(fileItem) {
493
+ this.fileList.update(fileList => fileList.filter(item => item().id !== fileItem().id));
494
+ if (this.canSetAvatar() && fileItem().isAvatar && this.fileList().length) {
495
+ this.fileList.update(fileList => {
496
+ fileList[0].update(file => ({ ...file, isAvatar: true }));
497
+ return [...fileList];
498
+ });
499
+ }
500
+ this.outFileChanged.emit(this.fileList());
501
+ }
502
+ async showEditModal(fileItem) {
503
+ if (this.imageEditorComponentRef) {
504
+ return;
505
+ }
506
+ const fileDataUrl = fileItem().url || fileItem().origin_url || '';
507
+ this.imageEditorComponentRef = this.dynamicComponentService.resolveComponentFactory(LibsUiComponentsImageEditorComponent);
508
+ this.imageEditorComponentRef.setInput('imgSrc', fileDataUrl);
509
+ this.imageEditorComponentRef.setInput('zIndex', this.zIndex() + 1);
510
+ this.imageEditorComponentRef.setInput('nameFile', fileItem.name);
511
+ if (this.aspectRatio()) {
512
+ this.imageEditorComponentRef.setInput('aspectRatio', this.aspectRatio());
513
+ }
514
+ this.imageEditorComponentRef.instance.outClose.subscribe(() => {
515
+ this.dynamicComponentService.remove(this.imageEditorComponentRef);
516
+ this.imageEditorComponentRef = undefined;
517
+ });
518
+ this.imageEditorComponentRef.instance.outSaveFile.subscribe(async (result) => {
519
+ const messageError = !(await this.checkValidFileSize(result.file)) ? this.messageMaxSizeError() : undefined;
520
+ const nameFile = fileItem().file?.name || fileItem().name;
521
+ fileItem.update(data => ({ ...data, file: convertBlobToFile(result.file, nameFile), name: nameFile, origin_url: undefined, size: getLabelBySizeFile(result.file.size), error: messageError, url: result.url, isUpdate: true }));
522
+ this.outFileChanged.emit(this.fileList());
523
+ this.imageEditorComponentRef?.instance.outClose.emit({ isClickButtonClose: true });
524
+ });
525
+ this.dynamicComponentService.addToBody(this.imageEditorComponentRef);
526
+ }
527
+ async checkValidFileExtension(file) {
528
+ const extension = getFileExtension(file);
529
+ if (!extension) {
530
+ return false;
531
+ }
532
+ const isImage = file.type.match(/image.*/) ? true : false;
533
+ const isVideo = file.type.match(/video.*/) ? true : false;
534
+ const isAudio = file.type.match(/audio.*/) ? true : false;
535
+ const validImage = this.imageExtList().indexOf(extension) >= 0;
536
+ const validVideo = this.videoExtList().indexOf(extension) >= 0;
537
+ const validAudio = this.audioExtList().indexOf(extension) >= 0;
538
+ const validDocument = this.documentExtList().indexOf(extension) >= 0;
539
+ const typeSplit = this.fileType().split('_');
540
+ if (isImage && typeSplit.includes('image')) {
541
+ return validImage;
542
+ }
543
+ if (isVideo && typeSplit.includes('video')) {
544
+ return validVideo;
545
+ }
546
+ if (isAudio && typeSplit.includes('audio')) {
547
+ return validAudio;
548
+ }
549
+ if (typeSplit.includes('document')) {
550
+ return validDocument;
551
+ }
552
+ return false;
553
+ }
554
+ async checkValidFileSize(file) {
555
+ const isImage = file.type.match(/image.*/) ? true : false;
556
+ const isVideo = file.type.match(/video.*/) ? true : false;
557
+ const isAudio = file.type.match(/audio.*/) ? true : false;
558
+ const validImage = file.size <= this.maxImageSize();
559
+ const validVideo = file.size <= this.maxVideoSize();
560
+ const validAudio = file.size <= this.maxAudioSize();
561
+ const validDocument = file.size <= this.maxDocumentSize();
562
+ const typeSplit = this.fileType().split('_');
563
+ if (isImage && typeSplit.includes('image')) {
564
+ return validImage;
565
+ }
566
+ if (isVideo && typeSplit.includes('video')) {
567
+ return validVideo;
568
+ }
569
+ if (isAudio && typeSplit.includes('audio')) {
570
+ return validAudio;
571
+ }
572
+ if (typeSplit.includes('document')) {
573
+ return validDocument;
574
+ }
575
+ return false;
576
+ }
577
+ async validate() {
578
+ if (this.validRequired()?.isRequired && !this.fileList().length) {
579
+ this.messageError.set(this.validRequired()?.message || ERROR_MESSAGE_EMPTY_VALID);
580
+ return false;
581
+ }
582
+ if (this.multiple() && this.fileList().length > this.limitFile()) {
583
+ this.messageError.set(this.messageTotalFileExceedsError());
584
+ return false;
585
+ }
586
+ const fileError = this.fileList().find(item => item().error);
587
+ if (fileError) {
588
+ this.messageError.set(this.multiple() ? this.messageFileUploadError() : fileError().error);
589
+ return false;
590
+ }
591
+ this.messageError.set(undefined);
592
+ return true;
593
+ }
594
+ async handlerSetAvatar(event, file) {
595
+ event.stopPropagation();
596
+ this.fileList().forEach(item => {
597
+ if (item().id === file().id) {
598
+ item.update(file => ({ ...file, isAvatar: true }));
599
+ return;
600
+ }
601
+ item.update(file => ({ ...file, isAvatar: false }));
602
+ });
603
+ this.outFileChanged.emit(this.fileList());
604
+ }
605
+ async removeAllFile() {
606
+ this.fileList.set([]);
607
+ this.messageError.set(undefined);
608
+ }
609
+ async handlerDownloadSampleFile(event) {
610
+ event.stopPropagation();
611
+ const config = this.configDownloadSampleFile();
612
+ if (!config) {
613
+ return;
614
+ }
615
+ if (config?.callBack) {
616
+ config.callBack();
617
+ return;
618
+ }
619
+ if (config?.url) {
620
+ downloadFileByUrl(config.url, config.title);
621
+ }
622
+ }
623
+ // #endregion
624
+ ngOnDestroy() {
625
+ this.onDestroy.next();
626
+ this.onDestroy.complete();
627
+ }
628
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
629
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsInputsUploadComponent, isStandalone: true, selector: "libs_ui-components-inputs-upload", inputs: { originFiles: { classPropertyName: "originFiles", publicName: "originFiles", isSignal: true, isRequired: false, transformFunction: null }, fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, canUploadIfHasExistFile: { classPropertyName: "canUploadIfHasExistFile", publicName: "canUploadIfHasExistFile", isSignal: true, isRequired: false, transformFunction: null }, canSetAvatar: { classPropertyName: "canSetAvatar", publicName: "canSetAvatar", isSignal: true, isRequired: false, transformFunction: null }, limitFile: { classPropertyName: "limitFile", publicName: "limitFile", isSignal: true, isRequired: false, transformFunction: null }, maxTotalSize: { classPropertyName: "maxTotalSize", publicName: "maxTotalSize", isSignal: true, isRequired: false, transformFunction: null }, maxImageSize: { classPropertyName: "maxImageSize", publicName: "maxImageSize", isSignal: true, isRequired: false, transformFunction: null }, maxVideoSize: { classPropertyName: "maxVideoSize", publicName: "maxVideoSize", isSignal: true, isRequired: false, transformFunction: null }, maxDocumentSize: { classPropertyName: "maxDocumentSize", publicName: "maxDocumentSize", isSignal: true, isRequired: false, transformFunction: null }, maxAudioSize: { classPropertyName: "maxAudioSize", publicName: "maxAudioSize", isSignal: true, isRequired: false, transformFunction: null }, imageExtList: { classPropertyName: "imageExtList", publicName: "imageExtList", isSignal: true, isRequired: false, transformFunction: null }, videoExtList: { classPropertyName: "videoExtList", publicName: "videoExtList", isSignal: true, isRequired: false, transformFunction: null }, documentExtList: { classPropertyName: "documentExtList", publicName: "documentExtList", isSignal: true, isRequired: false, transformFunction: null }, audioExtList: { classPropertyName: "audioExtList", publicName: "audioExtList", isSignal: true, isRequired: false, transformFunction: null }, classIncludeListItem: { classPropertyName: "classIncludeListItem", publicName: "classIncludeListItem", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, aspectRatio: { classPropertyName: "aspectRatio", publicName: "aspectRatio", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, ignoreShowSizeFile: { classPropertyName: "ignoreShowSizeFile", publicName: "ignoreShowSizeFile", isSignal: true, isRequired: false, transformFunction: null }, allowShowPushMessageMaxSizeError: { classPropertyName: "allowShowPushMessageMaxSizeError", publicName: "allowShowPushMessageMaxSizeError", isSignal: true, isRequired: false, transformFunction: null }, messageTypeFileError: { classPropertyName: "messageTypeFileError", publicName: "messageTypeFileError", isSignal: true, isRequired: false, transformFunction: null }, messageMaxSizeError: { classPropertyName: "messageMaxSizeError", publicName: "messageMaxSizeError", isSignal: true, isRequired: false, transformFunction: null }, messageFileUploadError: { classPropertyName: "messageFileUploadError", publicName: "messageFileUploadError", isSignal: true, isRequired: false, transformFunction: null }, messageTotalFileExceedsError: { classPropertyName: "messageTotalFileExceedsError", publicName: "messageTotalFileExceedsError", isSignal: true, isRequired: false, transformFunction: null }, configDescriptionInputUpload: { classPropertyName: "configDescriptionInputUpload", publicName: "configDescriptionInputUpload", isSignal: true, isRequired: false, transformFunction: null }, modeDisplayFile: { classPropertyName: "modeDisplayFile", publicName: "modeDisplayFile", isSignal: true, isRequired: false, transformFunction: null }, descriptionFormatAndSizeFile: { classPropertyName: "descriptionFormatAndSizeFile", publicName: "descriptionFormatAndSizeFile", isSignal: true, isRequired: false, transformFunction: null }, showVideoDuration: { classPropertyName: "showVideoDuration", publicName: "showVideoDuration", isSignal: true, isRequired: false, transformFunction: null }, labelConfig: { classPropertyName: "labelConfig", publicName: "labelConfig", isSignal: true, isRequired: false, transformFunction: null }, showBlockUploadWhenHasFileAndModeSingle: { classPropertyName: "showBlockUploadWhenHasFileAndModeSingle", publicName: "showBlockUploadWhenHasFileAndModeSingle", isSignal: true, isRequired: false, transformFunction: null }, ignoreIconRemove: { classPropertyName: "ignoreIconRemove", publicName: "ignoreIconRemove", isSignal: true, isRequired: false, transformFunction: null }, ignoreIconEdit: { classPropertyName: "ignoreIconEdit", publicName: "ignoreIconEdit", isSignal: true, isRequired: false, transformFunction: null }, ignoreIconPreview: { classPropertyName: "ignoreIconPreview", publicName: "ignoreIconPreview", isSignal: true, isRequired: false, transformFunction: null }, classIncludeFileContent: { classPropertyName: "classIncludeFileContent", publicName: "classIncludeFileContent", isSignal: true, isRequired: false, transformFunction: null }, showBorderErrorAllItemWhenError: { classPropertyName: "showBorderErrorAllItemWhenError", publicName: "showBorderErrorAllItemWhenError", isSignal: true, isRequired: false, transformFunction: null }, configDownloadSampleFile: { classPropertyName: "configDownloadSampleFile", publicName: "configDownloadSampleFile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClose: "outClose", outFileChanged: "outFileChanged", outFileRemoved: "outFileRemoved", outFunctionsControl: "outFunctionsControl" }, viewQueries: [{ propertyName: "uploadRef", first: true, predicate: ["upload"], descendants: true, isSignal: true }, { propertyName: "uploadInputRef", first: true, predicate: ["uploadInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col w-full h-full\">\n <div>\n @if (labelConfig();as labelConfig) {\n <libs_ui-components-label [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required \"\n [description]=\"labelConfig.description\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n @if ((!configDownloadSampleFile()?.position || configDownloadSampleFile()?.position === 'top') && configDownloadSampleFile();as configDownloadSampleFile) {\n <libs_ui-components-buttons-button [type]=\"'button-link-primary'\"\n [classLabel]=\"'libs-ui-font-h7m'\"\n [classInclude]=\"'!mb-[8px] !p-0'\"\n [classIconLeft]=\"'libs-ui-icon-attachment before:!text-[12px]'\"\n [label]=\"configDownloadSampleFile?.title || ' '\"\n (outClick)=\"handlerDownloadSampleFile($event)\" />\n }\n @if (multiple() || showBlockUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div #upload\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || (!multiple() && fileList().length)\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\">\n <div class=\"flex items-center\">\n <div class=\"mr-[16px]\">\n <i class=\"libs-ui-components-inputs-upload-icon libs-ui-icon-file-upload before:!text-[32px]\"></i>\n </div>\n <div class=\"libs-ui-components-inputs-upload-description\">\n <div class=\"mb-[4px] libs-ui-font-h6m\"\n [innerHTML]=\"(configDescriptionInputUpload().message || '') | translate:configDescriptionInputUpload().interpolateParams\">\n </div>\n @for (item of descriptionFormatAndSizeFileComputed(); track item; let last = $last) {\n <div class=\"libs-ui-font-h7r\"\n [class.mb-[4px]]=\"!last\"\n [innerHTML]=\"item.message | translate:item.interpolateParams\">\n </div>\n }\n </div>\n </div>\n @if (multiple()) {\n <input #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n multiple\n [accept]=\"accessFiles()\" />\n } @else {\n <input #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n [accept]=\"accessFiles()\" />\n }\n </div>\n }\n @if (messageError() && (multiple() || showBlockUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple()))) {\n <div class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r\">\n {{ (messageError() || '') | translate:{ value: limitFile() } }}\n </div>\n }\n @if (configDownloadSampleFile()?.position === 'bottom' && configDownloadSampleFile();as configDownloadSampleFile) {\n <libs_ui-components-buttons-button [type]=\"'button-link-primary'\"\n [classLabel]=\"'libs-ui-font-h7m'\"\n [classInclude]=\"'!mt-[8px] !p-0'\"\n [classIconLeft]=\"'libs-ui-icon-attachment before:!text-[12px]'\"\n [label]=\"configDownloadSampleFile.title || ' '\"\n (moClick)=\"handlerDownloadSampleFile($event)\" />\n }\n </div>\n @if (fileList().length) {\n <div LibsUiComponentsScrollOverlayDirective\n class=\"relative w-full h-full px-[10px] libs-ui-components-inputs-upload-view-list {{ classIncludeFileContent() || '' }}\"\n [class.mt-[12px]]=\"multiple() || showBlockUploadWhenHasFileAndModeSingle()\">\n <ng-content select=\"[label-file]\"></ng-content>\n @for (item of fileList(); track item(); let first = $first) {\n <div class=\"libs-ui-components-inputs-upload-view-list-item {{ classIncludeListItem() || '' }}\"\n [class.libs-ui-components-inputs-upload-file-full]=\"modeDisplayFile() === 'full'\"\n [class.libs-ui-components-inputs-upload-file-short]=\"modeDisplayFile() === 'short'\"\n [class.libs-ui-border-error-general]=\"item().error || (messageError() && showBorderErrorAllItemWhenError())\"\n [class.mt-0]=\"first && !multiple() && !showBlockUploadWhenHasFileAndModeSingle()\">\n\n <div class=\"flex w-full\">\n <div class=\"flex items-center\">\n @if (canSetAvatar() && item().type === 'image') {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'!mr-0' + (item().isAvatar ? ' libs-ui-icon-check-circle-solid before:!text-[#00bc62]': ' libs-ui-icon-check-circle-outline') + ((disable() || item().isUploading || !!item().error) ? ' libs-ui-disable' : '')\"\n [popover]=\"{config:{ content: item().isAvatar ? 'i18n_avatar' : 'i18n_choose_as_your_avatar', zIndex: zIndex()}}\"\n [classInclude]=\"'!mr-[12px] !p-0'\"\n [disable]=\"disable() || item().isUploading || !!item().error\"\n (outClick)=\"handlerSetAvatar($event, item)\" />\n }\n </div>\n <div class=\"flex\"\n [class.w-[calc(100%-28px)]]=\"canSetAvatar()\"\n [class.w-full]=\"!canSetAvatar()\">\n @if (modeDisplayFile() === 'full') {\n <libs_ui-components-inputs-upload-avatar [disable]=\"disable()\"\n [(item)]=\"item\"\n [showVideoDuration]=\"showVideoDuration()\"\n (outOpenPreview)=\"handlerOpenPreviewFile($event)\" />\n }\n <div class=\"relative w-full\">\n <div class=\"flex absolute w-full h-full flex-col\"\n [class.flex-col]=\"modeDisplayFile() === 'full'\"\n [class.justify-center]=\"modeDisplayFile() === 'full'\"\n [class.items-center]=\"modeDisplayFile() === 'short'\">\n <libs_ui-components-label class=\"flex w-full\"\n [labelLeft]=\"item().name\"\n [zIndexPopover]=\"zIndex() + 1\"\n [labelLeftClass]=\"'libs-ui-font-h6m ' + ((disable() || item().isUploading || item().error) ? 'text-[#6a7383]' : 'text-[#071631]')\"\n [classInclude]=\"modeDisplayFile() === 'short' ? '!mb-0' : ''\" />\n\n @if (!ignoreShowSizeFile()) {\n <div class=\"text-[#9ca2ad] libs-ui-font-h7r shrink-0\"\n [class.flex]=\"modeDisplayFile() === 'full'\"\n [class.items-center]=\"modeDisplayFile() === 'short'\"\n [class.ml-[12px]]=\"modeDisplayFile() === 'short'\">\n {{ item().size }}\n </div>\n }\n </div>\n </div>\n @if (item().isUploading && item().percentUploading) {\n <div class=\"flex items-center ml-[16px]\"\n [class.mr-[26px]]=\"modeDisplayFile() === 'full'\">\n <div class=\"w-[120px] h-[4px] rounded-[4px] bg-[#f8f9fa] relative\">\n <div class=\"absolute top-0 left-0 h-[4px] rounded-[4px] bg-[#00bc62]\"\n [style.width.px]=\"(item().percentUploading ?? 0)*1.2\"></div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"flex ml-[16px]\">\n @if (!ignoreIconPreview()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-eye-outline !mr-0'\"\n [popover]=\"{config:{ content: 'i18n_preview', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0' + (ignoreIconRemove() && !ignoreIconEdit() ? '' : ' !mr-[12px]')\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerOpenPreviewFile(item())\" />\n }\n @if (item().type === 'image' && !item().error && !ignoreIconEdit()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-edit-line !mr-0'\"\n [popover]=\"{config:{ content: 'i18n_edit', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0' + (ignoreIconRemove() ? '' : ' !mr-[12px]')\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerEditImage($event, item)\" />\n }\n @if (!ignoreIconRemove()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-close !mr-0'\"\n [popover]=\"{config: {content: 'i18n_delete', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0'\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || !showBlockUploadWhenHasFileAndModeSingle())) {\n <div class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r\">{{ (item().error || ' ') | translate }}</div>\n }\n }\n </div>\n }\n</div>\n", styles: [":host ::ng-deep .libs-ui-components-inputs-upload{width:100%;padding:16px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;background-color:#fff;border:1px dashed #e6e7ea}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-icon:before{color:#9ca2ad}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-description{color:#9ca2ad}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-color-default, #226ff5)}:host ::ng-deep .libs-ui-components-inputs-upload:hover,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over{background-color:var(--libs-ui-color-light-3, #f4f8ff);border:1px dashed var(--libs-ui-color-light-1, #226ff5)}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-icon:before,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-description,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-description span,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable{cursor:default!important;text-decoration:none;pointer-events:none;background-color:#f8f9fa!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error{background-color:#fef5f6!important;border:1px dashed #ee2d41!important}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-file-full{background-color:#fff;padding:8px 12px}:host ::ng-deep .libs-ui-components-inputs-upload-file-short{background-color:#f4f8ff;padding:6px 12px}.libs-ui-components-inputs-upload-view-list{overflow-y:auto;max-height:100%;padding:0 10px}.libs-ui-components-inputs-upload-view-list .libs-ui-components-inputs-upload-view-list-item{width:100%;display:flex;align-items:center;justify-content:center;border-radius:4px;margin-bottom:8px}.libs-ui-components-inputs-upload-view-list .libs-ui-components-inputs-upload-view-list-item:hover{background-color:#f8f9fa}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsLabelComponent, selector: "libs_ui-components-label", inputs: ["iconPopoverClass", "classInclude", "labelLeft", "labelLeftClass", "labelLeftBehindToggleButton", "popover", "required", "buttonsLeft", "disableButtonsLeft", "buttonsRight", "disableButtonsRight", "labelRight", "labelRightClass", "labelRightRequired", "hasToggle", "toggleSize", "toggleActive", "toggleDisable", "description", "descriptionClass", "buttonsDescription", "disableButtonsDescription", "buttonsDescriptionContainerClass", "onlyShowCount", "zIndexPopover", "timerDestroyPopover", "count", "limitLength"], outputs: ["outClickButton", "outSwitchEvent", "outLabelRightClick", "outLabelLeftClick"] }, { kind: "component", type: LibsUiComponentsInputsUploadAvatarComponent, selector: "libs_ui-components-inputs-upload-avatar", inputs: ["item", "showVideoDuration", "disable", "size"], outputs: ["itemChange", "outOpenPreview"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
630
+ }
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadComponent, decorators: [{
632
+ type: Component,
633
+ args: [{ selector: 'libs_ui-components-inputs-upload', standalone: true, imports: [TranslateModule,
634
+ LibsUiComponentsButtonsButtonComponent,
635
+ LibsUiComponentsLabelComponent,
636
+ LibsUiComponentsInputsUploadAvatarComponent,
637
+ LibsUiComponentsScrollOverlayDirective
638
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col w-full h-full\">\n <div>\n @if (labelConfig();as labelConfig) {\n <libs_ui-components-label [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required \"\n [description]=\"labelConfig.description\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n @if ((!configDownloadSampleFile()?.position || configDownloadSampleFile()?.position === 'top') && configDownloadSampleFile();as configDownloadSampleFile) {\n <libs_ui-components-buttons-button [type]=\"'button-link-primary'\"\n [classLabel]=\"'libs-ui-font-h7m'\"\n [classInclude]=\"'!mb-[8px] !p-0'\"\n [classIconLeft]=\"'libs-ui-icon-attachment before:!text-[12px]'\"\n [label]=\"configDownloadSampleFile?.title || ' '\"\n (outClick)=\"handlerDownloadSampleFile($event)\" />\n }\n @if (multiple() || showBlockUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div #upload\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || (!multiple() && fileList().length)\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\">\n <div class=\"flex items-center\">\n <div class=\"mr-[16px]\">\n <i class=\"libs-ui-components-inputs-upload-icon libs-ui-icon-file-upload before:!text-[32px]\"></i>\n </div>\n <div class=\"libs-ui-components-inputs-upload-description\">\n <div class=\"mb-[4px] libs-ui-font-h6m\"\n [innerHTML]=\"(configDescriptionInputUpload().message || '') | translate:configDescriptionInputUpload().interpolateParams\">\n </div>\n @for (item of descriptionFormatAndSizeFileComputed(); track item; let last = $last) {\n <div class=\"libs-ui-font-h7r\"\n [class.mb-[4px]]=\"!last\"\n [innerHTML]=\"item.message | translate:item.interpolateParams\">\n </div>\n }\n </div>\n </div>\n @if (multiple()) {\n <input #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n multiple\n [accept]=\"accessFiles()\" />\n } @else {\n <input #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n [accept]=\"accessFiles()\" />\n }\n </div>\n }\n @if (messageError() && (multiple() || showBlockUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple()))) {\n <div class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r\">\n {{ (messageError() || '') | translate:{ value: limitFile() } }}\n </div>\n }\n @if (configDownloadSampleFile()?.position === 'bottom' && configDownloadSampleFile();as configDownloadSampleFile) {\n <libs_ui-components-buttons-button [type]=\"'button-link-primary'\"\n [classLabel]=\"'libs-ui-font-h7m'\"\n [classInclude]=\"'!mt-[8px] !p-0'\"\n [classIconLeft]=\"'libs-ui-icon-attachment before:!text-[12px]'\"\n [label]=\"configDownloadSampleFile.title || ' '\"\n (moClick)=\"handlerDownloadSampleFile($event)\" />\n }\n </div>\n @if (fileList().length) {\n <div LibsUiComponentsScrollOverlayDirective\n class=\"relative w-full h-full px-[10px] libs-ui-components-inputs-upload-view-list {{ classIncludeFileContent() || '' }}\"\n [class.mt-[12px]]=\"multiple() || showBlockUploadWhenHasFileAndModeSingle()\">\n <ng-content select=\"[label-file]\"></ng-content>\n @for (item of fileList(); track item(); let first = $first) {\n <div class=\"libs-ui-components-inputs-upload-view-list-item {{ classIncludeListItem() || '' }}\"\n [class.libs-ui-components-inputs-upload-file-full]=\"modeDisplayFile() === 'full'\"\n [class.libs-ui-components-inputs-upload-file-short]=\"modeDisplayFile() === 'short'\"\n [class.libs-ui-border-error-general]=\"item().error || (messageError() && showBorderErrorAllItemWhenError())\"\n [class.mt-0]=\"first && !multiple() && !showBlockUploadWhenHasFileAndModeSingle()\">\n\n <div class=\"flex w-full\">\n <div class=\"flex items-center\">\n @if (canSetAvatar() && item().type === 'image') {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'!mr-0' + (item().isAvatar ? ' libs-ui-icon-check-circle-solid before:!text-[#00bc62]': ' libs-ui-icon-check-circle-outline') + ((disable() || item().isUploading || !!item().error) ? ' libs-ui-disable' : '')\"\n [popover]=\"{config:{ content: item().isAvatar ? 'i18n_avatar' : 'i18n_choose_as_your_avatar', zIndex: zIndex()}}\"\n [classInclude]=\"'!mr-[12px] !p-0'\"\n [disable]=\"disable() || item().isUploading || !!item().error\"\n (outClick)=\"handlerSetAvatar($event, item)\" />\n }\n </div>\n <div class=\"flex\"\n [class.w-[calc(100%-28px)]]=\"canSetAvatar()\"\n [class.w-full]=\"!canSetAvatar()\">\n @if (modeDisplayFile() === 'full') {\n <libs_ui-components-inputs-upload-avatar [disable]=\"disable()\"\n [(item)]=\"item\"\n [showVideoDuration]=\"showVideoDuration()\"\n (outOpenPreview)=\"handlerOpenPreviewFile($event)\" />\n }\n <div class=\"relative w-full\">\n <div class=\"flex absolute w-full h-full flex-col\"\n [class.flex-col]=\"modeDisplayFile() === 'full'\"\n [class.justify-center]=\"modeDisplayFile() === 'full'\"\n [class.items-center]=\"modeDisplayFile() === 'short'\">\n <libs_ui-components-label class=\"flex w-full\"\n [labelLeft]=\"item().name\"\n [zIndexPopover]=\"zIndex() + 1\"\n [labelLeftClass]=\"'libs-ui-font-h6m ' + ((disable() || item().isUploading || item().error) ? 'text-[#6a7383]' : 'text-[#071631]')\"\n [classInclude]=\"modeDisplayFile() === 'short' ? '!mb-0' : ''\" />\n\n @if (!ignoreShowSizeFile()) {\n <div class=\"text-[#9ca2ad] libs-ui-font-h7r shrink-0\"\n [class.flex]=\"modeDisplayFile() === 'full'\"\n [class.items-center]=\"modeDisplayFile() === 'short'\"\n [class.ml-[12px]]=\"modeDisplayFile() === 'short'\">\n {{ item().size }}\n </div>\n }\n </div>\n </div>\n @if (item().isUploading && item().percentUploading) {\n <div class=\"flex items-center ml-[16px]\"\n [class.mr-[26px]]=\"modeDisplayFile() === 'full'\">\n <div class=\"w-[120px] h-[4px] rounded-[4px] bg-[#f8f9fa] relative\">\n <div class=\"absolute top-0 left-0 h-[4px] rounded-[4px] bg-[#00bc62]\"\n [style.width.px]=\"(item().percentUploading ?? 0)*1.2\"></div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <div class=\"flex ml-[16px]\">\n @if (!ignoreIconPreview()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-eye-outline !mr-0'\"\n [popover]=\"{config:{ content: 'i18n_preview', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0' + (ignoreIconRemove() && !ignoreIconEdit() ? '' : ' !mr-[12px]')\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerOpenPreviewFile(item())\" />\n }\n @if (item().type === 'image' && !item().error && !ignoreIconEdit()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-edit-line !mr-0'\"\n [popover]=\"{config:{ content: 'i18n_edit', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0' + (ignoreIconRemove() ? '' : ' !mr-[12px]')\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerEditImage($event, item)\" />\n }\n @if (!ignoreIconRemove()) {\n <libs_ui-components-buttons-button [type]=\"'button-link-third'\"\n [classIconLeft]=\"'libs-ui-icon-close !mr-0'\"\n [popover]=\"{config: {content: 'i18n_delete', zIndex: zIndex()+1}}\"\n [classInclude]=\"'!p-0'\"\n [disable]=\"item().isUploading || disable()\"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || !showBlockUploadWhenHasFileAndModeSingle())) {\n <div class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r\">{{ (item().error || ' ') | translate }}</div>\n }\n }\n </div>\n }\n</div>\n", styles: [":host ::ng-deep .libs-ui-components-inputs-upload{width:100%;padding:16px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;background-color:#fff;border:1px dashed #e6e7ea}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-icon:before{color:#9ca2ad}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-description{color:#9ca2ad}:host ::ng-deep .libs-ui-components-inputs-upload .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-color-default, #226ff5)}:host ::ng-deep .libs-ui-components-inputs-upload:hover,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over{background-color:var(--libs-ui-color-light-3, #f4f8ff);border:1px dashed var(--libs-ui-color-light-1, #226ff5)}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-icon:before,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-description,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload:hover .libs-ui-components-inputs-upload-description span,:host ::ng-deep .libs-ui-components-inputs-upload.libs-ui-components-inputs-upload-drag-over .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable{cursor:default!important;text-decoration:none;pointer-events:none;background-color:#f8f9fa!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error{background-color:#fef5f6!important;border:1px dashed #ee2d41!important}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-description{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-error .libs-ui-components-inputs-upload-description span{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-file-full{background-color:#fff;padding:8px 12px}:host ::ng-deep .libs-ui-components-inputs-upload-file-short{background-color:#f4f8ff;padding:6px 12px}.libs-ui-components-inputs-upload-view-list{overflow-y:auto;max-height:100%;padding:0 10px}.libs-ui-components-inputs-upload-view-list .libs-ui-components-inputs-upload-view-list-item{width:100%;display:flex;align-items:center;justify-content:center;border-radius:4px;margin-bottom:8px}.libs-ui-components-inputs-upload-view-list .libs-ui-components-inputs-upload-view-list-item:hover{background-color:#f8f9fa}\n"] }]
639
+ }], ctorParameters: () => [] });
640
+
641
+ /**
642
+ * Generated bundle index. Do not edit.
643
+ */
644
+
645
+ export { AudioExtList, DocumentExtList, ImageExtList, LibsUiComponentsInputsUploadComponent, VideoExtList };
646
+ //# sourceMappingURL=libs-ui-components-inputs-upload.mjs.map