@sixbell-telco/sdk 0.6.1 → 0.7.1
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/CHANGELOG.md +33 -0
- package/README.md +158 -12
- package/_index.scss +6 -0
- package/components/audio-player/button-play/button-play.component.d.ts +11 -1
- package/components/audio-player/services/audio.service.d.ts +1 -0
- package/components/button/src/button.component.d.ts +2 -2
- package/components/file-upload/file-dropzone/src/file-dropzone.component.d.ts +59 -6
- package/components/file-upload/file-dropzone/src/file-dropzone.constants.d.ts +6 -0
- package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +2 -2
- package/components/forms/input/src/input.component.d.ts +2 -2
- package/components/icon/src/icon.component.d.ts +3 -4
- package/components/modal/src/modal.component.d.ts +72 -4
- package/components/table/src/table.component.d.ts +140 -0
- package/components/table/table-header-checkbox/table-header-checkbox.component.d.ts +42 -0
- package/components/table/table-row-checkbox/table-row-checkbox.component.d.ts +46 -0
- package/components/tooltip/src/tooltip.component.d.ts +1 -2
- package/directives/typography/src/typography.directive.d.ts +46 -0
- package/esm2022/components/audio-player/button-play/button-play.component.mjs +14 -5
- package/esm2022/components/audio-player/services/audio.service.mjs +4 -1
- package/esm2022/components/audio-player/src/audio-player.component.mjs +1 -1
- package/esm2022/components/audio-player/track-info/track-info.component.mjs +3 -3
- package/esm2022/components/audio-player/volume-control/volume-control.component.mjs +2 -2
- package/esm2022/components/badge/src/badge.component.mjs +2 -2
- package/esm2022/components/button/src/button.component.mjs +5 -4
- package/esm2022/components/dropdown/src/dropdown.component.mjs +1 -1
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +211 -16
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.constants.mjs +7 -0
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +1 -1
- package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +1 -1
- package/esm2022/components/forms/input/src/input.component.mjs +6 -5
- package/esm2022/components/icon/src/icon.component.mjs +5 -5
- package/esm2022/components/link/src/link.component.mjs +2 -2
- package/esm2022/components/modal/src/modal.component.mjs +79 -6
- package/esm2022/components/notification/src/notification.component.mjs +1 -1
- package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +2 -2
- package/esm2022/components/product-card/src/product-card.component.mjs +1 -1
- package/esm2022/components/table/src/table.component.mjs +144 -8
- package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +43 -1
- package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +47 -1
- package/esm2022/components/toast/toast-message/toast-message.component.mjs +2 -2
- package/esm2022/components/tooltip/src/tooltip.component.mjs +3 -5
- package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +1 -1
- package/esm2022/directives/typography/src/typography.directive.mjs +62 -13
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +20 -8
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +4 -3
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +216 -15
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +5 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs +78 -5
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +231 -7
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +2 -4
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +61 -12
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
- package/package.json +50 -48
|
@@ -1,39 +1,240 @@
|
|
|
1
1
|
import { NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, output,
|
|
3
|
+
import { inject, input, model, computed, signal, output, viewChild, forwardRef, Component } from '@angular/core';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
|
+
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
|
6
|
+
import { AudioPlayerService, ButtonPlayComponent, AudioPlayerComponent } from '@sixbell-telco/sdk/components/audio-player';
|
|
4
7
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
8
|
+
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
9
|
+
import { matDelete, matDownload, matInsertDriveFile, matCloudUpload, matError, matVisibility, matVisibilityOff } from '@sixbell-telco/sdk/components/icon/material/baseline';
|
|
10
|
+
import { TooltipComponent } from '@sixbell-telco/sdk/components/tooltip';
|
|
7
11
|
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
12
|
+
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
8
13
|
import { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';
|
|
9
14
|
import { ToBytesPipe } from '@sixbell-telco/sdk/utils/pipes/to-bytes-extesion';
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
const AUDIO_EXTENSIONS = ['.mp3', '.wav', '.ogg', '.m4a', '.aac', '.wma'];
|
|
17
|
+
const VIDEO_EXTENSIONS = ['.mp4', '.avi', '.mov', '.wmv', '.mkv', '.flv', '.webm'];
|
|
18
|
+
const IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.webp'];
|
|
19
|
+
const DOCUMENT_EXTENSIONS = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.csv'];
|
|
20
|
+
const ARCHIVE_EXTENSIONS = ['.zip', '.rar', '.7z'];
|
|
21
|
+
const CODE_EXTENSIONS = ['.html', '.xml', '.json', '.js', '.ts', '.css'];
|
|
12
22
|
|
|
13
23
|
class DropzoneComponent {
|
|
24
|
+
translateService = inject(TranslateService);
|
|
25
|
+
audioService = inject(AudioPlayerService);
|
|
26
|
+
// Inputs
|
|
14
27
|
maxFiles = input(1);
|
|
15
28
|
maxFileSize = input(0);
|
|
16
29
|
showFiles = input(true);
|
|
17
30
|
extensions = input([]);
|
|
18
31
|
uploading = input(false);
|
|
32
|
+
disabled = model(false);
|
|
33
|
+
multiple = input(false);
|
|
34
|
+
name = input('file');
|
|
35
|
+
accept = computed(() => this.extensions().join(','));
|
|
36
|
+
opened = signal(false);
|
|
37
|
+
// form control properties
|
|
38
|
+
parentForm = input(null);
|
|
39
|
+
formControlName = input('');
|
|
40
|
+
get formField() {
|
|
41
|
+
if (!this.parentForm())
|
|
42
|
+
return null;
|
|
43
|
+
return this.parentForm()?.get(this.formControlName());
|
|
44
|
+
}
|
|
45
|
+
// Outputs
|
|
19
46
|
onDrop = output();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
47
|
+
onRemove = output();
|
|
48
|
+
// Models
|
|
49
|
+
files = signal([]);
|
|
50
|
+
isDragging = signal(false);
|
|
51
|
+
errorMessage = signal('');
|
|
52
|
+
// ControlValueAccessor props
|
|
53
|
+
onChange = () => { };
|
|
54
|
+
onTouched = () => { };
|
|
55
|
+
// Template references
|
|
56
|
+
fileInput = viewChild('fileInput');
|
|
57
|
+
// Icons
|
|
58
|
+
iconDelete = matDelete;
|
|
59
|
+
iconDownload = matDownload;
|
|
60
|
+
iconInsertDriveFile = matInsertDriveFile;
|
|
61
|
+
iconCloudUpload = matCloudUpload;
|
|
62
|
+
iconError = matError;
|
|
63
|
+
iconVisibility = matVisibility;
|
|
64
|
+
iconVisibilityOff = matVisibilityOff;
|
|
65
|
+
tracks = computed(() => {
|
|
66
|
+
return this.files()
|
|
67
|
+
.filter((audio) => this.checkIfIsAudioFile(audio))
|
|
68
|
+
.map((audio) => ({
|
|
69
|
+
title: audio.name,
|
|
70
|
+
description: new ToBytesPipe().transform(audio.size),
|
|
71
|
+
url: URL.createObjectURL(audio),
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
getIndexForTracks(file) {
|
|
75
|
+
return this.files()
|
|
76
|
+
.filter((audio) => this.checkIfIsAudioFile(audio))
|
|
77
|
+
.indexOf(file);
|
|
78
|
+
}
|
|
79
|
+
// styles
|
|
80
|
+
get dropzoneClass() {
|
|
81
|
+
const isFormError = this.parentForm() !== null && this.formControlName() !== '' && this.formField?.invalid && (this.formField?.touched || this.formField?.dirty);
|
|
82
|
+
const isComponentError = !!this.errorMessage();
|
|
83
|
+
return cn('cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors duration-300 ease-ease-out-back', {
|
|
84
|
+
'border-secondary hover:bg-secondary/10': !this.disabled() && !isComponentError && !isFormError,
|
|
85
|
+
'border-secondary bg-secondary/30': this.isDragging() && !this.disabled(),
|
|
86
|
+
'cursor-not-allowed bg-base-100/40 text-base-content/40': this.disabled(),
|
|
87
|
+
'border-error bg-error/15 hover:border-error hover:bg-error/10': isComponentError || isFormError,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Drag and drop handlers
|
|
91
|
+
handleDragOver(event) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
if (this.disabled())
|
|
94
|
+
return;
|
|
95
|
+
this.isDragging.set(true);
|
|
96
|
+
}
|
|
97
|
+
handleDragLeave(event) {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
this.isDragging.set(false);
|
|
100
|
+
}
|
|
101
|
+
handleDrop(event) {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
this.isDragging.set(false);
|
|
104
|
+
if (this.disabled())
|
|
105
|
+
return;
|
|
106
|
+
const files = Array.from(event.dataTransfer?.files || []);
|
|
107
|
+
this.processFiles(files);
|
|
108
|
+
}
|
|
109
|
+
// File input handler
|
|
110
|
+
handleFileSelect(event) {
|
|
111
|
+
const input = event.target;
|
|
112
|
+
const files = Array.from(input.files || []);
|
|
113
|
+
this.processFiles(files);
|
|
114
|
+
input.value = ''; // Reset input
|
|
115
|
+
}
|
|
116
|
+
processFiles(files) {
|
|
117
|
+
this.errorMessage.set('');
|
|
118
|
+
// Validate max files first
|
|
119
|
+
const totalFiles = this.files().length + files.length;
|
|
120
|
+
if (this.maxFiles() > 0 && totalFiles > this.maxFiles()) {
|
|
121
|
+
this.errorMessage.set(this.translateService.instant('file-uploader.dropzone.maxFilesExceeded', {
|
|
122
|
+
max: this.maxFiles(),
|
|
123
|
+
}));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// Validate each file
|
|
127
|
+
const validFiles = files.filter((file) => {
|
|
128
|
+
const isValidSize = this.validateFileSize(file);
|
|
129
|
+
const isValidType = this.validateFileType(file);
|
|
130
|
+
if (!isValidSize) {
|
|
131
|
+
console.warn(`File ${file.name} exceeds size limit`);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (!isValidType) {
|
|
135
|
+
console.warn(`File ${file.name} has invalid type`);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
});
|
|
140
|
+
// Update model only with valid files
|
|
141
|
+
if (validFiles.length > 0) {
|
|
142
|
+
this.files.update((current) => [...current, ...validFiles]);
|
|
143
|
+
this.onChange(this.files());
|
|
144
|
+
this.onTouched();
|
|
145
|
+
this.onDrop.emit(validFiles);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.errorMessage.set(this.translateService.instant('file-uploader.dropzone.noValidFiles'));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
validateFileSize(file) {
|
|
152
|
+
return this.maxFileSize() === 0 || file.size <= this.maxFileSize();
|
|
153
|
+
}
|
|
154
|
+
validateFileType(file) {
|
|
155
|
+
if (this.extensions().length === 0)
|
|
156
|
+
return true;
|
|
157
|
+
const extension = file.name.match(/\.([0-9a-z]+)$/i)?.[0]?.toLowerCase() || '';
|
|
158
|
+
return this.extensions().some((ext) => ext.toLowerCase() === extension);
|
|
159
|
+
}
|
|
160
|
+
handlefileDownload(file) {
|
|
161
|
+
const url = URL.createObjectURL(file);
|
|
162
|
+
const a = document.createElement('a');
|
|
163
|
+
a.href = url;
|
|
164
|
+
a.download = file.name;
|
|
165
|
+
document.body.appendChild(a);
|
|
166
|
+
a.click();
|
|
167
|
+
URL.revokeObjectURL(url);
|
|
168
|
+
document.body.removeChild(a);
|
|
25
169
|
}
|
|
26
170
|
handleRemove(file) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
171
|
+
this.files.update((current) => current.filter((f) => f !== file));
|
|
172
|
+
this.onChange(this.files());
|
|
173
|
+
this.onTouched();
|
|
174
|
+
this.onRemove.emit(file);
|
|
175
|
+
}
|
|
176
|
+
checkIfIsAudioFile(file) {
|
|
177
|
+
return AUDIO_EXTENSIONS.some((ext) => file.name.endsWith(ext));
|
|
178
|
+
}
|
|
179
|
+
handleAudioPlayerOpen() {
|
|
180
|
+
if (this.audioService.isPlayingATrack() && !this.opened()) {
|
|
181
|
+
this.opened.set(true);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
handleAudioPlayerOpenToggle() {
|
|
185
|
+
this.opened.set(!this.opened());
|
|
186
|
+
}
|
|
187
|
+
ngDestroy() {
|
|
188
|
+
this.tracks().forEach((track) => URL.revokeObjectURL(track.url));
|
|
189
|
+
}
|
|
190
|
+
// ControlValueAccessor implementation
|
|
191
|
+
writeValue(files) {
|
|
192
|
+
this.files.set(files || []);
|
|
193
|
+
}
|
|
194
|
+
registerOnChange(fn) {
|
|
195
|
+
this.onChange = fn;
|
|
196
|
+
}
|
|
197
|
+
registerOnTouched(fn) {
|
|
198
|
+
this.onTouched = fn;
|
|
199
|
+
}
|
|
200
|
+
setDisabledState(isDisabled) {
|
|
201
|
+
this.disabled.set(isDisabled);
|
|
202
|
+
}
|
|
203
|
+
triggerFileInput() {
|
|
204
|
+
if (!this.disabled()) {
|
|
205
|
+
this.fileInput()?.nativeElement.click();
|
|
206
|
+
}
|
|
30
207
|
}
|
|
31
208
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: DropzoneComponent, isStandalone: true, selector: "st-file-dropzone", inputs: { maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, showFiles: { classPropertyName: "showFiles", publicName: "showFiles", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null },
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: DropzoneComponent, isStandalone: true, selector: "st-file-dropzone", inputs: { maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, showFiles: { classPropertyName: "showFiles", publicName: "showFiles", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", onDrop: "onDrop", onRemove: "onRemove" }, providers: [
|
|
210
|
+
{
|
|
211
|
+
provide: NG_VALUE_ACCESSOR,
|
|
212
|
+
useExisting: forwardRef(() => DropzoneComponent),
|
|
213
|
+
multi: true,
|
|
214
|
+
},
|
|
215
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<div class=\"w-full\">\n\t<div\n\t\t[class]=\"dropzoneClass\"\n\t\t(dragover)=\"handleDragOver($event)\"\n\t\t(dragleave)=\"handleDragLeave($event)\"\n\t\t(drop)=\"handleDrop($event)\"\n\t\t(click)=\"triggerFileInput()\"\n\t\t(blur)=\"onTouched()\"\n\t\ttabindex=\"0\"\n\t>\n\t\t@if (parentForm()) {\n\t\t\t<input\n\t\t\t\t#fileInput\n\t\t\t\ttype=\"file\"\n\t\t\t\t[multiple]=\"multiple()\"\n\t\t\t\t[accept]=\"accept()\"\n\t\t\t\t(change)=\"handleFileSelect($event)\"\n\t\t\t\t[name]=\"name()\"\n\t\t\t\t(blur)=\"onTouched()\"\n\t\t\t\trequired\n\t\t\t\thidden\n\t\t\t/>\n\t\t} @else {\n\t\t\t<input #fileInput type=\"file\" [multiple]=\"multiple()\" [accept]=\"accept()\" (change)=\"handleFileSelect($event)\" [name]=\"name()\" required hidden />\n\t\t}\n\n\t\t<div class=\"grid h-48 place-content-center\">\n\t\t\t@let errorMessageVar = this.errorMessage();\n\t\t\t@if (errorMessageVar) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconError\" size=\"xl\" class=\"text-error\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ errorMessageVar }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (!uploading()) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconCloudUpload\" size=\"xl\" class=\"text-accent\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ 'file-uploader.dropzone.selectPrompt' | translate }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.maxSizeLabel' | translate }} <span class=\"text-accent\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t@if (extensions().length > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t@if (maxFiles() > 0) {\n\t\t<div class=\"mt-4 flex items-center justify-between\">\n\t\t\t<ng-content></ng-content>\n\t\t\t<span typography [tyVariant]=\"'body-sm'\" [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ 'file-uploader.dropzone.fileCounter' | translate: { current: files().length, max: maxFiles() } }}\n\t\t\t</span>\n\t\t</div>\n\t}\n\n\t@if (showFiles() && files().length > 0) {\n\t\t<div class=\"mt-4 space-y-2\">\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<div class=\"flex items-center justify-between rounded-md bg-neutral/30 py-3 pl-3 pr-5\">\n\t\t\t\t\t<div class=\"flex items-center justify-start\">\n\t\t\t\t\t\t<div class=\"relative text-primary\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconInsertDriveFile\" size=\"xl\" />\n\t\t\t\t\t\t\t<div class=\"absolute bottom-3 left-1/2 -translate-x-1/2 text-primary-content\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t\t{{ file.name | extractExtension }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex flex-col items-start justify-center\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t\t\t{{ file.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"text-tertiary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\"> {{ file.size | toBytes }} </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"inline-flex items-center justify-end gap-1\">\n\t\t\t\t\t\t@if (checkIfIsAudioFile(file)) {\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!this.audioService.isPlayingATrack()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.pause' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button-play\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center justify-center\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t[asButton]=\"true\"\n\t\t\t\t\t\t\t\t\t[trackIndex]=\"getIndexForTracks(file)\"\n\t\t\t\t\t\t\t\t\t(onTogglePlay)=\"handleAudioPlayerOpen()\"\n\t\t\t\t\t\t\t\t></st-button-play>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!opened()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.showPlayer' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.hidePlayer' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t\t[icon]=\"!opened() ? iconVisibility : iconVisibilityOff\"\n\t\t\t\t\t\t\t\t\tvariant=\"warning\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleAudioPlayerOpenToggle()\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDownload\"\n\t\t\t\t\t\t\t\tvariant=\"info\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handlefileDownload(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDelete\"\n\t\t\t\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handleRemove(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t}\n</div>\n<st-audio-player [tracks]=\"tracks()\" [showTrackList]=\"false\" [variant]=\"'fixed'\" [opened]=\"opened()\"></st-audio-player>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: ToBytesPipe, name: "toBytes" }, { kind: "pipe", type: ExtractExtensionPipe, name: "extractExtension" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: ButtonPlayComponent, selector: "st-button-play", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "size", "shadow", "asButton", "trackIndex"], outputs: ["onTogglePlay"] }, { kind: "component", type: AudioPlayerComponent, selector: "st-audio-player", inputs: ["variant", "opened", "trackListTitle", "currentTrackIndex", "tracks", "showTrackList", "shadow"], outputs: ["currentTrackIndexChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: TooltipComponent, selector: "st-tooltip", inputs: ["variant", "position", "label"] }] });
|
|
33
216
|
}
|
|
34
217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
35
218
|
type: Component,
|
|
36
|
-
args: [{ selector: 'st-file-dropzone', standalone: true, imports: [
|
|
219
|
+
args: [{ selector: 'st-file-dropzone', standalone: true, imports: [
|
|
220
|
+
NgClass,
|
|
221
|
+
ButtonComponent,
|
|
222
|
+
TypographyDirective,
|
|
223
|
+
ToBytesPipe,
|
|
224
|
+
ExtractExtensionPipe,
|
|
225
|
+
IconComponent,
|
|
226
|
+
ButtonPlayComponent,
|
|
227
|
+
AudioPlayerComponent,
|
|
228
|
+
FormsModule,
|
|
229
|
+
TranslatePipe,
|
|
230
|
+
TooltipComponent,
|
|
231
|
+
], providers: [
|
|
232
|
+
{
|
|
233
|
+
provide: NG_VALUE_ACCESSOR,
|
|
234
|
+
useExisting: forwardRef(() => DropzoneComponent),
|
|
235
|
+
multi: true,
|
|
236
|
+
},
|
|
237
|
+
], template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<div class=\"w-full\">\n\t<div\n\t\t[class]=\"dropzoneClass\"\n\t\t(dragover)=\"handleDragOver($event)\"\n\t\t(dragleave)=\"handleDragLeave($event)\"\n\t\t(drop)=\"handleDrop($event)\"\n\t\t(click)=\"triggerFileInput()\"\n\t\t(blur)=\"onTouched()\"\n\t\ttabindex=\"0\"\n\t>\n\t\t@if (parentForm()) {\n\t\t\t<input\n\t\t\t\t#fileInput\n\t\t\t\ttype=\"file\"\n\t\t\t\t[multiple]=\"multiple()\"\n\t\t\t\t[accept]=\"accept()\"\n\t\t\t\t(change)=\"handleFileSelect($event)\"\n\t\t\t\t[name]=\"name()\"\n\t\t\t\t(blur)=\"onTouched()\"\n\t\t\t\trequired\n\t\t\t\thidden\n\t\t\t/>\n\t\t} @else {\n\t\t\t<input #fileInput type=\"file\" [multiple]=\"multiple()\" [accept]=\"accept()\" (change)=\"handleFileSelect($event)\" [name]=\"name()\" required hidden />\n\t\t}\n\n\t\t<div class=\"grid h-48 place-content-center\">\n\t\t\t@let errorMessageVar = this.errorMessage();\n\t\t\t@if (errorMessageVar) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconError\" size=\"xl\" class=\"text-error\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ errorMessageVar }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (!uploading()) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconCloudUpload\" size=\"xl\" class=\"text-accent\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ 'file-uploader.dropzone.selectPrompt' | translate }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.maxSizeLabel' | translate }} <span class=\"text-accent\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t@if (extensions().length > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t@if (maxFiles() > 0) {\n\t\t<div class=\"mt-4 flex items-center justify-between\">\n\t\t\t<ng-content></ng-content>\n\t\t\t<span typography [tyVariant]=\"'body-sm'\" [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ 'file-uploader.dropzone.fileCounter' | translate: { current: files().length, max: maxFiles() } }}\n\t\t\t</span>\n\t\t</div>\n\t}\n\n\t@if (showFiles() && files().length > 0) {\n\t\t<div class=\"mt-4 space-y-2\">\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<div class=\"flex items-center justify-between rounded-md bg-neutral/30 py-3 pl-3 pr-5\">\n\t\t\t\t\t<div class=\"flex items-center justify-start\">\n\t\t\t\t\t\t<div class=\"relative text-primary\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconInsertDriveFile\" size=\"xl\" />\n\t\t\t\t\t\t\t<div class=\"absolute bottom-3 left-1/2 -translate-x-1/2 text-primary-content\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t\t{{ file.name | extractExtension }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex flex-col items-start justify-center\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t\t\t{{ file.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"text-tertiary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\"> {{ file.size | toBytes }} </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"inline-flex items-center justify-end gap-1\">\n\t\t\t\t\t\t@if (checkIfIsAudioFile(file)) {\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!this.audioService.isPlayingATrack()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.pause' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button-play\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center justify-center\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t[asButton]=\"true\"\n\t\t\t\t\t\t\t\t\t[trackIndex]=\"getIndexForTracks(file)\"\n\t\t\t\t\t\t\t\t\t(onTogglePlay)=\"handleAudioPlayerOpen()\"\n\t\t\t\t\t\t\t\t></st-button-play>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!opened()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.showPlayer' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.hidePlayer' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t\t[icon]=\"!opened() ? iconVisibility : iconVisibilityOff\"\n\t\t\t\t\t\t\t\t\tvariant=\"warning\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleAudioPlayerOpenToggle()\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDownload\"\n\t\t\t\t\t\t\t\tvariant=\"info\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handlefileDownload(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDelete\"\n\t\t\t\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handleRemove(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t}\n</div>\n<st-audio-player [tracks]=\"tracks()\" [showTrackList]=\"false\" [variant]=\"'fixed'\" [opened]=\"opened()\"></st-audio-player>\n" }]
|
|
37
238
|
}] });
|
|
38
239
|
|
|
39
240
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-dropzone.mjs","sources":["../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.ts","../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.html","../../../projects/sdk/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport { Component, input, model, output } from '@angular/core';\nimport { ButtonComponent } from '@sixbell-telco/sdk/components/button';\nimport { matDeleteOutline } from '@sixbell-telco/sdk/components/icon/material/outline';\nimport { TableComponent } from '@sixbell-telco/sdk/components/table';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';\nimport { ToBytesPipe } from '@sixbell-telco/sdk/utils/pipes/to-bytes-extesion';\nimport { NgxDropzoneModule } from 'ngx-dropzone';\n\n@Component({\n\tselector: 'st-file-dropzone',\n\tstandalone: true,\n\timports: [NgxDropzoneModule, TypographyDirective, ToBytesPipe, ExtractExtensionPipe, NgClass, TableComponent, ButtonComponent],\n\ttemplateUrl: './file-dropzone.component.html',\n})\nexport class DropzoneComponent {\n\tmaxFiles = input(1);\n\tmaxFileSize = input(0);\n\tshowFiles = input(true);\n\textensions = input<string[]>([]);\n\tuploading = input(false);\n\tonDrop = output<File[]>();\n\n\ticon = matDeleteOutline;\n\n\tfiles = model<File[]>([]);\n\n\thandleDrop(files: File[]) {\n\t\tthis.files.update((currentFiles) => [...currentFiles, ...files]);\n\t\tthis.onDrop.emit(files);\n\t}\n\n\thandleRemove(file: File) {\n\t\tconst files = this.files();\n\t\tfiles.splice(files.indexOf(file), 1);\n\t\tthis.files.set(files);\n\t}\n}\n","<ngx-dropzone (change)=\"handleDrop($event.addedFiles)\" [disabled]=\"uploading()\">\n\t<ngx-dropzone-label>\n\t\t@if (!uploading()) {\n\t\t\t<div typography [tyVariant]=\"'body-sm'\">Haga clic y seleccione archivos o suéltelos aquí</div>\n\n\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tTamaño máximo por archivo: <span class=\"primary-text\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t@if (extensions().length > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tArchivos aceptados: <span class=\"primary-text\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t} @else {\n\t\t\t<div class=\"upload-progress\">\n\t\t\t\t<div class=\"mini-text mb-2\">Cargando archivos...</div>\n\t\t\t\t<div class=\"progress\"></div>\n\t\t\t</div>\n\t\t}\n\t</ngx-dropzone-label>\n</ngx-dropzone>\n\n@if (maxFiles() > 0) {\n\t<div class=\"mt-1 flex justify-end\">\n\t\t<div typography [tyVariant]=\"'body-xs'\">\n\t\t\t<span [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ files().length }} {{ files().length === 1 ? 'archivo' : 'archivos' }} cargado de un maximo de {{ maxFiles() }}\n\t\t\t\t{{ maxFiles() === 1 ? 'archivo' : 'archivos' }}</span\n\t\t\t>\n\t\t</div>\n\t</div>\n}\n\n<!-- TODO: hacer la tabla mas chiquita y bonita :) -->\n@if (showFiles() && files().length > 0) {\n\t<st-table size=\"sm\" [data]=\"files()\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"col\">Archivo</th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<tr>\n\t\t\t\t\t@let tooBig = file.size > maxFileSize();\n\t\t\t\t\t@let extensionsList = extensions();\n\t\t\t\t\t@let hasExtension = extensionsList.length === 0 || (extensionsList.length > 0 && extensionsList.includes(file.name | extractExtension));\n\n\t\t\t\t\t<td [ngClass]=\"{ 'text-error': tooBig || !hasExtension }\">\n\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\">{{ file.name }}</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t@if (!hasExtension) {\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">La extensión del archivo no es válida</span>\n\t\t\t\t\t\t} @else if (tooBig) {\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">El tamaño del archivo excede el límite permitido</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<st-button variant=\"icon\" [icon]=\"icon\" (click)=\"handleRemove(file)\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t}\n\t\t</tbody>\n\t</st-table>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAgBa,iBAAiB,CAAA;AAC7B,IAAA,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,IAAA,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvB,IAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AACxB,IAAA,UAAU,GAAG,KAAK,CAAW,EAAE,CAAC,CAAC;AACjC,IAAA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,GAAG,MAAM,EAAU,CAAC;IAE1B,IAAI,GAAG,gBAAgB,CAAC;AAExB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAE1B,IAAA,UAAU,CAAC,KAAa,EAAA;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC,GAAG,YAAY,E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A,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGjH,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,cAChB,IAAI,EAAA,OAAA,EACP,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,kuFAAA,EAAA,CAAA;;;AEb/H;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-dropzone.mjs","sources":["../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.constants.ts","../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.ts","../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.html","../../../projects/sdk/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.ts"],"sourcesContent":["export const AUDIO_EXTENSIONS = ['.mp3', '.wav', '.ogg', '.m4a', '.aac', '.wma'] as const;\nexport const VIDEO_EXTENSIONS = ['.mp4', '.avi', '.mov', '.wmv', '.mkv', '.flv', '.webm'] as const;\nexport const IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.webp'] as const;\nexport const DOCUMENT_EXTENSIONS = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.csv'] as const;\nexport const ARCHIVE_EXTENSIONS = ['.zip', '.rar', '.7z'] as const;\nexport const CODE_EXTENSIONS = ['.html', '.xml', '.json', '.js', '.ts', '.css'] as const;\n","import { NgClass } from '@angular/common';\nimport { Component, computed, ElementRef, forwardRef, inject, input, model, output, signal, viewChild } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { AudioPlayerComponent, AudioPlayerService, ButtonPlayComponent, Track } from '@sixbell-telco/sdk/components/audio-player';\nimport { ButtonComponent } from '@sixbell-telco/sdk/components/button';\nimport { IconComponent } from '@sixbell-telco/sdk/components/icon';\nimport {\n\tmatCloudUpload,\n\tmatDelete,\n\tmatDownload,\n\tmatError,\n\tmatInsertDriveFile,\n\tmatVisibility,\n\tmatVisibilityOff,\n} from '@sixbell-telco/sdk/components/icon/material/baseline';\nimport { TooltipComponent } from '@sixbell-telco/sdk/components/tooltip';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';\nimport { ToBytesPipe } from '@sixbell-telco/sdk/utils/pipes/to-bytes-extesion';\nimport {\n\tARCHIVE_EXTENSIONS,\n\tAUDIO_EXTENSIONS,\n\tCODE_EXTENSIONS,\n\tDOCUMENT_EXTENSIONS,\n\tIMAGE_EXTENSIONS,\n\tVIDEO_EXTENSIONS,\n} from './file-dropzone.constants';\n\nexport type FileExtensionAudio = (typeof AUDIO_EXTENSIONS)[number];\nexport type FileExtensionVideo = (typeof VIDEO_EXTENSIONS)[number];\nexport type FileExtensionImage = (typeof IMAGE_EXTENSIONS)[number];\nexport type FileExtensionDocument = (typeof DOCUMENT_EXTENSIONS)[number];\nexport type FileExtensionArchive = (typeof ARCHIVE_EXTENSIONS)[number];\nexport type FileExtensionCode = (typeof CODE_EXTENSIONS)[number];\nexport type FileExtension =\n\t| FileExtensionAudio\n\t| FileExtensionVideo\n\t| FileExtensionImage\n\t| FileExtensionDocument\n\t| FileExtensionArchive\n\t| FileExtensionCode;\n\n@Component({\n\tselector: 'st-file-dropzone',\n\tstandalone: true,\n\timports: [\n\t\tNgClass,\n\t\tButtonComponent,\n\t\tTypographyDirective,\n\t\tToBytesPipe,\n\t\tExtractExtensionPipe,\n\t\tIconComponent,\n\t\tButtonPlayComponent,\n\t\tAudioPlayerComponent,\n\t\tFormsModule,\n\t\tTranslatePipe,\n\t\tTooltipComponent,\n\t],\n\ttemplateUrl: './file-dropzone.component.html',\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => DropzoneComponent),\n\t\t\tmulti: true,\n\t\t},\n\t],\n})\nexport class DropzoneComponent implements ControlValueAccessor {\n\ttranslateService = inject(TranslateService);\n\taudioService = inject(AudioPlayerService);\n\n\t// Inputs\n\tmaxFiles = input<number>(1);\n\tmaxFileSize = input<number>(0);\n\tshowFiles = input<boolean>(true);\n\textensions = input<FileExtension[]>([]);\n\tuploading = input<boolean>(false);\n\tdisabled = model<boolean>(false);\n\tmultiple = input<boolean>(false);\n\tname = input<string>('file');\n\taccept = computed(() => this.extensions().join(','));\n\topened = signal<boolean>(false);\n\n\t// form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// Outputs\n\tonDrop = output<File[]>();\n\tonRemove = output<File>();\n\n\t// Models\n\tfiles = signal<File[]>([]);\n\tisDragging = signal<boolean>(false);\n\terrorMessage = signal<string>('');\n\n\t// ControlValueAccessor props\n\tprivate onChange: (value: File[]) => void = () => {};\n\tonTouched: () => void = () => {};\n\n\t// Template references\n\tfileInput = viewChild<ElementRef>('fileInput');\n\n\t// Icons\n\ticonDelete = matDelete;\n\ticonDownload = matDownload;\n\ticonInsertDriveFile = matInsertDriveFile;\n\ticonCloudUpload = matCloudUpload;\n\ticonError = matError;\n\ticonVisibility = matVisibility;\n\ticonVisibilityOff = matVisibilityOff;\n\n\ttracks = computed<Track[]>(() => {\n\t\treturn this.files()\n\t\t\t.filter((audio) => this.checkIfIsAudioFile(audio))\n\t\t\t.map((audio) => ({\n\t\t\t\ttitle: audio.name,\n\t\t\t\tdescription: new ToBytesPipe().transform(audio.size),\n\t\t\t\turl: URL.createObjectURL(audio),\n\t\t\t}));\n\t});\n\n\tgetIndexForTracks(file: File) {\n\t\treturn this.files()\n\t\t\t.filter((audio) => this.checkIfIsAudioFile(audio))\n\t\t\t.indexOf(file);\n\t}\n\n\t// styles\n\tget dropzoneClass() {\n\t\tconst isFormError =\n\t\t\tthis.parentForm() !== null && this.formControlName() !== '' && this.formField?.invalid && (this.formField?.touched || this.formField?.dirty);\n\n\t\tconst isComponentError = !!this.errorMessage();\n\n\t\treturn cn('cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors duration-300 ease-ease-out-back', {\n\t\t\t'border-secondary hover:bg-secondary/10': !this.disabled() && !isComponentError && !isFormError,\n\t\t\t'border-secondary bg-secondary/30': this.isDragging() && !this.disabled(),\n\t\t\t'cursor-not-allowed bg-base-100/40 text-base-content/40': this.disabled(),\n\t\t\t'border-error bg-error/15 hover:border-error hover:bg-error/10': isComponentError || isFormError,\n\t\t});\n\t}\n\n\t// Drag and drop handlers\n\thandleDragOver(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tif (this.disabled()) return;\n\t\tthis.isDragging.set(true);\n\t}\n\n\thandleDragLeave(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tthis.isDragging.set(false);\n\t}\n\n\thandleDrop(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tthis.isDragging.set(false);\n\t\tif (this.disabled()) return;\n\n\t\tconst files = Array.from(event.dataTransfer?.files || []);\n\t\tthis.processFiles(files);\n\t}\n\n\t// File input handler\n\thandleFileSelect(event: Event) {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tconst files = Array.from(input.files || []);\n\t\tthis.processFiles(files);\n\t\tinput.value = ''; // Reset input\n\t}\n\n\tprivate processFiles(files: File[]) {\n\t\tthis.errorMessage.set('');\n\n\t\t// Validate max files first\n\t\tconst totalFiles = this.files().length + files.length;\n\t\tif (this.maxFiles() > 0 && totalFiles > this.maxFiles()) {\n\t\t\tthis.errorMessage.set(\n\t\t\t\tthis.translateService.instant('file-uploader.dropzone.maxFilesExceeded', {\n\t\t\t\t\tmax: this.maxFiles(),\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Validate each file\n\t\tconst validFiles = files.filter((file) => {\n\t\t\tconst isValidSize = this.validateFileSize(file);\n\t\t\tconst isValidType = this.validateFileType(file);\n\n\t\t\tif (!isValidSize) {\n\t\t\t\tconsole.warn(`File ${file.name} exceeds size limit`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!isValidType) {\n\t\t\t\tconsole.warn(`File ${file.name} has invalid type`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\n\t\t// Update model only with valid files\n\t\tif (validFiles.length > 0) {\n\t\t\tthis.files.update((current) => [...current, ...validFiles]);\n\t\t\tthis.onChange(this.files());\n\t\t\tthis.onTouched();\n\t\t\tthis.onDrop.emit(validFiles);\n\t\t} else {\n\t\t\tthis.errorMessage.set(this.translateService.instant('file-uploader.dropzone.noValidFiles'));\n\t\t}\n\t}\n\n\tvalidateFileSize(file: File): boolean {\n\t\treturn this.maxFileSize() === 0 || file.size <= this.maxFileSize();\n\t}\n\n\tvalidateFileType(file: File): boolean {\n\t\tif (this.extensions().length === 0) return true;\n\t\tconst extension = file.name.match(/\\.([0-9a-z]+)$/i)?.[0]?.toLowerCase() || '';\n\t\treturn this.extensions().some((ext) => ext.toLowerCase() === extension);\n\t}\n\n\thandlefileDownload(file: File) {\n\t\tconst url = URL.createObjectURL(file);\n\t\tconst a = document.createElement('a');\n\t\ta.href = url;\n\t\ta.download = file.name;\n\t\tdocument.body.appendChild(a);\n\t\ta.click();\n\t\tURL.revokeObjectURL(url);\n\t\tdocument.body.removeChild(a);\n\t}\n\n\thandleRemove(file: File) {\n\t\tthis.files.update((current) => current.filter((f) => f !== file));\n\t\tthis.onChange(this.files());\n\t\tthis.onTouched();\n\t\tthis.onRemove.emit(file);\n\t}\n\n\tcheckIfIsAudioFile(file: File) {\n\t\treturn AUDIO_EXTENSIONS.some((ext) => file.name.endsWith(ext));\n\t}\n\n\thandleAudioPlayerOpen() {\n\t\tif (this.audioService.isPlayingATrack() && !this.opened()) {\n\t\t\tthis.opened.set(true);\n\t\t}\n\t}\n\n\thandleAudioPlayerOpenToggle() {\n\t\tthis.opened.set(!this.opened());\n\t}\n\n\tngDestroy() {\n\t\tthis.tracks().forEach((track) => URL.revokeObjectURL(track.url));\n\t}\n\n\t// ControlValueAccessor implementation\n\twriteValue(files: File[]): void {\n\t\tthis.files.set(files || []);\n\t}\n\n\tregisterOnChange(fn: (value: File[]) => void): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\ttriggerFileInput() {\n\t\tif (!this.disabled()) {\n\t\t\tthis.fileInput()?.nativeElement.click();\n\t\t}\n\t}\n}\n","<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<div class=\"w-full\">\n\t<div\n\t\t[class]=\"dropzoneClass\"\n\t\t(dragover)=\"handleDragOver($event)\"\n\t\t(dragleave)=\"handleDragLeave($event)\"\n\t\t(drop)=\"handleDrop($event)\"\n\t\t(click)=\"triggerFileInput()\"\n\t\t(blur)=\"onTouched()\"\n\t\ttabindex=\"0\"\n\t>\n\t\t@if (parentForm()) {\n\t\t\t<input\n\t\t\t\t#fileInput\n\t\t\t\ttype=\"file\"\n\t\t\t\t[multiple]=\"multiple()\"\n\t\t\t\t[accept]=\"accept()\"\n\t\t\t\t(change)=\"handleFileSelect($event)\"\n\t\t\t\t[name]=\"name()\"\n\t\t\t\t(blur)=\"onTouched()\"\n\t\t\t\trequired\n\t\t\t\thidden\n\t\t\t/>\n\t\t} @else {\n\t\t\t<input #fileInput type=\"file\" [multiple]=\"multiple()\" [accept]=\"accept()\" (change)=\"handleFileSelect($event)\" [name]=\"name()\" required hidden />\n\t\t}\n\n\t\t<div class=\"grid h-48 place-content-center\">\n\t\t\t@let errorMessageVar = this.errorMessage();\n\t\t\t@if (errorMessageVar) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconError\" size=\"xl\" class=\"text-error\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ errorMessageVar }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (!uploading()) {\n\t\t\t\t<div>\n\t\t\t\t\t<st-icon [icon]=\"iconCloudUpload\" size=\"xl\" class=\"text-accent\" />\n\t\t\t\t\t<div typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t{{ 'file-uploader.dropzone.selectPrompt' | translate }}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.maxSizeLabel' | translate }} <span class=\"text-accent\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t@if (extensions().length > 0) {\n\t\t\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t{{ 'file-uploader.dropzone.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t@if (maxFiles() > 0) {\n\t\t<div class=\"mt-4 flex items-center justify-between\">\n\t\t\t<ng-content></ng-content>\n\t\t\t<span typography [tyVariant]=\"'body-sm'\" [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ 'file-uploader.dropzone.fileCounter' | translate: { current: files().length, max: maxFiles() } }}\n\t\t\t</span>\n\t\t</div>\n\t}\n\n\t@if (showFiles() && files().length > 0) {\n\t\t<div class=\"mt-4 space-y-2\">\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<div class=\"flex items-center justify-between rounded-md bg-neutral/30 py-3 pl-3 pr-5\">\n\t\t\t\t\t<div class=\"flex items-center justify-start\">\n\t\t\t\t\t\t<div class=\"relative text-primary\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconInsertDriveFile\" size=\"xl\" />\n\t\t\t\t\t\t\t<div class=\"absolute bottom-3 left-1/2 -translate-x-1/2 text-primary-content\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" tyFontWeight=\"medium\">\n\t\t\t\t\t\t\t\t\t{{ file.name | extractExtension }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex flex-col items-start justify-center\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\">\n\t\t\t\t\t\t\t\t{{ file.name }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"text-tertiary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\"> {{ file.size | toBytes }} </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"inline-flex items-center justify-end gap-1\">\n\t\t\t\t\t\t@if (checkIfIsAudioFile(file)) {\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!this.audioService.isPlayingATrack()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.pause' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button-play\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center justify-center\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t[asButton]=\"true\"\n\t\t\t\t\t\t\t\t\t[trackIndex]=\"getIndexForTracks(file)\"\n\t\t\t\t\t\t\t\t\t(onTogglePlay)=\"handleAudioPlayerOpen()\"\n\t\t\t\t\t\t\t\t></st-button-play>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t\t<st-tooltip\n\t\t\t\t\t\t\t\t[label]=\"\n\t\t\t\t\t\t\t\t\t!opened()\n\t\t\t\t\t\t\t\t\t\t? ('file-uploader.dropzone.fileActions.showPlayer' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('file-uploader.dropzone.fileActions.hidePlayer' | translate)\n\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t\t[icon]=\"!opened() ? iconVisibility : iconVisibilityOff\"\n\t\t\t\t\t\t\t\t\tvariant=\"warning\"\n\t\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleAudioPlayerOpenToggle()\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDownload\"\n\t\t\t\t\t\t\t\tvariant=\"info\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handlefileDownload(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip class=\"inline-flex items-center\" [label]=\"'file-uploader.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tclass=\"inline-flex items-center\"\n\t\t\t\t\t\t\t\t[icon]=\"iconDelete\"\n\t\t\t\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[square]=\"true\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t(click)=\"handleRemove(file)\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t}\n</div>\n<st-audio-player [tracks]=\"tracks()\" [showTrackList]=\"false\" [variant]=\"'fixed'\" [opened]=\"opened()\"></st-audio-player>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAO,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AACnF,MAAM,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AAA,CAAA,SAAA,EAAA,UAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAWL,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAzB7B,SAAS;+BACC,kBAAkB,EAAA,UAAA,EAChB,IAAI,EACP,OAAA,EAAA;wBACR,OAAO;wBACP,eAAe;wBACf,mBAAmB;wBACnB,WAAW;wBACX,oBAAoB;wBACpB,aAAa;wBACb,mBAAmB;wBACnB,oBAAoB;wBACpB,WAAW;wBACX,aAAa;wBACb,gBAAgB;qBAChB,EAEU,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB,CAAC;AAChD,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,+jNAAA,EAAA,CAAA;;;AEnEF;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-uploader.mjs","sources":["../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.ts","../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.html","../../../projects/sdk/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, forwardRef, input, model, output, viewChild } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { InputComponent, InputSizeProps, InputVariantProps } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n// Create a new type by excluding specific values from the variant property\nexport type FileUploaderVariantProps = Exclude<InputVariantProps, 'search' | 'search-ghost'>;\nexport type FileUploaderSizeProps = InputSizeProps;\n\nexport type FileUploaderProps = {\n\tvariant?: FileUploaderVariantProps;\n\tsize?: FileUploaderSizeProps;\n};\n\n@Component({\n\tselector: 'st-file-uploader',\n\tstandalone: true,\n\timports: [FormsModule, InputComponent, TypographyDirective],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }],\n\ttemplateUrl: './file-uploader.component.html',\n\tchangeDetection: ChangeDetectionStrategy.Default,\n})\nexport class FileUploaderComponent implements ControlValueAccessor {\n\t// Base input properties\n\tvariant = input<FileUploaderVariantProps>('secondary');\n\tsize = input<FileUploaderSizeProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tshowExtensions = input<boolean>(true);\n\textensions = input<string[]>([]);\n\tonFileChange = output<File>();\n\n\tfilename = '';\n\tfileValue: File | null = null;\n\tformattedExtensions = computed(() => this.extensions().join(', '));\n\tfileInput = viewChild<ElementRef>('uploader');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\tvalue = model<File | null>(null);\n\n\t// ControlValueAccessor attributes\n\t_onChange: any;\n\t_onTouched: any;\n\tdisabled = model<boolean>(false);\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\twriteValue(value: any): void {\n\t\tthis.value.set(value);\n\t\tthis.filename = value?.name || '';\n\t}\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn; // Register this as a change callback function\n\t}\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouched = fn; // Register this as a blur callback function\n\t}\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Input functions\n\thandleClick() {\n\t\tif (!this.fileInput()) return;\n\t\tthis.fileInput()?.nativeElement.click(); // Access the element to trigger click\n\t}\n\n\thandleReadFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis._onChange(file);\n\t\t\tthis.value.set(file);\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\thandleAddFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\tremoveFile() {\n\t\tthis.filename = '';\n\t\tthis.value.set(null);\n\t\tthis._onChange(null);\n\t}\n\n\t// Style Getters\n\tcomponentClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'md',\n\t\t};\n\t}\n\n\terrorClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'error',\n\t\t\tsize: this.size(),\n\t\t};\n\t}\n\n\tsuccessClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'success',\n\t\t\tsize: this.size(),\n\t\t};\n\t}\n\n\tvalidationClass(): FileUploaderProps {\n\t\tif (!this.formField) return this.componentClass();\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClass();\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClass();\n\t\t\t}\n\t\t}\n\n\t\treturn this.componentClass();\n\t}\n}\n","<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</st-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;MAuBa,qBAAqB,CAAA;;AAEjC,IAAA,OAAO,GAAG,KAAK,CAA2B,WAAW,CAAC,CAAC;AACvD,IAAA,IAAI,GAAG,KAAK,CAAwB,IAAI,CAAC,CAAC;AAC1C,IAAA,OAAO,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC5B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC1B,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;AAClC,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAChC,IAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;AACtC,IAAA,UAAU,GAAG,KAAK,CAAW,EAAE,CAAC,CAAC;IACjC,YAAY,GAAG,MAAM,EAAQ,CAAC;IAE9B,QAAQ,GAAG,EAAE,CAAC;IACd,SAAS,GAAgB,IAAI,CAAC;AAC9B,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACnE,IAAA,SAAS,GAAG,SAAS,CAAa,UAAU,CAAC,CAAC;;AAG9C,IAAA,UAAU,GAAG,KAAK,CAAmB,IAAI,CAAC,CAAC;AAC3C,IAAA,eAAe,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AACpC,IAAA,KAAK,GAAG,KA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E,WAAW,EAAE,UAAU,CAAC,MAAM,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,ECnB/G,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,WAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,48BA6BA,EDXW,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,WAAW,EAAE,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,cAAc,kWAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,cAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,OAAA,EAAA,CAAA,CAAA;;4FAK9C,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBARjC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAChB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,WAAW,EAAE,cAAc,EAAE,mBAAmB,CAAC,EAChD,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAE7F,eAAA,EAAA,uBAAuB,CAAC,OAAO,EAAA,QAAA,EAAA,48BAAA,EAAA,CAAA;;;AErBjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-uploader.mjs","sources":["../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.ts","../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.html","../../../projects/sdk/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, forwardRef, input, model, output, viewChild } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { InputComponent, InputSizeProps, InputVariantProps } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n// Create a new type by excluding specific values from the variant property\nexport type FileUploaderVariantProps = InputVariantProps;\nexport type FileUploaderSizeProps = InputSizeProps;\n\nexport type FileUploaderProps = {\n\tvariant?: FileUploaderVariantProps;\n\tsize?: FileUploaderSizeProps;\n};\n\n@Component({\n\tselector: 'st-file-uploader',\n\tstandalone: true,\n\timports: [FormsModule, InputComponent, TypographyDirective],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }],\n\ttemplateUrl: './file-uploader.component.html',\n\tchangeDetection: ChangeDetectionStrategy.Default,\n})\nexport class FileUploaderComponent implements ControlValueAccessor {\n\t// Base input properties\n\tvariant = input<FileUploaderVariantProps>('secondary');\n\tsize = input<FileUploaderSizeProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tshowExtensions = input<boolean>(true);\n\textensions = input<string[]>([]);\n\tonFileChange = output<File>();\n\n\tfilename = '';\n\tfileValue: File | null = null;\n\tformattedExtensions = computed(() => this.extensions().join(', '));\n\tfileInput = viewChild<ElementRef>('uploader');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\tvalue = model<File | null>(null);\n\n\t// ControlValueAccessor attributes\n\t_onChange: any;\n\t_onTouched: any;\n\tdisabled = model<boolean>(false);\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\twriteValue(value: any): void {\n\t\tthis.value.set(value);\n\t\tthis.filename = value?.name || '';\n\t}\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn; // Register this as a change callback function\n\t}\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouched = fn; // Register this as a blur callback function\n\t}\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Input functions\n\thandleClick() {\n\t\tif (!this.fileInput()) return;\n\t\tthis.fileInput()?.nativeElement.click(); // Access the element to trigger click\n\t}\n\n\thandleReadFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis._onChange(file);\n\t\t\tthis.value.set(file);\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\thandleAddFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\tremoveFile() {\n\t\tthis.filename = '';\n\t\tthis.value.set(null);\n\t\tthis._onChange(null);\n\t}\n\n\t// Style Getters\n\tcomponentClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'md',\n\t\t};\n\t}\n\n\terrorClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'error',\n\t\t\tsize: this.size(),\n\t\t};\n\t}\n\n\tsuccessClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'success',\n\t\t\tsize: this.size(),\n\t\t};\n\t}\n\n\tvalidationClass(): FileUploaderProps {\n\t\tif (!this.formField) return this.componentClass();\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClass();\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClass();\n\t\t\t}\n\t\t}\n\n\t\treturn this.componentClass();\n\t}\n}\n","<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [tyVariant]=\"'body-xs'\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</st-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;MAuBa,qBAAqB,CAAA;;AAEjC,IAAA,OAAO,GAAG,KAAK,CAA2B,WAAW,CAAC,CAAC;AACvD,IAAA,IAAI,GAAG,KAAK,CAAwB,IAAI,CAAC,CAAC;AAC1C,IAAA,OAAO,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC5B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC1B,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;AAClC,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAChC,IAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;AACtC,IAAA,UAAU,GAAG,KAA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cAAc,EAAE,mBAAmB,CAAC,EAChD,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAE7F,eAAA,EAAA,uBAAuB,CAAC,OAAO,EAAA,QAAA,EAAA,48BAAA,EAAA,CAAA;;;AErBjD;;AAEG;;;;"}
|
|
@@ -191,7 +191,7 @@ class DatepickerComponent {
|
|
|
191
191
|
useExisting: DatepickerComponent,
|
|
192
192
|
multi: true,
|
|
193
193
|
},
|
|
194
|
-
], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<st-input (click)=\"toggleDatepicker()\" [(value)]=\"current\" [readonly]=\"true\" [label]=\"label()\" />\n<div class=\"datepicker-container\">\n\t<div [class]=\"isOpen ? 'calendar-wrapper active' : 'calendar-wrapper inactive'\">\n\t\t<div class=\"calendar-header\">\n\t\t\t<button (click)=\"changeMonth(true)\" class=\"btn-prev\">\n\t\t\t\t<!-- <img src=\"assets/icons/calendar/left.svg\" /> -->\n\t\t\t\t<st-icon class=\"text-secondary-content\" [icon]=\"iconArrowLeft\" color=\"inherit\">></st-icon>\n\t\t\t</button>\n\t\t\t<h1>{{ monthAndYearLabel | datepickerFormatMonth: language() }}</h1>\n\t\t\t<button (click)=\"changeMonth(false)\" class=\"btn-next\">\n\t\t\t\t<!-- <img src=\"assets/icons/calendar/right.svg\" /> -->\n\t\t\t\t<st-icon class=\"text-secondary-content\" [icon]=\"iconArrowRight\" color=\"inherit\"></st-icon>\n\t\t\t</button>\n\t\t</div>\n\t\t<ol class=\"days\">\n\t\t\t@for (day of weekFromLanguage(); track day) {\n\t\t\t\t<li class=\"day-name\">{{ day | slice: 0 : 1 }}</li>\n\t\t\t}\n\n\t\t\t@for (day of daysOfMonth; track day.value) {\n\t\t\t\t<li\n\t\t\t\t\tclass=\"day\"\n\t\t\t\t\t(click)=\"handleSelectDay(day)\"\n\t\t\t\t\t[ngClass]=\"{ active: day.date === current(), disabled: day.disabled }\"\n\t\t\t\t\t[style.gridColumnStart]=\"$first ? day.indexWeek : 'auto'\"\n\t\t\t\t>\n\t\t\t\t\t<span>{{ day.value }}</span>\n\t\t\t\t</li>\n\t\t\t}\n\t\t</ol>\n\t</div>\n</div>\n", styles: [".datepicker-container{position:relative}.calendar-wrapper{padding:20px;border:solid 1px #eaeaea;background:#fff;box-shadow:0 4px 15px #0000001a;border-radius:15px;position:absolute;top:5px;left:0;z-index:9999;max-width:280px}.calendar-wrapper.active{display:block}.calendar-wrapper.inactive{display:none}.calendar-header{display:flex;width:100%;justify-content:space-between;align-items:center;align-content:center;padding:10px 0 0;margin-bottom:10px}.calendar-header h1{width:100%;font-style:normal;font-weight:500;font-size:15px;line-height:18px;color:#777675;text-align:center;font-family:Roboto,sans-serif}.calendar-header button{cursor:pointer;background-color:transparent;border:0;width:40px;display:flex;justify-content:center;align-items:center}.days{list-style:none;display:grid;grid-template-columns:repeat(7,34px);margin:0;padding:0;gap:0}.days .day-name{font-weight:700;margin-bottom:2px;padding:4px;text-align:center;font-style:normal;font-size:15px;color:#4dd6ed;margin-top:10px}.days .day{display:flex;justify-content:center;align-items:center;width:100%;height:34px;padding:.25rem;font-size:15px;cursor:pointer;color:#636363}.days .day:hover{font-weight:600;background:#4dd6ed;border-radius:50%;color:#fff}.days .day.disabled{color:#ccc}.days .day.active{font-weight:600;background:#4dd6ed;border-radius:50%;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: InputComponent, selector: "st-input", inputs: ["variant", "size", "label", "type", "name", "placeholder", "icon", "iconPosition", "readonly", "iconClickable", "ghost", "value", "parentForm", "formControlName", "disabled", "debounceTime"], outputs: ["onIconClick", "valueChange", "disabledChange", "onEnter", "onBlur", "onDebounceChange"] }, { kind: "pipe", type: DatepickerFormatMonthPipe, name: "datepickerFormatMonth" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "
|
|
194
|
+
], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<st-input (click)=\"toggleDatepicker()\" [(value)]=\"current\" [readonly]=\"true\" [label]=\"label()\" />\n<div class=\"datepicker-container\">\n\t<div [class]=\"isOpen ? 'calendar-wrapper active' : 'calendar-wrapper inactive'\">\n\t\t<div class=\"calendar-header\">\n\t\t\t<button (click)=\"changeMonth(true)\" class=\"btn-prev\">\n\t\t\t\t<!-- <img src=\"assets/icons/calendar/left.svg\" /> -->\n\t\t\t\t<st-icon class=\"text-secondary-content\" [icon]=\"iconArrowLeft\" color=\"inherit\">></st-icon>\n\t\t\t</button>\n\t\t\t<h1>{{ monthAndYearLabel | datepickerFormatMonth: language() }}</h1>\n\t\t\t<button (click)=\"changeMonth(false)\" class=\"btn-next\">\n\t\t\t\t<!-- <img src=\"assets/icons/calendar/right.svg\" /> -->\n\t\t\t\t<st-icon class=\"text-secondary-content\" [icon]=\"iconArrowRight\" color=\"inherit\"></st-icon>\n\t\t\t</button>\n\t\t</div>\n\t\t<ol class=\"days\">\n\t\t\t@for (day of weekFromLanguage(); track day) {\n\t\t\t\t<li class=\"day-name\">{{ day | slice: 0 : 1 }}</li>\n\t\t\t}\n\n\t\t\t@for (day of daysOfMonth; track day.value) {\n\t\t\t\t<li\n\t\t\t\t\tclass=\"day\"\n\t\t\t\t\t(click)=\"handleSelectDay(day)\"\n\t\t\t\t\t[ngClass]=\"{ active: day.date === current(), disabled: day.disabled }\"\n\t\t\t\t\t[style.gridColumnStart]=\"$first ? day.indexWeek : 'auto'\"\n\t\t\t\t>\n\t\t\t\t\t<span>{{ day.value }}</span>\n\t\t\t\t</li>\n\t\t\t}\n\t\t</ol>\n\t</div>\n</div>\n", styles: [".datepicker-container{position:relative}.calendar-wrapper{padding:20px;border:solid 1px #eaeaea;background:#fff;box-shadow:0 4px 15px #0000001a;border-radius:15px;position:absolute;top:5px;left:0;z-index:9999;max-width:280px}.calendar-wrapper.active{display:block}.calendar-wrapper.inactive{display:none}.calendar-header{display:flex;width:100%;justify-content:space-between;align-items:center;align-content:center;padding:10px 0 0;margin-bottom:10px}.calendar-header h1{width:100%;font-style:normal;font-weight:500;font-size:15px;line-height:18px;color:#777675;text-align:center;font-family:Roboto,sans-serif}.calendar-header button{cursor:pointer;background-color:transparent;border:0;width:40px;display:flex;justify-content:center;align-items:center}.days{list-style:none;display:grid;grid-template-columns:repeat(7,34px);margin:0;padding:0;gap:0}.days .day-name{font-weight:700;margin-bottom:2px;padding:4px;text-align:center;font-style:normal;font-size:15px;color:#4dd6ed;margin-top:10px}.days .day{display:flex;justify-content:center;align-items:center;width:100%;height:34px;padding:.25rem;font-size:15px;cursor:pointer;color:#636363}.days .day:hover{font-weight:600;background:#4dd6ed;border-radius:50%;color:#fff}.days .day.disabled{color:#ccc}.days .day.active{font-weight:600;background:#4dd6ed;border-radius:50%;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: InputComponent, selector: "st-input", inputs: ["variant", "size", "label", "type", "name", "placeholder", "icon", "iconPosition", "readonly", "iconClickable", "ghost", "value", "parentForm", "formControlName", "disabled", "debounceTime"], outputs: ["onIconClick", "valueChange", "disabledChange", "onEnter", "onBlur", "onDebounceChange"] }, { kind: "pipe", type: DatepickerFormatMonthPipe, name: "datepickerFormatMonth" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }] });
|
|
195
195
|
}
|
|
196
196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
197
197
|
type: Component,
|