@nanahoshi/mona-ui 0.32.3 → 0.33.0
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/docs/api/file-upload.md +174 -0
- package/docs/api/i18n.md +46 -0
- package/docs/api/locales.md +14 -14
- package/docs/file-upload.md +516 -0
- package/docs/forms.md +2 -0
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-command.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-file-upload.mjs +1137 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-C62HvK-w.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-BpsJwMkQ.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C1qjq2s7.mjs → nanahoshi-mona-ui-grid-grid-list.component-BVpGUjA7.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-CgOt2A6O.mjs → nanahoshi-mona-ui-grid-grid-row.component-D0T8kfdm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-tguG2LpN.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-5D2BjGx4.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs → nanahoshi-mona-ui-grid-grid.styles-62LTuPhD.mjs} +3 -3
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +11 -10
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +74 -0
- package/fesm2022/nanahoshi-mona-ui-internal-live-announcer.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +50 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +44 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +44 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/file-upload/package.json +4 -0
- package/i18n/catalogs/en-US.messages.json +29 -0
- package/internal/live-announcer/package.json +4 -0
- package/llms.txt +3 -1
- package/locales/ar-sa/ar-sa.messages.json +29 -0
- package/locales/de-de/de-de.messages.json +29 -0
- package/locales/es-es/es-es.messages.json +29 -0
- package/locales/fr-fr/fr-fr.messages.json +29 -0
- package/locales/id-id/id-id.messages.json +29 -0
- package/locales/it-it/it-it.messages.json +29 -0
- package/locales/ja-jp/ja-jp.messages.json +29 -0
- package/locales/ko-kr/ko-kr.messages.json +29 -0
- package/locales/pl-pl/pl-pl.messages.json +29 -0
- package/locales/pt-br/pt-br.messages.json +29 -0
- package/locales/ru-ru/ru-ru.messages.json +29 -0
- package/locales/tr-tr/tr-tr.messages.json +29 -0
- package/locales/zh-cn/zh-cn.messages.json +29 -0
- package/locales/zh-tw/zh-tw.messages.json +29 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-file-upload.d.ts +366 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +60 -0
- package/types/nanahoshi-mona-ui-internal-live-announcer.d.ts +12 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ElementRef } from "@angular/core";
|
|
3
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
import { MonaFileUploadMessages } from "@nanahoshi/mona-ui/i18n";
|
|
6
|
+
/**
|
|
7
|
+
* What the upload function gets with each file.
|
|
8
|
+
*/
|
|
9
|
+
export interface FileUploadContext {
|
|
10
|
+
/**
|
|
11
|
+
* Reports how much of the file has been sent. `total` defaults to the file's size. HttpClient's upload progress
|
|
12
|
+
* events are read without it.
|
|
13
|
+
*/
|
|
14
|
+
progress(loaded: number, total?: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* Aborted when the upload stops early: the file is removed, the list is cleared, the value is replaced or the
|
|
17
|
+
* component is destroyed. Pass it to `fetch`. An observable doesn't need it, since it's unsubscribed instead.
|
|
18
|
+
*/
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Uploads one file, and returns a promise or an observable.
|
|
23
|
+
*
|
|
24
|
+
* An observable can be HttpClient's request with `reportProgress: true` and `observe: "events"`: its upload progress
|
|
25
|
+
* events move the progress bar, and its response's body becomes the file's `response`. For any other observable, its
|
|
26
|
+
* last value does. For a promise, what it resolves to does. A rejected promise or an observable's error marks the file
|
|
27
|
+
* `failed`.
|
|
28
|
+
*/
|
|
29
|
+
export type FileUploadHandler = (file: File, context: FileUploadContext) => Observable<unknown> | Promise<unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Why a file wasn't added: its type isn't in `accept` (`type`), it's larger than `maxFileSize` (`maxFileSize`) or
|
|
32
|
+
* smaller than `minFileSize` (`minFileSize`), or the list already holds as many files as it can (`maxFiles`).
|
|
33
|
+
*/
|
|
34
|
+
export type FileUploadRejection = "maxFileSize" | "maxFiles" | "minFileSize" | "type";
|
|
35
|
+
/**
|
|
36
|
+
* Where a file in the list stands.
|
|
37
|
+
*
|
|
38
|
+
* - `selected`: added and not uploaded. Without an `upload` function, every file the checks let through stays here.
|
|
39
|
+
* With one, a file waits here while `autoUpload` is off.
|
|
40
|
+
* - `uploading`: its upload is running.
|
|
41
|
+
* - `uploaded`: its upload finished.
|
|
42
|
+
* - `failed`: its upload failed, and can be retried.
|
|
43
|
+
* - `rejected`: it didn't pass the type, size or count checks. It's listed with the reason, and isn't in the value.
|
|
44
|
+
*/
|
|
45
|
+
export type FileUploadStatus = "failed" | "rejected" | "selected" | "uploaded" | "uploading";
|
|
46
|
+
/**
|
|
47
|
+
* A file in the upload's list, and where it stands.
|
|
48
|
+
*/
|
|
49
|
+
export interface FileUploadItem {
|
|
50
|
+
/** What the upload failed with, while the status is `failed`. */
|
|
51
|
+
readonly error: unknown;
|
|
52
|
+
readonly file: File;
|
|
53
|
+
/**
|
|
54
|
+
* How much of the file has been sent, from 0 to 1, while it uploads. Null until the upload function reports
|
|
55
|
+
* progress, which it may never do.
|
|
56
|
+
*/
|
|
57
|
+
readonly progress: number | null;
|
|
58
|
+
/** Why the file wasn't added, while the status is `rejected`. */
|
|
59
|
+
readonly rejection: FileUploadRejection | null;
|
|
60
|
+
/** What the upload function returned for the file, once its status is `uploaded`. */
|
|
61
|
+
readonly response: unknown;
|
|
62
|
+
readonly status: FileUploadStatus;
|
|
63
|
+
}
|
|
64
|
+
/** What a row of the template shows. */
|
|
65
|
+
interface FileUploadRow {
|
|
66
|
+
readonly actionsShown: boolean;
|
|
67
|
+
readonly icon: "error" | "file" | "uploaded";
|
|
68
|
+
readonly item: FileUploadItem;
|
|
69
|
+
readonly key: number;
|
|
70
|
+
readonly nameId: string;
|
|
71
|
+
readonly progressLabel: string;
|
|
72
|
+
readonly progressValue: number | null;
|
|
73
|
+
/** Name of the button that removes the file, or cancels its upload while it runs. */
|
|
74
|
+
readonly removeLabel: string;
|
|
75
|
+
readonly retryLabel: string;
|
|
76
|
+
readonly status: string;
|
|
77
|
+
readonly statusError: boolean;
|
|
78
|
+
readonly statusId: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Picks files from a drop zone or the browser's file dialog, checks their type, size and count, and lists them. Given
|
|
82
|
+
* an `upload` function, it uploads each file with a progress bar, and lets the person cancel or retry an upload.
|
|
83
|
+
*
|
|
84
|
+
* The value is the files the checks let through. With an `upload` function, it's the files that finished uploading,
|
|
85
|
+
* so a required field stays invalid until one has.
|
|
86
|
+
*/
|
|
87
|
+
export declare class FileUploadComponent implements FormValueControl<File[]> {
|
|
88
|
+
#private;
|
|
89
|
+
protected readonly actionsClass: string;
|
|
90
|
+
/** What the status region says: the last files added or rejected, upload finished or failed, or file removed. */
|
|
91
|
+
protected readonly announcement: import("@angular/core").WritableSignal<string>;
|
|
92
|
+
protected readonly browseButtonRef: import("@angular/core").Signal<ElementRef<HTMLButtonElement>>;
|
|
93
|
+
protected readonly browseClass: string;
|
|
94
|
+
protected readonly browseDescribedBy: import("@angular/core").Signal<string | null>;
|
|
95
|
+
protected readonly classes: import("@angular/core").Signal<string>;
|
|
96
|
+
protected readonly dragging: import("@angular/core").WritableSignal<boolean>;
|
|
97
|
+
protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
|
|
98
|
+
protected readonly fileInputRef: import("@angular/core").Signal<ElementRef<HTMLInputElement>>;
|
|
99
|
+
protected readonly interactive: import("@angular/core").Signal<boolean>;
|
|
100
|
+
protected readonly invalidState: import("@angular/core").Signal<boolean>;
|
|
101
|
+
protected readonly itemActionsClass: string;
|
|
102
|
+
protected readonly itemBodyClass: string;
|
|
103
|
+
protected readonly itemClass: string;
|
|
104
|
+
protected readonly itemIconClass: {
|
|
105
|
+
readonly error: string;
|
|
106
|
+
readonly file: string;
|
|
107
|
+
readonly uploaded: string;
|
|
108
|
+
};
|
|
109
|
+
protected readonly itemNameClass: string;
|
|
110
|
+
protected readonly itemProgressClass: string;
|
|
111
|
+
protected readonly itemStatusClass: {
|
|
112
|
+
readonly error: string;
|
|
113
|
+
readonly muted: string;
|
|
114
|
+
};
|
|
115
|
+
protected readonly labelledBy: import("@angular/core").Signal<string | null>;
|
|
116
|
+
protected readonly listClass: string;
|
|
117
|
+
protected readonly listId: string;
|
|
118
|
+
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaFileUploadMessages>;
|
|
119
|
+
/** Whether the upload and clear buttons show: files wait for them while `autoUpload` is off. */
|
|
120
|
+
protected readonly pendingActionsShown: import("@angular/core").Signal<boolean>;
|
|
121
|
+
protected readonly restrictions: import("@angular/core").Signal<string>;
|
|
122
|
+
protected readonly restrictionsClass: string;
|
|
123
|
+
protected readonly restrictionsId: string;
|
|
124
|
+
protected readonly rows: import("@angular/core").Signal<readonly FileUploadRow[]>;
|
|
125
|
+
protected readonly zoneClass: string;
|
|
126
|
+
protected readonly zoneIconClass: string;
|
|
127
|
+
protected readonly zoneTextClass: string;
|
|
128
|
+
/**
|
|
129
|
+
* @description File types the dialog offers and the checks accept, as in the native `accept` attribute: extensions
|
|
130
|
+
* such as `.pdf`, MIME types such as `image/png`, or `image/*`. Files dropped on the zone are checked against it
|
|
131
|
+
* too, since the dialog's filter doesn't apply to them. Empty accepts every file.
|
|
132
|
+
* @default ""
|
|
133
|
+
*/
|
|
134
|
+
readonly accept: import("@angular/core").InputSignal<string>;
|
|
135
|
+
/**
|
|
136
|
+
* @description Id of an element that describes the browse button, such as an error message. A form field's hint
|
|
137
|
+
* and errors are added after it.
|
|
138
|
+
* @default null
|
|
139
|
+
*/
|
|
140
|
+
readonly ariaDescribedBy: import("@angular/core").InputSignal<string | null>;
|
|
141
|
+
/**
|
|
142
|
+
* @description Accessible name of the group, when no label names it.
|
|
143
|
+
* @default null
|
|
144
|
+
*/
|
|
145
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
146
|
+
/**
|
|
147
|
+
* @description Id of the element that names the group.
|
|
148
|
+
* @default null
|
|
149
|
+
*/
|
|
150
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string | null>;
|
|
151
|
+
/**
|
|
152
|
+
* @description Uploads each file as soon as it's added. When off, files wait for the upload button, or for
|
|
153
|
+
* `uploadFiles()`. Has no effect without an `upload` function.
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
readonly autoUpload: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
157
|
+
/**
|
|
158
|
+
* @description Turns off the drop zone, the browse button and the list's buttons. When bound to a signal form
|
|
159
|
+
* field via `[formField]`, this is written by the `FormField` directive.
|
|
160
|
+
* @default false
|
|
161
|
+
*/
|
|
162
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* @description Marks the upload as invalid. When bound to a signal form field via `[formField]`, this is written
|
|
165
|
+
* by the `FormField` directive.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
169
|
+
/** Every file in the list, with where it stands, in the order they were added. */
|
|
170
|
+
readonly items: import("@angular/core").Signal<readonly FileUploadItem[]>;
|
|
171
|
+
/**
|
|
172
|
+
* @description The largest file size in bytes. Larger files are listed as rejected, and not added.
|
|
173
|
+
* @default null
|
|
174
|
+
*/
|
|
175
|
+
readonly maxFileSize: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
176
|
+
/**
|
|
177
|
+
* @description The most files the list holds, when `multiple` is on. Files past it are listed as rejected.
|
|
178
|
+
* @default null
|
|
179
|
+
*/
|
|
180
|
+
readonly maxFiles: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
181
|
+
/**
|
|
182
|
+
* @description The smallest file size in bytes. Smaller files, such as empty ones, are listed as rejected.
|
|
183
|
+
* @default null
|
|
184
|
+
*/
|
|
185
|
+
readonly minFileSize: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
186
|
+
/**
|
|
187
|
+
* @description Lets the person add several files. When off, a new file replaces the one in the list.
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
190
|
+
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
191
|
+
/**
|
|
192
|
+
* @description Keeps the list as it is: files can't be added or removed.
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
196
|
+
/**
|
|
197
|
+
* @description Emitted when the person removes a file, by its remove or cancel button or by the clear button,
|
|
198
|
+
* with the file as it was. Delete an uploaded file from the server here.
|
|
199
|
+
*/
|
|
200
|
+
readonly remove: import("@angular/core").OutputEmitterRef<FileUploadItem>;
|
|
201
|
+
/**
|
|
202
|
+
* @description Marks the upload as required: it's invalid when touched with no file in its value.
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
206
|
+
/**
|
|
207
|
+
* @description Emitted when focus leaves the component, and when files are dropped on it. The `FormField`
|
|
208
|
+
* directive listens to this to mark the field as touched.
|
|
209
|
+
*/
|
|
210
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
211
|
+
/**
|
|
212
|
+
* @description Sets the touched state. When bound to a signal form field via `[formField]`, this is written by the
|
|
213
|
+
* `FormField` directive.
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
217
|
+
/**
|
|
218
|
+
* @description Uploads one file, and returns a promise or an observable, such as HttpClient's request with
|
|
219
|
+
* `reportProgress: true` and `observe: "events"`. Without it, the component only picks files, and the value holds
|
|
220
|
+
* them for the form to send.
|
|
221
|
+
* @default null
|
|
222
|
+
*/
|
|
223
|
+
readonly upload: import("@angular/core").InputSignal<FileUploadHandler | null>;
|
|
224
|
+
/**
|
|
225
|
+
* @description Emitted when a file fails to upload, with the error in its `error`.
|
|
226
|
+
*/
|
|
227
|
+
readonly uploadError: import("@angular/core").OutputEmitterRef<FileUploadItem>;
|
|
228
|
+
/**
|
|
229
|
+
* @description Emitted when a file finishes uploading, with what the upload returned in its `response`.
|
|
230
|
+
*/
|
|
231
|
+
readonly uploadSuccess: import("@angular/core").OutputEmitterRef<FileUploadItem>;
|
|
232
|
+
/** Whether any file is uploading. */
|
|
233
|
+
readonly uploading: import("@angular/core").Signal<boolean>;
|
|
234
|
+
/**
|
|
235
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
236
|
+
* @default ""
|
|
237
|
+
*/
|
|
238
|
+
readonly userClass: import("@angular/core").InputSignal<string>;
|
|
239
|
+
/**
|
|
240
|
+
* @description The files the checks let through, or with an `upload` function, the files that finished
|
|
241
|
+
* uploading. Setting it from outside replaces the list, and stops the uploads that are running.
|
|
242
|
+
* @default []
|
|
243
|
+
*/
|
|
244
|
+
readonly value: import("@angular/core").ModelSignal<File[]>;
|
|
245
|
+
constructor();
|
|
246
|
+
/** Opens the browser's file dialog, unless the component is disabled or read-only. */
|
|
247
|
+
browse(): void;
|
|
248
|
+
/** Removes every file, stopping the uploads that are running, and emits `remove` for each but the rejected. */
|
|
249
|
+
clearFiles(): void;
|
|
250
|
+
/** Moves focus to the browse button. */
|
|
251
|
+
focus(): void;
|
|
252
|
+
/** Uploads every file waiting for the upload button. Does nothing without an `upload` function. */
|
|
253
|
+
uploadFiles(): void;
|
|
254
|
+
protected onClearClick(): void;
|
|
255
|
+
protected onDragEnter(event: DragEvent): void;
|
|
256
|
+
protected onDragLeave(event: DragEvent): void;
|
|
257
|
+
protected onDragOver(event: DragEvent): void;
|
|
258
|
+
protected onDrop(event: DragEvent): void;
|
|
259
|
+
protected onFileInputChange(event: Event): void;
|
|
260
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
261
|
+
protected onRemoveClick(row: FileUploadRow): void;
|
|
262
|
+
protected onRetryClick(row: FileUploadRow): void;
|
|
263
|
+
protected onUploadClick(): void;
|
|
264
|
+
protected onZoneClick(event: MouseEvent): void;
|
|
265
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
|
|
266
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "mona-file-upload", ["monaFileUpload"], {
|
|
267
|
+
"accept": {
|
|
268
|
+
"alias": "accept";
|
|
269
|
+
"required": false;
|
|
270
|
+
"isSignal": true;
|
|
271
|
+
};
|
|
272
|
+
"ariaDescribedBy": {
|
|
273
|
+
"alias": "aria-describedby";
|
|
274
|
+
"required": false;
|
|
275
|
+
"isSignal": true;
|
|
276
|
+
};
|
|
277
|
+
"ariaLabel": {
|
|
278
|
+
"alias": "aria-label";
|
|
279
|
+
"required": false;
|
|
280
|
+
"isSignal": true;
|
|
281
|
+
};
|
|
282
|
+
"ariaLabelledBy": {
|
|
283
|
+
"alias": "aria-labelledby";
|
|
284
|
+
"required": false;
|
|
285
|
+
"isSignal": true;
|
|
286
|
+
};
|
|
287
|
+
"autoUpload": {
|
|
288
|
+
"alias": "autoUpload";
|
|
289
|
+
"required": false;
|
|
290
|
+
"isSignal": true;
|
|
291
|
+
};
|
|
292
|
+
"disabled": {
|
|
293
|
+
"alias": "disabled";
|
|
294
|
+
"required": false;
|
|
295
|
+
"isSignal": true;
|
|
296
|
+
};
|
|
297
|
+
"invalid": {
|
|
298
|
+
"alias": "invalid";
|
|
299
|
+
"required": false;
|
|
300
|
+
"isSignal": true;
|
|
301
|
+
};
|
|
302
|
+
"maxFileSize": {
|
|
303
|
+
"alias": "maxFileSize";
|
|
304
|
+
"required": false;
|
|
305
|
+
"isSignal": true;
|
|
306
|
+
};
|
|
307
|
+
"maxFiles": {
|
|
308
|
+
"alias": "maxFiles";
|
|
309
|
+
"required": false;
|
|
310
|
+
"isSignal": true;
|
|
311
|
+
};
|
|
312
|
+
"minFileSize": {
|
|
313
|
+
"alias": "minFileSize";
|
|
314
|
+
"required": false;
|
|
315
|
+
"isSignal": true;
|
|
316
|
+
};
|
|
317
|
+
"multiple": {
|
|
318
|
+
"alias": "multiple";
|
|
319
|
+
"required": false;
|
|
320
|
+
"isSignal": true;
|
|
321
|
+
};
|
|
322
|
+
"readonly": {
|
|
323
|
+
"alias": "readonly";
|
|
324
|
+
"required": false;
|
|
325
|
+
"isSignal": true;
|
|
326
|
+
};
|
|
327
|
+
"required": {
|
|
328
|
+
"alias": "required";
|
|
329
|
+
"required": false;
|
|
330
|
+
"isSignal": true;
|
|
331
|
+
};
|
|
332
|
+
"touched": {
|
|
333
|
+
"alias": "touched";
|
|
334
|
+
"required": false;
|
|
335
|
+
"isSignal": true;
|
|
336
|
+
};
|
|
337
|
+
"upload": {
|
|
338
|
+
"alias": "upload";
|
|
339
|
+
"required": false;
|
|
340
|
+
"isSignal": true;
|
|
341
|
+
};
|
|
342
|
+
"userClass": {
|
|
343
|
+
"alias": "class";
|
|
344
|
+
"required": false;
|
|
345
|
+
"isSignal": true;
|
|
346
|
+
};
|
|
347
|
+
"value": {
|
|
348
|
+
"alias": "value";
|
|
349
|
+
"required": false;
|
|
350
|
+
"isSignal": true;
|
|
351
|
+
};
|
|
352
|
+
}, {
|
|
353
|
+
"remove": "remove";
|
|
354
|
+
"touch": "touch";
|
|
355
|
+
"uploadError": "uploadError";
|
|
356
|
+
"uploadSuccess": "uploadSuccess";
|
|
357
|
+
"value": "valueChange";
|
|
358
|
+
}, never, never, true, never>;
|
|
359
|
+
}
|
|
360
|
+
export declare const FILE_UPLOAD_DEFAULT_MESSAGES: MonaFileUploadMessages;
|
|
361
|
+
/**
|
|
362
|
+
* A file size in the locale, in the largest unit that keeps it at 1 or more: "512 bytes", "1.5 kB", "20 MB". Units are
|
|
363
|
+
* multiples of 1024, as limits are usually written (`5 * 1024 * 1024`), so that limit reads as "5 MB".
|
|
364
|
+
*/
|
|
365
|
+
export declare function formatFileSize(bytes: number, localeId: string): string;
|
|
366
|
+
export {};
|
|
@@ -449,6 +449,65 @@ export interface MonaEditorMessages {
|
|
|
449
449
|
/** The label of the width field in the insert image form. */
|
|
450
450
|
readonly widthPx: string;
|
|
451
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* The file upload's drop zone, its list of files, and what it announces as files are added, uploaded and removed.
|
|
454
|
+
*/
|
|
455
|
+
export interface MonaFileUploadMessages {
|
|
456
|
+
/** The browse button's text, when several files can be added. */
|
|
457
|
+
readonly browse: string;
|
|
458
|
+
/** The browse button's text, when one file can be added. */
|
|
459
|
+
readonly browseFile: string;
|
|
460
|
+
/** Name of the button that stops a file's upload and removes it. */
|
|
461
|
+
cancel(name: string): string;
|
|
462
|
+
/** Text of the button that removes every file, shown with the upload button while `autoUpload` is off. */
|
|
463
|
+
readonly clear: string;
|
|
464
|
+
/** The drop zone's text, when one file can be added. */
|
|
465
|
+
readonly dropFile: string;
|
|
466
|
+
/** The drop zone's text, when several files can be added. */
|
|
467
|
+
readonly dropFiles: string;
|
|
468
|
+
/** The drop zone's text while files are dragged over it. */
|
|
469
|
+
readonly dropToAdd: string;
|
|
470
|
+
/** Announced when a file's upload fails. */
|
|
471
|
+
fileFailed(name: string): string;
|
|
472
|
+
/** Announced for a file that wasn't added, with the reason, which is one of the rejection messages. */
|
|
473
|
+
fileRejected(name: string, reason: string): string;
|
|
474
|
+
/** Announced when a file is removed. */
|
|
475
|
+
fileRemoved(name: string): string;
|
|
476
|
+
/** The accepted types under the drop zone, as a list such as "PDF, PNG or JPG". */
|
|
477
|
+
fileTypes(types: string): string;
|
|
478
|
+
/** Announced when a file's upload finishes. */
|
|
479
|
+
fileUploaded(name: string): string;
|
|
480
|
+
/** Name of the list of files. */
|
|
481
|
+
readonly files: string;
|
|
482
|
+
/** Announced when files are added. */
|
|
483
|
+
filesAdded(count: number): string;
|
|
484
|
+
/** Why a file of a type `accept` doesn't list wasn't added. */
|
|
485
|
+
readonly invalidType: string;
|
|
486
|
+
/** The largest file size under the drop zone, formatted in the locale. */
|
|
487
|
+
maxFileSize(size: string): string;
|
|
488
|
+
/** The most files under the drop zone. */
|
|
489
|
+
maxFiles(count: number): string;
|
|
490
|
+
/** A file's status while it waits for the upload button. */
|
|
491
|
+
readonly readyToUpload: string;
|
|
492
|
+
/** Name of the button that removes a file. */
|
|
493
|
+
remove(name: string): string;
|
|
494
|
+
/** Name of the button that uploads a failed file again. */
|
|
495
|
+
retry(name: string): string;
|
|
496
|
+
/** Why a file larger than `maxFileSize` wasn't added, with the size formatted in the locale. */
|
|
497
|
+
tooLarge(size: string): string;
|
|
498
|
+
/** Why a file past `maxFiles` wasn't added. */
|
|
499
|
+
tooMany(count: number): string;
|
|
500
|
+
/** Why a file smaller than `minFileSize` wasn't added, with the size formatted in the locale. */
|
|
501
|
+
tooSmall(size: string): string;
|
|
502
|
+
/** Text of the button that uploads the waiting files, while `autoUpload` is off. */
|
|
503
|
+
readonly upload: string;
|
|
504
|
+
/** A file's status when its upload failed. */
|
|
505
|
+
readonly uploadFailed: string;
|
|
506
|
+
/** A file's status once it's uploaded. */
|
|
507
|
+
readonly uploaded: string;
|
|
508
|
+
/** A file's status while it uploads. */
|
|
509
|
+
readonly uploading: string;
|
|
510
|
+
}
|
|
452
511
|
export interface MonaFilterMessages {
|
|
453
512
|
readonly and: string;
|
|
454
513
|
readonly apply: string;
|
|
@@ -859,6 +918,7 @@ export interface MonaLocaleMessages {
|
|
|
859
918
|
dropdownList: MonaDropdownListMessages;
|
|
860
919
|
dropdowns: MonaDropdownsMessages;
|
|
861
920
|
editor: MonaEditorMessages;
|
|
921
|
+
fileUpload: MonaFileUploadMessages;
|
|
862
922
|
filter: MonaFilterMessages;
|
|
863
923
|
formField: MonaFormFieldMessages;
|
|
864
924
|
grid: MonaGridMessages;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LiveAnnouncer } from "@angular/cdk/a11y";
|
|
2
|
+
/**
|
|
3
|
+
* Injects CDK's `LiveAnnouncer`, and loads the style that hides its live region.
|
|
4
|
+
*
|
|
5
|
+
* The announcer adds a `cdk-visually-hidden` element to the end of `<body>`, but doesn't load that class's rule. CDK's
|
|
6
|
+
* focus trap and `cdkAriaLive` load it, as a side effect. On a page with neither, everything announced shows as text
|
|
7
|
+
* below the page. This loads the rule as they do: once per application, with no global stylesheet, so it works for
|
|
8
|
+
* applications that don't import Mona UI's or CDK's CSS.
|
|
9
|
+
*
|
|
10
|
+
* Use it instead of `inject(LiveAnnouncer)`. Call it in an injection context.
|
|
11
|
+
*/
|
|
12
|
+
export declare function injectLiveAnnouncer(): LiveAnnouncer;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_AR_SA_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_DE_DE_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_ES_ES_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_FR_FR_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_ID_ID_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|
|
@@ -279,6 +279,35 @@ export declare const MONA_IT_IT_LOCALE: {
|
|
|
279
279
|
undo: string;
|
|
280
280
|
widthPx: string;
|
|
281
281
|
};
|
|
282
|
+
fileUpload: {
|
|
283
|
+
browse: string;
|
|
284
|
+
browseFile: string;
|
|
285
|
+
cancel: (name: string) => string;
|
|
286
|
+
clear: string;
|
|
287
|
+
dropFile: string;
|
|
288
|
+
dropFiles: string;
|
|
289
|
+
dropToAdd: string;
|
|
290
|
+
fileFailed: (name: string) => string;
|
|
291
|
+
fileRejected: (name: string, reason: string) => string;
|
|
292
|
+
fileRemoved: (name: string) => string;
|
|
293
|
+
fileTypes: (types: string) => string;
|
|
294
|
+
fileUploaded: (name: string) => string;
|
|
295
|
+
files: string;
|
|
296
|
+
filesAdded: (count: number) => string;
|
|
297
|
+
invalidType: string;
|
|
298
|
+
maxFileSize: (size: string) => string;
|
|
299
|
+
maxFiles: (count: number) => string;
|
|
300
|
+
readyToUpload: string;
|
|
301
|
+
remove: (name: string) => string;
|
|
302
|
+
retry: (name: string) => string;
|
|
303
|
+
tooLarge: (size: string) => string;
|
|
304
|
+
tooMany: (count: number) => string;
|
|
305
|
+
tooSmall: (size: string) => string;
|
|
306
|
+
upload: string;
|
|
307
|
+
uploadFailed: string;
|
|
308
|
+
uploaded: string;
|
|
309
|
+
uploading: string;
|
|
310
|
+
};
|
|
282
311
|
filter: {
|
|
283
312
|
and: string;
|
|
284
313
|
apply: string;
|