@nanahoshi/mona-ui 0.32.2 → 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.
Files changed (109) hide show
  1. package/docs/api/calendar.md +1 -1
  2. package/docs/api/file-upload.md +174 -0
  3. package/docs/api/i18n.md +49 -3
  4. package/docs/api/list-box.md +1 -1
  5. package/docs/api/locales.md +14 -14
  6. package/docs/api/tabs.md +1 -1
  7. package/docs/breadcrumb.md +6 -1
  8. package/docs/chart-line-area.md +6 -1
  9. package/docs/chart-treemap.md +1 -1
  10. package/docs/checkbox.md +1 -3
  11. package/docs/circular-progress-bar.md +26 -5
  12. package/docs/collapsible.md +28 -6
  13. package/docs/color-palette.md +24 -3
  14. package/docs/date-range-picker.md +1 -5
  15. package/docs/dropdown-button.md +6 -1
  16. package/docs/editor.md +8 -2
  17. package/docs/expansion-panel.md +6 -1
  18. package/docs/file-upload.md +516 -0
  19. package/docs/forms.md +2 -0
  20. package/docs/otp-input.md +12 -4
  21. package/docs/popup.md +2 -6
  22. package/docs/progress-bar.md +12 -3
  23. package/docs/scroll-view.md +6 -3
  24. package/docs/sheet.md +6 -2
  25. package/docs/sidebar.md +5 -1
  26. package/docs/skeleton.md +9 -2
  27. package/docs/stepper.md +3 -1
  28. package/docs/textarea.md +7 -1
  29. package/docs/textbox.md +7 -1
  30. package/docs/window.md +1 -1
  31. package/fesm2022/nanahoshi-mona-ui-card.mjs +2 -2
  32. package/fesm2022/nanahoshi-mona-ui-chart.mjs +2 -2
  33. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +2 -2
  34. package/fesm2022/nanahoshi-mona-ui-command.mjs +4 -3
  35. package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +2 -2
  36. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +6 -3
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +10 -5
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +8 -8
  39. package/fesm2022/nanahoshi-mona-ui-file-upload.mjs +1137 -0
  40. package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-C62HvK-w.mjs} +2 -2
  41. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-BpsJwMkQ.mjs} +2 -2
  42. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs → nanahoshi-mona-ui-grid-grid-list.component-BVpGUjA7.mjs} +5 -5
  43. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs → nanahoshi-mona-ui-grid-grid-row.component-D0T8kfdm.mjs} +7 -7
  44. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-5D2BjGx4.mjs} +5 -5
  45. package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs → nanahoshi-mona-ui-grid-grid.styles-62LTuPhD.mjs} +3 -3
  46. package/fesm2022/nanahoshi-mona-ui-grid.mjs +15 -14
  47. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +74 -0
  48. package/fesm2022/nanahoshi-mona-ui-internal-live-announcer.mjs +10 -0
  49. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +3 -2
  50. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +2 -2
  51. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +50 -0
  52. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +38 -0
  53. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +38 -0
  54. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +38 -0
  55. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -0
  56. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +38 -0
  57. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -0
  58. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -0
  59. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +44 -0
  60. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +38 -0
  61. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +44 -0
  62. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +29 -0
  63. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -0
  64. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -0
  65. package/fesm2022/nanahoshi-mona-ui-notification.mjs +2 -2
  66. package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -2
  67. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +2 -2
  68. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +6 -6
  69. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +2 -2
  70. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +2 -2
  71. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
  72. package/fesm2022/nanahoshi-mona-ui-window.mjs +15 -67
  73. package/file-upload/package.json +4 -0
  74. package/i18n/catalogs/en-US.messages.json +29 -0
  75. package/internal/live-announcer/package.json +4 -0
  76. package/llms.txt +3 -1
  77. package/locales/ar-sa/ar-sa.messages.json +29 -0
  78. package/locales/de-de/de-de.messages.json +29 -0
  79. package/locales/es-es/es-es.messages.json +29 -0
  80. package/locales/fr-fr/fr-fr.messages.json +29 -0
  81. package/locales/id-id/id-id.messages.json +29 -0
  82. package/locales/it-it/it-it.messages.json +29 -0
  83. package/locales/ja-jp/ja-jp.messages.json +29 -0
  84. package/locales/ko-kr/ko-kr.messages.json +29 -0
  85. package/locales/pl-pl/pl-pl.messages.json +29 -0
  86. package/locales/pt-br/pt-br.messages.json +29 -0
  87. package/locales/ru-ru/ru-ru.messages.json +29 -0
  88. package/locales/tr-tr/tr-tr.messages.json +29 -0
  89. package/locales/zh-cn/zh-cn.messages.json +29 -0
  90. package/locales/zh-tw/zh-tw.messages.json +29 -0
  91. package/package.json +9 -1
  92. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -0
  93. package/types/nanahoshi-mona-ui-file-upload.d.ts +366 -0
  94. package/types/nanahoshi-mona-ui-i18n.d.ts +73 -13
  95. package/types/nanahoshi-mona-ui-internal-live-announcer.d.ts +12 -0
  96. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
  97. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
  98. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
  99. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
  100. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
  101. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
  102. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
  103. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
  104. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +29 -0
  105. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
  106. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
  107. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
  108. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
  109. 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;
@@ -851,6 +910,7 @@ export interface MonaLocaleMessages {
851
910
  colorPalette: MonaColorPaletteMessages;
852
911
  colorPicker: MonaColorPickerMessages;
853
912
  comboBox: MonaComboBoxMessages;
913
+ command: MonaCommandMessages;
854
914
  datePicker: MonaDatePickerMessages;
855
915
  dateRangePicker: MonaDateRangePickerMessages;
856
916
  dateTimePicker: MonaDateTimePickerMessages;
@@ -858,6 +918,7 @@ export interface MonaLocaleMessages {
858
918
  dropdownList: MonaDropdownListMessages;
859
919
  dropdowns: MonaDropdownsMessages;
860
920
  editor: MonaEditorMessages;
921
+ fileUpload: MonaFileUploadMessages;
861
922
  filter: MonaFilterMessages;
862
923
  formField: MonaFormFieldMessages;
863
924
  grid: MonaGridMessages;
@@ -871,11 +932,10 @@ export interface MonaLocaleMessages {
871
932
  pager: MonaPagerMessages;
872
933
  progressBar: MonaProgressBarMessages;
873
934
  qrCode: MonaQrCodeMessages;
874
- sidebar: MonaSidebarMessages;
875
935
  rating: MonaRatingMessages;
876
- command: MonaCommandMessages;
877
936
  scrollView: MonaScrollViewMessages;
878
937
  sheet: MonaSheetMessages;
938
+ sidebar: MonaSidebarMessages;
879
939
  slider: MonaSliderMessages;
880
940
  spinner: MonaSpinnerMessages;
881
941
  splitButton: MonaSplitButtonMessages;
@@ -995,19 +1055,19 @@ export declare function mergeTwo<T extends object>(base: T, source?: DeepPartial
995
1055
  export declare function mergeMessages<T extends object>(fallback: T, localeMessages?: DeepPartial<NoInfer<T>>, overrideMessages?: DeepPartial<NoInfer<T>>): T;
996
1056
  export interface NumberSymbols {
997
1057
  readonly decimal: string;
1058
+ readonly digits: ReadonlyMap<string, string>;
998
1059
  readonly group: string;
999
1060
  readonly minus: string;
1000
- readonly digits: ReadonlyMap<string, string>;
1001
1061
  }
1002
1062
  export interface NumberGroupingPattern {
1003
- readonly primaryGroupSize: number;
1004
- readonly secondaryGroupSize: number;
1005
1063
  readonly groupSeparator: string;
1006
1064
  /**
1007
1065
  * Fewest integer digits the locale groups when formatting (5 in es-ES, which formats 1000 but 10.000).
1008
1066
  * Parsing does not enforce it: "1.000" is still read as 1000 in es-ES.
1009
1067
  */
1010
1068
  readonly minimumGroupedIntegerDigits: number;
1069
+ readonly primaryGroupSize: number;
1070
+ readonly secondaryGroupSize: number;
1011
1071
  }
1012
1072
  export declare function getNumberGroupingPattern(locale: string): NumberGroupingPattern;
1013
1073
  /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
@@ -1034,6 +1094,10 @@ export declare function normalizeLocalizedInput(text: string, localeId: string):
1034
1094
  export declare function getEditDecimalSeparators(symbols: NumberSymbols): ReadonlySet<string>;
1035
1095
  export type LocalizedNumberParseMode = "edit" | "locale";
1036
1096
  export interface ParseLocalizedNumberOptions {
1097
+ /**
1098
+ * Legacy convenience flag equivalent to `mode: "edit"`.
1099
+ */
1100
+ alternateDecimal?: boolean;
1037
1101
  /**
1038
1102
  * When "locale" (default), parses strictly according to canonical locale rules.
1039
1103
  * Only the locale's canonical decimal separator is treated as decimal, and only
@@ -1042,10 +1106,6 @@ export interface ParseLocalizedNumberOptions {
1042
1106
  * during interactive input entry, unless the alternate is the locale's group separator.
1043
1107
  */
1044
1108
  mode?: LocalizedNumberParseMode;
1045
- /**
1046
- * Legacy convenience flag equivalent to `mode: "edit"`.
1047
- */
1048
- alternateDecimal?: boolean;
1049
1109
  }
1050
1110
  /**
1051
1111
  * Why a value was refused:
@@ -1113,8 +1173,8 @@ export interface LocalizedDecimalEditValidationResult {
1113
1173
  readonly value: string | null;
1114
1174
  }
1115
1175
  export interface ValidateLocalizedNumberEditOptions {
1116
- readonly decimals?: number;
1117
1176
  readonly allowSign?: boolean;
1177
+ readonly decimals?: number;
1118
1178
  }
1119
1179
  /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
1120
1180
  export declare function validateLocalizedNumberEdit(text: string | null | undefined, localeId: string, options?: ValidateLocalizedNumberEditOptions): LocalizedNumberEditValidationResult;
@@ -1217,14 +1277,14 @@ export declare function getLocaleDateTimeInputFormat(localeId: string, options?:
1217
1277
  */
1218
1278
  export declare function getLocaleFirstDayOfWeek(localeId: string): LocaleFirstDayOfWeek;
1219
1279
  export interface PseudoLocalizationOptions {
1220
- readonly prefix?: string;
1221
- readonly suffix?: string;
1222
1280
  readonly expand?: boolean;
1223
1281
  readonly expansionFactor?: number;
1282
+ readonly prefix?: string;
1283
+ readonly suffix?: string;
1224
1284
  }
1225
1285
  export interface GeneratePseudoLocaleOptions {
1226
- readonly id?: string;
1227
1286
  readonly direction?: MonaTextDirection;
1287
+ readonly id?: string;
1228
1288
  readonly pseudoOptions?: PseudoLocalizationOptions;
1229
1289
  }
1230
1290
  /**
@@ -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;