@libs-ui/components-inputs-upload 0.2.306-4 → 0.2.306-5
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/avatar/avatar.component.d.ts +1 -1
- package/esm2022/avatar/avatar.component.mjs +12 -19
- package/esm2022/defines/helper.define.mjs +5 -5
- package/esm2022/index.mjs +1 -1
- package/esm2022/interfaces/upload.interface.mjs +1 -1
- package/esm2022/pipes/calc-duration-video.pipe.mjs +4 -4
- package/esm2022/pipes/check-file-extension.pipe.mjs +2 -2
- package/esm2022/upload-drop-file.directive.mjs +11 -5
- package/esm2022/upload-file.directive.mjs +10 -6
- package/esm2022/upload.component.mjs +79 -73
- package/fesm2022/libs-ui-components-inputs-upload.mjs +106 -97
- package/fesm2022/libs-ui-components-inputs-upload.mjs.map +1 -1
- package/package.json +14 -14
- package/upload.component.d.ts +1 -0
|
@@ -26,13 +26,13 @@ class LibsUiPipesInputsUploadCalcDurationVideoPipe {
|
|
|
26
26
|
duration = Math.round(duration);
|
|
27
27
|
if (duration >= 3600) {
|
|
28
28
|
const hour = Math.floor(duration / 3600);
|
|
29
|
-
const minute = Math.floor((duration -
|
|
29
|
+
const minute = Math.floor((duration - hour * 3600) / 60);
|
|
30
30
|
const second = duration - (hour * 3600 + minute * 60);
|
|
31
31
|
return `${hour}:${minute < 10 ? `0${minute}` : minute}:${second < 10 ? `0${second}` : second}`;
|
|
32
32
|
}
|
|
33
33
|
if (duration >= 60) {
|
|
34
34
|
const minute = Math.floor(duration / 60);
|
|
35
|
-
const second = duration -
|
|
35
|
+
const second = duration - minute * 60;
|
|
36
36
|
return `${minute}:${second < 10 ? `0${second}` : second}`;
|
|
37
37
|
}
|
|
38
38
|
return `0:${duration}`;
|
|
@@ -44,7 +44,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
44
44
|
type: Pipe,
|
|
45
45
|
args: [{
|
|
46
46
|
name: 'LibsUiPipesInputsUploadCalcDurationVideoPipe',
|
|
47
|
-
standalone: true
|
|
47
|
+
standalone: true,
|
|
48
48
|
}]
|
|
49
49
|
}] });
|
|
50
50
|
|
|
@@ -78,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
78
78
|
type: Pipe,
|
|
79
79
|
args: [{
|
|
80
80
|
name: 'LibsUiPipesInputsUploadCheckFileExtensionPipe',
|
|
81
|
-
standalone: true
|
|
81
|
+
standalone: true,
|
|
82
82
|
}]
|
|
83
83
|
}] });
|
|
84
84
|
|
|
@@ -103,18 +103,11 @@ class LibsUiComponentsInputsUploadAvatarComponent {
|
|
|
103
103
|
this.outOpenPreview.emit(this.item());
|
|
104
104
|
}
|
|
105
105
|
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 });
|
|
106
|
-
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
|
|
106
|
+
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\n class=\"flex mr-[12px] bg-[#ffffff] rounded-[4px]\"\n [class.libs-ui-disable]=\"disable() || item().isUploading || item().error\">\n @if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'image') {\n <div\n [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\n [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 } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'video') {\n <div\n class=\"relative\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\">\n @if (item().url || item().origin_url) {\n <video\n #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]\"></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 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 } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'pdf') {\n <ng-container *ngComponentOutlet=\"'pdf' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'word') {\n <ng-container *ngComponentOutlet=\"'word' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'pptx') {\n <ng-container *ngComponentOutlet=\"'pptx' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'xlsx') {\n <ng-container *ngComponentOutlet=\"'xlsx' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else {\n <div\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"flex items-center justify-center\">\n <i\n 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 });
|
|
107
107
|
}
|
|
108
108
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadAvatarComponent, decorators: [{
|
|
109
109
|
type: Component,
|
|
110
|
-
args: [{ selector: 'libs_ui-components-inputs-upload-avatar', standalone: true, imports: [
|
|
111
|
-
NgComponentOutlet, AsyncPipe, TranslateModule,
|
|
112
|
-
LibsUiComponentsSpinnerComponent,
|
|
113
|
-
LibsUiPipesSecurityTrustPipe,
|
|
114
|
-
LibsUiPipesInputsUploadCalcDurationVideoPipe,
|
|
115
|
-
LibsUiPipesInputsUploadCheckFileExtensionPipe,
|
|
116
|
-
LibsUiIconsGetIconComponentPipe,
|
|
117
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex mr-[12px] bg-[#ffffff] rounded-[4px]\"\n [class.libs-ui-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" }]
|
|
110
|
+
args: [{ selector: 'libs_ui-components-inputs-upload-avatar', standalone: true, imports: [NgComponentOutlet, AsyncPipe, TranslateModule, LibsUiComponentsSpinnerComponent, LibsUiPipesSecurityTrustPipe, LibsUiPipesInputsUploadCalcDurationVideoPipe, LibsUiPipesInputsUploadCheckFileExtensionPipe, LibsUiIconsGetIconComponentPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"flex mr-[12px] bg-[#ffffff] rounded-[4px]\"\n [class.libs-ui-disable]=\"disable() || item().isUploading || item().error\">\n @if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'image') {\n <div\n [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\n [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 } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'video') {\n <div\n class=\"relative\"\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\">\n @if (item().url || item().origin_url) {\n <video\n #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]\"></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 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 } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'pdf') {\n <ng-container *ngComponentOutlet=\"'pdf' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'word') {\n <ng-container *ngComponentOutlet=\"'word' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'pptx') {\n <ng-container *ngComponentOutlet=\"'pptx' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else if (item() | LibsUiPipesInputsUploadCheckFileExtensionPipe: 'xlsx') {\n <ng-container *ngComponentOutlet=\"'xlsx' | LibsUiIconsGetIconComponentPipe | async\" />\n } @else {\n <div\n [style.width.px]=\"size() || 32\"\n [style.height.px]=\"size() || 32\"\n class=\"flex items-center justify-center\">\n <i\n 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" }]
|
|
118
111
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
119
112
|
type: Optional
|
|
120
113
|
}, {
|
|
@@ -125,19 +118,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
125
118
|
const getDescriptionFormatAndSizeFileDefault = (type, maxImageSize, maxVideoSize, maxDocumentSize, maxAudioSize) => {
|
|
126
119
|
const image = {
|
|
127
120
|
message: 'i18n_note_upload_image_volume',
|
|
128
|
-
interpolateParams: { value: getLabelBySizeFile(maxImageSize, 0) }
|
|
121
|
+
interpolateParams: { value: getLabelBySizeFile(maxImageSize, 0) },
|
|
129
122
|
};
|
|
130
123
|
const video = {
|
|
131
124
|
message: 'i18n_note_upload_video_volume',
|
|
132
|
-
interpolateParams: { value: getLabelBySizeFile(maxVideoSize, 0) }
|
|
125
|
+
interpolateParams: { value: getLabelBySizeFile(maxVideoSize, 0) },
|
|
133
126
|
};
|
|
134
127
|
const document = {
|
|
135
128
|
message: 'i18n_note_upload_file_volume',
|
|
136
|
-
interpolateParams: { value: getLabelBySizeFile(maxDocumentSize, 0) }
|
|
129
|
+
interpolateParams: { value: getLabelBySizeFile(maxDocumentSize, 0) },
|
|
137
130
|
};
|
|
138
131
|
const audio = {
|
|
139
132
|
message: 'i18n_note_upload_audio_volume',
|
|
140
|
-
interpolateParams: { value: getLabelBySizeFile(maxAudioSize, 0) }
|
|
133
|
+
interpolateParams: { value: getLabelBySizeFile(maxAudioSize, 0) },
|
|
141
134
|
};
|
|
142
135
|
const typeSplit = type.split('_');
|
|
143
136
|
const description = [];
|
|
@@ -169,12 +162,16 @@ class LibsUiComponentsInputsUploadDropFileDirective {
|
|
|
169
162
|
this.elementRef = elementRef;
|
|
170
163
|
}
|
|
171
164
|
ngAfterViewInit() {
|
|
172
|
-
fromEvent(this.elementRef.nativeElement, 'dragover')
|
|
165
|
+
fromEvent(this.elementRef.nativeElement, 'dragover')
|
|
166
|
+
.pipe(takeUntil(this.onDestroy))
|
|
167
|
+
.subscribe((e) => {
|
|
173
168
|
e.stopPropagation();
|
|
174
169
|
e.preventDefault();
|
|
175
170
|
this.outDragOver.emit(e);
|
|
176
171
|
});
|
|
177
|
-
fromEvent(this.elementRef.nativeElement, 'dragleave')
|
|
172
|
+
fromEvent(this.elementRef.nativeElement, 'dragleave')
|
|
173
|
+
.pipe(takeUntil(this.onDestroy))
|
|
174
|
+
.subscribe((e) => {
|
|
178
175
|
e.stopPropagation();
|
|
179
176
|
e.preventDefault();
|
|
180
177
|
if (checkMouseOverInContainer(e, this.elementRef.nativeElement)) {
|
|
@@ -182,7 +179,9 @@ class LibsUiComponentsInputsUploadDropFileDirective {
|
|
|
182
179
|
}
|
|
183
180
|
this.outDragLeave.emit(e);
|
|
184
181
|
});
|
|
185
|
-
fromEvent(this.elementRef.nativeElement, 'drop')
|
|
182
|
+
fromEvent(this.elementRef.nativeElement, 'drop')
|
|
183
|
+
.pipe(takeUntil(this.onDestroy))
|
|
184
|
+
.subscribe((e) => {
|
|
186
185
|
e.stopPropagation();
|
|
187
186
|
e.preventDefault();
|
|
188
187
|
this.outDrop.emit(e);
|
|
@@ -209,19 +208,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
209
208
|
args: [{
|
|
210
209
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
211
210
|
selector: '[LibsUiComponentsInputsUploadDropFileDirective]',
|
|
212
|
-
standalone: true
|
|
211
|
+
standalone: true,
|
|
213
212
|
}]
|
|
214
213
|
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
215
214
|
|
|
216
215
|
class LibsUiComponentsInputsUploadDirective {
|
|
217
216
|
onDestroy = new Subject();
|
|
218
|
-
multiple = input(true, { transform: val => val ?? true });
|
|
219
|
-
accessFiles = input('image/x-png,image/jpg,image/jpeg,image/PNG,image/x-PNG,image/JPG,image/JPEG', { transform: val => val ?? 'image/x-png,image/jpg,image/jpeg,image/PNG,image/x-PNG,image/JPG,image/JPEG' });
|
|
217
|
+
multiple = input(true, { transform: (val) => val ?? true });
|
|
218
|
+
accessFiles = input('image/x-png,image/jpg,image/jpeg,image/PNG,image/x-PNG,image/JPG,image/JPEG', { transform: (val) => val ?? 'image/x-png,image/jpg,image/jpeg,image/PNG,image/x-PNG,image/JPG,image/JPEG' });
|
|
220
219
|
outUploadFiles = output();
|
|
221
220
|
outUploadFile = output();
|
|
222
221
|
elementRef = inject(ElementRef);
|
|
223
222
|
ngAfterViewInit() {
|
|
224
|
-
fromEvent(this.elementRef.nativeElement, 'click')
|
|
223
|
+
fromEvent(this.elementRef.nativeElement, 'click')
|
|
224
|
+
.pipe(takeUntil$1(this.onDestroy))
|
|
225
|
+
.subscribe((e) => {
|
|
225
226
|
e.stopPropagation();
|
|
226
227
|
e.preventDefault();
|
|
227
228
|
const inputElementUpload = document.createElement('input');
|
|
@@ -230,7 +231,9 @@ class LibsUiComponentsInputsUploadDirective {
|
|
|
230
231
|
inputElementUpload.multiple = this.multiple();
|
|
231
232
|
inputElementUpload.style.display = 'none';
|
|
232
233
|
inputElementUpload.click();
|
|
233
|
-
fromEvent(inputElementUpload, 'change')
|
|
234
|
+
fromEvent(inputElementUpload, 'change')
|
|
235
|
+
.pipe(takeUntil$1(this.onDestroy))
|
|
236
|
+
.subscribe((event) => {
|
|
234
237
|
const files = Array.from(event.dataTransfer?.files || event.target?.files || []);
|
|
235
238
|
inputElementUpload.remove();
|
|
236
239
|
if (!files?.length) {
|
|
@@ -256,7 +259,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
256
259
|
args: [{
|
|
257
260
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
258
261
|
selector: '[LibsUiComponentsInputsUploadDirective]',
|
|
259
|
-
standalone: true
|
|
262
|
+
standalone: true,
|
|
260
263
|
}]
|
|
261
264
|
}] });
|
|
262
265
|
|
|
@@ -278,46 +281,46 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
278
281
|
onDestroy = new Subject();
|
|
279
282
|
// #endregion
|
|
280
283
|
// #region INPUTS
|
|
281
|
-
originFiles = input([], { transform: val => val ?? [] });
|
|
282
|
-
fileType = input('image_video_document', { transform: val => val ?? 'image_video_document' });
|
|
284
|
+
originFiles = input([], { transform: (val) => val ?? [] });
|
|
285
|
+
fileType = input('image_video_document', { transform: (val) => val ?? 'image_video_document' });
|
|
283
286
|
multiple = input();
|
|
284
|
-
canUploadIfHasExistFile = input(false, { transform: val => val ?? false });
|
|
287
|
+
canUploadIfHasExistFile = input(false, { transform: (val) => val ?? false });
|
|
285
288
|
canSetAvatar = input(false);
|
|
286
|
-
limitFile = input(10, { transform: val => val ?? 10 });
|
|
287
|
-
maxTotalSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
|
|
288
|
-
maxImageSize = input(5 * 1024 * 1024, { transform: val => val ?? 5 * 1024 * 1024 });
|
|
289
|
-
maxVideoSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
|
|
290
|
-
maxDocumentSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
|
|
291
|
-
maxAudioSize = input(10 * 1024 * 1024, { transform: val => val ?? 10 * 1024 * 1024 });
|
|
292
|
-
imageExtList = input(ImageExtList, { transform: val => val ?? ImageExtList });
|
|
293
|
-
videoExtList = input(VideoExtList, { transform: val => val ?? VideoExtList });
|
|
294
|
-
documentExtList = input(DocumentExtList, { transform: val => val ?? DocumentExtList });
|
|
295
|
-
audioExtList = input(AudioExtList, { transform: val => val ?? AudioExtList });
|
|
289
|
+
limitFile = input(10, { transform: (val) => val ?? 10 });
|
|
290
|
+
maxTotalSize = input(10 * 1024 * 1024, { transform: (val) => val ?? 10 * 1024 * 1024 });
|
|
291
|
+
maxImageSize = input(5 * 1024 * 1024, { transform: (val) => val ?? 5 * 1024 * 1024 });
|
|
292
|
+
maxVideoSize = input(10 * 1024 * 1024, { transform: (val) => val ?? 10 * 1024 * 1024 });
|
|
293
|
+
maxDocumentSize = input(10 * 1024 * 1024, { transform: (val) => val ?? 10 * 1024 * 1024 });
|
|
294
|
+
maxAudioSize = input(10 * 1024 * 1024, { transform: (val) => val ?? 10 * 1024 * 1024 });
|
|
295
|
+
imageExtList = input(ImageExtList, { transform: (val) => val ?? ImageExtList });
|
|
296
|
+
videoExtList = input(VideoExtList, { transform: (val) => val ?? VideoExtList });
|
|
297
|
+
documentExtList = input(DocumentExtList, { transform: (val) => val ?? DocumentExtList });
|
|
298
|
+
audioExtList = input(AudioExtList, { transform: (val) => val ?? AudioExtList });
|
|
296
299
|
classIncludeListItem = input();
|
|
297
300
|
validRequired = input();
|
|
298
|
-
disable = input(false, { transform: val => val ?? false });
|
|
299
|
-
readonly = input(false, { transform: val => val ?? false });
|
|
301
|
+
disable = input(false, { transform: (val) => val ?? false });
|
|
302
|
+
readonly = input(false, { transform: (val) => val ?? false });
|
|
300
303
|
aspectRatio = input();
|
|
301
|
-
zIndex = input(1200, { transform: val => val ?? 1200 });
|
|
302
|
-
ignoreShowSizeFile = input(false, { transform: val => val ?? false });
|
|
303
|
-
allowShowPushMessageMaxSizeError = input(false, { transform: val => val ?? false });
|
|
304
|
-
messageTypeFileError = input('i18n_the_file_support_format_is_not_correct', { transform: val => val || 'i18n_the_file_support_format_is_not_correct' });
|
|
305
|
-
messageMaxSizeError = input('i18n_file_size_exceeds_the_allowed_limit', { transform: val => val || 'i18n_file_size_exceeds_the_allowed_limit' });
|
|
306
|
-
messageFileUploadError = input('i18n_invalid_file_upload', { transform: val => val || 'i18n_invalid_file_upload' });
|
|
307
|
-
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' });
|
|
304
|
+
zIndex = input(1200, { transform: (val) => val ?? 1200 });
|
|
305
|
+
ignoreShowSizeFile = input(false, { transform: (val) => val ?? false });
|
|
306
|
+
allowShowPushMessageMaxSizeError = input(false, { transform: (val) => val ?? false });
|
|
307
|
+
messageTypeFileError = input('i18n_the_file_support_format_is_not_correct', { transform: (val) => val || 'i18n_the_file_support_format_is_not_correct' });
|
|
308
|
+
messageMaxSizeError = input('i18n_file_size_exceeds_the_allowed_limit', { transform: (val) => val || 'i18n_file_size_exceeds_the_allowed_limit' });
|
|
309
|
+
messageFileUploadError = input('i18n_invalid_file_upload', { transform: (val) => val || 'i18n_invalid_file_upload' });
|
|
310
|
+
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' });
|
|
308
311
|
configDescriptionInputUpload = input({ message: 'i18n_drag_file_here_to_upload_or_select_file' }, {
|
|
309
|
-
transform: val => val ?? { message: 'i18n_drag_file_here_to_upload_or_select_file' }
|
|
312
|
+
transform: (val) => val ?? { message: 'i18n_drag_file_here_to_upload_or_select_file' },
|
|
310
313
|
});
|
|
311
|
-
modeDisplayFile = input('full', { transform: val => val || 'full' });
|
|
314
|
+
modeDisplayFile = input('full', { transform: (val) => val || 'full' });
|
|
312
315
|
descriptionFormatAndSizeFile = input();
|
|
313
|
-
showVideoDuration = input(false, { transform: val => val ?? false });
|
|
316
|
+
showVideoDuration = input(false, { transform: (val) => val ?? false });
|
|
314
317
|
labelConfig = input();
|
|
315
|
-
showPopupUploadWhenHasFileAndModeSingle = input(false, { transform: val => val ?? false });
|
|
316
|
-
ignoreIconRemove = input(false, { transform: val => val ?? false });
|
|
317
|
-
ignoreIconEdit = input(false, { transform: val => val ?? false });
|
|
318
|
-
ignoreIconPreview = input(true, { transform: val => val ?? true });
|
|
318
|
+
showPopupUploadWhenHasFileAndModeSingle = input(false, { transform: (val) => val ?? false });
|
|
319
|
+
ignoreIconRemove = input(false, { transform: (val) => val ?? false });
|
|
320
|
+
ignoreIconEdit = input(false, { transform: (val) => val ?? false });
|
|
321
|
+
ignoreIconPreview = input(true, { transform: (val) => val ?? true });
|
|
319
322
|
classIncludeFileContent = input();
|
|
320
|
-
showBorderErrorAllItemWhenError = input(false, { transform: val => val ?? false });
|
|
323
|
+
showBorderErrorAllItemWhenError = input(false, { transform: (val) => val ?? false });
|
|
321
324
|
configDownloadSampleFile = input();
|
|
322
325
|
// #endregion
|
|
323
326
|
// #region OUTPUTS
|
|
@@ -346,26 +349,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
346
349
|
}
|
|
347
350
|
// #region LIFECYCLE HOOKS
|
|
348
351
|
ngOnInit() {
|
|
349
|
-
this.outFunctionsControl.emit(
|
|
350
|
-
checkIsValid: this.validate.bind(this),
|
|
351
|
-
removeAll: this.removeAllFile.bind(this),
|
|
352
|
-
uploading: async (process, id) => {
|
|
353
|
-
const fileUploading = this.fileList().find(file => file().id === id);
|
|
354
|
-
if (fileUploading) {
|
|
355
|
-
fileUploading.update(file => ({ ...file, percentUploading: process.percent, isUploading: process.percent !== 100 }));
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
setMessageError: async (message, id) => {
|
|
359
|
-
this.messageError.set(message);
|
|
360
|
-
if (id) {
|
|
361
|
-
const fileError = this.fileList().find(file => file().id === id);
|
|
362
|
-
if (fileError) {
|
|
363
|
-
fileError.update(file => ({ ...file, error: message }));
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
handlerUploadFile: this.showUploadPopup.bind(this)
|
|
368
|
-
});
|
|
352
|
+
this.outFunctionsControl.emit(this.FunctionsControl);
|
|
369
353
|
}
|
|
370
354
|
ngAfterViewInit() {
|
|
371
355
|
setTimeout(() => {
|
|
@@ -389,7 +373,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
389
373
|
if (typeSplit.includes('audio')) {
|
|
390
374
|
accessExts.push(...this.audioExtList());
|
|
391
375
|
}
|
|
392
|
-
this.accessFiles.set(accessExts.map(ext => `.${ext}`).join(','));
|
|
376
|
+
this.accessFiles.set(accessExts.map((ext) => `.${ext}`).join(','));
|
|
393
377
|
}
|
|
394
378
|
// #endregion
|
|
395
379
|
// #region FILE OPERATIONS
|
|
@@ -429,7 +413,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
429
413
|
file: file,
|
|
430
414
|
size: getLabelBySizeFile(file.size),
|
|
431
415
|
type: isImage ? 'image' : isVideo ? 'video' : isAudio ? 'audio' : 'document',
|
|
432
|
-
id: uuid()
|
|
416
|
+
id: uuid(),
|
|
433
417
|
};
|
|
434
418
|
if (!(await this.checkValidFileExtension(file))) {
|
|
435
419
|
if (!errorExceedsMaxFile) {
|
|
@@ -453,11 +437,11 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
453
437
|
}
|
|
454
438
|
await this.pushFileInList(file, newFile);
|
|
455
439
|
}
|
|
456
|
-
if (this.canSetAvatar() && this.fileList().length && !this.fileList().find(file => file().isAvatar)) {
|
|
457
|
-
this.fileList.update(fileList => {
|
|
458
|
-
const itemImage = fileList.find(file => file().type === 'image');
|
|
440
|
+
if (this.canSetAvatar() && this.fileList().length && !this.fileList().find((file) => file().isAvatar)) {
|
|
441
|
+
this.fileList.update((fileList) => {
|
|
442
|
+
const itemImage = fileList.find((file) => file().type === 'image');
|
|
459
443
|
if (itemImage) {
|
|
460
|
-
itemImage.update(file => ({ ...file, isAvatar: true }));
|
|
444
|
+
itemImage.update((file) => ({ ...file, isAvatar: true }));
|
|
461
445
|
}
|
|
462
446
|
return [...fileList];
|
|
463
447
|
});
|
|
@@ -466,8 +450,8 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
466
450
|
this.validate();
|
|
467
451
|
}
|
|
468
452
|
async pushFileInList(file, newFile) {
|
|
469
|
-
newFile.url = await convertFileToBase64_ObjectUrl(file);
|
|
470
|
-
this.fileList.update(fileList => {
|
|
453
|
+
newFile.url = (await convertFileToBase64_ObjectUrl(file));
|
|
454
|
+
this.fileList.update((fileList) => {
|
|
471
455
|
fileList.splice(0, this.canUploadIfHasExistFile() ? 1 : 0, signal(newFile));
|
|
472
456
|
return [...fileList];
|
|
473
457
|
});
|
|
@@ -516,7 +500,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
516
500
|
async handlerRemoveFile(event, item) {
|
|
517
501
|
event.stopPropagation();
|
|
518
502
|
this.removeFile(item);
|
|
519
|
-
if (this.originFiles().find(file => file().url === item().url)) {
|
|
503
|
+
if (this.originFiles().find((file) => file().url === item().url)) {
|
|
520
504
|
this.outFileRemoved.emit(item);
|
|
521
505
|
}
|
|
522
506
|
this.validate();
|
|
@@ -527,10 +511,10 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
527
511
|
}
|
|
528
512
|
}
|
|
529
513
|
async removeFile(fileItem) {
|
|
530
|
-
this.fileList.update(fileList => fileList.filter(item => item().id !== fileItem().id));
|
|
514
|
+
this.fileList.update((fileList) => fileList.filter((item) => item().id !== fileItem().id));
|
|
531
515
|
if (this.canSetAvatar() && fileItem().isAvatar && this.fileList().length) {
|
|
532
|
-
this.fileList.update(fileList => {
|
|
533
|
-
fileList[0].update(file => ({ ...file, isAvatar: true }));
|
|
516
|
+
this.fileList.update((fileList) => {
|
|
517
|
+
fileList[0].update((file) => ({ ...file, isAvatar: true }));
|
|
534
518
|
return [...fileList];
|
|
535
519
|
});
|
|
536
520
|
}
|
|
@@ -553,7 +537,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
553
537
|
this.imageEditorComponentRef.instance.outSaveFile.subscribe(async (result) => {
|
|
554
538
|
const messageError = !(await this.checkValidFileSize(result.file)) ? this.messageMaxSizeError() : undefined;
|
|
555
539
|
const nameFile = fileItem().file?.name || fileItem().name;
|
|
556
|
-
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 }));
|
|
540
|
+
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 }));
|
|
557
541
|
this.outFileChanged.emit(this.fileList());
|
|
558
542
|
this.imageEditorComponentRef?.instance.outClose.emit({ isClickButtonClose: true });
|
|
559
543
|
});
|
|
@@ -618,7 +602,7 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
618
602
|
this.messageError.set(this.messageTotalFileExceedsError());
|
|
619
603
|
return false;
|
|
620
604
|
}
|
|
621
|
-
const fileError = this.fileList().find(item => item().error);
|
|
605
|
+
const fileError = this.fileList().find((item) => item().error);
|
|
622
606
|
if (fileError) {
|
|
623
607
|
this.messageError.set(this.multiple() ? this.messageFileUploadError() : fileError().error);
|
|
624
608
|
return false;
|
|
@@ -628,12 +612,12 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
628
612
|
}
|
|
629
613
|
async handlerSetAvatar(event, file) {
|
|
630
614
|
event.stopPropagation();
|
|
631
|
-
this.fileList().forEach(item => {
|
|
615
|
+
this.fileList().forEach((item) => {
|
|
632
616
|
if (item().id === file().id) {
|
|
633
|
-
item.update(file => ({ ...file, isAvatar: true }));
|
|
617
|
+
item.update((file) => ({ ...file, isAvatar: true }));
|
|
634
618
|
return;
|
|
635
619
|
}
|
|
636
|
-
item.update(file => ({ ...file, isAvatar: false }));
|
|
620
|
+
item.update((file) => ({ ...file, isAvatar: false }));
|
|
637
621
|
});
|
|
638
622
|
this.outFileChanged.emit(this.fileList());
|
|
639
623
|
}
|
|
@@ -660,23 +644,48 @@ class LibsUiComponentsInputsUploadComponent {
|
|
|
660
644
|
this.uploadInputRef()?.nativeElement.setAttribute('accept', this.accessFiles());
|
|
661
645
|
}
|
|
662
646
|
// #endregion
|
|
647
|
+
// #region FUNCTIONS
|
|
648
|
+
get FunctionsControl() {
|
|
649
|
+
return {
|
|
650
|
+
checkIsValid: this.validate.bind(this),
|
|
651
|
+
removeAll: this.removeAllFile.bind(this),
|
|
652
|
+
uploading: async (process, id) => {
|
|
653
|
+
const fileUploading = this.fileList().find((file) => file().id === id);
|
|
654
|
+
if (fileUploading) {
|
|
655
|
+
fileUploading.update((file) => ({ ...file, percentUploading: process.percent, isUploading: process.percent !== 100 }));
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
setMessageError: async (message, id) => {
|
|
659
|
+
this.messageError.set(message);
|
|
660
|
+
if (id) {
|
|
661
|
+
const fileError = this.fileList().find((file) => file().id === id);
|
|
662
|
+
if (fileError) {
|
|
663
|
+
fileError.update((file) => ({ ...file, error: message }));
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
handlerUploadFile: this.showUploadPopup.bind(this),
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
// #endregion
|
|
663
671
|
ngOnDestroy() {
|
|
664
672
|
this.onDestroy.next();
|
|
665
673
|
this.onDestroy.complete();
|
|
666
674
|
}
|
|
667
675
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
668
|
-
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 }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, showPopupUploadWhenHasFileAndModeSingle: { classPropertyName: "showPopupUploadWhenHasFileAndModeSingle", publicName: "showPopupUploadWhenHasFileAndModeSingle", 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() || readonly() \"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable() || readonly() \"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable() || readonly() \"\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() || readonly() \"\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() || !showPopupUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div #upload\n LibsUiComponentsInputsUploadDirective\n LibsUiComponentsInputsUploadDropFileDirective\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || readonly() || (!multiple() && fileList().length && !canUploadIfHasExistFile())\"\n [class.libs-ui-components-inputs-upload-readonly]=\"readonly()\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\"\n [multiple]=\"multiple()\"\n [accessFiles]=\"accessFiles()\"\n (outUploadFiles)=\"handleUploadFiles($event)\"\n (outUploadFile)=\"handleUploadFiles([$event])\"\n (outDragOver)=\"handlerSetClassDrag(true)\"\n (outDragLeave)=\"handlerSetClassDrag(false)\"\n (outDrop)=\"handlerSetClassDrag(false)\"\n (outDropFiles)=\"handleUploadFiles($event)\"\n (outDropFile)=\"handleUploadFiles([$event])\">\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() || !showPopupUploadWhenHasFileAndModeSingle() || (!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() || !showPopupUploadWhenHasFileAndModeSingle()\">\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() && !showPopupUploadWhenHasFileAndModeSingle()\">\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() || readonly() || 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() || readonly() || 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() || readonly() \"\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() || readonly() || 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() || readonly() \"\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() || readonly() \"\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() || readonly() \"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || showPopupUploadWhenHasFileAndModeSingle())) {\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:var(--libs-ui-background-disable, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly{cursor:default!important;text-decoration:none;pointer-events:none;background-color:var(--libs-ui-backgrond-realonly, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-realonly, #071631)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-realonly, #071631)}: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", "isHandlerEnterDocumentClickButton"], 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", "ignoreInit", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY", "elementScroll"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "directive", type: LibsUiComponentsInputsUploadDirective, selector: "[LibsUiComponentsInputsUploadDirective]", inputs: ["multiple", "accessFiles"], outputs: ["outUploadFiles", "outUploadFile"] }, { kind: "directive", type: LibsUiComponentsInputsUploadDropFileDirective, selector: "[LibsUiComponentsInputsUploadDropFileDirective]", inputs: ["multiple"], outputs: ["outDragOver", "outDragLeave", "outDrop", "outDropFiles", "outDropFile"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
676
|
+
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 }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, showPopupUploadWhenHasFileAndModeSingle: { classPropertyName: "showPopupUploadWhenHasFileAndModeSingle", publicName: "showPopupUploadWhenHasFileAndModeSingle", 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\n [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() || readonly()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable() || readonly()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable() || readonly()\"\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() || readonly()\"\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\n [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() || !showPopupUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div\n #upload\n LibsUiComponentsInputsUploadDirective\n LibsUiComponentsInputsUploadDropFileDirective\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || readonly() || (!multiple() && fileList().length && !canUploadIfHasExistFile())\"\n [class.libs-ui-components-inputs-upload-readonly]=\"readonly()\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\"\n [multiple]=\"multiple()\"\n [accessFiles]=\"accessFiles()\"\n (outUploadFiles)=\"handleUploadFiles($event)\"\n (outUploadFile)=\"handleUploadFiles([$event])\"\n (outDragOver)=\"handlerSetClassDrag(true)\"\n (outDragLeave)=\"handlerSetClassDrag(false)\"\n (outDrop)=\"handlerSetClassDrag(false)\"\n (outDropFiles)=\"handleUploadFiles($event)\"\n (outDropFile)=\"handleUploadFiles([$event])\">\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\n class=\"mb-[4px] libs-ui-font-h6m\"\n [innerHTML]=\"configDescriptionInputUpload().message || '' | translate: configDescriptionInputUpload().interpolateParams\"></div>\n @for (item of descriptionFormatAndSizeFileComputed(); track item; let last = $last) {\n <div\n class=\"libs-ui-font-h7r\"\n [class.mb-[4px]]=\"!last\"\n [innerHTML]=\"item.message | translate: item.interpolateParams\"></div>\n }\n </div>\n </div>\n @if (multiple()) {\n <input\n #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n multiple\n [accept]=\"accessFiles()\" />\n } @else {\n <input\n #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n [accept]=\"accessFiles()\" />\n }\n </div>\n }\n @if (messageError() && (multiple() || !showPopupUploadWhenHasFileAndModeSingle() || (!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\n [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\n LibsUiComponentsScrollOverlayDirective\n class=\"relative w-full h-full px-[10px] libs-ui-components-inputs-upload-view-list {{ classIncludeFileContent() || '' }}\"\n [class.mt-[12px]]=\"multiple() || !showPopupUploadWhenHasFileAndModeSingle()\">\n <ng-content select=\"[label-file]\"></ng-content>\n @for (item of fileList(); track item(); let first = $first) {\n <div\n 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() && !showPopupUploadWhenHasFileAndModeSingle()\">\n <div class=\"flex w-full\">\n <div class=\"flex items-center\">\n @if (canSetAvatar() && item().type === 'image') {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [classIconLeft]=\"\n '!mr-0' + (item().isAvatar ? ' libs-ui-icon-check-circle-solid before:!text-[#00bc62]' : ' libs-ui-icon-check-circle-outline') + (disable() || readonly() || item().isUploading || !!item().error ? ' libs-ui-disable' : '')\n \"\n [popover]=\"{ config: { content: item().isAvatar ? 'i18n_avatar' : 'i18n_choose_as_your_avatar', zIndex: zIndex() } }\"\n [classInclude]=\"'!mr-[12px] !p-0'\"\n [disable]=\"disable() || readonly() || item().isUploading || !!item().error\"\n (outClick)=\"handlerSetAvatar($event, item)\" />\n }\n </div>\n <div\n 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\n [disable]=\"disable() || readonly()\"\n [(item)]=\"item\"\n [showVideoDuration]=\"showVideoDuration()\"\n (outOpenPreview)=\"handlerOpenPreviewFile($event)\" />\n }\n <div class=\"relative w-full\">\n <div\n 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\n class=\"flex w-full\"\n [labelLeft]=\"item().name\"\n [zIndexPopover]=\"zIndex() + 1\"\n [labelLeftClass]=\"'libs-ui-font-h6m ' + (disable() || readonly() || item().isUploading || item().error ? 'text-[#6a7383]' : 'text-[#071631]')\"\n [classInclude]=\"modeDisplayFile() === 'short' ? '!mb-0' : ''\" />\n\n @if (!ignoreShowSizeFile()) {\n <div\n 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\n 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\n 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\n [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() || readonly()\"\n (outClick)=\"handlerOpenPreviewFile(item())\" />\n }\n @if (item().type === 'image' && !item().error && !ignoreIconEdit()) {\n <libs_ui-components-buttons-button\n [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() || readonly()\"\n (outClick)=\"handlerEditImage($event, item)\" />\n }\n @if (!ignoreIconRemove()) {\n <libs_ui-components-buttons-button\n [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() || readonly()\"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || showPopupUploadWhenHasFileAndModeSingle())) {\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:var(--libs-ui-background-disable, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly{cursor:default!important;text-decoration:none;pointer-events:none;background-color:var(--libs-ui-backgrond-realonly, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-realonly, #071631)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-realonly, #071631)}: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", "isHandlerEnterDocumentClickButton"], 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", "ignoreInit", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY", "elementScroll"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "directive", type: LibsUiComponentsInputsUploadDirective, selector: "[LibsUiComponentsInputsUploadDirective]", inputs: ["multiple", "accessFiles"], outputs: ["outUploadFiles", "outUploadFile"] }, { kind: "directive", type: LibsUiComponentsInputsUploadDropFileDirective, selector: "[LibsUiComponentsInputsUploadDropFileDirective]", inputs: ["multiple"], outputs: ["outDragOver", "outDragLeave", "outDrop", "outDropFiles", "outDropFile"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
669
677
|
}
|
|
670
678
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsUploadComponent, decorators: [{
|
|
671
679
|
type: Component,
|
|
672
|
-
args: [{ selector: 'libs_ui-components-inputs-upload', standalone: true, imports: [
|
|
680
|
+
args: [{ selector: 'libs_ui-components-inputs-upload', standalone: true, imports: [
|
|
681
|
+
TranslateModule,
|
|
673
682
|
LibsUiComponentsButtonsButtonComponent,
|
|
674
683
|
LibsUiComponentsLabelComponent,
|
|
675
684
|
LibsUiComponentsInputsUploadAvatarComponent,
|
|
676
685
|
LibsUiComponentsScrollOverlayDirective,
|
|
677
686
|
LibsUiComponentsInputsUploadDirective,
|
|
678
|
-
LibsUiComponentsInputsUploadDropFileDirective
|
|
679
|
-
], 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() || readonly() \"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable() || readonly() \"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable() || readonly() \"\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() || readonly() \"\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() || !showPopupUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div #upload\n LibsUiComponentsInputsUploadDirective\n LibsUiComponentsInputsUploadDropFileDirective\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || readonly() || (!multiple() && fileList().length && !canUploadIfHasExistFile())\"\n [class.libs-ui-components-inputs-upload-readonly]=\"readonly()\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\"\n [multiple]=\"multiple()\"\n [accessFiles]=\"accessFiles()\"\n (outUploadFiles)=\"handleUploadFiles($event)\"\n (outUploadFile)=\"handleUploadFiles([$event])\"\n (outDragOver)=\"handlerSetClassDrag(true)\"\n (outDragLeave)=\"handlerSetClassDrag(false)\"\n (outDrop)=\"handlerSetClassDrag(false)\"\n (outDropFiles)=\"handleUploadFiles($event)\"\n (outDropFile)=\"handleUploadFiles([$event])\">\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() || !showPopupUploadWhenHasFileAndModeSingle() || (!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() || !showPopupUploadWhenHasFileAndModeSingle()\">\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() && !showPopupUploadWhenHasFileAndModeSingle()\">\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() || readonly() || 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() || readonly() || 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() || readonly() \"\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() || readonly() || 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() || readonly() \"\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() || readonly() \"\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() || readonly() \"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || showPopupUploadWhenHasFileAndModeSingle())) {\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:var(--libs-ui-background-disable, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly{cursor:default!important;text-decoration:none;pointer-events:none;background-color:var(--libs-ui-backgrond-realonly, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-realonly, #071631)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-realonly, #071631)}: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"] }]
|
|
687
|
+
LibsUiComponentsInputsUploadDropFileDirective,
|
|
688
|
+
], 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\n [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() || readonly()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable() || readonly()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable() || readonly()\"\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() || readonly()\"\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\n [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() || !showPopupUploadWhenHasFileAndModeSingle() || (!fileList().length && !multiple())) {\n <div\n #upload\n LibsUiComponentsInputsUploadDirective\n LibsUiComponentsInputsUploadDropFileDirective\n class=\"libs-ui-components-inputs-upload\"\n [class.libs-ui-components-inputs-upload-disable]=\"disable() || readonly() || (!multiple() && fileList().length && !canUploadIfHasExistFile())\"\n [class.libs-ui-components-inputs-upload-readonly]=\"readonly()\"\n [class.libs-ui-components-inputs-upload-error]=\"messageError()\"\n [multiple]=\"multiple()\"\n [accessFiles]=\"accessFiles()\"\n (outUploadFiles)=\"handleUploadFiles($event)\"\n (outUploadFile)=\"handleUploadFiles([$event])\"\n (outDragOver)=\"handlerSetClassDrag(true)\"\n (outDragLeave)=\"handlerSetClassDrag(false)\"\n (outDrop)=\"handlerSetClassDrag(false)\"\n (outDropFiles)=\"handleUploadFiles($event)\"\n (outDropFile)=\"handleUploadFiles([$event])\">\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\n class=\"mb-[4px] libs-ui-font-h6m\"\n [innerHTML]=\"configDescriptionInputUpload().message || '' | translate: configDescriptionInputUpload().interpolateParams\"></div>\n @for (item of descriptionFormatAndSizeFileComputed(); track item; let last = $last) {\n <div\n class=\"libs-ui-font-h7r\"\n [class.mb-[4px]]=\"!last\"\n [innerHTML]=\"item.message | translate: item.interpolateParams\"></div>\n }\n </div>\n </div>\n @if (multiple()) {\n <input\n #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n multiple\n [accept]=\"accessFiles()\" />\n } @else {\n <input\n #uploadInput\n class=\"upload-input hidden\"\n type=\"file\"\n name=\"files[]\"\n [accept]=\"accessFiles()\" />\n }\n </div>\n }\n @if (messageError() && (multiple() || !showPopupUploadWhenHasFileAndModeSingle() || (!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\n [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\n LibsUiComponentsScrollOverlayDirective\n class=\"relative w-full h-full px-[10px] libs-ui-components-inputs-upload-view-list {{ classIncludeFileContent() || '' }}\"\n [class.mt-[12px]]=\"multiple() || !showPopupUploadWhenHasFileAndModeSingle()\">\n <ng-content select=\"[label-file]\"></ng-content>\n @for (item of fileList(); track item(); let first = $first) {\n <div\n 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() && !showPopupUploadWhenHasFileAndModeSingle()\">\n <div class=\"flex w-full\">\n <div class=\"flex items-center\">\n @if (canSetAvatar() && item().type === 'image') {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [classIconLeft]=\"\n '!mr-0' + (item().isAvatar ? ' libs-ui-icon-check-circle-solid before:!text-[#00bc62]' : ' libs-ui-icon-check-circle-outline') + (disable() || readonly() || item().isUploading || !!item().error ? ' libs-ui-disable' : '')\n \"\n [popover]=\"{ config: { content: item().isAvatar ? 'i18n_avatar' : 'i18n_choose_as_your_avatar', zIndex: zIndex() } }\"\n [classInclude]=\"'!mr-[12px] !p-0'\"\n [disable]=\"disable() || readonly() || item().isUploading || !!item().error\"\n (outClick)=\"handlerSetAvatar($event, item)\" />\n }\n </div>\n <div\n 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\n [disable]=\"disable() || readonly()\"\n [(item)]=\"item\"\n [showVideoDuration]=\"showVideoDuration()\"\n (outOpenPreview)=\"handlerOpenPreviewFile($event)\" />\n }\n <div class=\"relative w-full\">\n <div\n 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\n class=\"flex w-full\"\n [labelLeft]=\"item().name\"\n [zIndexPopover]=\"zIndex() + 1\"\n [labelLeftClass]=\"'libs-ui-font-h6m ' + (disable() || readonly() || item().isUploading || item().error ? 'text-[#6a7383]' : 'text-[#071631]')\"\n [classInclude]=\"modeDisplayFile() === 'short' ? '!mb-0' : ''\" />\n\n @if (!ignoreShowSizeFile()) {\n <div\n 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\n 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\n 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\n [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() || readonly()\"\n (outClick)=\"handlerOpenPreviewFile(item())\" />\n }\n @if (item().type === 'image' && !item().error && !ignoreIconEdit()) {\n <libs_ui-components-buttons-button\n [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() || readonly()\"\n (outClick)=\"handlerEditImage($event, item)\" />\n }\n @if (!ignoreIconRemove()) {\n <libs_ui-components-buttons-button\n [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() || readonly()\"\n (outClick)=\"handlerRemoveFile($event, item)\" />\n }\n </div>\n </div>\n @if (item().error && (multiple() || showPopupUploadWhenHasFileAndModeSingle())) {\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:var(--libs-ui-background-disable, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-icon:before{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-disable .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-disable, #9ca2ad)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly{cursor:default!important;text-decoration:none;pointer-events:none;background-color:var(--libs-ui-backgrond-realonly, #f8f9fa)!important;border:1px dashed #e6e7ea!important}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-icon:before{color:#cdd0d6}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description{color:var(--libs-ui-text-realonly, #071631)}:host ::ng-deep .libs-ui-components-inputs-upload-readonly .libs-ui-components-inputs-upload-description span{color:var(--libs-ui-text-realonly, #071631)}: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"] }]
|
|
680
689
|
}], ctorParameters: () => [] });
|
|
681
690
|
|
|
682
691
|
/**
|