@arsedizioni/ars-utils 22.5.36 → 22.5.38

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.
Files changed (26) hide show
  1. package/README.md +179 -179
  2. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +174 -151
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  4. package/fesm2022/arsedizioni-ars-utils-core.date.mjs +16 -5
  5. package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
  6. package/fesm2022/arsedizioni-ars-utils-core.mjs +43 -7
  7. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  8. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +0 -6
  9. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
  10. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +73 -3
  11. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
  12. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +91 -30
  13. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
  14. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +97 -42
  16. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
  17. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +24 -10
  18. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
  19. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +79 -23
  22. package/types/arsedizioni-ars-utils-core.d.ts +46 -10
  23. package/types/arsedizioni-ars-utils-ui.controls.d.ts +34 -1
  24. package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +116 -6
  25. package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +93 -11
  26. package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +29 -1
@@ -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 } 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 getErrorMessage = 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>{{ getErrorMessage(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 { ShellService } from '@arsedizioni/ars-utils/ui.shell';\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(ShellService);\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 { ShellService } from '@arsedizioni/ars-utils/ui.shell';\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(ShellService);\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 { ShellService } from '@arsedizioni/ars-utils/ui.shell';\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(ShellService);\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,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,IAAI,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B,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 getErrorMessage = 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>{{ getErrorMessage(nameForm.name().errors()) }}</mat-error>\n }\n</mat-form-field>","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\r\nimport { ShellService } from '@arsedizioni/ars-utils/ui.shell';\r\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, signal, viewChild } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog';\r\nimport { SafeUrlPipe } from '@arsedizioni/ars-utils/core';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatButtonModule } from '@angular/material/button';\r\n\r\nexport interface FilePreviewDialogData {\r\n url?: string;\r\n embed?: boolean;\r\n authToken?: string;\r\n}\r\n\r\n\r\n@Component({\r\n templateUrl: './file-preview.component.html',\r\n styleUrl: './file-preview.component.scss',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatDialogContent, FlexLayoutModule, MatDialogActions, MatButtonModule, MatTooltipModule,\r\n MatDialogClose, SafeUrlPipe]\r\n})\r\nexport class FilePreviewComponent {\r\n readonly iframe = viewChild<ElementRef>('iframe');\r\n private readonly httpClient = inject(HttpClient);\r\n private readonly dialogService = inject(ShellService);\r\n protected readonly dialogData = inject<FilePreviewDialogData>(MAT_DIALOG_DATA) ?? {};\r\n protected readonly url = signal<string | null>(null);\r\n\r\n constructor() {\r\n // Revoke the blob object URL on destroy: createObjectURL keeps the whole\r\n // downloaded blob alive until revoked — repeated previews leaked memory.\r\n inject(DestroyRef).onDestroy(() => {\r\n const u = this.url();\r\n if (u?.startsWith('blob:')) URL.revokeObjectURL(u);\r\n });\r\n\r\n const data = this.dialogData;\r\n if (!data?.url) return;\r\n\r\n if (!data.embed) {\r\n this.dialogService.setBusy('Download in corso...');\r\n this.httpClient.get(data.url, {\r\n headers: data.authToken\r\n ? new HttpHeaders().set('Authorization', data.authToken)\r\n : new HttpHeaders(),\r\n responseType: 'blob'\r\n })\r\n .pipe(takeUntilDestroyed())\r\n .subscribe({\r\n next: (res: Blob) => {\r\n this.url.set(URL.createObjectURL(res));\r\n this.dialogService.clearBusy();\r\n },\r\n error: () => {\r\n this.dialogService.clearBusy();\r\n }\r\n });\r\n } else {\r\n this.url.set('https://view.officeapps.live.com/op/embed.aspx?src=' + encodeURIComponent(data.url));\r\n }\r\n }\r\n\r\n /**\r\n * Handles the iframe load event: scrolls to the top and centers a single image when present.\r\n */\r\n protected loaded(): void {\r\n const iframe = this.iframe()?.nativeElement;\r\n if (!iframe) { return; }\r\n \r\n try {\r\n iframe.contentWindow?.scrollTo(0, 0);\r\n \r\n // Resize and center single image\r\n if (!this.dialogData?.embed && iframe.contentDocument) { \r\n const images = iframe.contentDocument.querySelectorAll('img') || [];\r\n if (images.length === 1) { \r\n Object.assign(images[0].style, {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n maxWidth: images[0].style.maxWidth || '100%',\r\n maxHeight: images[0].style.maxHeight || '100%'\r\n });\r\n const iframeBody = iframe.contentDocument.body;\r\n if (iframeBody && !iframeBody.style.height) {\r\n iframeBody.style.height = '100%';\r\n }\r\n }\r\n }\r\n } catch (e) {\r\n console.error('Impossibile accedere al contenuto dell\\'iframe:', e);\r\n }\r\n }\r\n\r\n /**\r\n * Opens the current file URL in a new browser tab for manual download.\r\n */\r\n protected download(): void {\r\n const currentUrl = this.url();\r\n if (currentUrl) {\r\n window.open(currentUrl, '_blank');\r\n }\r\n }\r\n\r\n /**\r\n * Displays a help dialog with browser-specific instructions for enabling PDF preview.\r\n */\r\n protected troubles(): void {\r\n this.dialogService.info(\r\n \"<p>Se non riesci a visualizzare l'anteprima dei file PDF probabilmente devi abilitare un'impostazione del tuo browser.</p>\" +\r\n \"<b>Per Google Chrome</b><br>\" +\r\n \"<p class='small' style='padding-left:10px'><i>impostazioni > privacy e sicurezza > impostazioni sito > documenti PDF</i></p>\" +\r\n \"<b>Per Microsoft Edge</b><br>\" +\r\n \"<p class='small' style='padding-left:10px'><i>impostazioni > cookie e autorizzazioni sito > documenti PDF</i></p>\" +\r\n \"<b>Per Mozilla Firefox</b><br>\" +\r\n \"<p class='small' style='padding-left:10px'><i>impostazioni > generale > applicazioni</i></p>\" +\r\n \"<b>Altri browser</b><br>\" +\r\n \"<p class='small' style='padding-left:10px'>Fate riferimento alla documentazione specifica del vostro browser.</p>\",\r\n \"Problemi con le anteprime dei file PDF?\"\r\n )\r\n }\r\n}\r\n\r\n\r\n\r\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';\r\nimport { FlexLayoutModule, SelectFile, SelectFileDialogData } from '@arsedizioni/ars-utils/ui';\r\nimport { ShellService } from '@arsedizioni/ars-utils/ui.shell';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';\r\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\r\n\r\n@Component({\r\n templateUrl: './select-file-dialog.component.html',\r\n styleUrl: './select-file-dialog.component.scss',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\r\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\r\n})\r\nexport class SelectFileDialogComponent {\r\n readonly done = output<SelectFile>();\r\n private readonly dialogService = inject(ShellService);\r\n private readonly dialogRef = inject(MatDialogRef<SelectFileDialogComponent>);\r\n protected readonly dialogData = signal<SelectFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\r\n protected readonly file = signal<File | undefined>(undefined);\r\n protected fileClass = signal<'selectfile-file' | 'selectfile-file-drop'>('selectfile-file');\r\n\r\n /**\r\n * Handles the native file input change event and delegates to `selectFile`.\r\n * @param e - The DOM change event from the file input.\r\n */\r\n protected update(e: Event): void {\r\n const input = e.target as HTMLInputElement;\r\n if (input.files?.length) {\r\n this.selectFile(input.files[0]);\r\n }\r\n }\r\n\r\n /**\r\n * Validates and sets the selected file, showing an error if size or type constraints are violated.\r\n * @param file - The `File` object to validate and store.\r\n */\r\n private selectFile(file: File): void {\r\n const data = this.dialogData();\r\n const maxSize = data.maxSize ?? 0;\r\n if (maxSize > 0) {\r\n const size = file.size / 1048576;\r\n if (size > maxSize) {\r\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\r\n return;\r\n }\r\n }\r\n if (data.accept) {\r\n const accept = data.accept.toLowerCase();\r\n const a = file.name.split('.').pop()?.toLowerCase();\r\n let b = file.type.toLowerCase();\r\n if (b.startsWith('image/') && accept.includes('image/*')) {\r\n b = 'image/*';\r\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\r\n b = 'video/*';\r\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\r\n b = 'audio/*';\r\n }\r\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\r\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\r\n return;\r\n }\r\n }\r\n this.file.set(file);\r\n }\r\n\r\n /**\r\n * Formats a byte count into a human-readable size string.\r\n * @param size - File size in bytes.\r\n * @returns A formatted size string (e.g. \"1.2 MB\").\r\n */\r\n protected size(size: number): string {\r\n return SystemUtils.formatFileSize(size);\r\n }\r\n\r\n /** Emits the selected file and options, then closes the dialog. */\r\n protected ok(): void {\r\n this.done.emit({ file: this.file(), options: this.dialogData().options });\r\n setTimeout(() => {\r\n this.dialogRef.close();\r\n }, 500);\r\n }\r\n\r\n /** Highlights the drop zone when a drag enters the area.\r\n * @param e - The drag event.\r\n */\r\n protected onDragOver(e: DragEvent): void {\r\n this.fileClass.set('selectfile-file-drop');\r\n e.preventDefault();\r\n }\r\n\r\n /** Highlights the drop zone when a dragged item enters.\r\n * @param e - The drag event.\r\n */\r\n protected onDragEnter(e: DragEvent): void {\r\n this.fileClass.set('selectfile-file-drop');\r\n e.preventDefault();\r\n }\r\n\r\n /** Resets the drop zone style when dragging ends.\r\n * @param e - The drag event.\r\n */\r\n protected onDragEnd(e: DragEvent): void {\r\n this.fileClass.set('selectfile-file');\r\n e.preventDefault();\r\n }\r\n\r\n /** Resets the drop zone style when a dragged item leaves the area.\r\n * @param e - The drag event.\r\n */\r\n protected onDragLeave(e: DragEvent): void {\r\n this.fileClass.set('selectfile-file');\r\n e.preventDefault();\r\n }\r\n\r\n /**\r\n * Handles a file drop event, extracting and processing the dropped files.\r\n * @param e - The drop event.\r\n */\r\n protected onDrop(e: DragEvent): void {\r\n this.fileClass.set('selectfile-file');\r\n e.preventDefault();\r\n e.stopPropagation();\r\n if (e.dataTransfer?.files?.length) {\r\n this.addFiles(e.dataTransfer.files);\r\n }\r\n }\r\n\r\n /**\r\n * Picks the first file from the list and passes it to `selectFile`.\r\n * @param files - The `FileList` from the drag-and-drop event.\r\n */\r\n private addFiles(files: FileList): void {\r\n if (files.length > 0) {\r\n this.selectFile(files[0]);\r\n }\r\n }\r\n}\r\n\r\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';\r\nimport { FlexLayoutModule, SelectFile, SelectPictureFileDialogData } from '@arsedizioni/ars-utils/ui';\r\nimport { ShellService } from '@arsedizioni/ars-utils/ui.shell';\r\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog';\r\nimport { SafeHtmlPipe, SystemUtils } from '@arsedizioni/ars-utils/core';\r\n\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatButtonModule } from '@angular/material/button';\r\n\r\n@Component({\r\n templateUrl: './select-picture-dialog.component.html',\r\n styleUrl: './select-picture-dialog.component.scss',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatDialogTitle, MatDialogContent, FlexLayoutModule, MatButtonModule, MatCheckboxModule,\r\n MatDialogActions, MatDialogClose, SafeHtmlPipe]\r\n})\r\nexport class SelectPictureDialogComponent {\r\n readonly done = output<SelectFile>();\r\n private readonly dialogService = inject(ShellService);\r\n private readonly dialogRef = inject(MatDialogRef<SelectPictureDialogComponent>);\r\n protected readonly dialogData = signal<SelectPictureFileDialogData>(inject(MAT_DIALOG_DATA) ?? {});\r\n protected readonly file = signal<File | undefined>(undefined);\r\n protected fileClass = signal<'selectpicture-file' | 'selectpicture-file-drop'>('selectpicture-file');\r\n protected pictureWidth = signal<number>(0);\r\n protected pictureHeight = signal<number>(0);\r\n protected picturePreview = signal<any>(undefined);\r\n\r\n /**\r\n * Handles the native file input change event and delegates to `selectFile`.\r\n * @param e - The DOM change event from the file input.\r\n */\r\n protected update(e: Event): void {\r\n const input = e.target as HTMLInputElement;\r\n if (input.files?.length) {\r\n this.selectFile(input.files[0]);\r\n }\r\n }\r\n\r\n /**\r\n * Validates the file size and type, then reads it as a data URL to generate a preview.\r\n * @param file - The `File` object to validate and preview.\r\n */\r\n private selectFile(file: File): void {\r\n const data = this.dialogData();\r\n const maxSize = data.maxSize ?? 0;\r\n if (maxSize > 0) {\r\n const size = file.size / 1048576;\r\n if (size > maxSize) {\r\n this.dialogService.error(`File troppo grande (massimo ${SystemUtils.formatFileSize(maxSize * 1048576)})`);\r\n return;\r\n }\r\n }\r\n if (data.accept) {\r\n const accept = data.accept.toLowerCase();\r\n const a = file.name.split('.').pop()?.toLowerCase();\r\n let b = file.type.toLowerCase();\r\n if (b.startsWith('image/') && accept.includes('image/*')) {\r\n b = 'image/*';\r\n } else if (b.startsWith('video/') && accept.includes('video/*')) {\r\n b = 'video/*';\r\n } else if (b.startsWith('audio/') && accept.includes('audio/*')) {\r\n b = 'audio/*';\r\n }\r\n if (!accept.includes(a ?? '') && !accept.includes(b)) {\r\n this.dialogService.error(`Sono accettati solo questi tipi di file: ${accept}`);\r\n return;\r\n }\r\n }\r\n const reader = new FileReader();\r\n reader.onload = (_e: ProgressEvent<FileReader>) => {\r\n const img = new Image();\r\n img.onload = () => {\r\n const maxWidth = data.maxWidth ?? 0;\r\n if (maxWidth > 0 && img.width > maxWidth) {\r\n this.dialogService.error(`Immagine troppo larga (massimo ${maxWidth} pixel)`);\r\n return;\r\n }\r\n const maxHeight = data.maxHeight ?? 0;\r\n if (maxHeight > 0 && img.height > maxHeight) {\r\n this.dialogService.error(`Immagine troppo alta (massimo ${maxHeight} pixel)`);\r\n return;\r\n }\r\n this.pictureWidth.set(img.width);\r\n this.pictureHeight.set(img.height);\r\n this.picturePreview.set((_e.target as FileReader).result);\r\n this.file.set(file);\r\n };\r\n img.src = (_e.target as FileReader).result as string;\r\n };\r\n reader.readAsDataURL(file);\r\n }\r\n\r\n /**\r\n * Formats a byte count into a human-readable size string.\r\n * @param size - File size in bytes.\r\n * @returns A formatted size string (e.g. \"1.2 MB\").\r\n */\r\n protected size(size: number): string {\r\n return SystemUtils.formatFileSize(size);\r\n }\r\n\r\n /** Emits the selected file and options, then closes the dialog. */\r\n protected ok(): void {\r\n this.done.emit({ file: this.file(), options: this.dialogData().options });\r\n setTimeout(() => {\r\n this.dialogRef.close();\r\n }, 500);\r\n }\r\n\r\n /** Highlights the drop zone when a dragged item is over it.\r\n * @param e - The drag event.\r\n */\r\n protected onDragOver(e: DragEvent): void {\r\n this.fileClass.set('selectpicture-file-drop');\r\n e.preventDefault();\r\n }\r\n\r\n /** Highlights the drop zone when a dragged item enters.\r\n * @param e - The drag event.\r\n */\r\n protected onDragEnter(e: DragEvent): void {\r\n this.fileClass.set('selectpicture-file-drop');\r\n e.preventDefault();\r\n }\r\n\r\n /** Resets the drop zone style when dragging ends.\r\n * @param e - The drag event.\r\n */\r\n protected onDragEnd(e: DragEvent): void {\r\n this.fileClass.set('selectpicture-file');\r\n e.preventDefault();\r\n }\r\n\r\n /** Resets the drop zone style when a dragged item leaves.\r\n * @param e - The drag event.\r\n */\r\n protected onDragLeave(e: DragEvent): void {\r\n this.fileClass.set('selectpicture-file');\r\n e.preventDefault();\r\n }\r\n\r\n /**\r\n * Handles a file drop event, extracting and processing the dropped image.\r\n * @param e - The drop event.\r\n */\r\n protected onDrop(e: DragEvent): void {\r\n this.fileClass.set('selectpicture-file');\r\n e.preventDefault();\r\n e.stopPropagation();\r\n if (e.dataTransfer?.files?.length) {\r\n this.addFiles(e.dataTransfer.files);\r\n }\r\n }\r\n\r\n /**\r\n * Picks the first file from the list and passes it to `selectFile`.\r\n * @param files - The `FileList` from the drag-and-drop event.\r\n */\r\n private addFiles(files: FileList): void {\r\n if (files.length > 0) {\r\n this.selectFile(files[0]);\r\n }\r\n }\r\n}\r\n\r\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;MA6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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "22.5.36",
3
+ "version": "22.5.38",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -489,11 +489,15 @@ declare class ClipperSearchResultManager extends ClipperDocumentManager {
489
489
  }
490
490
 
491
491
  /**
492
- * Shape of the browser filter-pane form model. Text fields use '' when empty,
493
- * numeric/select/date fields use null, list fields use null — never undefined,
494
- * because signal forms only create child fields for defined values.
492
+ * Shape of the browser filter-pane form model, derived from the {@link ClipperSearchParams}
493
+ * DTO: every field of that DTO is optional, so it cannot back a signal form directly.
494
+ *
495
+ * Text fields use '' when empty, numeric/select/date fields use null, list fields use
496
+ * null — never undefined, because signal forms only create child fields for defined
497
+ * values. Dates are always `Date | null` — never a `Date | string` — because `null` is
498
+ * what Material's date accessors write when a datepicker input is cleared.
495
499
  */
496
- interface BrowserFilterModel {
500
+ interface BrowserFilterForm {
497
501
  modules: NameValueItem<ClipperModule>[] | null;
498
502
  tags: NameValueItem<string>[] | null;
499
503
  topics: NameValueItem<string>[] | null;
@@ -634,15 +638,15 @@ declare class ClipperBrowserComponent extends ClipperSearchResultManager {
634
638
  /**
635
639
  * Model backing the filter-pane signal form. This is the single source of truth
636
640
  * for every filter value bound in the template; `filterParams` only carries the
637
- * assembled query DTO (see syncParams/loadFilter). Empty values are '' / null /
638
- * false / null-array — never undefined, so every child field exists.
641
+ * assembled query DTO (see toForm/toPayload and loadFilter). Empty values are
642
+ * '' / null / false / null-array — never undefined, so every child field exists.
639
643
  */
640
- protected readonly filterModel: _angular_core.WritableSignal<BrowserFilterModel>;
644
+ protected readonly filterModel: _angular_core.WritableSignal<BrowserFilterForm>;
641
645
  /**
642
646
  * Signal form for the filter pane. The four year fields accept values from 1750
643
647
  * (previously the native min attribute on the inputs).
644
648
  */
645
- protected readonly filterForm: _angular_forms_signals.FieldTree<BrowserFilterModel, string | number, "writable">;
649
+ protected readonly filterForm: _angular_forms_signals.FieldTree<BrowserFilterForm, string | number, "writable">;
646
650
  /** Root signal form for the sort-mode button selector. */
647
651
  protected readonly sortForm: _angular_forms_signals.FieldTree<NameValueItem<ClipperSort>, string | number, "writable">;
648
652
  /** Debounced stream of keyup events on the interval inputs (shorthand typing support). */
@@ -738,18 +742,40 @@ declare class ClipperBrowserComponent extends ClipperSearchResultManager {
738
742
  */
739
743
  protected clearFilter(): void;
740
744
  /**
741
- * Copies the filter model into `filterParams`, normalizing empty values back
742
- * to the undefined-based convention of ClipperSearchParams.
745
+ * Builds the filter form model from a set of search parameters.
746
+ *
747
+ * Ad-hoc because the two publication ranges do not map field-to-field: the DTO keeps
748
+ * them as `fromDate`/`toDate`, and a range is only restored when both of its bounds
749
+ * are set, exactly as the saved filters were written.
750
+ *
751
+ * @param dto - The search parameters to read: the live `filterParams` on a state
752
+ * restore, or the deserialized data of a saved filter.
753
+ * @returns A fresh form model; the caller decides what to keep of the current one.
743
754
  */
744
- private syncParams;
755
+ private toForm;
756
+ /**
757
+ * Builds the search payload out of the filter model, normalizing empty values back to
758
+ * the undefined-based convention of {@link ClipperSearchParams}.
759
+ *
760
+ * Ad-hoc for two reasons. The two publication ranges are not payload fields: they
761
+ * reach the DTO as `fromDate`/`toDate` through {@link loadFilter} and
762
+ * {@link prepareFetch}. And every key has to be listed, `undefined` included, because
763
+ * `filterParams` is a long-lived object — reused across searches and serialized into
764
+ * saved filters — so a field the user has just emptied must be overwritten, not
765
+ * merely left out of the copy the way {@link DtoUtils.toPayload} does.
766
+ *
767
+ * @returns The subset of the search parameters the filter pane owns.
768
+ */
769
+ private toPayload;
745
770
  /**
746
771
  * Commits the form model to filterParams before the component state is serialised.
747
772
  */
748
773
  protected onStateSaving(): void;
749
774
  /**
750
775
  * Rebuilds the form model from filterParams after a state restore.
751
- * The publication intervals are intentionally not rebuilt from fromDate/toDate,
752
- * matching the historical behavior where the range inputs were not restored.
776
+ * The publication intervals are intentionally not rebuilt here — filterParams carries
777
+ * no fromDate/toDate at this point — matching the historical behavior where the range
778
+ * inputs were not restored.
753
779
  */
754
780
  protected onStateRestored(): void;
755
781
  /**
@@ -1344,27 +1370,57 @@ declare class ClipperSearchFreeTextHelpComponent {
1344
1370
  interface SearchFreeTextQueryParams {
1345
1371
  query: string;
1346
1372
  }
1373
+ /**
1374
+ * Form model of the free-text query builder: one field per query operator.
1375
+ *
1376
+ * The DTO ({@link SearchFreeTextQueryParams}) is not a projection of this model — it
1377
+ * carries the single Lucene-style expression assembled out of the five fields — which
1378
+ * is why {@link ClipperSearchFreeTextQueryBuilderComponent.toPayload} is ad-hoc.
1379
+ */
1380
+ interface SearchFreeTextQueryForm {
1381
+ /** Exact phrase to look for; `''` when the input is empty. */
1382
+ queryPhrase: string;
1383
+ /** Comma-separated words that must all appear; `''` when the input is empty. */
1384
+ queryAnd: string;
1385
+ /** Comma-separated words of which at least one must appear; `''` when the input is empty. */
1386
+ queryOr: string;
1387
+ /** Prefix the document must start with; `''` when the input is empty. */
1388
+ queryStart: string;
1389
+ /** Comma-separated words that must not appear; `''` when the input is empty. */
1390
+ queryNot: string;
1391
+ }
1347
1392
  declare class ClipperSearchFreeTextQueryBuilderComponent {
1348
1393
  readonly done: _angular_core.OutputEmitterRef<SearchFreeTextQueryParams>;
1349
1394
  private readonly dialogService;
1350
1395
  /** Model backing the signal form: one entry per query operator field. */
1351
1396
  private readonly model;
1397
+ /**
1398
+ * Builds the form model. The builder always opens empty, so the model is the neutral
1399
+ * one; it also serves as what the "clear" button restores.
1400
+ * @returns A fresh form model.
1401
+ */
1402
+ private toForm;
1403
+ /**
1404
+ * Assembles the Lucene-style free-text query out of the five operator fields.
1405
+ *
1406
+ * Ad-hoc because the payload is not a projection of the model: every field
1407
+ * contributes a differently shaped fragment (a quoted phrase, `+` terms, a `*`
1408
+ * wildcard, `-` exclusions) to one single string.
1409
+ * @returns The query to emit, or `undefined` when only the exclusion operator was
1410
+ * filled in, which cannot produce a valid query on its own.
1411
+ */
1412
+ private toPayload;
1352
1413
  /** Signal form for the query fields; every field is capped at 200 characters. */
1353
- protected readonly form: _angular_forms_signals.FieldTree<{
1354
- queryPhrase: string;
1355
- queryAnd: string;
1356
- queryOr: string;
1357
- queryStart: string;
1358
- queryNot: string;
1359
- }, string | number, "writable">;
1414
+ protected readonly form: _angular_forms_signals.FieldTree<SearchFreeTextQueryForm, string | number, "writable">;
1360
1415
  /**
1361
1416
  * Resets all query fields to empty strings.
1362
1417
  */
1363
1418
  protected clear(): void;
1364
1419
  /**
1365
- * Builds the Lucene-style free-text query from the current field values and emits it via `done`.
1366
- * Shows an error dialog when only the NOT operator has been filled in, since it requires
1367
- * at least one positive term to produce a valid query.
1420
+ * Emits the assembled free-text query via `done`.
1421
+ *
1422
+ * Shows an error dialog when only the NOT operator has been filled in, since it
1423
+ * requires at least one positive term to produce a valid query.
1368
1424
  */
1369
1425
  protected ok(): void;
1370
1426
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClipperSearchFreeTextQueryBuilderComponent, never>;
@@ -188,21 +188,62 @@ interface LoginResult<T> extends ApiResult<boolean> {
188
188
  * The two shapes differ in one systematic way. A DTO leaves out what it does not have: a place
189
189
  * with no phone number simply has no `phone`. A form model cannot afford that — signal forms only
190
190
  * build a child field for a key whose value is defined, and the string validators need a `string`
191
- * rather than `string | undefined` — so every editable field is present, holding its empty value
192
- * (`''` for text and for the boxes of a datepicker, `false` for a checkbox, `0` for a counter).
191
+ * rather than `string | undefined` — so every editable field is present, holding its empty value.
193
192
  *
194
193
  * Doing that conversion by hand means a `?? ''` per field on the way in and a `|| undefined` per
195
194
  * field on the way out, twice per form, kept in sync forever. {@link DtoUtils.toForm} and
196
195
  * {@link DtoUtils.toPayload} do it once, driven by a single "empty model" constant that also serves as
197
196
  * the initial value of the form and as what a "clear" button restores.
197
+ *
198
+ * ## The convention
199
+ *
200
+ * 1. **A component that edits a DTO owns a form model of its own.** `ProfileEditComponent`
201
+ * receiving a `ProfileModel` declares a `ProfileForm`, derived from it — never binds the DTO
202
+ * to the form directly. The DTO stays free to say "absent"; the form is not.
203
+ * 2. **What is optional in the DTO becomes `| null` in the form model.** `phone?: string` becomes
204
+ * `phone: string` holding `''`, `level?: Level` becomes `level: Level | null`. The optionality
205
+ * is not lost, it moves into the empty value, and {@link Dto} gives it back on the way out.
206
+ * 3. **A date field is `Date | null`.** Always a `Date`, never a `Date | string`; `null` is its
207
+ * empty value, because that is what Material's date accessors — the single datepicker and both
208
+ * boxes of a `mat-date-range-picker` — write when an input is cleared.
209
+ * 4. **The empty model is named `_EMPTY_ITEM`.** One constant per form, next to its interface.
210
+ * 5. **The two conversions are called `toForm()` and `toPayload()`, and are written one after the
211
+ * other.** When a component builds more than one payload, the others are `toPayloadXxx()` and
212
+ * the main one keeps the bare name.
213
+ * 6. **A payload always goes through `toPayload()` before it reaches the API.** When the payload
214
+ * needs adjustments the generic conversion cannot make — a bitmask to rebuild, dates to
215
+ * normalize, a number to coerce, fields the model does not own — the component declares its own
216
+ * `toPayload()` and calls {@link DtoUtils.toPayload} inside it for the field-by-field part.
217
+ *
218
+ * @example
219
+ * ```ts
220
+ * interface ProfileForm {
221
+ * name: string; // name?: string in ProfileModel
222
+ * level: Level | null; // level?: Level
223
+ * from: Date | null; // fromDate?: Date, bound to a mat-date-range-picker
224
+ * to: Date | null; // toDate?: Date
225
+ * active: boolean;
226
+ * }
227
+ *
228
+ * const _EMPTY_ITEM: ProfileForm = { name: '', level: null, from: null, to: null, active: false };
229
+ *
230
+ * private toForm(dto?: ProfileModel): ProfileForm {
231
+ * return DtoUtils.toForm(_EMPTY_ITEM, dto as Partial<ProfileForm>);
232
+ * }
233
+ *
234
+ * private toPayload(): ProfileModel {
235
+ * const { from, to, ...rest } = this.model();
236
+ * return { ...DtoUtils.toPayload(rest), fromDate: from ?? undefined, toDate: to ?? undefined };
237
+ * }
238
+ * ```
198
239
  */
199
240
  /**
200
241
  * The DTO shape of a form model: the same fields, without the values that stand for "empty".
201
242
  *
202
243
  * It mirrors what {@link DtoUtils.toPayload} does at runtime, so the payload type says the truth. It
203
- * only works when the empty value is a literal type — `Date | '' | null` narrows to `Date`, while
204
- * a field typed `Date | string` cannot be narrowed, because `string` is not assignable to `''`.
205
- * That is the reason the convention is `| ''` and not `| string`.
244
+ * only works when the empty value is `''` or `null` — `Date | null` narrows to `Date`, and
245
+ * `string` (which is what `''` widens to) narrows to `string`. That is the reason a date field is
246
+ * `Date | null` and never `Date | string`: the latter could not be narrowed at all.
206
247
  */
207
248
  type Dto<TModel> = {
208
249
  [K in keyof TModel]: Exclude<TModel[K], '' | null>;
@@ -224,9 +265,6 @@ declare class DtoUtils {
224
265
  * one takes when the DTO does not carry it.
225
266
  * @param dto - The object coming from the API, or `undefined` when creating a new record.
226
267
  * @returns A new model, never the same reference as `empty` nor as `dto`.
227
- * @example
228
- * const EMPTY_PLACE: PlaceForm = { name: '', city: '', phone: '', disabled: false };
229
- * this.form().reset(DtoUtils.toForm(EMPTY_PLACE, r.value));
230
268
  */
231
269
  static toForm<TModel extends object>(empty: TModel, dto?: Partial<TModel> | null): TModel;
232
270
  /**
@@ -248,8 +286,6 @@ declare class DtoUtils {
248
286
  *
249
287
  * @param model - The current form model.
250
288
  * @returns A shallow copy without the empty fields.
251
- * @example
252
- * this.scmService.places.savePlace(DtoUtils.toPayload(this.model()));
253
289
  */
254
290
  static toPayload<TModel extends object>(model: TModel): Dto<TModel>;
255
291
  }