@zambon-dev/ui 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +743 -5
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +2318 -180
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/i18n/framework/en.json +14 -1
- package/i18n/framework/pt.json +14 -1
- package/package.json +1 -1
- package/types/zambon-dev-ui-framework.d.ts +306 -3
- package/types/zambon-dev-ui-library.d.ts +754 -9
package/i18n/framework/en.json
CHANGED
|
@@ -32,6 +32,18 @@
|
|
|
32
32
|
"CatalogSelect-MinimumLengthSearch": "Type at least {{ minimumLengthSearch }} characters.",
|
|
33
33
|
"CatalogSelect-NoResultsFound": "No results found.",
|
|
34
34
|
"EditSection-Details": "Details",
|
|
35
|
+
"FileUpload-Accept": "Accepted: {{ types }}",
|
|
36
|
+
"FileUpload-Browse": "browse",
|
|
37
|
+
"FileUpload-Empty": "No files.",
|
|
38
|
+
"FileUpload-MaxFiles": "Up to {{ count }} files",
|
|
39
|
+
"FileUpload-MaxFileSize": "Up to {{ size }} each",
|
|
40
|
+
"FileUpload-Progress": "Upload progress of {{ name }}",
|
|
41
|
+
"FileUpload-Prompt": "Drop a file here or",
|
|
42
|
+
"FileUpload-Prompt-Multiple": "Drop files here or",
|
|
43
|
+
"FileUpload-Rejected-FileSize": "{{ name }} was not added: it is larger than {{ size }}.",
|
|
44
|
+
"FileUpload-Rejected-FileType": "{{ name }} was not added: this file type is not accepted.",
|
|
45
|
+
"FileUpload-Rejected-MaxFiles": "{{ name }} was not added: the file limit was reached.",
|
|
46
|
+
"FileUpload-Remove": "Remove {{ name }}",
|
|
35
47
|
"Format-Currency": "1.2",
|
|
36
48
|
"Format-Date": "MM/dd/yyyy",
|
|
37
49
|
"Format-DateTime": "MM/dd/yyyy hh:mm a",
|
|
@@ -59,5 +71,6 @@
|
|
|
59
71
|
"RibbonGroup-Page": "Page",
|
|
60
72
|
"Tabs-CloseTab": "Close {{title}}",
|
|
61
73
|
"Tabs-ScrollLeft": "Scroll tabs left",
|
|
62
|
-
"Tabs-ScrollRight": "Scroll tabs right"
|
|
74
|
+
"Tabs-ScrollRight": "Scroll tabs right",
|
|
75
|
+
"Toast-Close": "Close notification"
|
|
63
76
|
}
|
package/i18n/framework/pt.json
CHANGED
|
@@ -32,6 +32,18 @@
|
|
|
32
32
|
"CatalogSelect-MinimumLengthSearch": "Digite ao menos {{ minimumLengthSearch }} caracteres.",
|
|
33
33
|
"CatalogSelect-NoResultsFound": "Nenhum resultado encontrado.",
|
|
34
34
|
"EditSection-Details": "Detalhes",
|
|
35
|
+
"FileUpload-Accept": "Aceitos: {{ types }}",
|
|
36
|
+
"FileUpload-Browse": "procure no computador",
|
|
37
|
+
"FileUpload-Empty": "Nenhum arquivo.",
|
|
38
|
+
"FileUpload-MaxFiles": "Até {{ count }} arquivos",
|
|
39
|
+
"FileUpload-MaxFileSize": "Até {{ size }} cada",
|
|
40
|
+
"FileUpload-Progress": "Progresso do envio de {{ name }}",
|
|
41
|
+
"FileUpload-Prompt": "Solte um arquivo aqui ou",
|
|
42
|
+
"FileUpload-Prompt-Multiple": "Solte os arquivos aqui ou",
|
|
43
|
+
"FileUpload-Rejected-FileSize": "{{ name }} não foi adicionado: é maior que {{ size }}.",
|
|
44
|
+
"FileUpload-Rejected-FileType": "{{ name }} não foi adicionado: este tipo de arquivo não é aceito.",
|
|
45
|
+
"FileUpload-Rejected-MaxFiles": "{{ name }} não foi adicionado: o limite de arquivos foi atingido.",
|
|
46
|
+
"FileUpload-Remove": "Remover {{ name }}",
|
|
35
47
|
"Format-Currency": "1.2",
|
|
36
48
|
"Format-Date": "dd/MM/yyyy",
|
|
37
49
|
"Format-DateTime": "dd/MM/yyyy HH:mm",
|
|
@@ -59,5 +71,6 @@
|
|
|
59
71
|
"RibbonGroup-Page": "Página",
|
|
60
72
|
"Tabs-CloseTab": "Fechar {{title}}",
|
|
61
73
|
"Tabs-ScrollLeft": "Rolar abas para a esquerda",
|
|
62
|
-
"Tabs-ScrollRight": "Rolar abas para a direita"
|
|
74
|
+
"Tabs-ScrollRight": "Rolar abas para a direita",
|
|
75
|
+
"Toast-Close": "Fechar notificação"
|
|
63
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zambon-dev/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Angular 22 component library and application shell: form controls, a virtual-scroll data grid, modals, ribbon, sidebar, tabbed navigation, view base classes and authentication layouts, themed with Tailwind CSS 4 tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { AfterViewInit, ApplicationRef, EnvironmentProviders, EventEmitter, InjectionToken, InputSignal, ModelSignal, NgZone, OnDestroy, OnInit, OutputEmitterRef, Provider, Signal, TemplateRef, WritableSignal } from "@angular/core";
|
|
3
|
-
import { AngularAssetPattern, ButtonIntent, DataGridConfigsProvider, DataGridDataset, DataProviderService, DateValidators, FormService, IModal, IRibbonButtonOption, ITabView, ModalComponent, ModalSize, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, RibbonButtonComponent, RibbonGroupChild } from "@zambon-dev/ui/library";
|
|
3
|
+
import { AngularAssetPattern, BaseComponent, ButtonIntent, DataGridConfigsProvider, DataGridDataset, DataProviderService, DateValidators, FormService, IModal, IRibbonButtonOption, ITabView, ModalComponent, ModalSize, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, RibbonButtonComponent, RibbonGroupChild } from "@zambon-dev/ui/library";
|
|
4
4
|
import { Observable, ReplaySubject, Subject } from "rxjs";
|
|
5
5
|
import { JwtHelperService } from "@auth0/angular-jwt";
|
|
6
6
|
import { Location } from "@angular/common";
|
|
7
7
|
import { ActivatedRoute, ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy, Router } from "@angular/router";
|
|
8
|
-
import { FormBuilder, FormGroup, FormGroupDirective } from "@angular/forms";
|
|
8
|
+
import { FormBuilder, FormControl, FormGroup, FormGroupDirective, FormGroupName } from "@angular/forms";
|
|
9
9
|
import { HttpBackend, HttpErrorResponse } from "@angular/common/http";
|
|
10
10
|
import { MultiTranslateHttpLoader, TranslationResource } from "ngx-translate-multi-http-loader";
|
|
11
11
|
/**
|
|
@@ -1911,6 +1911,309 @@ export declare class FrameworkComponentsModule {
|
|
|
1911
1911
|
static ɵmod: i0.ɵɵNgModuleDeclaration<FrameworkComponentsModule, never, never, [typeof FrameworkButtonsModule, typeof FrameworkModalsModule, typeof FrameworkViewsModule]>;
|
|
1912
1912
|
static ɵinj: i0.ɵɵInjectorDeclaration<FrameworkComponentsModule>;
|
|
1913
1913
|
}
|
|
1914
|
+
/** Why a chosen file was not added. Each reason is also the key of the error set on the control. */
|
|
1915
|
+
type FileUploadRejectionReason = 'fileSize' | 'fileType' | 'maxFiles';
|
|
1916
|
+
/** A file the user chose that was not added, and why. */
|
|
1917
|
+
interface FileUploadRejection {
|
|
1918
|
+
/** The file that was left out. */
|
|
1919
|
+
file: File;
|
|
1920
|
+
/** Why it was left out. */
|
|
1921
|
+
reason: FileUploadRejectionReason;
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* A labelled file field: a drop zone the user can also click or activate with the keyboard to
|
|
1925
|
+
* browse, and the list of chosen files. The control named by `controlName` holds a `File[]`, or a
|
|
1926
|
+
* `File | null` when `multiple` is off. Files that break `accept`, `maxFileSize` or `maxFiles` are
|
|
1927
|
+
* not added; the field lists them with the reason. They put no error on the control: the value
|
|
1928
|
+
* holds only accepted files, so a rejected one cannot leave the form invalid.
|
|
1929
|
+
*
|
|
1930
|
+
* The field does no upload. Read the files from the control, or listen to `filesAdded`, and send
|
|
1931
|
+
* them yourself. Pass `progress` to show how far each upload is.
|
|
1932
|
+
*/
|
|
1933
|
+
export declare class FileUploadComponent extends BaseComponent implements OnInit {
|
|
1934
|
+
/**
|
|
1935
|
+
* File types the field takes, in the format of the native `accept` attribute: extensions and
|
|
1936
|
+
* MIME types separated by commas, for example `.pdf,image/*`. Empty takes any file.
|
|
1937
|
+
*/
|
|
1938
|
+
readonly accept: InputSignal<string>;
|
|
1939
|
+
/** Name of the control in the surrounding form group that holds the chosen files. Required. */
|
|
1940
|
+
readonly controlName: InputSignal<string>;
|
|
1941
|
+
/** Text of the label, as a translation key. Defaults to empty. */
|
|
1942
|
+
readonly label: InputSignal<string>;
|
|
1943
|
+
/** Largest size of one file, in bytes. No limit by default. */
|
|
1944
|
+
readonly maxFileSize: InputSignal<number | undefined>;
|
|
1945
|
+
/** Most files the field holds when `multiple` is on. No limit by default. */
|
|
1946
|
+
readonly maxFiles: InputSignal<number | undefined>;
|
|
1947
|
+
/**
|
|
1948
|
+
* Lets the user choose several files. The control then holds a `File[]`; otherwise it holds one
|
|
1949
|
+
* `File` or `null`, and a new file replaces the old one. Defaults to `false`.
|
|
1950
|
+
*/
|
|
1951
|
+
readonly multiple: InputSignal<boolean>;
|
|
1952
|
+
/** Hint shown in small italics under the field, as a translation key. Defaults to empty. */
|
|
1953
|
+
readonly notes: InputSignal<string>;
|
|
1954
|
+
/**
|
|
1955
|
+
* Upload progress per file, keyed by file name, from 0 to 100. A file with an entry shows a
|
|
1956
|
+
* progress bar. The field does no upload itself; you fill this in while you upload.
|
|
1957
|
+
*/
|
|
1958
|
+
readonly progress: InputSignal<Record<string, number> | undefined>;
|
|
1959
|
+
/**
|
|
1960
|
+
* Messages per validation error key, as translation keys, for example
|
|
1961
|
+
* `{ required: 'Validation-Required' }`. A file the field leaves out sets no error; the field
|
|
1962
|
+
* lists it with the reason itself.
|
|
1963
|
+
*/
|
|
1964
|
+
readonly validations: InputSignal<{
|
|
1965
|
+
[id: string]: string;
|
|
1966
|
+
}>;
|
|
1967
|
+
/** Emits the files the user just added, after they pass the limits. A good place to start uploads. */
|
|
1968
|
+
readonly filesAdded: OutputEmitterRef<File[]>;
|
|
1969
|
+
/** Emits a file the user removed from the list. */
|
|
1970
|
+
readonly fileRemoved: OutputEmitterRef<File>;
|
|
1971
|
+
/** Emits the files left out of the last choice, with the reason for each. */
|
|
1972
|
+
readonly filesRejected: OutputEmitterRef<FileUploadRejection[]>;
|
|
1973
|
+
protected readonly formGroupDirective: FormGroupDirective;
|
|
1974
|
+
protected readonly formGroupName: FormGroupName | null;
|
|
1975
|
+
protected readonly formService: FormService;
|
|
1976
|
+
protected readonly hintId: string;
|
|
1977
|
+
protected readonly isDragOver: WritableSignal<boolean>;
|
|
1978
|
+
protected readonly rejections: WritableSignal<FileUploadRejection[]>;
|
|
1979
|
+
/** The app language's locale, such as `pt-BR`, for formatting sizes. */
|
|
1980
|
+
private readonly locale;
|
|
1981
|
+
/**
|
|
1982
|
+
* Bumped on every event the form emits. A FormGroup is not a signal, so without it the field
|
|
1983
|
+
* would keep its first face and its first file list. See `lib-form-input` for the same pattern.
|
|
1984
|
+
*/
|
|
1985
|
+
private readonly formChanged;
|
|
1986
|
+
/** The chosen files, as a list whether or not `multiple` is on. */
|
|
1987
|
+
/** `accept` as the limits line shows it: `image/*, .pdf` rather than `image/*,.pdf`. */
|
|
1988
|
+
protected readonly acceptText: Signal<string>;
|
|
1989
|
+
protected readonly files: Signal<File[]>;
|
|
1990
|
+
/** Whether the field shows the drop zone rather than a read-only list. */
|
|
1991
|
+
protected readonly isEditable: Signal<boolean>;
|
|
1992
|
+
protected readonly isInvalid: Signal<boolean>;
|
|
1993
|
+
/** The most files the field holds, or `undefined` for no limit. */
|
|
1994
|
+
protected readonly fileLimit: Signal<number | undefined>;
|
|
1995
|
+
protected get formControl(): FormControl | null;
|
|
1996
|
+
private get formGroup();
|
|
1997
|
+
constructor();
|
|
1998
|
+
ngOnInit(): void;
|
|
1999
|
+
protected onDragLeave(event: DragEvent): void;
|
|
2000
|
+
protected onDragOver(event: DragEvent): void;
|
|
2001
|
+
protected onDrop(event: DragEvent): void;
|
|
2002
|
+
protected onInputChange(event: Event): void;
|
|
2003
|
+
protected onKeyDown(event: Event, fileInput: HTMLInputElement): void;
|
|
2004
|
+
protected onRemoveClick(file: File): void;
|
|
2005
|
+
/**
|
|
2006
|
+
* Adds files as if the user had chosen them. Files that break the limits are left out, listed
|
|
2007
|
+
* with their reason and emitted through `filesRejected`.
|
|
2008
|
+
*/
|
|
2009
|
+
addFiles(candidates: File[]): void;
|
|
2010
|
+
/** Formats a size in bytes in the app's language, for example `1.5 MB` or `1,5 MB`. */
|
|
2011
|
+
protected formatSize(bytes: number): string;
|
|
2012
|
+
/** The file's upload progress, held between 0 and 100, or `undefined` when there is none. */
|
|
2013
|
+
protected progressOf(file: File): number | undefined;
|
|
2014
|
+
protected rejectionKey(reason: FileUploadRejectionReason): string;
|
|
2015
|
+
private isSameFile;
|
|
2016
|
+
/** Applies `accept` the way the native picker does: extensions, exact MIME types and `type/*`. */
|
|
2017
|
+
private matchesAccept;
|
|
2018
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
|
|
2019
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "framework-file-upload", never, {
|
|
2020
|
+
"accept": {
|
|
2021
|
+
"alias": "accept";
|
|
2022
|
+
"required": false;
|
|
2023
|
+
"isSignal": true;
|
|
2024
|
+
};
|
|
2025
|
+
"controlName": {
|
|
2026
|
+
"alias": "controlName";
|
|
2027
|
+
"required": true;
|
|
2028
|
+
"isSignal": true;
|
|
2029
|
+
};
|
|
2030
|
+
"label": {
|
|
2031
|
+
"alias": "label";
|
|
2032
|
+
"required": false;
|
|
2033
|
+
"isSignal": true;
|
|
2034
|
+
};
|
|
2035
|
+
"maxFileSize": {
|
|
2036
|
+
"alias": "maxFileSize";
|
|
2037
|
+
"required": false;
|
|
2038
|
+
"isSignal": true;
|
|
2039
|
+
};
|
|
2040
|
+
"maxFiles": {
|
|
2041
|
+
"alias": "maxFiles";
|
|
2042
|
+
"required": false;
|
|
2043
|
+
"isSignal": true;
|
|
2044
|
+
};
|
|
2045
|
+
"multiple": {
|
|
2046
|
+
"alias": "multiple";
|
|
2047
|
+
"required": false;
|
|
2048
|
+
"isSignal": true;
|
|
2049
|
+
};
|
|
2050
|
+
"notes": {
|
|
2051
|
+
"alias": "notes";
|
|
2052
|
+
"required": false;
|
|
2053
|
+
"isSignal": true;
|
|
2054
|
+
};
|
|
2055
|
+
"progress": {
|
|
2056
|
+
"alias": "progress";
|
|
2057
|
+
"required": false;
|
|
2058
|
+
"isSignal": true;
|
|
2059
|
+
};
|
|
2060
|
+
"validations": {
|
|
2061
|
+
"alias": "validations";
|
|
2062
|
+
"required": false;
|
|
2063
|
+
"isSignal": true;
|
|
2064
|
+
};
|
|
2065
|
+
}, {
|
|
2066
|
+
"filesAdded": "filesAdded";
|
|
2067
|
+
"fileRemoved": "fileRemoved";
|
|
2068
|
+
"filesRejected": "filesRejected";
|
|
2069
|
+
}, never, never, true, never>;
|
|
2070
|
+
}
|
|
2071
|
+
/** What a toast reports. It picks the icon, the colour and how the toast is announced. */
|
|
2072
|
+
type ToastIntent = 'success' | 'error' | 'warning' | 'info';
|
|
2073
|
+
/** Options for `ToastService.show()`. */
|
|
2074
|
+
interface ToastOptions {
|
|
2075
|
+
/** Translation key or text of the message. */
|
|
2076
|
+
message: string;
|
|
2077
|
+
/** Translation key or text shown in bold above the message. Optional. */
|
|
2078
|
+
title?: string;
|
|
2079
|
+
/** Values for the placeholders in `message` and `title`, such as `{ count: 3 }`. */
|
|
2080
|
+
params?: Record<string, unknown>;
|
|
2081
|
+
/** What the toast reports. Defaults to `info`. */
|
|
2082
|
+
intent?: ToastIntent;
|
|
2083
|
+
/**
|
|
2084
|
+
* Milliseconds before the toast closes by itself. `0` keeps it until the user closes it. Defaults
|
|
2085
|
+
* to `5000`, except for `error`, which stays until closed.
|
|
2086
|
+
*/
|
|
2087
|
+
duration?: number;
|
|
2088
|
+
}
|
|
2089
|
+
/** Options for the shortcut methods such as `ToastService.success()`. The method sets the intent. */
|
|
2090
|
+
type ToastShortcutOptions = Omit<ToastOptions, 'message' | 'intent'>;
|
|
2091
|
+
/** A toast on screen. `ToastService.toasts` lists them, oldest first. */
|
|
2092
|
+
interface Toast {
|
|
2093
|
+
/** Id returned by `show()`. Pass it to `dismiss()`. */
|
|
2094
|
+
readonly id: number;
|
|
2095
|
+
/** Translation key or text of the message. */
|
|
2096
|
+
readonly message: string;
|
|
2097
|
+
/** Translation key or text of the title, if any. */
|
|
2098
|
+
readonly title?: string;
|
|
2099
|
+
/** Values for the placeholders in `message` and `title`. */
|
|
2100
|
+
readonly params?: Record<string, unknown>;
|
|
2101
|
+
/** What the toast reports. */
|
|
2102
|
+
readonly intent: ToastIntent;
|
|
2103
|
+
/** Milliseconds before the toast closes by itself. `0` means it stays until closed. */
|
|
2104
|
+
readonly duration: number;
|
|
2105
|
+
}
|
|
2106
|
+
/** How many toasts show at once. A new toast beyond this closes the oldest one. */
|
|
2107
|
+
export declare const TOAST_MAX_VISIBLE = 5;
|
|
2108
|
+
/** Default `duration` for each intent, in milliseconds. `0` means the toast stays until closed. */
|
|
2109
|
+
export declare const TOAST_DEFAULT_DURATIONS: Readonly<Record<ToastIntent, number>>;
|
|
2110
|
+
/**
|
|
2111
|
+
* One toast: an intent icon, the message and a close button. `ToastService` renders these for you;
|
|
2112
|
+
* you only need this component to show a toast in a place of your own.
|
|
2113
|
+
*
|
|
2114
|
+
* The toast is not a live region: `ToastService` reads it out through the CDK `LiveAnnouncer`. If
|
|
2115
|
+
* you place one yourself, announce it the same way.
|
|
2116
|
+
*/
|
|
2117
|
+
export declare class ToastComponent {
|
|
2118
|
+
/** The toast to show. */
|
|
2119
|
+
readonly toast: InputSignal<Toast>;
|
|
2120
|
+
/** Emits when the user presses the close button. */
|
|
2121
|
+
readonly closed: OutputEmitterRef<void>;
|
|
2122
|
+
/** Emits `true` when the pointer or focus enters the toast and `false` when both have left it. */
|
|
2123
|
+
readonly pausedChange: OutputEmitterRef<boolean>;
|
|
2124
|
+
private readonly elementRef;
|
|
2125
|
+
private readonly isFocused;
|
|
2126
|
+
private readonly isHovered;
|
|
2127
|
+
/** Font Awesome classes of the intent icon. */
|
|
2128
|
+
protected readonly iconClass: Signal<string>;
|
|
2129
|
+
/** Whether the pointer or the focus is inside the toast. */
|
|
2130
|
+
protected readonly isPaused: Signal<boolean>;
|
|
2131
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
2132
|
+
protected setFocused(value: boolean): void;
|
|
2133
|
+
protected setHovered(value: boolean): void;
|
|
2134
|
+
private update;
|
|
2135
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
|
|
2136
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "framework-toast", never, {
|
|
2137
|
+
"toast": {
|
|
2138
|
+
"alias": "toast";
|
|
2139
|
+
"required": true;
|
|
2140
|
+
"isSignal": true;
|
|
2141
|
+
};
|
|
2142
|
+
}, {
|
|
2143
|
+
"closed": "closed";
|
|
2144
|
+
"pausedChange": "pausedChange";
|
|
2145
|
+
}, never, never, true, never>;
|
|
2146
|
+
}
|
|
2147
|
+
/** What the stack reads and calls. `ToastService` provides itself under this token. */
|
|
2148
|
+
interface ToastStackSource {
|
|
2149
|
+
readonly toasts: Signal<readonly Toast[]>;
|
|
2150
|
+
dismiss(id: number): void;
|
|
2151
|
+
pause(id: number): void;
|
|
2152
|
+
resume(id: number): void;
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* Hands the service to the stack without the stack importing the service, which imports the stack.
|
|
2156
|
+
* Internal: not exported from the package.
|
|
2157
|
+
*/
|
|
2158
|
+
declare const TOAST_STACK_SOURCE: InjectionToken<ToastStackSource>;
|
|
2159
|
+
/** The column of toasts that `ToastService` places in a corner of the screen. Internal. */
|
|
2160
|
+
declare class ToastStackComponent {
|
|
2161
|
+
protected readonly source: ToastStackSource;
|
|
2162
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastStackComponent, never>;
|
|
2163
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastStackComponent, "framework-toast-stack", never, {}, {}, never, never, true, never>;
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Shows short, non-blocking messages in the bottom-right corner of the screen. The first call adds
|
|
2167
|
+
* the container to the page, so a template needs nothing.
|
|
2168
|
+
*
|
|
2169
|
+
* Each toast is read out through the CDK `LiveAnnouncer`: politely for success, info and warning,
|
|
2170
|
+
* and assertively for an error. The announcer keeps one live region on the page, which screen
|
|
2171
|
+
* readers watch reliably; a toast that arrived with its text already inside its own live region was
|
|
2172
|
+
* often skipped.
|
|
2173
|
+
*/
|
|
2174
|
+
export declare class ToastService implements ToastStackSource {
|
|
2175
|
+
private readonly announcer;
|
|
2176
|
+
private readonly injector;
|
|
2177
|
+
private readonly translate;
|
|
2178
|
+
private readonly isBrowser;
|
|
2179
|
+
private nextId;
|
|
2180
|
+
/** Texts of the toasts shown in the current task, read out together once it ends. */
|
|
2181
|
+
private pendingAnnouncement?;
|
|
2182
|
+
private overlayRef?;
|
|
2183
|
+
private readonly state;
|
|
2184
|
+
private readonly timers;
|
|
2185
|
+
/** The toasts on screen, oldest first. */
|
|
2186
|
+
readonly toasts: Signal<readonly Toast[]>;
|
|
2187
|
+
constructor();
|
|
2188
|
+
/** Closes the toast with this id. Does nothing when it is already gone. */
|
|
2189
|
+
dismiss(id: number): void;
|
|
2190
|
+
/** Closes every toast. */
|
|
2191
|
+
dismissAll(): void;
|
|
2192
|
+
/** Shows an error toast. It stays until closed unless `options.duration` says otherwise. Returns its id. */
|
|
2193
|
+
error(message: string, options?: ToastShortcutOptions): number;
|
|
2194
|
+
/** Shows an info toast. Returns its id. */
|
|
2195
|
+
info(message: string, options?: ToastShortcutOptions): number;
|
|
2196
|
+
/** Stops the countdown of a toast, for example while the user reads it. `resume()` restarts it. */
|
|
2197
|
+
pause(id: number): void;
|
|
2198
|
+
/** Restarts the countdown of a paused toast with the time it had left. */
|
|
2199
|
+
resume(id: number): void;
|
|
2200
|
+
/**
|
|
2201
|
+
* Shows a toast and returns its id. Beyond five toasts on screen the oldest one closes. The message
|
|
2202
|
+
* and title are translation keys, translated with `params`.
|
|
2203
|
+
*/
|
|
2204
|
+
show(options: ToastOptions): number;
|
|
2205
|
+
/** Shows a success toast. Returns its id. */
|
|
2206
|
+
success(message: string, options?: ToastShortcutOptions): number;
|
|
2207
|
+
/** Shows a warning toast. Returns its id. */
|
|
2208
|
+
warning(message: string, options?: ToastShortcutOptions): number;
|
|
2209
|
+
private announce;
|
|
2210
|
+
private clearTimer;
|
|
2211
|
+
private ensureContainer;
|
|
2212
|
+
private showIntent;
|
|
2213
|
+
private startTimer;
|
|
2214
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
2215
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2216
|
+
}
|
|
1914
2217
|
export declare const APP_CONFIG: InjectionToken<AppConfig>;
|
|
1915
2218
|
export interface AppConfigOptions {
|
|
1916
2219
|
appName?: string;
|
|
@@ -1973,4 +2276,4 @@ export interface ZambonFrameworkTranslateConfig {
|
|
|
1973
2276
|
export declare function createZambonFrameworkTranslateLoader(httpBackend: HttpBackend, appResources?: (string | TranslationResource)[]): MultiTranslateHttpLoader;
|
|
1974
2277
|
export declare function provideZambonFrameworkTranslateLoader(appResources?: (string | TranslationResource)[]): Provider;
|
|
1975
2278
|
export declare function provideZambonFrameworkTranslateService(config?: ZambonFrameworkTranslateConfig): EnvironmentProviders;
|
|
1976
|
-
export { DateValidators };
|
|
2279
|
+
export { DateValidators, type FileUploadRejection, type FileUploadRejectionReason, type Toast, type ToastIntent, type ToastOptions, type ToastShortcutOptions };
|