@sixbell-telco/sdk 0.7.1 → 0.7.2
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 +59 -27
- package/README.md +337 -54
- package/components/audio-player/src/audio-player.component.d.ts +1 -2
- package/components/button/src/button.component.d.ts +2 -2
- package/components/countdown/src/countdown.component.d.ts +1 -5
- package/components/dual-list/src/dual-list.component.d.ts +2 -3
- package/components/forms/combobox/src/combobox.component.d.ts +1 -1
- package/components/forms/form-error/src/form-error.component.d.ts +1 -8
- package/components/forms/input/src/input.component.d.ts +1 -1
- package/components/forms/select/src/select.component.d.ts +3 -1
- package/components/icon/src/icon.component.d.ts +2 -2
- package/components/product-card/src/product-card.component.d.ts +1 -2
- package/components/table/src/table.component.d.ts +3 -12
- package/components/wizard/wizard-marker/wizard-marker.component.d.ts +10 -2
- package/directives/typography/src/typography.directive.d.ts +1 -1
- package/esm2022/components/audio-player/audio-timeline/audio-timeline.component.mjs +3 -3
- package/esm2022/components/audio-player/button-play/button-play.component.mjs +5 -5
- package/esm2022/components/audio-player/src/audio-player.component.mjs +5 -4
- package/esm2022/components/audio-player/track-info/track-info.component.mjs +4 -3
- package/esm2022/components/avatar/src/avatar.component.mjs +3 -3
- package/esm2022/components/badge/src/badge.component.mjs +6 -5
- package/esm2022/components/button/src/button.component.mjs +6 -7
- package/esm2022/components/countdown/src/countdown.component.mjs +4 -7
- package/esm2022/components/dropdown/src/dropdown.component.mjs +6 -6
- package/esm2022/components/dual-list/src/dual-list.component.mjs +15 -5
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +10 -8
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +4 -3
- package/esm2022/components/forms/combobox/src/combobox.component.mjs +6 -5
- package/esm2022/components/forms/form-error/src/form-error.component.mjs +4 -11
- package/esm2022/components/forms/input/src/input.component.mjs +12 -12
- package/esm2022/components/forms/select/src/select.component.mjs +9 -7
- package/esm2022/components/forms/textarea/src/textarea.component.mjs +9 -8
- package/esm2022/components/forms/toggle/src/toggle.component.mjs +31 -31
- package/esm2022/components/icon/src/icon.component.mjs +5 -4
- package/esm2022/components/link/src/link.component.mjs +2 -2
- package/esm2022/components/product-card/src/product-card.component.mjs +4 -7
- package/esm2022/components/tab/src/tab.component.mjs +5 -5
- package/esm2022/components/table/src/table.component.mjs +23 -19
- package/esm2022/components/tooltip/src/tooltip.component.mjs +2 -2
- package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +22 -3
- package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +4 -3
- package/esm2022/directives/typography/src/typography.directive.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +12 -11
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -4
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +5 -6
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +3 -6
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +14 -4
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +9 -7
- 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 +3 -2
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +5 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +3 -10
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +11 -11
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +8 -6
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +8 -7
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +30 -30
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +4 -3
- 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-product-card.mjs +3 -6
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +22 -18
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +23 -4
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +1 -0
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
- package/package.json +57 -57
|
@@ -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.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,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAC5F,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAC7F,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BACX,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
|
+
{"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.translateService.get(_('sdk.fileUpload.dropzone.maxFilesExceeded'), { max: this.maxFiles() }).subscribe((res: string) => {\n\t\t\t\tthis.errorMessage.set(res);\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.translateService.get(_('sdk.fileUpload.dropzone.noValidFiles')).subscribe((res: string) => {\n\t\t\t\tthis.errorMessage.set(res);\n\t\t\t});\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{{ 'sdk.fileUpload.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{{ 'sdk.fileUpload.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{{ 'sdk.fileUpload.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{{ 'sdk.fileUpload.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 align-top\">\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? ('sdk.fileUpload.dropzone.fileActions.play' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('sdk.fileUpload.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>\n\t\t\t\t\t\t\t\t<st-button-play\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? ('sdk.fileUpload.dropzone.fileActions.showPlayer' | translate)\n\t\t\t\t\t\t\t\t\t\t: ('sdk.fileUpload.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>\n\t\t\t\t\t\t\t\t<st-button\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 [label]=\"'sdk.fileUpload.dropzone.fileActions.download' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button [icon]=\"iconDownload\" variant=\"info\" [outline]=\"true\" [square]=\"true\" size=\"sm\" (click)=\"handlefileDownload(file)\" />\n\t\t\t\t\t\t</st-tooltip>\n\t\t\t\t\t\t<st-tooltip [label]=\"'sdk.fileUpload.dropzone.fileActions.remove' | translate\" variant=\"secondary\">\n\t\t\t\t\t\t\t<st-button [icon]=\"iconDelete\" variant=\"error\" [outline]=\"true\" [square]=\"true\" size=\"sm\" (click)=\"handleRemove(file)\" />\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,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAC5F,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAC7F,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AACjH,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAC5D,MAAM,eAAe,GAAG,CAAC,OAAO,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X,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,w9LAAA,EAAA,CAAA;;;AEnEF;;AAEG;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, computed, viewChild, model, forwardRef, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
4
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
5
|
import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
|
|
5
6
|
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
6
7
|
|
|
@@ -106,11 +107,11 @@ class FileUploaderComponent {
|
|
|
106
107
|
return this.componentClass();
|
|
107
108
|
}
|
|
108
109
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FileUploaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FileUploaderComponent, isStandalone: true, selector: "st-file-uploader", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showExtensions: { classPropertyName: "showExtensions", publicName: "showExtensions", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFileChange: "onFileChange", value: "valueChange", disabled: "disabledChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["uploader"], descendants: true, isSignal: true }], ngImport: i0, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\
|
|
110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FileUploaderComponent, isStandalone: true, selector: "st-file-uploader", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showExtensions: { classPropertyName: "showExtensions", publicName: "showExtensions", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFileChange: "onFileChange", value: "valueChange", disabled: "disabledChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["uploader"], descendants: true, isSignal: true }], ngImport: i0, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\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'\" tyFontWeight=\"medium\">\n\t\t\t\t\t{{ 'sdk.fileUpload.fileUploader.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ formattedExtensions() }}</span>\n\t\t\t\t</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", dependencies: [{ 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: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
110
111
|
}
|
|
111
112
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FileUploaderComponent, decorators: [{
|
|
112
113
|
type: Component,
|
|
113
|
-
args: [{ selector: 'st-file-uploader', standalone: true, imports: [FormsModule, InputComponent, TypographyDirective], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], changeDetection: ChangeDetectionStrategy.Default, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\
|
|
114
|
+
args: [{ selector: 'st-file-uploader', standalone: true, imports: [FormsModule, InputComponent, TypographyDirective, TranslatePipe], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], changeDetection: ChangeDetectionStrategy.Default, template: "<st-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\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'\" tyFontWeight=\"medium\">\n\t\t\t\t\t{{ 'sdk.fileUpload.fileUploader.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ formattedExtensions() }}</span>\n\t\t\t\t</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" }]
|
|
114
115
|
}] });
|
|
115
116
|
|
|
116
117
|
/**
|
|
@@ -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 = 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":";;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A,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 { TranslatePipe } from '@ngx-translate/core';\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, TranslatePipe],\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\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'\" tyFontWeight=\"medium\">\n\t\t\t\t\t{{ 'sdk.fileUpload.fileUploader.allowedTypesLabel' | translate }} <span class=\"text-accent\">{{ formattedExtensions() }}</span>\n\t\t\t\t</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;MAwBa,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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AAA,QAAA,EAAA,kBAAkB,cAChB,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAA,SAAA,EAC/D,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,+hCAAA,EAAA,CAAA;;;AEtBjD;;AAEG;;;;"}
|
|
@@ -4,6 +4,7 @@ import * as i2 from '@angular/forms';
|
|
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@ng-select/ng-select';
|
|
6
6
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
7
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
7
8
|
import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
|
|
8
9
|
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
9
10
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
@@ -54,7 +55,7 @@ class ComboboxComponent {
|
|
|
54
55
|
label = input('');
|
|
55
56
|
value = model();
|
|
56
57
|
options = input([]);
|
|
57
|
-
emptyOptionText = input(
|
|
58
|
+
emptyOptionText = input();
|
|
58
59
|
loading = input(false);
|
|
59
60
|
search = '';
|
|
60
61
|
// Options properties
|
|
@@ -151,17 +152,17 @@ class ComboboxComponent {
|
|
|
151
152
|
useExisting: ComboboxComponent,
|
|
152
153
|
multi: true,
|
|
153
154
|
},
|
|
154
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\
|
|
155
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\t[notFoundText]=\"'sdk.combobox.noResultsFound' | translate\"\n\t\t[loadingText]=\"'sdk.combobox.loading' | translate\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<st-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" variant=\"secondary\" [ghost]=\"true\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.NgOptionComponent, selector: "ng-option", inputs: ["value", "disabled"] }, { kind: "directive", type: i1.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
155
156
|
}
|
|
156
157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
157
158
|
type: Component,
|
|
158
|
-
args: [{ selector: 'st-combobox', standalone: true, imports: [NgSelectModule, FormsModule, InputComponent, TypographyDirective, ReactiveFormsModule], providers: [
|
|
159
|
+
args: [{ selector: 'st-combobox', standalone: true, imports: [NgSelectModule, FormsModule, InputComponent, TypographyDirective, ReactiveFormsModule, TranslatePipe], providers: [
|
|
159
160
|
{
|
|
160
161
|
provide: NG_VALUE_ACCESSOR,
|
|
161
162
|
useExisting: ComboboxComponent,
|
|
162
163
|
multi: true,
|
|
163
164
|
},
|
|
164
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\
|
|
165
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\t[notFoundText]=\"'sdk.combobox.noResultsFound' | translate\"\n\t\t[loadingText]=\"'sdk.combobox.loading' | translate\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<st-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" variant=\"secondary\" [ghost]=\"true\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n" }]
|
|
165
166
|
}] });
|
|
166
167
|
|
|
167
168
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-combobox.mjs","sources":["../../../projects/sdk/components/forms/combobox/src/combobox.component.ts","../../../projects/sdk/components/forms/combobox/src/combobox.component.html","../../../projects/sdk/components/forms/combobox/sixbell-telco-sdk-components-forms-combobox.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, effect, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { NgSelectModule } from '@ng-select/ng-select';\nimport { InputComponent } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst comboboxComponent = cva(['[&>*]:w-full', 'font-body', 'custom-ng-select'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['combobox-primary first:'],\n\t\t\tsecondary: ['combobox-secondary'],\n\t\t\tsuccess: ['combobox-success'],\n\t\t\terror: ['combobox-error'],\n\t\t\twarning: ['combobox-warning'],\n\t\t},\n\t\tshape: {\n\t\t\t'round-none': ['[&>*]:rounded-[0px_!important]'],\n\t\t\t'round-sm': ['[&>*]:rounded-[var(--rounded-btn-sm)_!important]'],\n\t\t\t'round-md': ['[&>*]:rounded-[var(--rounded-btn-md)_!important]'],\n\t\t\t'round-lg': ['[&>*]:rounded-[var(--rounded-btn-lg)_!important]'],\n\t\t},\n\t\tsize: {\n\t\t\tsm: ['[&>*:first-child]:!px-2', '[&>*:first-child]:!py-1', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t\tmd: ['[&>*:first-child]:!px-3', '[&>*:first-child]:!py-2', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t\tlg: ['[&>*:first-child]:!px-4', '[&>*:first-child]:!py-3', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'secondary',\n\t\tshape: 'round-sm',\n\t\tsize: 'md',\n\t},\n});\n\nexport type ComboboxVariantProps = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | null | undefined;\nexport type ComboboxShapeProps = 'round-none' | 'round-sm' | 'round-md' | 'round-lg' | null | undefined;\nexport type ComboboxSizeProps = 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type ComboboxProps = {\n\tvariant?: ComboboxVariantProps;\n\tshape?: ComboboxShapeProps;\n\tsize?: ComboboxSizeProps;\n};\n\n/**\n * Search input component\n * A search input component that allows the user to search for an option from a list of options\n * This component was implemented using the ng-select library\n * Docs: https://github.com/ng-select/ng-select\n */\n@Component({\n\tselector: 'st-combobox',\n\tstandalone: true,\n\timports: [NgSelectModule, FormsModule, InputComponent, TypographyDirective, ReactiveFormsModule],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ComboboxComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './combobox.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComboboxComponent implements ControlValueAccessor {\n\t// Basic input properties\n\tvariant = input<ComboboxVariantProps>('secondary');\n\tshape = input<ComboboxShapeProps>('round-sm');\n\tsize = input<ComboboxSizeProps>('md');\n\tclasses = input<string>('');\n\tname = input<string | null>(null);\n\tlabel = input<string>('');\n\n\tvalue = model();\n\toptions = input<any[]>([]);\n\temptyOptionText = input<string>('');\n\tloading = input<boolean>(false);\n\tsearch = '';\n\n\t// Options properties\n\ttrackBy = input<string>('id');\n\tkey = input<string>('name');\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// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Select handler\n\tonChange = output<any>();\n\thandleSelect() {\n\t\tthis.onChange.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t\tthis.handleSearch('');\n\t}\n\n\t// Search handler\n\tonSearch = output<string>();\n\thandleSearch(search: string) {\n\t\tthis.onSearch.emit(search);\n\t\tthis.search = search;\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// Checks if options are primitives or not\n\tsimpleOption = false;\n\toptionsEffect = effect(() => {\n\t\tthis.simpleOption = this.options().every((option) => typeof option !== 'object');\n\t});\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget errorClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget successClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget validationClass() {\n\t\tif (!this.formField) return this.componentClass;\n\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","<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\tnotFoundText=\"Ningún elemento encontrado...\"\n\t\tloadingText=\"Cargando...\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<st-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" variant=\"secondary\" [ghost]=\"true\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AASA,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,cAAc,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAE;AAChF,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,yBAAyB,C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,EAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,aAAA,EAAA,MAAA,EAAA,cAAA,EAAA,UAAA,EAAA,eAAA,EAAA,OAAA,EAAA,OAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,cAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,QAAA,EAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,cAAA,EAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAWnF,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EACX,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,EACrF,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAmB,iBAAA;AAC9B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mnDAAA,EAAA,CAAA;;;AElEhD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-combobox.mjs","sources":["../../../projects/sdk/components/forms/combobox/src/combobox.component.ts","../../../projects/sdk/components/forms/combobox/src/combobox.component.html","../../../projects/sdk/components/forms/combobox/sixbell-telco-sdk-components-forms-combobox.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, effect, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { NgSelectModule } from '@ng-select/ng-select';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { InputComponent } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst comboboxComponent = cva(['[&>*]:w-full', 'font-body', 'custom-ng-select'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['combobox-primary first:'],\n\t\t\tsecondary: ['combobox-secondary'],\n\t\t\tsuccess: ['combobox-success'],\n\t\t\terror: ['combobox-error'],\n\t\t\twarning: ['combobox-warning'],\n\t\t},\n\t\tshape: {\n\t\t\t'round-none': ['[&>*]:rounded-[0px_!important]'],\n\t\t\t'round-sm': ['[&>*]:rounded-[var(--rounded-btn-sm)_!important]'],\n\t\t\t'round-md': ['[&>*]:rounded-[var(--rounded-btn-md)_!important]'],\n\t\t\t'round-lg': ['[&>*]:rounded-[var(--rounded-btn-lg)_!important]'],\n\t\t},\n\t\tsize: {\n\t\t\tsm: ['[&>*:first-child]:!px-2', '[&>*:first-child]:!py-1', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t\tmd: ['[&>*:first-child]:!px-3', '[&>*:first-child]:!py-2', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t\tlg: ['[&>*:first-child]:!px-4', '[&>*:first-child]:!py-3', '[&>*:first-child]:!h-auto', '[&>*:first-child]:!min-h-[auto]'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'secondary',\n\t\tshape: 'round-sm',\n\t\tsize: 'md',\n\t},\n});\n\nexport type ComboboxVariantProps = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | null | undefined;\nexport type ComboboxShapeProps = 'round-none' | 'round-sm' | 'round-md' | 'round-lg' | null | undefined;\nexport type ComboboxSizeProps = 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type ComboboxProps = {\n\tvariant?: ComboboxVariantProps;\n\tshape?: ComboboxShapeProps;\n\tsize?: ComboboxSizeProps;\n};\n\n/**\n * Search input component\n * A search input component that allows the user to search for an option from a list of options\n * This component was implemented using the ng-select library\n * Docs: https://github.com/ng-select/ng-select\n */\n@Component({\n\tselector: 'st-combobox',\n\tstandalone: true,\n\timports: [NgSelectModule, FormsModule, InputComponent, TypographyDirective, ReactiveFormsModule, TranslatePipe],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ComboboxComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './combobox.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComboboxComponent implements ControlValueAccessor {\n\t// Basic input properties\n\tvariant = input<ComboboxVariantProps>('secondary');\n\tshape = input<ComboboxShapeProps>('round-sm');\n\tsize = input<ComboboxSizeProps>('md');\n\tclasses = input<string>('');\n\tname = input<string | null>(null);\n\tlabel = input<string>('');\n\n\tvalue = model();\n\toptions = input<any[]>([]);\n\temptyOptionText = input<string>();\n\tloading = input<boolean>(false);\n\tsearch = '';\n\n\t// Options properties\n\ttrackBy = input<string>('id');\n\tkey = input<string>('name');\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// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Select handler\n\tonChange = output<any>();\n\thandleSelect() {\n\t\tthis.onChange.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t\tthis.handleSearch('');\n\t}\n\n\t// Search handler\n\tonSearch = output<string>();\n\thandleSearch(search: string) {\n\t\tthis.onSearch.emit(search);\n\t\tthis.search = search;\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// Checks if options are primitives or not\n\tsimpleOption = false;\n\toptionsEffect = effect(() => {\n\t\tthis.simpleOption = this.options().every((option) => typeof option !== 'object');\n\t});\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget errorClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget successClass() {\n\t\treturn cn(\n\t\t\tcomboboxComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget validationClass() {\n\t\tif (!this.formField) return this.componentClass;\n\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","<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\t[notFoundText]=\"'sdk.combobox.noResultsFound' | translate\"\n\t\t[loadingText]=\"'sdk.combobox.loading' | translate\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<st-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" variant=\"secondary\" [ghost]=\"true\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAUA,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,cAAc,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAE;AAChF,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,yBAAyB,CAAC;YACpC,SAAS,EAAE,CAAC,oBAAoB,CAAC;YACjC,OAAO,EAAE,CAAC,kBAAkB,CAAC;YAC7B,KAAK,EAAE,CAAC,gBAAgB,CAAC;YACzB,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC7B,SAAA;AACD,QAAA,KAAK,EAAE;YACN,YAAY,EAAE,CAAC,gCAAgC,CAAC;YAChD,UAAU,EAAE,CAAC,kDAAkD,CAAC;YAChE,UAAU,EAAE,CAAC,kDAAkD,CAAC;YAChE,UAAU,EAAE,CAAC,kDAAkD,CAAC;AAChE,SAAA;AACD,QAAA,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iCAAiC,CAAC;YAC1H,EAAE,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iCAAiC,CAAC;YAC1H,EAAE,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iCAAiC,CAAC;AAC1H,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,eAAe,EAAE;AAChB,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,IAAI,EAAE,IAAI;AACV,KAAA;AACD,CAAA,CAAC,CAAC;AAYH;;;;;AAKG;MAeU,iBAAiB,CAAA;;AAE7B,IAAA,OAAO,GAAG,KAAK,CAAuB,WAAW,CAAC,CAAC;AACnD,IAAA,K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AAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAWlG,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,cACX,IAAI,EAAA,OAAA,EACP,CAAC,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,aAAa,CAAC,EACpG,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAmB,iBAAA;AAC9B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qpDAAA,EAAA,CAAA;;;AEnEhD;;AAEG;;;;"}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, Component } from '@angular/core';
|
|
3
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
3
4
|
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
4
5
|
|
|
5
6
|
class FormErrorsComponent {
|
|
6
7
|
// Main properties
|
|
7
8
|
parentForm = input.required();
|
|
8
9
|
formField = input.required();
|
|
9
|
-
// Custom messages
|
|
10
|
-
isRequired = input(undefined);
|
|
11
|
-
isMinLength = input(undefined);
|
|
12
|
-
isMaxLength = input(undefined);
|
|
13
|
-
isMin = input(undefined);
|
|
14
|
-
isMax = input(undefined);
|
|
15
|
-
isPattern = input(undefined);
|
|
16
|
-
isEmail = input(undefined);
|
|
17
10
|
formControl = computed(() => this.parentForm().get(this.formField()));
|
|
18
11
|
customError = computed(() => {
|
|
19
12
|
const errors = this.formControl()?.errors;
|
|
@@ -24,11 +17,11 @@ class FormErrorsComponent {
|
|
|
24
17
|
return null;
|
|
25
18
|
});
|
|
26
19
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FormErrorsComponent, isStandalone: true, selector: "st-form-errors", inputs: { parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: true, transformFunction: null }, formField: { classPropertyName: "formField", publicName: "formField", isSignal: true, isRequired: true, transformFunction: null }
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FormErrorsComponent, isStandalone: true, selector: "st-form-errors", inputs: { parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: true, transformFunction: null }, formField: { classPropertyName: "formField", publicName: "formField", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n\t[class]=\"\n\t\t!(formControl()?.errors && (formControl().dirty || formControl().touched))\n\t\t\t? 'invisible flex select-none items-center justify-start px-1 text-error opacity-0 transition-opacity duration-300 ease-ease-out-back'\n\t\t\t: 'visible flex select-none items-center justify-start px-1 text-error opacity-100 transition-opacity duration-300 ease-ease-out-back'\n\t\"\n>\n\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t@if (formControl()?.errors && (formControl().dirty || formControl().touched)) {\n\t\t\t@if (formControl().getError('required')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.required' | translate }}\n\t\t\t} @else if (formControl().getError('minlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.minLength' | translate: { min: formControl().getError('minlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('maxlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.maxLength' | translate: { max: formControl().getError('maxlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('min')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.min' | translate: { min: formControl().getError('min').min } }}\n\t\t\t} @else if (formControl().getError('max')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.max' | translate: { max: formControl().getError('max').max } }}\n\t\t\t} @else if (formControl().getError('pattern')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.pattern' | translate }}\n\t\t\t} @else if (formControl().getError('email')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.email' | translate }}\n\t\t\t} @else if (customError()) {\n\t\t\t\t{{ customError() }}\n\t\t\t}\n\t\t} @else {\n\t\t\t{{ 'sdk.formErrors.validation.unhandledError' | translate }}\n\t\t}\n\t</span>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
28
21
|
}
|
|
29
22
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormErrorsComponent, decorators: [{
|
|
30
23
|
type: Component,
|
|
31
|
-
args: [{ selector: 'st-form-errors', standalone: true, imports: [TypographyDirective], template: "<div\n\t[class]=\"\n\t\t!(formControl()?.errors && (formControl().dirty || formControl().touched))\n\t\t\t? 'invisible flex select-none items-center justify-start px-1 text-error opacity-0 transition-opacity duration-300 ease-ease-out-back'\n\t\t\t: 'visible flex select-none items-center justify-start px-1 text-error opacity-100 transition-opacity duration-300 ease-ease-out-back'\n\t\"\n>\n\t<span typography [tyVariant]=\"'body-
|
|
24
|
+
args: [{ selector: 'st-form-errors', standalone: true, imports: [TypographyDirective, TranslatePipe], template: "<div\n\t[class]=\"\n\t\t!(formControl()?.errors && (formControl().dirty || formControl().touched))\n\t\t\t? 'invisible flex select-none items-center justify-start px-1 text-error opacity-0 transition-opacity duration-300 ease-ease-out-back'\n\t\t\t: 'visible flex select-none items-center justify-start px-1 text-error opacity-100 transition-opacity duration-300 ease-ease-out-back'\n\t\"\n>\n\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t@if (formControl()?.errors && (formControl().dirty || formControl().touched)) {\n\t\t\t@if (formControl().getError('required')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.required' | translate }}\n\t\t\t} @else if (formControl().getError('minlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.minLength' | translate: { min: formControl().getError('minlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('maxlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.maxLength' | translate: { max: formControl().getError('maxlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('min')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.min' | translate: { min: formControl().getError('min').min } }}\n\t\t\t} @else if (formControl().getError('max')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.max' | translate: { max: formControl().getError('max').max } }}\n\t\t\t} @else if (formControl().getError('pattern')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.pattern' | translate }}\n\t\t\t} @else if (formControl().getError('email')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.email' | translate }}\n\t\t\t} @else if (customError()) {\n\t\t\t\t{{ customError() }}\n\t\t\t}\n\t\t} @else {\n\t\t\t{{ 'sdk.formErrors.validation.unhandledError' | translate }}\n\t\t}\n\t</span>\n</div>\n" }]
|
|
32
25
|
}] });
|
|
33
26
|
|
|
34
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-form-error.mjs","sources":["../../../projects/sdk/components/forms/form-error/src/form-error.component.ts","../../../projects/sdk/components/forms/form-error/src/form-error.component.html","../../../projects/sdk/components/forms/form-error/sixbell-telco-sdk-components-forms-form-error.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n@Component({\n\tselector: 'st-form-errors',\n\tstandalone: true,\n\timports: [TypographyDirective],\n\ttemplateUrl: './form-error.component.html',\n})\nexport class FormErrorsComponent {\n\t// Main properties\n\tparentForm = input.required<FormGroup>();\n\tformField = input.required<string>();\n\n\
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-form-error.mjs","sources":["../../../projects/sdk/components/forms/form-error/src/form-error.component.ts","../../../projects/sdk/components/forms/form-error/src/form-error.component.html","../../../projects/sdk/components/forms/form-error/sixbell-telco-sdk-components-forms-form-error.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n@Component({\n\tselector: 'st-form-errors',\n\tstandalone: true,\n\timports: [TypographyDirective, TranslatePipe],\n\ttemplateUrl: './form-error.component.html',\n})\nexport class FormErrorsComponent {\n\t// Main properties\n\tparentForm = input.required<FormGroup>();\n\tformField = input.required<string>();\n\n\tformControl = computed(() => this.parentForm().get(this.formField()) as FormControl);\n\tcustomError = computed(() => {\n\t\tconst errors = this.formControl()?.errors;\n\t\tconst keys = Object.keys(errors || {});\n\n\t\tif (keys.length > 0) {\n\t\t\treturn this.formControl().getError(keys[0]);\n\t\t}\n\n\t\treturn null;\n\t});\n}\n","<div\n\t[class]=\"\n\t\t!(formControl()?.errors && (formControl().dirty || formControl().touched))\n\t\t\t? 'invisible flex select-none items-center justify-start px-1 text-error opacity-0 transition-opacity duration-300 ease-ease-out-back'\n\t\t\t: 'visible flex select-none items-center justify-start px-1 text-error opacity-100 transition-opacity duration-300 ease-ease-out-back'\n\t\"\n>\n\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t@if (formControl()?.errors && (formControl().dirty || formControl().touched)) {\n\t\t\t@if (formControl().getError('required')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.required' | translate }}\n\t\t\t} @else if (formControl().getError('minlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.minLength' | translate: { min: formControl().getError('minlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('maxlength')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.maxLength' | translate: { max: formControl().getError('maxlength').requiredLength } }}\n\t\t\t} @else if (formControl().getError('min')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.min' | translate: { min: formControl().getError('min').min } }}\n\t\t\t} @else if (formControl().getError('max')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.max' | translate: { max: formControl().getError('max').max } }}\n\t\t\t} @else if (formControl().getError('pattern')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.pattern' | translate }}\n\t\t\t} @else if (formControl().getError('email')) {\n\t\t\t\t{{ 'sdk.formErrors.validation.email' | translate }}\n\t\t\t} @else if (customError()) {\n\t\t\t\t{{ customError() }}\n\t\t\t}\n\t\t} @else {\n\t\t\t{{ 'sdk.formErrors.validation.unhandledError' | translate }}\n\t\t}\n\t</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAWa,mBAAmB,CAAA;;AAE/B,IAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,EAAa,CAAC;AACzC,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;AAErC,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAgB,CAAC,CAAC;AACrF,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC;QAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;AAEvC,QAAA,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;AACpB,YAAA,OAAO,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