@arsedizioni/ars-utils 22.5.28 → 22.5.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"arsedizioni-ars-utils-ui.files.mjs","sources":["../../../projects/ars-utils/ui.files/file-input/file-input.component.ts","../../../projects/ars-utils/ui.files/file-input/file-input.component.html","../../../projects/ars-utils/ui.files/file-preview/file-preview.component.ts","../../../projects/ars-utils/ui.files/file-preview/file-preview.component.html","../../../projects/ars-utils/ui.files/select-file/select-file-dialog.component.ts","../../../projects/ars-utils/ui.files/select-file/select-file-dialog.component.html","../../../projects/ars-utils/ui.files/select-picture/select-picture-dialog.component.ts","../../../projects/ars-utils/ui.files/select-picture/select-picture-dialog.component.html","../../../projects/ars-utils/ui.files/public_api.ts","../../../projects/ars-utils/ui.files/arsedizioni-ars-utils-ui.files.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { afterNextRender, ChangeDetectionStrategy, Component, DoCheck, effect, ElementRef, Input, OnDestroy, Optional, Renderer2, Self, inject, input, model, output, signal, viewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { FormField, disabled as disabledSchema, form, required as requiredSchema, validate } from '@angular/forms/signals';\nimport { notEmpty } from '@arsedizioni/ars-utils/core.validators';\nimport { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';\nimport { FileInfo, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { Subject } from 'rxjs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { UIService } from '@arsedizioni/ars-utils/ui';\n\n@Component({\n selector: 'file-input',\n templateUrl: './file-input.component.html',\n styleUrl: './file-input.component.scss',\n providers: [{ provide: MatFormFieldControl, useExisting: FileInputComponent }],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatFormFieldModule, MatInputModule, FormField, MatButtonModule,\n MatIconModule, MatTooltipModule],\n host: {\n '[id]': 'id',\n '[class.floating]': 'shouldLabelFloat',\n '[attr.aria-describedBy]': 'describedBy',\n },\n})\nexport class FileInputComponent\n implements\n OnDestroy,\n DoCheck,\n MatFormFieldControl<FileInfo>,\n ControlValueAccessor {\n\n /** Reference to the hidden native file input element. */\n protected readonly __file = viewChild.required<ElementRef>('__file');\n\n private readonly renderer = inject(Renderer2);\n private readonly uiService = inject(UIService);\n\n // Initialize\n static nextId = 0;\n readonly stateChanges = new Subject<void>();\n private previousNativeValue: any;\n controlType: string = 'file-input';\n focused = false;\n\n /** Whether the device supports camera capture. */\n protected readonly canCapture = signal<boolean>(false);\n\n /** Size in MB of the currently selected file. */\n protected readonly fileSize = signal<number>(0);\n\n private readonly _placeholder = signal<string>('');\n\n private _value: FileInfo = new FileInfo();\n set value(value: FileInfo) {\n this.setValue(value, true);\n }\n\n /**\n * Updates the internal state. Form propagation is skipped for model->view\n * writes (writeValue) to avoid the CVA echo loop, and performed for\n * user-driven changes (selectFile/clearFile) and the public value setter.\n * @param value - The new file info to store and display.\n * @param propagate - When `true`, notifies the registered onChange callback.\n */\n private setValue(value: FileInfo, propagate: boolean): void {\n this._value = value;\n if (propagate) {\n this.propagateChange(this._value);\n }\n this.stateChanges.next();\n this.changed.emit(this._value);\n }\n get value() {\n return this._value;\n }\n get size() {\n return this._value?.file?.size;\n }\n\n /** Backing signal so the internal form schema reacts to `required` changes. */\n private readonly _required = signal<boolean>(false);\n @Input()\n get required() {\n return this._required();\n }\n set required(value: boolean) {\n this._required.set(coerceBooleanProperty(value));\n this.stateChanges.next();\n }\n /** Backing signal so the internal form schema reacts to `disabled` changes. */\n private readonly _disabled = signal<boolean>(false);\n @Input()\n get disabled() {\n if (this.ngControl && this.ngControl.disabled != null) {\n return this.ngControl.disabled;\n }\n return this._disabled();\n }\n set disabled(value: boolean) {\n this._disabled.set(coerceBooleanProperty(value));\n if (this.focused) {\n this.focused = false;\n this.stateChanges.next();\n }\n }\n @Input()\n get placeholder(): string {\n return this._placeholder();\n }\n set placeholder(value: string) {\n this._placeholder.set(value);\n this.stateChanges.next();\n }\n\n /** The currently displayed file name. Can be bound two-way from outside or updated on file selection. */\n readonly fileName = model<string | undefined>(undefined);\n readonly maxSizeMb = input<number>(5);\n readonly minSizeMb = input<number>(0);\n readonly isNew = input<boolean>(false);\n readonly canPreview = input<boolean>(false);\n readonly appearance = input<'fill' | 'outline' | undefined>(this.uiService.appearance());\n readonly accept = input<string>();\n get empty(): boolean {\n return !this._value || !this._value.file;\n }\n /** True when the control has validation errors and has been touched. */\n get errorState(): boolean {\n return (this.ngControl?.errors != null) && (this.ngControl?.touched ?? false);\n }\n\n id = `${this.controlType}-${FileInputComponent.nextId++}`;\n\n /** True when the label should float above the field. */\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n describedBy = '';\n\n readonly changed = output<FileInfo>();\n readonly download = output();\n readonly preview = output();\n\n /** Model backing the internal display form: the (readonly) file-name text. */\n private readonly nameModel = signal<{ name: string }>({ name: '' });\n\n /**\n * Internal signal form for the file-name input. It reproduces the previous\n * template-driven validators: `required` follows the `required` input and the\n * size rule mirrors FileSizeValidatorDirective (empty name is left to `required`).\n */\n protected readonly nameForm = form(this.nameModel, p => {\n requiredSchema(p.name, { when: () => this._required() });\n notEmpty(p.name, { when: () => this._required() });\n // The outer-form path is covered by setDisabledState, which writes the DOM directly.\n disabledSchema(p.name, () => this._disabled());\n validate(p.name, ({ value }) => {\n if (!value()) return undefined;\n const s = this.fileSize() ?? 0;\n return s <= this.maxSizeMb() && s >= this.minSizeMb()\n ? undefined\n : { kind: 'fileSize', message: 'Non valido.' };\n });\n });\n\n private propagateChange: (_: any) => void = (_: any) => { };\n private propagateTouched: () => void = () => { };\n\n\n constructor(\n @Optional() @Self() public ngControl: NgControl) {\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n\n // Keep the internal form model in sync with the two-way bindable fileName.\n effect(() => this.nameModel.set({ name: this.fileName() ?? '' }));\n\n // Detect camera availability and set the default placeholder after the first render.\n // The file-name input is also made read-only imperatively: marking the field as\n // readonly in the form schema would skip its validation entirely by design.\n afterNextRender(() => {\n this.setupDevices();\n const elem = document.getElementById(this.id);\n if (elem) {\n this.renderer.setProperty(elem, 'readOnly', true);\n }\n });\n }\n\n /**\n * Detects camera availability and updates the placeholder accordingly.\n */\n private async setupDevices(): Promise<void> {\n this.canCapture.set(false);\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n if (stream) {\n this.canCapture.set(true);\n }\n } catch { }\n }\n if (!this.placeholder || this.placeholder === 'Seleziona file') {\n this._placeholder.set(\n this.canCapture()\n ? 'Seleziona file o acquisisci con fotocamera'\n : 'Seleziona file'\n );\n }\n }\n\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n ngDoCheck(): void {\n this.updateInputDirtyCheck();\n }\n\n /**\n * Writes a new value to the component (called by the form layer).\n * @param value - The new file info to display.\n */\n writeValue(value: any): void {\n // Model -> view write: must NOT propagate back to the form (echo loop)\n this.setValue(value as FileInfo, false);\n }\n\n /**\n * Registers the on-change callback (called by the form layer).\n * @param fn - Callback to invoke whenever the value changes.\n */\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n /**\n * Registers the on-touched callback (called by the form layer).\n * @param fn - Callback to invoke when the control is touched.\n */\n registerOnTouched(fn: any): void {\n this.propagateTouched = fn;\n }\n\n /**\n * Sets the ARIA describedby attribute from the given element IDs.\n * @param ids - Array of element IDs that describe this control.\n */\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n }\n\n /**\n * Updates the disabled state of the underlying native element.\n * @param isDisabled - Whether the control should be disabled.\n */\n setDisabledState?(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n if (!SystemUtils.isBrowser()) return;\n const elem = document.getElementById(this.id);\n if (elem) {\n this.renderer.setProperty(elem, 'disabled', isDisabled);\n }\n }\n\n /** Focuses the native input element and marks the control as touched. */\n onContainerClick(): void {\n if (!this.focused) {\n if (!SystemUtils.isBrowser()) return;\n const elem = document.getElementById(this.id);\n if (elem) {\n elem.focus();\n this.propagateTouched();\n }\n }\n }\n\n /**\n * Checks whether the value has changed since the last dirty check and emits `stateChanges` if needed.\n */\n protected updateInputDirtyCheck(): void {\n const newValue = this._value;\n if (this.previousNativeValue !== newValue) {\n this.previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }\n\n /**\n * Handles file selection from the native input element.\n * @param e - The DOM change event from the file input.\n */\n protected selectFile(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n const f = input.files[0];\n const fileInfo = new FileInfo();\n const fileSizeMb = f.size / 1048576;\n fileInfo.file = f;\n fileInfo.valid =\n (!this.maxSizeMb() || fileSizeMb <= this.maxSizeMb()) &&\n (!this.minSizeMb() || fileSizeMb >= this.minSizeMb());\n this.setValue(fileInfo, true);\n this.fileName.set(f.name);\n this.fileSize.set(Math.round(fileSizeMb));\n }\n }\n\n /**\n * Checks whether a file is currently selected.\n * @returns `true` if a file is attached to the current value.\n */\n protected hasFile(): boolean {\n return !!(this._value?.file);\n }\n\n /**\n * Clears the currently selected file and resets the control.\n */\n protected clearFile(): void {\n if (this.hasFile()) {\n this.fileName.set(undefined);\n this.fileSize.set(0);\n const fi = new FileInfo();\n fi.file = undefined;\n fi.valid = !this.required;\n this.setValue(fi, true);\n this.__file().nativeElement.value = '';\n }\n }\n\n /**\n * Emits the `download` output event if the file is not newly added.\n */\n protected downloadFile(): void {\n if (!this.isNew()) this.download.emit();\n }\n\n /**\n * Emits the `preview` output event if the file is not new and preview is enabled.\n */\n protected previewFile(): void {\n if (!this.isNew() && this.canPreview()) this.preview.emit();\n }\n}\n","<mat-form-field style=\"width:100%\" [appearance]=\"appearance()\">\n <mat-label>{{placeholder}}</mat-label>\n <input type=\"file\" [hidden]=\"true\" [accept]=\"accept()\" (change)=\"selectFile($event)\" #__file />\n <input [formField]=\"nameForm.name\" [id]=\"id\" matInput />\n @if (hasFile()) {\n <button type=\"button\" tabindex=\"-1\" mat-icon-button matSuffix aria-label=\"Azzera\" (click)=\"clearFile()\" [disabled]=\"disabled\">\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (!disabled) {\n <button type=\"button\" type=\"button\" mat-icon-button matSuffix (click)=\"__file.click()\" aria-label=\"Seleziona file\"\n matTooltip=\"Seleziona\" [disabled]=\"disabled\">\n <mat-icon>add</mat-icon>\n </button>\n }\n @if (!isNew() && canPreview()) {\n <button type=\"button\" mat-icon-button matSuffix (click)=\"previewFile()\" aria-label=\"Anteprima\" matTooltip=\"Anteprima\" [disabled]=\"disabled\">\n <mat-icon>preview</mat-icon>\n </button>\n }\n @if (!isNew()) {\n <button type=\"button\" mat-icon-button matSuffix (click)=\"downloadFile()\" aria-label=\"Scarica file\"\n matTooltip=\"Scarica\" [disabled]=\"disabled\">\n <mat-icon>save_alt</mat-icon>\n </button>\n }\n @if (hasFile() && fileSize() > 0) {\n <mat-hint align=\"start\">{{fileSize()}} MB</mat-hint>\n }\n @if (hasFile() && fileSize() == 0) {\n <mat-hint align=\"start\">\n &gt; 1 MB</mat-hint>\n } @if (maxSizeMb()) {\n <mat-hint align=\"end\">Massimo {{maxSizeMb()}} MB\n </mat-hint>\n }\n @if (nameForm.name().invalid() && !hasFile()) {\n <mat-error>Obbligatorio.</mat-error>\n }\n @if (nameForm.name().invalid() && hasFile()) {\n <mat-error>Dimensione non consentita.</mat-error>\n }\n</mat-form-field>","import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, signal, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog';\nimport { SafeUrlPipe } from '@arsedizioni/ars-utils/core';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\n\nexport interface FilePreviewDialogData {\n url?: string;\n embed?: boolean;\n authToken?: string;\n}\n\n\n@Component({\n templateUrl: './file-preview.component.html',\n styleUrl: './file-preview.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogContent, FlexLayoutModule, MatDialogActions, MatButtonModule, MatTooltipModule,\n MatDialogClose, SafeUrlPipe]\n})\nexport class FilePreviewComponent {\n readonly iframe = viewChild<ElementRef>('iframe');\n private readonly httpClient = inject(HttpClient);\n private readonly dialogService = inject(DialogService);\n protected readonly dialogData = inject<FilePreviewDialogData>(MAT_DIALOG_DATA) ?? {};\n protected readonly url = signal<string | null>(null);\n\n constructor() {\n // Revoke the blob object URL on destroy: createObjectURL keeps the whole\n // downloaded blob alive until revoked — repeated previews leaked memory.\n inject(DestroyRef).onDestroy(() => {\n const u = this.url();\n if (u?.startsWith('blob:')) URL.revokeObjectURL(u);\n });\n\n const data = this.dialogData;\n if (!data?.url) return;\n\n if (!data.embed) {\n this.dialogService.setBusy('Download in corso...');\n this.httpClient.get(data.url, {\n headers: data.authToken\n ? new HttpHeaders().set('Authorization', data.authToken)\n : new HttpHeaders(),\n responseType: 'blob'\n })\n .pipe(takeUntilDestroyed())\n .subscribe({\n next: (res: Blob) => {\n this.url.set(URL.createObjectURL(res));\n this.dialogService.clearBusy();\n },\n error: () => {\n this.dialogService.clearBusy();\n }\n });\n } else {\n this.url.set('https://view.officeapps.live.com/op/embed.aspx?src=' + encodeURIComponent(data.url));\n }\n }\n\n /**\n * Handles the iframe load event: scrolls to the top and centers a single image when present.\n */\n protected loaded(): void {\n const iframe = this.iframe()?.nativeElement;\n if (!iframe) { return; }\n \n try {\n iframe.contentWindow?.scrollTo(0, 0);\n \n // Resize and center single image\n if (!this.dialogData?.embed && iframe.contentDocument) { \n const images = iframe.contentDocument.querySelectorAll('img') || [];\n if (images.length === 1) { \n Object.assign(images[0].style, {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n maxWidth: images[0].style.maxWidth || '100%',\n maxHeight: images[0].style.maxHeight || '100%'\n });\n const iframeBody = iframe.contentDocument.body;\n if (iframeBody && !iframeBody.style.height) {\n iframeBody.style.height = '100%';\n }\n }\n }\n } catch (e) {\n console.error('Impossibile accedere al contenuto dell\\'iframe:', e);\n }\n }\n\n /**\n * Opens the current file URL in a new browser tab for manual download.\n */\n protected download(): void {\n const currentUrl = this.url();\n if (currentUrl) {\n window.open(currentUrl, '_blank');\n }\n }\n\n /**\n * Displays a help dialog with browser-specific instructions for enabling PDF preview.\n */\n protected troubles(): void {\n this.dialogService.info(\n \"<p>Se non riesci a visualizzare l'anteprima dei file PDF probabilmente devi abilitare un'impostazione del tuo browser.</p>\" +\n \"<b>Per Google Chrome</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > privacy e sicurezza > impostazioni sito > documenti PDF</i></p>\" +\n \"<b>Per Microsoft Edge</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > cookie e autorizzazioni sito > documenti PDF</i></p>\" +\n \"<b>Per Mozilla Firefox</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > generale > applicazioni</i></p>\" +\n \"<b>Altri browser</b><br>\" +\n \"<p class='small' style='padding-left:10px'>Fate riferimento alla documentazione specifica del vostro browser.</p>\",\n \"Problemi con le anteprime dei file PDF?\"\n )\n }\n}\n\n\n\n","<mat-dialog-content class=\"file-preview\" id=\"file-preview-scrollable\">\r\n <div class=\"content\">\r\n @if (!url()) {\r\n <div class=\"loading\">Caricamento in corso...</div>\r\n } @else {\r\n <iframe class=\"iframe\" #iframe (load)=\"loaded()\" [src]=\"url() | safeUrl\"></iframe>\r\n }\r\n </div>\r\n</mat-dialog-content>\r\n<mat-dialog-actions id=\"file-preview-fixed\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"50\">\r\n <button mat-stroked-button (click)=\"troubles()\"\r\n matTooltip=\"Fai click se non riesci a visualizzare l'anteprima dei file PDF\">Problemi con i PDF?</button>\r\n </div>\r\n <div fxFlex=\"50\" fxLayoutAlign=\"end\">\r\n <button mat-stroked-button (click)=\"download()\">Scarica</button>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n </div>\r\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\nimport { FlexLayoutModule, SelectFile, SelectFileDialogData } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\n\n@Component({\n templateUrl: './select-file-dialog.component.html',\n styleUrl: './select-file-dialog.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\n})\nexport class SelectFileDialogComponent {\n readonly done = output<SelectFile>();\n private readonly dialogService = inject(DialogService);\n private readonly dialogRef = inject(MatDialogRef<SelectFileDialogComponent>);\n protected readonly dialogData = signal<SelectFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\n protected readonly file = signal<File | undefined>(undefined);\n protected fileClass = signal<'selectfile-file' | 'selectfile-file-drop'>('selectfile-file');\n\n /**\n * Handles the native file input change event and delegates to `selectFile`.\n * @param e - The DOM change event from the file input.\n */\n protected update(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n this.selectFile(input.files[0]);\n }\n }\n\n /**\n * Validates and sets the selected file, showing an error if size or type constraints are violated.\n * @param file - The `File` object to validate and store.\n */\n private selectFile(file: File): void {\n const data = this.dialogData();\n const maxSize = data.maxSize ?? 0;\n if (maxSize > 0) {\n const size = file.size / 1048576;\n if (size > maxSize) {\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\n return;\n }\n }\n if (data.accept) {\n const accept = data.accept.toLowerCase();\n const a = file.name.split('.').pop()?.toLowerCase();\n let b = file.type.toLowerCase();\n if (b.startsWith('image/') && accept.includes('image/*')) {\n b = 'image/*';\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\n b = 'video/*';\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\n b = 'audio/*';\n }\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\n return;\n }\n }\n this.file.set(file);\n }\n\n /**\n * Formats a byte count into a human-readable size string.\n * @param size - File size in bytes.\n * @returns A formatted size string (e.g. \"1.2 MB\").\n */\n protected size(size: number): string {\n return SystemUtils.formatFileSize(size);\n }\n\n /** Emits the selected file and options, then closes the dialog. */\n protected ok(): void {\n this.done.emit({ file: this.file(), options: this.dialogData().options });\n setTimeout(() => {\n this.dialogRef.close();\n }, 500);\n }\n\n /** Highlights the drop zone when a drag enters the area.\n * @param e - The drag event.\n */\n protected onDragOver(e: DragEvent): void {\n this.fileClass.set('selectfile-file-drop');\n e.preventDefault();\n }\n\n /** Highlights the drop zone when a dragged item enters.\n * @param e - The drag event.\n */\n protected onDragEnter(e: DragEvent): void {\n this.fileClass.set('selectfile-file-drop');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when dragging ends.\n * @param e - The drag event.\n */\n protected onDragEnd(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when a dragged item leaves the area.\n * @param e - The drag event.\n */\n protected onDragLeave(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n }\n\n /**\n * Handles a file drop event, extracting and processing the dropped files.\n * @param e - The drop event.\n */\n protected onDrop(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer?.files?.length) {\n this.addFiles(e.dataTransfer.files);\n }\n }\n\n /**\n * Picks the first file from the list and passes it to `selectFile`.\n * @param files - The `FileList` from the drag-and-drop event.\n */\n private addFiles(files: FileList): void {\n if (files.length > 0) {\n this.selectFile(files[0]);\n }\n }\n}\n\n","<div mat-dialog-title [innerHTML]=\"dialogData().title | safeHtml\"></div>\n@if (dialogData().description) {\n<div class=\"selectfile-description\" [innerHtml]=\"dialogData().description | safeHtml\"></div>\n}\n<mat-dialog-content class=\"dialog-content\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"*\" [class]=\"fileClass()\" (drop)=\"onDrop($event)\" (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\" (dragenter)=\"onDragEnter($event)\" (dragend)=\"onDragEnd($event)\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"10px\" fxFlexAlign=\"start\" class=\"x-small secondary\"><i>Trascina qui il file o selezionalo</i></div>\n <div>\n <input #_file type=\"file\" [accept]=\"dialogData().accept\" [hidden]=\"true\" (change)=\"update($event)\" />\n <button type=\"button\" mat-stroked-button (click)=\"_file.click()\">Seleziona file...</button>\n </div>\n @if (file()) {\n <div style=\"padding:0 24px\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\n <div class=\"small accent bold\"><i>{{file().name}}</i></div>\n <div class=\"small\">Dimensioni: <i>{{size(file().size)}}</i></div>\n </div>\n </div>\n }\n </div>\n </div>\n @if (dialogData().options) {\n <div style=\"padding-bottom: 24px;\">\n @for (o of dialogData().options; track o; let i = $index) {\n <div>\n <mat-checkbox (change)=\"o.selected = $event.checked\" [checked]=\"o.selected === true\" name=\"opt_{{i}}\" >\n {{o.description}}\n </mat-checkbox>\n </div>\n }\n </div>\n }\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"50\">\n @if (dialogData().helpLink) {\n <a mat-stroked-button href=\"{{dialogData().helpLink}}\" target=\"_blank\">{{dialogData().helpCaption}}</a>\n }\n </div>\n <div fxFlex=\"50\" fxLayoutAlign=\"end\">\n <button mat-flat-button (click)=\"ok()\" [disabled]=\"!file()\">{{dialogData().okCaption}}</button>\n <button mat-stroked-button [mat-dialog-close]=\"true\">Annulla</button>\n </div>\n </div>\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\nimport { FlexLayoutModule, SelectFile, SelectPictureFileDialogData } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog';\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\n\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n templateUrl: './select-picture-dialog.component.html',\n styleUrl: './select-picture-dialog.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\n})\nexport class SelectPictureDialogComponent {\n readonly done = output<SelectFile>();\n private readonly dialogService = inject(DialogService);\n private readonly dialogRef = inject(MatDialogRef<SelectPictureDialogComponent>);\n protected readonly dialogData = signal<SelectPictureFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\n protected readonly file = signal<File | undefined>(undefined);\n protected fileClass = signal<'selectpicture-file' | 'selectpicture-file-drop'>('selectpicture-file');\n protected pictureWidth = signal<number>(0);\n protected pictureHeight = signal<number>(0);\n protected picturePreview = signal<any>(undefined);\n\n /**\n * Handles the native file input change event and delegates to `selectFile`.\n * @param e - The DOM change event from the file input.\n */\n protected update(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n this.selectFile(input.files[0]);\n }\n }\n\n /**\n * Validates the file size and type, then reads it as a data URL to generate a preview.\n * @param file - The `File` object to validate and preview.\n */\n private selectFile(file: File): void {\n const data = this.dialogData();\n const maxSize = data.maxSize ?? 0;\n if (maxSize > 0) {\n const size = file.size / 1048576;\n if (size > maxSize) {\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\n return;\n }\n }\n if (data.accept) {\n const accept = data.accept.toLowerCase();\n const a = file.name.split('.').pop()?.toLowerCase();\n let b = file.type.toLowerCase();\n if (b.startsWith('image/') && accept.includes('image/*')) {\n b = 'image/*';\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\n b = 'video/*';\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\n b = 'audio/*';\n }\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\n return;\n }\n }\n const reader = new FileReader();\n reader.onload = (_e: ProgressEvent<FileReader>) => {\n const img = new Image();\n img.onload = () => {\n const maxWidth = data.maxWidth ?? 0;\n if (maxWidth > 0 && img.width > maxWidth) {\n this.dialogService.error(`Immagine troppo larga (massimo ${maxWidth} pixel)`);\n return;\n }\n const maxHeight = data.maxHeight ?? 0;\n if (maxHeight > 0 && img.height > maxHeight) {\n this.dialogService.error(`Immagine troppo alta (massimo ${maxHeight} pixel)`);\n return;\n }\n this.pictureWidth.set(img.width);\n this.pictureHeight.set(img.height);\n this.picturePreview.set((_e.target as FileReader).result);\n this.file.set(file);\n };\n img.src = (_e.target as FileReader).result as string;\n };\n reader.readAsDataURL(file);\n }\n\n /**\n * Formats a byte count into a human-readable size string.\n * @param size - File size in bytes.\n * @returns A formatted size string (e.g. \"1.2 MB\").\n */\n protected size(size: number): string {\n return SystemUtils.formatFileSize(size);\n }\n\n /** Emits the selected file and options, then closes the dialog. */\n protected ok(): void {\n this.done.emit({ file: this.file(), options: this.dialogData().options });\n setTimeout(() => {\n this.dialogRef.close();\n }, 500);\n }\n\n /** Highlights the drop zone when a dragged item is over it.\n * @param e - The drag event.\n */\n protected onDragOver(e: DragEvent): void {\n this.fileClass.set('selectpicture-file-drop');\n e.preventDefault();\n }\n\n /** Highlights the drop zone when a dragged item enters.\n * @param e - The drag event.\n */\n protected onDragEnter(e: DragEvent): void {\n this.fileClass.set('selectpicture-file-drop');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when dragging ends.\n * @param e - The drag event.\n */\n protected onDragEnd(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when a dragged item leaves.\n * @param e - The drag event.\n */\n protected onDragLeave(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n }\n\n /**\n * Handles a file drop event, extracting and processing the dropped image.\n * @param e - The drop event.\n */\n protected onDrop(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer?.files?.length) {\n this.addFiles(e.dataTransfer.files);\n }\n }\n\n /**\n * Picks the first file from the list and passes it to `selectFile`.\n * @param files - The `FileList` from the drag-and-drop event.\n */\n private addFiles(files: FileList): void {\n if (files.length > 0) {\n this.selectFile(files[0]);\n }\n }\n}\n\n","<div mat-dialog-title [innerHTML]=\"dialogData().title | safeHtml\"></div>\n@if (dialogData().description) {\n<div class=\"selectpicture-description\" [innerHtml]=\"dialogData().description | safeHtml\"></div>\n}\n<mat-dialog-content class=\"dialog-content\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\" fxFill>\n <div fxFlex=\"*\" [class]=\"fileClass()\" (drop)=\"onDrop($event)\" (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\" (dragenter)=\"onDragEnter($event)\" (dragend)=\"onDragEnd($event)\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"10px\" fxFlexAlign=\"start\" class=\"x-small secondary\"><i>Trascina qui l'immagine o selezionala</i></div>\n <div>\n <input #_file type=\"file\" [hidden]=\"true\" [accept]=\"dialogData().accept ?? 'image/*'\"\n (change)=\"update($event)\" />\n <button type=\"button\" mat-stroked-button (click)=\"_file.click()\">Seleziona file...</button>\n </div>\n @if (file()) {\n <div style=\"padding:0 24px\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\n <img [src]=\"picturePreview()\" class=\"selectpicture-preview\">\n <div class=\"small accent bold \"><i>{{file().name}}</i></div>\n <div class=\"small\">Dimensioni:<i>{{pictureWidth()}} x {{pictureHeight()}} ({{size(file().size)}})</i></div>\n </div>\n </div>\n }\n </div>\n </div>\n @if (dialogData().options) {\n <div style=\"padding-bottom: 24px;\">\n @for (o of dialogData().options; track o; let i = $index) {\n <div>\n <mat-checkbox (change)=\"o.selected = $event.checked\" [checked]=\"o.selected === true\" name=\"opt_{{i}}\" >\n {{o.description}}\n </mat-checkbox>\n </div>\n }\n </div>\n }\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\n <button mat-flat-button (click)=\"ok()\" [disabled]=\"!file()\">{{dialogData().okCaption}}</button>\n <button mat-stroked-button mat-dialog-close >Annulla</button>\n </div>\n</mat-dialog-actions>\n","/*\n * Public API Surface of @arsedizioni/ars-utils/ui.files\n */\nexport * from './file-input/file-input.component';\nexport * from './file-preview/file-preview.component';\nexport * from './select-file/select-file-dialog.component';\nexport * from './select-picture/select-picture-dialog.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["requiredSchema","disabledSchema","i4","i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;MA6Ba,kBAAkB,CAAA;;aActB,IAAA,CAAA,MAAM,GAAG,CAAH,CAAK;IAelB,IAAI,KAAK,CAAC,KAAe,EAAA;AACvB,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IAC5B;AAEA;;;;;;AAMG;IACK,QAAQ,CAAC,KAAe,EAAE,SAAkB,EAAA;AAClD,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;QACnB,IAAI,SAAS,EAAE;AACb,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QACnC;AACA,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChC;AACA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;AACA,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI;IAChC;AAIA,IAAA,IACI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;IACzB;IACA,IAAI,QAAQ,CAAC,KAAc,EAAA;QACzB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAChD,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC1B;AAGA,IAAA,IACI,QAAQ,GAAA;AACV,QAAA,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,IAAI,EAAE;AACrD,YAAA,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ;QAChC;AACA,QAAA,OAAO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,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB;AAC9F,wBAAA,gBAAgB,EAAE,cAAc,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,utEAAA,EAAA,MAAA,EAAA,CAAA,23JAAA,CAAA,EAAA;;;AEfnD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"arsedizioni-ars-utils-ui.files.mjs","sources":["../../../projects/ars-utils/ui.files/file-input/file-input.component.ts","../../../projects/ars-utils/ui.files/file-input/file-input.component.html","../../../projects/ars-utils/ui.files/file-preview/file-preview.component.ts","../../../projects/ars-utils/ui.files/file-preview/file-preview.component.html","../../../projects/ars-utils/ui.files/select-file/select-file-dialog.component.ts","../../../projects/ars-utils/ui.files/select-file/select-file-dialog.component.html","../../../projects/ars-utils/ui.files/select-picture/select-picture-dialog.component.ts","../../../projects/ars-utils/ui.files/select-picture/select-picture-dialog.component.html","../../../projects/ars-utils/ui.files/public_api.ts","../../../projects/ars-utils/ui.files/arsedizioni-ars-utils-ui.files.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { afterNextRender, ChangeDetectionStrategy, Component, DoCheck, effect, ElementRef, Input, OnDestroy, Optional, Renderer2, Self, inject, input, model, output, signal, viewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { FormField, disabled as disabledSchema, form, required as requiredSchema } from '@angular/forms/signals';\nimport { fileSize as fileSizeSchema, notEmpty, SignalsUtils } from '@arsedizioni/ars-utils/core.validators';\nimport { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';\nimport { FileInfo, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { Subject } from 'rxjs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { UIService } from '@arsedizioni/ars-utils/ui';\n\n@Component({\n selector: 'file-input',\n templateUrl: './file-input.component.html',\n styleUrl: './file-input.component.scss',\n providers: [{ provide: MatFormFieldControl, useExisting: FileInputComponent }],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatFormFieldModule, MatInputModule, FormField, MatButtonModule,\n MatIconModule, MatTooltipModule],\n host: {\n '[id]': 'id',\n '[class.floating]': 'shouldLabelFloat',\n '[attr.aria-describedBy]': 'describedBy',\n },\n})\nexport class FileInputComponent\n implements\n OnDestroy,\n DoCheck,\n MatFormFieldControl<FileInfo>,\n ControlValueAccessor {\n /** Error text of a field: the message declared in the schema, or the shared fallback. */\n protected readonly getFieldErrorMessage = SignalsUtils.getFieldErrorMessage;\n\n\n /** Reference to the hidden native file input element. */\n protected readonly __file = viewChild.required<ElementRef>('__file');\n\n private readonly renderer = inject(Renderer2);\n private readonly uiService = inject(UIService);\n\n // Initialize\n static nextId = 0;\n readonly stateChanges = new Subject<void>();\n private previousNativeValue: any;\n controlType: string = 'file-input';\n focused = false;\n\n /** Whether the device supports camera capture. */\n protected readonly canCapture = signal<boolean>(false);\n\n /** Size in MB of the currently selected file. */\n protected readonly fileSize = signal<number>(0);\n\n private readonly _placeholder = signal<string>('');\n\n private _value: FileInfo = new FileInfo();\n set value(value: FileInfo) {\n this.setValue(value, true);\n }\n\n /**\n * Updates the internal state. Form propagation is skipped for model->view\n * writes (writeValue) to avoid the CVA echo loop, and performed for\n * user-driven changes (selectFile/clearFile) and the public value setter.\n * @param value - The new file info to store and display.\n * @param propagate - When `true`, notifies the registered onChange callback.\n */\n private setValue(value: FileInfo, propagate: boolean): void {\n this._value = value;\n if (propagate) {\n this.propagateChange(this._value);\n }\n this.stateChanges.next();\n this.changed.emit(this._value);\n }\n get value() {\n return this._value;\n }\n get size() {\n return this._value?.file?.size;\n }\n\n /** Backing signal so the internal form schema reacts to `required` changes. */\n private readonly _required = signal<boolean>(false);\n @Input()\n get required() {\n return this._required();\n }\n set required(value: boolean) {\n this._required.set(coerceBooleanProperty(value));\n this.stateChanges.next();\n }\n /** Backing signal so the internal form schema reacts to `disabled` changes. */\n private readonly _disabled = signal<boolean>(false);\n @Input()\n get disabled() {\n if (this.ngControl && this.ngControl.disabled != null) {\n return this.ngControl.disabled;\n }\n return this._disabled();\n }\n set disabled(value: boolean) {\n this._disabled.set(coerceBooleanProperty(value));\n if (this.focused) {\n this.focused = false;\n this.stateChanges.next();\n }\n }\n @Input()\n get placeholder(): string {\n return this._placeholder();\n }\n set placeholder(value: string) {\n this._placeholder.set(value);\n this.stateChanges.next();\n }\n\n /** The currently displayed file name. Can be bound two-way from outside or updated on file selection. */\n readonly fileName = model<string | undefined>(undefined);\n readonly maxSizeMb = input<number>(5);\n readonly minSizeMb = input<number>(0);\n readonly isNew = input<boolean>(false);\n readonly canPreview = input<boolean>(false);\n readonly appearance = input<'fill' | 'outline' | undefined>(this.uiService.appearance());\n readonly accept = input<string>();\n get empty(): boolean {\n return !this._value || !this._value.file;\n }\n /** True when the control has validation errors and has been touched. */\n get errorState(): boolean {\n return (this.ngControl?.errors != null) && (this.ngControl?.touched ?? false);\n }\n\n id = `${this.controlType}-${FileInputComponent.nextId++}`;\n\n /** True when the label should float above the field. */\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n describedBy = '';\n\n readonly changed = output<FileInfo>();\n readonly download = output();\n readonly preview = output();\n\n /** Model backing the internal display form: the (readonly) file-name text. */\n private readonly nameModel = signal<{ name: string }>({ name: '' });\n\n /**\n * Internal signal form for the file-name input. It reproduces the previous\n * template-driven validators: `required` follows the `required` input and the\n * size rule mirrors FileSizeValidatorDirective (empty name is left to `required`).\n */\n protected readonly nameForm = form(this.nameModel, p => {\n requiredSchema(p.name, { when: () => this._required() });\n notEmpty(p.name, { when: () => this._required() });\n // The outer-form path is covered by setDisabledState, which writes the DOM directly.\n disabledSchema(p.name, () => this._disabled());\n // The shared rule, so the message comes from the same table as everywhere else.\n fileSizeSchema(p.name, () => this.fileSize(), () => this.maxSizeMb(), () => this.minSizeMb());\n });\n\n private propagateChange: (_: any) => void = (_: any) => { };\n private propagateTouched: () => void = () => { };\n\n\n constructor(\n @Optional() @Self() public ngControl: NgControl) {\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n\n // Keep the internal form model in sync with the two-way bindable fileName.\n effect(() => this.nameModel.set({ name: this.fileName() ?? '' }));\n\n // Detect camera availability and set the default placeholder after the first render.\n // The file-name input is also made read-only imperatively: marking the field as\n // readonly in the form schema would skip its validation entirely by design.\n afterNextRender(() => {\n this.setupDevices();\n const elem = document.getElementById(this.id);\n if (elem) {\n this.renderer.setProperty(elem, 'readOnly', true);\n }\n });\n }\n\n /**\n * Detects camera availability and updates the placeholder accordingly.\n */\n private async setupDevices(): Promise<void> {\n this.canCapture.set(false);\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n if (stream) {\n this.canCapture.set(true);\n }\n } catch { }\n }\n if (!this.placeholder || this.placeholder === 'Seleziona file') {\n this._placeholder.set(\n this.canCapture()\n ? 'Seleziona file o acquisisci con fotocamera'\n : 'Seleziona file'\n );\n }\n }\n\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n ngDoCheck(): void {\n this.updateInputDirtyCheck();\n }\n\n /**\n * Writes a new value to the component (called by the form layer).\n * @param value - The new file info to display.\n */\n writeValue(value: any): void {\n // Model -> view write: must NOT propagate back to the form (echo loop)\n this.setValue(value as FileInfo, false);\n }\n\n /**\n * Registers the on-change callback (called by the form layer).\n * @param fn - Callback to invoke whenever the value changes.\n */\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n /**\n * Registers the on-touched callback (called by the form layer).\n * @param fn - Callback to invoke when the control is touched.\n */\n registerOnTouched(fn: any): void {\n this.propagateTouched = fn;\n }\n\n /**\n * Sets the ARIA describedby attribute from the given element IDs.\n * @param ids - Array of element IDs that describe this control.\n */\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n }\n\n /**\n * Updates the disabled state of the underlying native element.\n * @param isDisabled - Whether the control should be disabled.\n */\n setDisabledState?(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n if (!SystemUtils.isBrowser()) return;\n const elem = document.getElementById(this.id);\n if (elem) {\n this.renderer.setProperty(elem, 'disabled', isDisabled);\n }\n }\n\n /** Focuses the native input element and marks the control as touched. */\n onContainerClick(): void {\n if (!this.focused) {\n if (!SystemUtils.isBrowser()) return;\n const elem = document.getElementById(this.id);\n if (elem) {\n elem.focus();\n this.propagateTouched();\n }\n }\n }\n\n /**\n * Checks whether the value has changed since the last dirty check and emits `stateChanges` if needed.\n */\n protected updateInputDirtyCheck(): void {\n const newValue = this._value;\n if (this.previousNativeValue !== newValue) {\n this.previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }\n\n /**\n * Handles file selection from the native input element.\n * @param e - The DOM change event from the file input.\n */\n protected selectFile(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n const f = input.files[0];\n const fileInfo = new FileInfo();\n const fileSizeMb = f.size / 1048576;\n fileInfo.file = f;\n fileInfo.valid =\n (!this.maxSizeMb() || fileSizeMb <= this.maxSizeMb()) &&\n (!this.minSizeMb() || fileSizeMb >= this.minSizeMb());\n this.setValue(fileInfo, true);\n this.fileName.set(f.name);\n this.fileSize.set(Math.round(fileSizeMb));\n }\n }\n\n /**\n * Checks whether a file is currently selected.\n * @returns `true` if a file is attached to the current value.\n */\n protected hasFile(): boolean {\n return !!(this._value?.file);\n }\n\n /**\n * Clears the currently selected file and resets the control.\n */\n protected clearFile(): void {\n if (this.hasFile()) {\n this.fileName.set(undefined);\n this.fileSize.set(0);\n const fi = new FileInfo();\n fi.file = undefined;\n fi.valid = !this.required;\n this.setValue(fi, true);\n this.__file().nativeElement.value = '';\n }\n }\n\n /**\n * Emits the `download` output event if the file is not newly added.\n */\n protected downloadFile(): void {\n if (!this.isNew()) this.download.emit();\n }\n\n /**\n * Emits the `preview` output event if the file is not new and preview is enabled.\n */\n protected previewFile(): void {\n if (!this.isNew() && this.canPreview()) this.preview.emit();\n }\n}\n","<mat-form-field style=\"width:100%\" [appearance]=\"appearance()\">\n <mat-label>{{placeholder}}</mat-label>\n <input type=\"file\" [hidden]=\"true\" [accept]=\"accept()\" (change)=\"selectFile($event)\" #__file />\n <input [formField]=\"nameForm.name\" [id]=\"id\" matInput />\n @if (hasFile()) {\n <button type=\"button\" tabindex=\"-1\" mat-icon-button matSuffix aria-label=\"Azzera\" (click)=\"clearFile()\" [disabled]=\"disabled\">\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (!disabled) {\n <button type=\"button\" type=\"button\" mat-icon-button matSuffix (click)=\"__file.click()\" aria-label=\"Seleziona file\"\n matTooltip=\"Seleziona\" [disabled]=\"disabled\">\n <mat-icon>add</mat-icon>\n </button>\n }\n @if (!isNew() && canPreview()) {\n <button type=\"button\" mat-icon-button matSuffix (click)=\"previewFile()\" aria-label=\"Anteprima\" matTooltip=\"Anteprima\" [disabled]=\"disabled\">\n <mat-icon>preview</mat-icon>\n </button>\n }\n @if (!isNew()) {\n <button type=\"button\" mat-icon-button matSuffix (click)=\"downloadFile()\" aria-label=\"Scarica file\"\n matTooltip=\"Scarica\" [disabled]=\"disabled\">\n <mat-icon>save_alt</mat-icon>\n </button>\n }\n @if (hasFile() && fileSize() > 0) {\n <mat-hint align=\"start\">{{fileSize()}} MB</mat-hint>\n }\n @if (hasFile() && fileSize() == 0) {\n <mat-hint align=\"start\">\n &gt; 1 MB</mat-hint>\n } @if (maxSizeMb()) {\n <mat-hint align=\"end\">Massimo {{maxSizeMb()}} MB\n </mat-hint>\n }\n @if (nameForm.name().invalid()) {\n <mat-error>{{ getFieldErrorMessage(nameForm.name().errors()) }}</mat-error>\n }\n</mat-form-field>","import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, signal, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog';\nimport { SafeUrlPipe } from '@arsedizioni/ars-utils/core';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\n\nexport interface FilePreviewDialogData {\n url?: string;\n embed?: boolean;\n authToken?: string;\n}\n\n\n@Component({\n templateUrl: './file-preview.component.html',\n styleUrl: './file-preview.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogContent, FlexLayoutModule, MatDialogActions, MatButtonModule, MatTooltipModule,\n MatDialogClose, SafeUrlPipe]\n})\nexport class FilePreviewComponent {\n readonly iframe = viewChild<ElementRef>('iframe');\n private readonly httpClient = inject(HttpClient);\n private readonly dialogService = inject(DialogService);\n protected readonly dialogData = inject<FilePreviewDialogData>(MAT_DIALOG_DATA) ?? {};\n protected readonly url = signal<string | null>(null);\n\n constructor() {\n // Revoke the blob object URL on destroy: createObjectURL keeps the whole\n // downloaded blob alive until revoked — repeated previews leaked memory.\n inject(DestroyRef).onDestroy(() => {\n const u = this.url();\n if (u?.startsWith('blob:')) URL.revokeObjectURL(u);\n });\n\n const data = this.dialogData;\n if (!data?.url) return;\n\n if (!data.embed) {\n this.dialogService.setBusy('Download in corso...');\n this.httpClient.get(data.url, {\n headers: data.authToken\n ? new HttpHeaders().set('Authorization', data.authToken)\n : new HttpHeaders(),\n responseType: 'blob'\n })\n .pipe(takeUntilDestroyed())\n .subscribe({\n next: (res: Blob) => {\n this.url.set(URL.createObjectURL(res));\n this.dialogService.clearBusy();\n },\n error: () => {\n this.dialogService.clearBusy();\n }\n });\n } else {\n this.url.set('https://view.officeapps.live.com/op/embed.aspx?src=' + encodeURIComponent(data.url));\n }\n }\n\n /**\n * Handles the iframe load event: scrolls to the top and centers a single image when present.\n */\n protected loaded(): void {\n const iframe = this.iframe()?.nativeElement;\n if (!iframe) { return; }\n \n try {\n iframe.contentWindow?.scrollTo(0, 0);\n \n // Resize and center single image\n if (!this.dialogData?.embed && iframe.contentDocument) { \n const images = iframe.contentDocument.querySelectorAll('img') || [];\n if (images.length === 1) { \n Object.assign(images[0].style, {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n maxWidth: images[0].style.maxWidth || '100%',\n maxHeight: images[0].style.maxHeight || '100%'\n });\n const iframeBody = iframe.contentDocument.body;\n if (iframeBody && !iframeBody.style.height) {\n iframeBody.style.height = '100%';\n }\n }\n }\n } catch (e) {\n console.error('Impossibile accedere al contenuto dell\\'iframe:', e);\n }\n }\n\n /**\n * Opens the current file URL in a new browser tab for manual download.\n */\n protected download(): void {\n const currentUrl = this.url();\n if (currentUrl) {\n window.open(currentUrl, '_blank');\n }\n }\n\n /**\n * Displays a help dialog with browser-specific instructions for enabling PDF preview.\n */\n protected troubles(): void {\n this.dialogService.info(\n \"<p>Se non riesci a visualizzare l'anteprima dei file PDF probabilmente devi abilitare un'impostazione del tuo browser.</p>\" +\n \"<b>Per Google Chrome</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > privacy e sicurezza > impostazioni sito > documenti PDF</i></p>\" +\n \"<b>Per Microsoft Edge</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > cookie e autorizzazioni sito > documenti PDF</i></p>\" +\n \"<b>Per Mozilla Firefox</b><br>\" +\n \"<p class='small' style='padding-left:10px'><i>impostazioni > generale > applicazioni</i></p>\" +\n \"<b>Altri browser</b><br>\" +\n \"<p class='small' style='padding-left:10px'>Fate riferimento alla documentazione specifica del vostro browser.</p>\",\n \"Problemi con le anteprime dei file PDF?\"\n )\n }\n}\n\n\n\n","<mat-dialog-content class=\"file-preview\" id=\"file-preview-scrollable\">\r\n <div class=\"content\">\r\n @if (!url()) {\r\n <div class=\"loading\">Caricamento in corso...</div>\r\n } @else {\r\n <iframe class=\"iframe\" #iframe (load)=\"loaded()\" [src]=\"url() | safeUrl\"></iframe>\r\n }\r\n </div>\r\n</mat-dialog-content>\r\n<mat-dialog-actions id=\"file-preview-fixed\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"10px\" fxFill>\r\n <div fxFlex=\"50\">\r\n <button mat-stroked-button (click)=\"troubles()\"\r\n matTooltip=\"Fai click se non riesci a visualizzare l'anteprima dei file PDF\">Problemi con i PDF?</button>\r\n </div>\r\n <div fxFlex=\"50\" fxLayoutAlign=\"end\">\r\n <button mat-stroked-button (click)=\"download()\">Scarica</button>\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" >Chiudi</button>\r\n </div>\r\n </div>\r\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\nimport { FlexLayoutModule, SelectFile, SelectFileDialogData } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\n\n@Component({\n templateUrl: './select-file-dialog.component.html',\n styleUrl: './select-file-dialog.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\n})\nexport class SelectFileDialogComponent {\n readonly done = output<SelectFile>();\n private readonly dialogService = inject(DialogService);\n private readonly dialogRef = inject(MatDialogRef<SelectFileDialogComponent>);\n protected readonly dialogData = signal<SelectFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\n protected readonly file = signal<File | undefined>(undefined);\n protected fileClass = signal<'selectfile-file' | 'selectfile-file-drop'>('selectfile-file');\n\n /**\n * Handles the native file input change event and delegates to `selectFile`.\n * @param e - The DOM change event from the file input.\n */\n protected update(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n this.selectFile(input.files[0]);\n }\n }\n\n /**\n * Validates and sets the selected file, showing an error if size or type constraints are violated.\n * @param file - The `File` object to validate and store.\n */\n private selectFile(file: File): void {\n const data = this.dialogData();\n const maxSize = data.maxSize ?? 0;\n if (maxSize > 0) {\n const size = file.size / 1048576;\n if (size > maxSize) {\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\n return;\n }\n }\n if (data.accept) {\n const accept = data.accept.toLowerCase();\n const a = file.name.split('.').pop()?.toLowerCase();\n let b = file.type.toLowerCase();\n if (b.startsWith('image/') && accept.includes('image/*')) {\n b = 'image/*';\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\n b = 'video/*';\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\n b = 'audio/*';\n }\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\n return;\n }\n }\n this.file.set(file);\n }\n\n /**\n * Formats a byte count into a human-readable size string.\n * @param size - File size in bytes.\n * @returns A formatted size string (e.g. \"1.2 MB\").\n */\n protected size(size: number): string {\n return SystemUtils.formatFileSize(size);\n }\n\n /** Emits the selected file and options, then closes the dialog. */\n protected ok(): void {\n this.done.emit({ file: this.file(), options: this.dialogData().options });\n setTimeout(() => {\n this.dialogRef.close();\n }, 500);\n }\n\n /** Highlights the drop zone when a drag enters the area.\n * @param e - The drag event.\n */\n protected onDragOver(e: DragEvent): void {\n this.fileClass.set('selectfile-file-drop');\n e.preventDefault();\n }\n\n /** Highlights the drop zone when a dragged item enters.\n * @param e - The drag event.\n */\n protected onDragEnter(e: DragEvent): void {\n this.fileClass.set('selectfile-file-drop');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when dragging ends.\n * @param e - The drag event.\n */\n protected onDragEnd(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when a dragged item leaves the area.\n * @param e - The drag event.\n */\n protected onDragLeave(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n }\n\n /**\n * Handles a file drop event, extracting and processing the dropped files.\n * @param e - The drop event.\n */\n protected onDrop(e: DragEvent): void {\n this.fileClass.set('selectfile-file');\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer?.files?.length) {\n this.addFiles(e.dataTransfer.files);\n }\n }\n\n /**\n * Picks the first file from the list and passes it to `selectFile`.\n * @param files - The `FileList` from the drag-and-drop event.\n */\n private addFiles(files: FileList): void {\n if (files.length > 0) {\n this.selectFile(files[0]);\n }\n }\n}\n\n","<div mat-dialog-title [innerHTML]=\"dialogData().title | safeHtml\"></div>\n@if (dialogData().description) {\n<div class=\"selectfile-description\" [innerHtml]=\"dialogData().description | safeHtml\"></div>\n}\n<mat-dialog-content class=\"dialog-content\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"*\" [class]=\"fileClass()\" (drop)=\"onDrop($event)\" (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\" (dragenter)=\"onDragEnter($event)\" (dragend)=\"onDragEnd($event)\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"10px\" fxFlexAlign=\"start\" class=\"x-small secondary\"><i>Trascina qui il file o selezionalo</i></div>\n <div>\n <input #_file type=\"file\" [accept]=\"dialogData().accept\" [hidden]=\"true\" (change)=\"update($event)\" />\n <button type=\"button\" mat-stroked-button (click)=\"_file.click()\">Seleziona file...</button>\n </div>\n @if (file()) {\n <div style=\"padding:0 24px\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\n <div class=\"small accent bold\"><i>{{file().name}}</i></div>\n <div class=\"small\">Dimensioni: <i>{{size(file().size)}}</i></div>\n </div>\n </div>\n }\n </div>\n </div>\n @if (dialogData().options) {\n <div style=\"padding-bottom: 24px;\">\n @for (o of dialogData().options; track o; let i = $index) {\n <div>\n <mat-checkbox (change)=\"o.selected = $event.checked\" [checked]=\"o.selected === true\" name=\"opt_{{i}}\" >\n {{o.description}}\n </mat-checkbox>\n </div>\n }\n </div>\n }\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\n <div fxFlex=\"50\">\n @if (dialogData().helpLink) {\n <a mat-stroked-button href=\"{{dialogData().helpLink}}\" target=\"_blank\">{{dialogData().helpCaption}}</a>\n }\n </div>\n <div fxFlex=\"50\" fxLayoutAlign=\"end\">\n <button mat-flat-button (click)=\"ok()\" [disabled]=\"!file()\">{{dialogData().okCaption}}</button>\n <button mat-stroked-button [mat-dialog-close]=\"true\">Annulla</button>\n </div>\n </div>\n</mat-dialog-actions>","import { ChangeDetectionStrategy, Component, inject, output, signal } from '@angular/core';\nimport { FlexLayoutModule, SelectFile, SelectPictureFileDialogData } from '@arsedizioni/ars-utils/ui';\nimport { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog';\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\n\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n templateUrl: './select-picture-dialog.component.html',\n styleUrl: './select-picture-dialog.component.scss',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\n})\nexport class SelectPictureDialogComponent {\n readonly done = output<SelectFile>();\n private readonly dialogService = inject(DialogService);\n private readonly dialogRef = inject(MatDialogRef<SelectPictureDialogComponent>);\n protected readonly dialogData = signal<SelectPictureFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\n protected readonly file = signal<File | undefined>(undefined);\n protected fileClass = signal<'selectpicture-file' | 'selectpicture-file-drop'>('selectpicture-file');\n protected pictureWidth = signal<number>(0);\n protected pictureHeight = signal<number>(0);\n protected picturePreview = signal<any>(undefined);\n\n /**\n * Handles the native file input change event and delegates to `selectFile`.\n * @param e - The DOM change event from the file input.\n */\n protected update(e: Event): void {\n const input = e.target as HTMLInputElement;\n if (input.files?.length) {\n this.selectFile(input.files[0]);\n }\n }\n\n /**\n * Validates the file size and type, then reads it as a data URL to generate a preview.\n * @param file - The `File` object to validate and preview.\n */\n private selectFile(file: File): void {\n const data = this.dialogData();\n const maxSize = data.maxSize ?? 0;\n if (maxSize > 0) {\n const size = file.size / 1048576;\n if (size > maxSize) {\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\n return;\n }\n }\n if (data.accept) {\n const accept = data.accept.toLowerCase();\n const a = file.name.split('.').pop()?.toLowerCase();\n let b = file.type.toLowerCase();\n if (b.startsWith('image/') && accept.includes('image/*')) {\n b = 'image/*';\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\n b = 'video/*';\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\n b = 'audio/*';\n }\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\n return;\n }\n }\n const reader = new FileReader();\n reader.onload = (_e: ProgressEvent<FileReader>) => {\n const img = new Image();\n img.onload = () => {\n const maxWidth = data.maxWidth ?? 0;\n if (maxWidth > 0 && img.width > maxWidth) {\n this.dialogService.error(`Immagine troppo larga (massimo ${maxWidth} pixel)`);\n return;\n }\n const maxHeight = data.maxHeight ?? 0;\n if (maxHeight > 0 && img.height > maxHeight) {\n this.dialogService.error(`Immagine troppo alta (massimo ${maxHeight} pixel)`);\n return;\n }\n this.pictureWidth.set(img.width);\n this.pictureHeight.set(img.height);\n this.picturePreview.set((_e.target as FileReader).result);\n this.file.set(file);\n };\n img.src = (_e.target as FileReader).result as string;\n };\n reader.readAsDataURL(file);\n }\n\n /**\n * Formats a byte count into a human-readable size string.\n * @param size - File size in bytes.\n * @returns A formatted size string (e.g. \"1.2 MB\").\n */\n protected size(size: number): string {\n return SystemUtils.formatFileSize(size);\n }\n\n /** Emits the selected file and options, then closes the dialog. */\n protected ok(): void {\n this.done.emit({ file: this.file(), options: this.dialogData().options });\n setTimeout(() => {\n this.dialogRef.close();\n }, 500);\n }\n\n /** Highlights the drop zone when a dragged item is over it.\n * @param e - The drag event.\n */\n protected onDragOver(e: DragEvent): void {\n this.fileClass.set('selectpicture-file-drop');\n e.preventDefault();\n }\n\n /** Highlights the drop zone when a dragged item enters.\n * @param e - The drag event.\n */\n protected onDragEnter(e: DragEvent): void {\n this.fileClass.set('selectpicture-file-drop');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when dragging ends.\n * @param e - The drag event.\n */\n protected onDragEnd(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n }\n\n /** Resets the drop zone style when a dragged item leaves.\n * @param e - The drag event.\n */\n protected onDragLeave(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n }\n\n /**\n * Handles a file drop event, extracting and processing the dropped image.\n * @param e - The drop event.\n */\n protected onDrop(e: DragEvent): void {\n this.fileClass.set('selectpicture-file');\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer?.files?.length) {\n this.addFiles(e.dataTransfer.files);\n }\n }\n\n /**\n * Picks the first file from the list and passes it to `selectFile`.\n * @param files - The `FileList` from the drag-and-drop event.\n */\n private addFiles(files: FileList): void {\n if (files.length > 0) {\n this.selectFile(files[0]);\n }\n }\n}\n\n","<div mat-dialog-title [innerHTML]=\"dialogData().title | safeHtml\"></div>\n@if (dialogData().description) {\n<div class=\"selectpicture-description\" [innerHtml]=\"dialogData().description | safeHtml\"></div>\n}\n<mat-dialog-content class=\"dialog-content\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"24px\" fxFill>\n <div fxFlex=\"*\" [class]=\"fileClass()\" (drop)=\"onDrop($event)\" (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\" (dragenter)=\"onDragEnter($event)\" (dragend)=\"onDragEnd($event)\">\n <div fxLayout=\"column\" fxLayoutGap=\"24px\" fxLayoutAlign=\"center center\" fxFill>\n <div fxFlex=\"10px\" fxFlexAlign=\"start\" class=\"x-small secondary\"><i>Trascina qui l'immagine o selezionala</i></div>\n <div>\n <input #_file type=\"file\" [hidden]=\"true\" [accept]=\"dialogData().accept ?? 'image/*'\"\n (change)=\"update($event)\" />\n <button type=\"button\" mat-stroked-button (click)=\"_file.click()\">Seleziona file...</button>\n </div>\n @if (file()) {\n <div style=\"padding:0 24px\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\n <img [src]=\"picturePreview()\" class=\"selectpicture-preview\">\n <div class=\"small accent bold \"><i>{{file().name}}</i></div>\n <div class=\"small\">Dimensioni:<i>{{pictureWidth()}} x {{pictureHeight()}} ({{size(file().size)}})</i></div>\n </div>\n </div>\n }\n </div>\n </div>\n @if (dialogData().options) {\n <div style=\"padding-bottom: 24px;\">\n @for (o of dialogData().options; track o; let i = $index) {\n <div>\n <mat-checkbox (change)=\"o.selected = $event.checked\" [checked]=\"o.selected === true\" name=\"opt_{{i}}\" >\n {{o.description}}\n </mat-checkbox>\n </div>\n }\n </div>\n }\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\n <button mat-flat-button (click)=\"ok()\" [disabled]=\"!file()\">{{dialogData().okCaption}}</button>\n <button mat-stroked-button mat-dialog-close >Annulla</button>\n </div>\n</mat-dialog-actions>\n","/*\n * Public API Surface of @arsedizioni/ars-utils/ui.files\n */\nexport * from './file-input/file-input.component';\nexport * from './file-preview/file-preview.component';\nexport * from './select-file/select-file-dialog.component';\nexport * from './select-picture/select-picture-dialog.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["requiredSchema","disabledSchema","fileSizeSchema","i4","i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;MA6Ba,kBAAkB,CAAA;;aAiBtB,IAAA,CAAA,MAAM,GAAG,CAAH,CAAK;IAelB,IAAI,KAAK,CAAC,KAAe,EAAA;AACvB,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IAC5B;AAEA;;;;;;AAMG;IACK,QAAQ,CAAC,KAAe,EAAE,SAAkB,EAAA;AAClD,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;QACnB,IAAI,SAAS,EAAE;AACb,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QACnC;AACA,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChC;AACA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;AACA,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI;IAChC;AAIA,IAAA,IACI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;IACzB;IACA,IAAI,QAAQ,CAAC,KAAc,EAAA;QACzB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAChD,QAAA,IAAI,CAAC,YAAY,CAAC,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A,UAAA,EAAA,CAAA;kBARxC,SAAS;AAGI,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB;AAC9F,wBAAA,gBAAgB,EAAE,cAAc,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,utEAAA,EAAA,MAAA,EAAA,CAAA,23JAAA,CAAA,EAAA;;;AEfnD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "22.5.28",
3
+ "version": "22.5.30",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -2,6 +2,7 @@ import * as _angular_forms_signals from '@angular/forms/signals';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { DestroyRef, ChangeDetectorRef } from '@angular/core';
4
4
  import { ScrollDispatcher } from '@angular/cdk/scrolling';
5
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
5
6
  import { MatExpansionPanel } from '@angular/material/expansion';
6
7
  import { MatInput } from '@angular/material/input';
7
8
  import { MatPaginator, PageEvent } from '@angular/material/paginator';
@@ -524,6 +525,21 @@ interface BrowserFilterModel {
524
525
  changeReason: number | null;
525
526
  }
526
527
  declare class ClipperBrowserComponent extends ClipperSearchResultManager {
528
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
529
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
530
+ /**
531
+ * Error text for a date range: whichever end is in error speaks for the pair.
532
+ * @param from - Errors of the start field, from `f.from().errors()`.
533
+ * @param to - Errors of the end field, from `f.to().errors()`.
534
+ * @returns The text to show under the range, or `undefined` when neither end is in error.
535
+ */
536
+ protected rangeErrorMessage(from: readonly {
537
+ kind: string;
538
+ message?: string;
539
+ }[], to: readonly {
540
+ kind: string;
541
+ message?: string;
542
+ }[]): string | undefined;
527
543
  readonly filterByNumber: _angular_core.Signal<MatInput>;
528
544
  readonly filterByText: _angular_core.Signal<MatInput>;
529
545
  readonly filterByChangeNumber: _angular_core.Signal<MatInput>;
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Validator, AbstractControl, ValidationErrors } from '@angular/forms';
3
- import { PathKind, SchemaPath, SchemaPathRules, LogicFn } from '@angular/forms/signals';
3
+ import { PathKind, LogicFn, SchemaPath, SchemaPathRules } from '@angular/forms/signals';
4
+ import { Validated } from '@arsedizioni/ars-utils/core';
4
5
 
5
6
  /**
6
7
  * Directive that delegates validation to an externally provided validator function.
@@ -266,56 +267,6 @@ declare class NotEmptyValidatorDirective implements Validator {
266
267
  static ɵdir: i0.ɵɵDirectiveDeclaration<NotEmptyValidatorDirective, "[notEmpty]", never, {}, {}, never, never, true, never>;
267
268
  }
268
269
 
269
- /**
270
- * Signal-forms counterparts of the classic validator directives in this entry point.
271
- *
272
- * The `[formField]` directive only honours `NG_VALIDATORS` providers on ControlValueAccessor
273
- * hosts (custom controls); on native inputs the attribute directives (`password`, `emails`,
274
- * `time`, `equals`) are ignored. Schemas built with `form()` must therefore use these
275
- * functions instead. Error kinds and messages match the directive versions one to one.
276
- */
277
- /**
278
- * Binds a validator requiring the value to be a semicolon-separated list of valid
279
- * email addresses. An empty value is considered valid (pair with `required` if needed).
280
- * Signal-forms counterpart of `EmailsValidatorDirective`.
281
- * @param path - Path of the string field to validate.
282
- */
283
- declare function emailsValidator<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void;
284
- /**
285
- * Binds a validator requiring the value to meet the minimum password-strength
286
- * requirements (see `SystemUtils.calculatePasswordStrength`). An empty value is
287
- * INVALID, exactly like the classic directive.
288
- * Signal-forms counterpart of `PasswordValidatorDirective`.
289
- * @param path - Path of the string field to validate.
290
- */
291
- declare function passwordValidator<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void;
292
- /**
293
- * Binds a validator requiring the value to be a valid `"HH:MM"` time string and,
294
- * when slots are provided, to fall within at least one of the allowed ranges.
295
- * An empty value is considered valid (pair with `required` if needed).
296
- * Signal-forms counterpart of `TimeValidatorDirective`.
297
- * @param path - Path of the string field to validate.
298
- * @param slots - Optional reactive function returning the pipe-separated allowed
299
- * ranges (e.g. `"08:00-12:00|14:00-18:00"`), or `undefined` for none.
300
- */
301
- declare function timeValidator<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, slots?: () => string | undefined): void;
302
- /**
303
- * Binds a validator requiring the value to strictly equal the value of another field
304
- * of the same form. Reactive on both fields, so the host field re-validates when the
305
- * other field changes (this replaces the `valueChanges` subscription of the directive).
306
- * Signal-forms counterpart of `EqualsValidatorDirective`.
307
- * @param path - Path of the field to validate.
308
- * @param other - Path of the field whose value must match.
309
- */
310
- declare function equalsValidator<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>): void;
311
- /**
312
- * Binds a validator requiring the value to be either empty or a complete 6-digit
313
- * OTP code. A partial code (e.g. `"12"`) is invalid; emptiness is left to `required`.
314
- * Schema-level counterpart of the `OtpInputComponent` internal validator.
315
- * @param path - Path of the string field to validate.
316
- */
317
- declare function otpValidator<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void;
318
-
319
270
  /**
320
271
  * Options shared by the ARS signal-form validators.
321
272
  *
@@ -336,6 +287,13 @@ interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathK
336
287
  */
337
288
  when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>;
338
289
  }
290
+ /**
291
+ * Default texts of the rules declared here, in one place so that the validators and the fallback
292
+ * map of `SignalsUtils.getFieldErrorMessage` cannot drift apart: a rule added below without a
293
+ * message here would show "Errore", and one renamed here without touching the validator would
294
+ * leave the map with a kind nobody produces.
295
+ */
296
+ declare const ARS_VALIDATOR_MESSAGES: Record<string, string>;
339
297
  /**
340
298
  * Requires the value to be a well-formed GUID / UUID.
341
299
  *
@@ -379,6 +337,163 @@ declare function password<TPathKind extends PathKind = PathKind.Root>(path: Sche
379
337
  * const f = form(this.model, p => { required(p.city); notEmpty(p.city); });
380
338
  */
381
339
  declare function notEmpty<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
340
+ /**
341
+ * Requires the value to differ from the value of another field of the same form.
342
+ *
343
+ * The signal-form counterpart of `NotEqualValidatorDirective`, with its exact rule: two empty
344
+ * values are considered different, so an untouched pair of fields does not start out in error.
345
+ * Reactive on both fields — editing either one re-validates this one, which is what the
346
+ * directive needed a `valueChanges` subscription (and a re-entrancy guard) to achieve.
347
+ *
348
+ * @param path - Path of the field to validate.
349
+ * @param other - Path of the field whose value must differ.
350
+ * @param config - Optional message override and `when` condition.
351
+ * @returns void
352
+ */
353
+ declare function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
354
+ /**
355
+ * Requires the value to be a date the backend can store: parseable, and after 1750.
356
+ *
357
+ * The signal-form counterpart of `SqlDateValidatorDirective`. The year floor is not arbitrary —
358
+ * it is what separates a real date from the 01/01/0001 that a mistyped year produces, which SQL
359
+ * Server rejects with an error nobody can read.
360
+ *
361
+ * @param path - Path of the field to validate.
362
+ * @param config - Optional message override and `when` condition.
363
+ * @returns void
364
+ */
365
+ declare function sqlDate<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
366
+ /**
367
+ * Requires the value to be a date that is not in the future.
368
+ *
369
+ * The signal-form counterpart of `NotFutureValidatorDirective`. Today counts as valid: the
370
+ * comparison is made on the end of the day, so a date entered this morning does not become
371
+ * invalid because the clock says 09:00.
372
+ *
373
+ * @param path - Path of the field to validate.
374
+ * @param config - Optional message override and `when` condition.
375
+ * @returns void
376
+ */
377
+ declare function notFuture<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
378
+ /**
379
+ * Requires the value to be a well-formed URL. An empty value passes, as everywhere else here.
380
+ *
381
+ * The signal-form counterpart of `UrlValidatorDirective`.
382
+ *
383
+ * @param path - Path of the field to validate.
384
+ * @param config - Optional message override and `when` condition.
385
+ * @returns void
386
+ */
387
+ declare function url<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
388
+ /**
389
+ * Requires the value to hold no more than `max` whitespace-separated terms.
390
+ *
391
+ * The signal-form counterpart of `MaxTermsValidatorDirective`, used on the search boxes where
392
+ * the backend refuses a query past a certain number of words.
393
+ *
394
+ * @param path - Path of the field to validate.
395
+ * @param max - The maximum number of terms, as a number or a reactive function.
396
+ * @param config - Optional message override and `when` condition.
397
+ * @returns void
398
+ */
399
+ declare function maxTerms<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, max: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
400
+ /**
401
+ * Requires the size of the picked file to fall within the allowed range.
402
+ *
403
+ * The signal-form counterpart of `FileSizeValidatorDirective`, and it keeps its shape: the field
404
+ * itself holds the file NAME, while the size arrives from outside — the control that picked the
405
+ * file knows it, the form does not. An empty field passes, so "no file" is `required()`'s call
406
+ * and not a size error.
407
+ *
408
+ * @param path - Path of the field holding the file name.
409
+ * @param sizeMb - The size of the picked file in megabytes, as a reactive function.
410
+ * @param maxSizeMb - The maximum allowed size in megabytes. Defaults to `5`.
411
+ * @param minSizeMb - The minimum required size in megabytes. Defaults to `0`.
412
+ * @param config - Optional message override and `when` condition.
413
+ * @returns void
414
+ */
415
+ declare function fileSize<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, sizeMb: () => number | undefined, maxSizeMb?: number | (() => number), minSizeMb?: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
416
+ /**
417
+ * Requires the value to declare itself valid.
418
+ *
419
+ * The signal-form counterpart of `ValidIfDirective`: when the field holds an object implementing
420
+ * `Validated` the verdict is its own `isValid()`, and when the field is empty the verdict is the
421
+ * `flag`. It is the escape hatch for the composite controls whose validity only they can judge.
422
+ *
423
+ * @param path - Path of the field to validate.
424
+ * @param flag - Verdict used while the field is empty, as a boolean or a reactive function.
425
+ * Defaults to `false`.
426
+ * @param config - Optional message override and `when` condition.
427
+ * @returns void
428
+ */
429
+ declare function validIf<TValue extends Partial<Validated>, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, flag?: boolean | (() => boolean), config?: ArsValidatorConfig<TValue, TPathKind>): void;
430
+ /**
431
+ * Requires the value to be a semicolon-separated list of valid e-mail addresses.
432
+ *
433
+ * The signal-form counterpart of `EmailsValidatorDirective`. An empty value passes, and so does
434
+ * an empty entry between two semicolons: the list is typed by hand and a trailing `;` is not a
435
+ * mistake worth an error.
436
+ *
437
+ * @param path - Path of the field to validate.
438
+ * @param config - Optional message override and `when` condition.
439
+ * @returns void
440
+ */
441
+ declare function emails<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
442
+ /**
443
+ * Requires the value to be a `"HH:MM"` time and, when slots are given, to fall inside one of them.
444
+ *
445
+ * The signal-form counterpart of `TimeValidatorDirective`. An empty value passes.
446
+ *
447
+ * @param path - Path of the field to validate.
448
+ * @param slots - Optional reactive function returning the pipe-separated allowed ranges
449
+ * (e.g. `"08:00-12:00|14:00-18:00"`), or `undefined` for no restriction.
450
+ * @param config - Optional message override and `when` condition.
451
+ * @returns void
452
+ */
453
+ declare function time<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, slots?: () => string | undefined, config?: ArsValidatorConfig<string, TPathKind>): void;
454
+ /**
455
+ * Requires the value to equal the value of another field of the same form.
456
+ *
457
+ * The signal-form counterpart of `EqualsValidatorDirective`. Reactive on both fields, which is
458
+ * what the directive needed a `valueChanges` subscription to obtain: retyping the first password
459
+ * re-validates the confirmation without anyone wiring the two together.
460
+ *
461
+ * @param path - Path of the field to validate.
462
+ * @param other - Path of the field whose value must match.
463
+ * @param config - Optional message override and `when` condition.
464
+ * @returns void
465
+ */
466
+ declare function equals<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
467
+ /**
468
+ * Requires the value to be either empty or a complete six-digit one-time code.
469
+ *
470
+ * The schema-level counterpart of the validator inside `OtpInputComponent`: a partial code is an
471
+ * error, an empty one is `required()`'s business.
472
+ *
473
+ * @param path - Path of the field to validate.
474
+ * @param config - Optional message override and `when` condition.
475
+ * @returns void
476
+ */
477
+ declare function otp<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
478
+ /** Helpers around signal forms that are not validators themselves. */
479
+ declare class SignalsUtils {
480
+ /**
481
+ * Builds the error text for a signal-forms field.
482
+ *
483
+ * Deliberately dumb: the wording lives in the schema, next to the rule that produces it
484
+ * (`required(p.x, { message: ... })`), so a field says what is wrong with it in one place
485
+ * instead of here in a switch that has to guess from the error kind. The map below is only
486
+ * the safety net for the rules declared without a message — the Angular built-ins, plus
487
+ * {@link ARS_VALIDATOR_MESSAGES} for the ones declared in this file.
488
+ * @param errors - The errors currently on the field, from `f.x().errors()`.
489
+ * @param message - Optional override applied to every error of the field.
490
+ * @returns The first relevant error text, or `undefined` when the field has no errors.
491
+ */
492
+ static getFieldErrorMessage(errors: readonly {
493
+ kind: string;
494
+ message?: string;
495
+ }[], message?: string): string | undefined;
496
+ }
382
497
 
383
- export { EmailsValidatorDirective, EqualsValidatorDirective, FileSizeValidatorDirective, GuidValidatorDirective, MaxTermsValidatorDirective, NotEmptyValidatorDirective, NotEqualValidatorDirective, NotFutureValidatorDirective, PasswordValidatorDirective, SqlDateValidatorDirective, TimeValidatorDirective, UrlValidatorDirective, ValidIfDirective, ValidatorDirective, emailsValidator, equalsValidator, guid, notEmpty, otpValidator, password, passwordValidator, timeValidator };
498
+ export { ARS_VALIDATOR_MESSAGES, EmailsValidatorDirective, EqualsValidatorDirective, FileSizeValidatorDirective, GuidValidatorDirective, MaxTermsValidatorDirective, NotEmptyValidatorDirective, NotEqualValidatorDirective, NotFutureValidatorDirective, PasswordValidatorDirective, SignalsUtils, SqlDateValidatorDirective, TimeValidatorDirective, UrlValidatorDirective, ValidIfDirective, ValidatorDirective, emails, equals, fileSize, guid, maxTerms, notEmpty, notEqual, notFuture, otp, password, sqlDate, time, url, validIf };
384
499
  export type { ArsValidatorConfig };