@4sh/ui-kit 0.16.0 → 0.17.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/README.fr.md +10 -10
- package/README.md +10 -10
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
- package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-types.mjs +0 -12
- package/fesm2022/4sh-ui-kit.mjs +3 -15
- package/fesm2022/4sh-ui-kit.mjs.map +1 -1
- package/mcp/data/component-api.json +299 -2
- package/mcp/data/text-search-docs.json +149 -9
- package/mcp/data/ui-config.json +378 -1
- package/mcp/index.js +8190 -2876
- package/mcp/package.json +1 -1
- package/package.json +5 -1
- package/styles/component-vars.scss +22 -1
- package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
- package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
- package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
- package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
- package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
- package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
- package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
- package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
- package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
- package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
- package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
- package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
- package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
- package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
- package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
- package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
- package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
- package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
- package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
- package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
- package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
- package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
- package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
- package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
- package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
- package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
- package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
- package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
- package/types/4sh-ui-kit-forms.d.ts +275 -194
- package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
- package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
- package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
- package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
- package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
- package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
- package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
- package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
- package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
- package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
- package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
- package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
- package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
- package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
- package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
- package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
- package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
- package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
- package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
- package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
- package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
- package/types/4sh-ui-kit-motion.d.ts +117 -67
- package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
- package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
- package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
- package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
- package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
- package/types/4sh-ui-kit-overlay.d.ts +6 -6
- package/types/4sh-ui-kit-ripple.d.ts +99 -74
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
- package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
- package/types/4sh-ui-kit-theming.d.ts +27 -29
- package/types/4sh-ui-kit-types.d.ts +6 -5
- package/types/4sh-ui-kit.d.ts +4 -3
- package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
|
@@ -1,119 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import { UiIconSize } from "@4sh/ui-kit/base/ui-icon";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import { TemplateRef } from "@angular/core";
|
|
5
7
|
/** Lifecycle of a selected file. */
|
|
6
|
-
type UiUploadStatus = 'pending' | 'uploading' | 'completed' | 'error';
|
|
8
|
+
export type UiUploadStatus = 'pending' | 'uploading' | 'completed' | 'error';
|
|
7
9
|
/** A file selected in the uploader, plus its upload/validation state. */
|
|
8
|
-
interface UiUploadFile {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
export interface UiUploadFile {
|
|
11
|
+
/** Stable id for tracking (kept across re-renders); the server id for a stored file. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** The underlying browser File; absent for a file already stored server-side (`initialFiles`). */
|
|
14
|
+
readonly file?: File;
|
|
15
|
+
/** File name (from the File, exposed for template convenience). */
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/** Size in bytes. */
|
|
18
|
+
readonly size: number;
|
|
19
|
+
/** MIME type reported by the browser. */
|
|
20
|
+
readonly type: string;
|
|
21
|
+
/** Current lifecycle state. */
|
|
22
|
+
status: UiUploadStatus;
|
|
23
|
+
/** Upload progress, 0–100 (meaningful while `status === 'uploading'`). */
|
|
24
|
+
progress: number;
|
|
25
|
+
/** Object URL for image previews — MUST be revoked when the file is removed. */
|
|
26
|
+
objectUrl?: string;
|
|
27
|
+
/** Validation or upload error message, when `status === 'error'`. */
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
/** A file picked in the browser (selector, drop or `add()`): it always carries its `File`. */
|
|
31
|
+
export type UiLocalUploadFile = UiUploadFile & {
|
|
32
|
+
readonly file: File;
|
|
33
|
+
};
|
|
34
|
+
/** A file already stored server-side, listed with the new ones (`initialFiles`). */
|
|
35
|
+
export interface UiStoredFile {
|
|
36
|
+
/** Server id, kept as the row id: `removed` and `fileOpen` hand it back. */
|
|
37
|
+
readonly id: string;
|
|
38
|
+
/** File name. */
|
|
39
|
+
readonly name: string;
|
|
40
|
+
/** Size in bytes. */
|
|
41
|
+
readonly size: number;
|
|
42
|
+
/** MIME type, when known. */
|
|
43
|
+
readonly type?: string;
|
|
27
44
|
}
|
|
45
|
+
/** Whether a file was picked in the browser, as opposed to stored server-side. */
|
|
46
|
+
export declare function isLocalUploadFile(file: UiUploadFile): file is UiLocalUploadFile;
|
|
28
47
|
/** Payload for the custom upload handler (customUpload = true). */
|
|
29
|
-
interface UiUploadHandlerEvent {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
export interface UiUploadHandlerEvent {
|
|
49
|
+
/** Files awaiting upload (status `pending`), all picked in the browser. */
|
|
50
|
+
files: UiLocalUploadFile[];
|
|
51
|
+
/** Marks a file as uploaded (sets status `completed`, progress 100). */
|
|
52
|
+
markUploaded: (file: UiUploadFile) => void;
|
|
53
|
+
/** Marks a file as failed with an optional message. */
|
|
54
|
+
markError: (file: UiUploadFile, message?: string) => void;
|
|
55
|
+
/** Updates a file's progress (0–100). */
|
|
56
|
+
setProgress: (file: UiUploadFile, progress: number) => void;
|
|
38
57
|
}
|
|
39
58
|
/** Emitted when files finish uploading (built-in uploader). */
|
|
40
|
-
interface UiUploadEvent {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
export interface UiUploadEvent {
|
|
60
|
+
files: UiUploadFile[];
|
|
61
|
+
/** Raw XHR of the last request (built-in uploader only). */
|
|
62
|
+
xhr?: XMLHttpRequest;
|
|
44
63
|
}
|
|
45
64
|
/** Emitted on a validation or upload error. */
|
|
46
|
-
interface UiUploadErrorEvent {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
export interface UiUploadErrorEvent {
|
|
66
|
+
file: UiUploadFile;
|
|
67
|
+
/** 'type' | 'size' | 'total-size' | 'limit' | 'upload'. */
|
|
68
|
+
reason: 'type' | 'size' | 'total-size' | 'limit' | 'upload';
|
|
69
|
+
message: string;
|
|
51
70
|
}
|
|
52
71
|
/** Human-readable file size (e.g. "2.5 MB"). Base-1024. */
|
|
53
|
-
declare function formatFileSize(bytes: number): string;
|
|
72
|
+
export declare function formatFileSize(bytes: number): string;
|
|
54
73
|
/**
|
|
55
74
|
* Whether a File matches an `accept` string (e.g. "image/*,.pdf").
|
|
56
75
|
* Empty/absent accept means everything is allowed.
|
|
57
76
|
*/
|
|
58
|
-
declare function isFileTypeAccepted(file: File, accept: string | undefined): boolean;
|
|
77
|
+
export declare function isFileTypeAccepted(file: File, accept: string | undefined): boolean;
|
|
59
78
|
/** Whether a File is a previewable image. */
|
|
60
|
-
declare function isImageFile(file: File): boolean;
|
|
61
|
-
|
|
62
|
-
type UiFileUploadListSize = 'default' | 'small';
|
|
79
|
+
export declare function isImageFile(file: File): boolean;
|
|
80
|
+
export type UiFileUploadListSize = 'default' | 'small';
|
|
63
81
|
/**
|
|
64
82
|
* ui-file-upload-list — a single file row (the repeatable unit of an upload list).
|
|
65
83
|
*
|
|
66
84
|
* Presentational: shows a leading thumbnail (for images) or file icon, the file
|
|
67
|
-
* name + size/status, and a remove button.
|
|
85
|
+
* name + size/status, and a remove button. With `openable`, the name becomes a button emitting
|
|
86
|
+
* `open` (e.g. to preview the file); content projected into the row lands next to the remove
|
|
87
|
+
* button, for extra actions. While the file is uploading it swaps
|
|
68
88
|
* the leading icon for a `ui-spinner` and reveals a slim progress bar.
|
|
69
89
|
*
|
|
70
90
|
* Named to mirror the Figma component; the uploader stacks one row per file.
|
|
71
91
|
*/
|
|
72
|
-
declare class UiFileUploadList {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
export declare class UiFileUploadList {
|
|
93
|
+
/** The file to display (name/size/status/progress/preview). */
|
|
94
|
+
file: import("@angular/core").InputSignal<UiUploadFile>;
|
|
95
|
+
/** Size of the file rows. */
|
|
96
|
+
size: import("@angular/core").InputSignal<UiFileUploadListSize>;
|
|
97
|
+
/** FontAwesome icon for non-image files. */
|
|
98
|
+
icon: import("@angular/core").InputSignal<string>;
|
|
99
|
+
/** Whether the remove button is shown. */
|
|
100
|
+
removable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
101
|
+
/** Makes the file name a button emitting `open`. */
|
|
102
|
+
openable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
103
|
+
/** Accessible name of the file name button (`openable`) — `{0}` is the file name. */
|
|
104
|
+
openLabel: import("@angular/core").InputSignal<string>;
|
|
105
|
+
/** Accessible name of the remove button (raw text — the file name is appended in the template). */
|
|
106
|
+
removeAriaLabel: import("@angular/core").InputSignal<string>;
|
|
107
|
+
/** Fallback error text when the file carries no message. */
|
|
108
|
+
failedLabel: import("@angular/core").InputSignal<string>;
|
|
109
|
+
/** Accessible name of the upload spinner — `{0}` is the file name. */
|
|
110
|
+
uploadingLabel: import("@angular/core").InputSignal<string>;
|
|
111
|
+
/** Accessible name of the progress bar — `{0}` is the file name. */
|
|
112
|
+
progressLabel: import("@angular/core").InputSignal<string>;
|
|
113
|
+
/** Emitted when the remove button is activated. */
|
|
114
|
+
remove: import("@angular/core").OutputEmitterRef<UiUploadFile>;
|
|
115
|
+
/** Emitted when the file name is activated (`openable`). */
|
|
116
|
+
open: import("@angular/core").OutputEmitterRef<UiUploadFile>;
|
|
117
|
+
/** @ignore Formatted size (e.g. "2.5 MB"). */
|
|
118
|
+
protected readonly sizeLabel: import("@angular/core").Signal<string>;
|
|
119
|
+
/** @ignore Accessible name of the file name button (`{0}` filled with the file name). */
|
|
120
|
+
protected readonly openAriaLabel: import("@angular/core").Signal<string>;
|
|
121
|
+
/** @ignore Accessible name of the upload spinner (`{0}` filled with the file name). */
|
|
122
|
+
protected readonly uploadingAriaLabel: import("@angular/core").Signal<string>;
|
|
123
|
+
/** @ignore Accessible name of the progress bar (`{0}` filled with the file name). */
|
|
124
|
+
protected readonly progressAriaLabel: import("@angular/core").Signal<string>;
|
|
125
|
+
/** @ignore Uploading in progress → show the spinner + progress bar. */
|
|
126
|
+
protected readonly isUploading: import("@angular/core").Signal<boolean>;
|
|
127
|
+
/** @ignore Error state → surface the message + error styling. */
|
|
128
|
+
protected readonly isError: import("@angular/core").Signal<boolean>;
|
|
129
|
+
/** @ignore Image with a usable preview URL → render a thumbnail. */
|
|
130
|
+
protected readonly thumbnail: import("@angular/core").Signal<string | null>;
|
|
131
|
+
/** @ignore Secondary line: error message, else size (+ status hint). */
|
|
132
|
+
protected readonly infoLabel: import("@angular/core").Signal<string>;
|
|
133
|
+
/** @ignore */
|
|
134
|
+
protected readonly iconSize: import("@angular/core").Signal<UiIconSize>;
|
|
135
|
+
/** @ignore */
|
|
136
|
+
protected readonly classes: import("@angular/core").Signal<string>;
|
|
137
|
+
/** @ignore */
|
|
138
|
+
protected onRemove(): void;
|
|
139
|
+
/** @ignore */
|
|
140
|
+
protected onOpen(): void;
|
|
141
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UiFileUploadList, never>;
|
|
142
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiFileUploadList, "ui-file-upload-list", never, {
|
|
143
|
+
"file": {
|
|
144
|
+
"alias": "file";
|
|
145
|
+
"required": true;
|
|
146
|
+
"isSignal": true;
|
|
147
|
+
};
|
|
148
|
+
"size": {
|
|
149
|
+
"alias": "size";
|
|
150
|
+
"required": false;
|
|
151
|
+
"isSignal": true;
|
|
152
|
+
};
|
|
153
|
+
"icon": {
|
|
154
|
+
"alias": "icon";
|
|
155
|
+
"required": false;
|
|
156
|
+
"isSignal": true;
|
|
157
|
+
};
|
|
158
|
+
"removable": {
|
|
159
|
+
"alias": "removable";
|
|
160
|
+
"required": false;
|
|
161
|
+
"isSignal": true;
|
|
162
|
+
};
|
|
163
|
+
"openable": {
|
|
164
|
+
"alias": "openable";
|
|
165
|
+
"required": false;
|
|
166
|
+
"isSignal": true;
|
|
167
|
+
};
|
|
168
|
+
"openLabel": {
|
|
169
|
+
"alias": "openLabel";
|
|
170
|
+
"required": false;
|
|
171
|
+
"isSignal": true;
|
|
172
|
+
};
|
|
173
|
+
"removeAriaLabel": {
|
|
174
|
+
"alias": "removeAriaLabel";
|
|
175
|
+
"required": false;
|
|
176
|
+
"isSignal": true;
|
|
177
|
+
};
|
|
178
|
+
"failedLabel": {
|
|
179
|
+
"alias": "failedLabel";
|
|
180
|
+
"required": false;
|
|
181
|
+
"isSignal": true;
|
|
182
|
+
};
|
|
183
|
+
"uploadingLabel": {
|
|
184
|
+
"alias": "uploadingLabel";
|
|
185
|
+
"required": false;
|
|
186
|
+
"isSignal": true;
|
|
187
|
+
};
|
|
188
|
+
"progressLabel": {
|
|
189
|
+
"alias": "progressLabel";
|
|
190
|
+
"required": false;
|
|
191
|
+
"isSignal": true;
|
|
192
|
+
};
|
|
193
|
+
}, {
|
|
194
|
+
"remove": "remove";
|
|
195
|
+
"open": "open";
|
|
196
|
+
}, never, ["*"], true, never>;
|
|
113
197
|
}
|
|
114
|
-
|
|
115
|
-
type
|
|
116
|
-
type UiFileUploadSize = 'default' | 'small';
|
|
198
|
+
export type UiFileUploadMode = 'field' | 'drag';
|
|
199
|
+
export type UiFileUploadSize = 'default' | 'small';
|
|
117
200
|
/**
|
|
118
201
|
* ui-file-upload — headless file uploader (field + drag-and-drop).
|
|
119
202
|
*
|
|
@@ -124,155 +207,414 @@ type UiFileUploadSize = 'default' | 'small';
|
|
|
124
207
|
* handler (`customUpload`). Progress is tracked with `XMLHttpRequest` so no
|
|
125
208
|
* global HTTP provider is required.
|
|
126
209
|
*
|
|
210
|
+
* Files already stored server-side (`initialFiles`) are listed with the new ones, without a
|
|
211
|
+
* browser `File`; `add()` feeds files obtained outside the picker (e.g. a camera capture)
|
|
212
|
+
* through the same validation and upload as a selection.
|
|
213
|
+
*
|
|
127
214
|
* Security notes: client-side validation is a UX convenience — always re-validate
|
|
128
215
|
* server-side. Image previews use object URLs that are revoked on removal/clear.
|
|
129
216
|
*/
|
|
130
|
-
declare class UiFileUpload {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
217
|
+
export declare class UiFileUpload {
|
|
218
|
+
/** `field` = compact input + Browse button; `drag` = full drop zone. */
|
|
219
|
+
mode: import("@angular/core").InputSignal<UiFileUploadMode>;
|
|
220
|
+
/** Size of the control, its buttons and its file list. */
|
|
221
|
+
size: import("@angular/core").InputSignal<UiFileUploadSize>;
|
|
222
|
+
/** Native `name`: a surrounding `<form>` submits the current selection under it. */
|
|
223
|
+
name: import("@angular/core").InputSignal<string | undefined>;
|
|
224
|
+
/** Allow selecting more than one file. */
|
|
225
|
+
multiple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
226
|
+
/** Ripple Effect */
|
|
227
|
+
ripple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
228
|
+
/** Native `accept` filter, e.g. "image/*,.pdf". Also enforced on drop. */
|
|
229
|
+
accept: import("@angular/core").InputSignal<string | undefined>;
|
|
230
|
+
/** Max size per file, in bytes. */
|
|
231
|
+
maxFileSize: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
232
|
+
/** Max size of the whole selection, stored files included, in bytes. */
|
|
233
|
+
maxTotalSize: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
234
|
+
/** Max number of files kept at once. */
|
|
235
|
+
fileLimit: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
236
|
+
/** Disables selection, drop and upload. */
|
|
237
|
+
disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
238
|
+
/**
|
|
239
|
+
* Files already stored server-side, listed with the new ones (status `completed`, no `File`).
|
|
240
|
+
* Setting it resets the selection to these files, without emitting `filesChange`; files picked
|
|
241
|
+
* in the browser and not uploaded yet (pending, uploading, failed) are kept.
|
|
242
|
+
*/
|
|
243
|
+
initialFiles: import("@angular/core").InputSignal<UiStoredFile[]>;
|
|
244
|
+
/** Upload each file as soon as it is selected. */
|
|
245
|
+
auto: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
246
|
+
/** Delegate uploading to the `uploadHandler` output instead of the built-in XHR. */
|
|
247
|
+
customUpload: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
248
|
+
/** Endpoint for the built-in uploader. */
|
|
249
|
+
url: import("@angular/core").InputSignal<string | undefined>;
|
|
250
|
+
/** HTTP method for the built-in uploader. */
|
|
251
|
+
method: import("@angular/core").InputSignal<"post" | "put">;
|
|
252
|
+
/** Field name used for each file in the multipart body. */
|
|
253
|
+
fieldName: import("@angular/core").InputSignal<string>;
|
|
254
|
+
/** Send credentials (cookies) with the built-in upload request. */
|
|
255
|
+
withCredentials: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
256
|
+
/** Show the file list under the control. */
|
|
257
|
+
showFileList: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
258
|
+
/** Show the Upload/Cancel toolbar buttons (drag mode). */
|
|
259
|
+
showControls: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
260
|
+
/** Show the file count and total size under the list. */
|
|
261
|
+
showTotal: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
262
|
+
/** Makes each file name a button emitting `fileOpen` (e.g. to preview the file). */
|
|
263
|
+
openable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
264
|
+
/** Label of the Browse button. */
|
|
265
|
+
browseLabel: import("@angular/core").InputSignal<string>;
|
|
266
|
+
/** Placeholder shown in field mode before any selection. */
|
|
267
|
+
chooseLabel: import("@angular/core").InputSignal<string>;
|
|
268
|
+
/** Label of the Upload toolbar button (drag mode). */
|
|
269
|
+
uploadLabel: import("@angular/core").InputSignal<string>;
|
|
270
|
+
/** Label of the toolbar button that clears the selection (drag mode). */
|
|
271
|
+
cancelLabel: import("@angular/core").InputSignal<string>;
|
|
272
|
+
/** Drag-zone link + prompt. */
|
|
273
|
+
dragLinkLabel: import("@angular/core").InputSignal<string>;
|
|
274
|
+
/** Text after the drag-zone link (drag mode). */
|
|
275
|
+
dragPromptLabel: import("@angular/core").InputSignal<string>;
|
|
276
|
+
/** Small hint under the drag prompt (e.g. "JPG, PNG (max 5 MB)"). */
|
|
277
|
+
hint: import("@angular/core").InputSignal<string | undefined>;
|
|
278
|
+
/** Accessible name for the whole control. */
|
|
279
|
+
ariaLabel: import("@angular/core").InputSignal<string>;
|
|
280
|
+
/** Multi-file summary in field mode — `{0}` is replaced by the file count. */
|
|
281
|
+
filesSummaryLabel: import("@angular/core").InputSignal<string>;
|
|
282
|
+
/** Rejection message: file type not accepted — `{0}` is the file name. */
|
|
283
|
+
invalidTypeMessage: import("@angular/core").InputSignal<string>;
|
|
284
|
+
/** Rejection message: file too large — `{0}` is the file name. */
|
|
285
|
+
invalidSizeMessage: import("@angular/core").InputSignal<string>;
|
|
286
|
+
/** Total under the list (`showTotal`) — `{0}` is the file count, `{1}` the total size. */
|
|
287
|
+
totalLabel: import("@angular/core").InputSignal<string>;
|
|
288
|
+
/** Rejection message: `maxTotalSize` exceeded — `{0}` is the file name, `{1}` the limit. */
|
|
289
|
+
totalSizeExceededMessage: import("@angular/core").InputSignal<string>;
|
|
290
|
+
/** Rejection message: `fileLimit` reached — `{0}` is the limit. */
|
|
291
|
+
limitReachedMessage: import("@angular/core").InputSignal<string>;
|
|
292
|
+
/** Error shown when an upload fails without a server message. */
|
|
293
|
+
uploadErrorMessage: import("@angular/core").InputSignal<string>;
|
|
294
|
+
/** Error shown when the upload request fails at the network level. */
|
|
295
|
+
networkErrorMessage: import("@angular/core").InputSignal<string>;
|
|
296
|
+
/** Error shown on a non-2xx response — `{0}` is the HTTP status. */
|
|
297
|
+
httpErrorMessage: import("@angular/core").InputSignal<string>;
|
|
298
|
+
/** Overrides a single file row (context: `{ $implicit: UiUploadFile, remove, open }`). */
|
|
299
|
+
fileTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
300
|
+
/** Extra actions on a default file row, next to its remove button (context: `{ $implicit: UiUploadFile, remove, open }`). */
|
|
301
|
+
fileActionsTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
302
|
+
/** Overrides the content section (context: `{ $implicit: UiUploadFile[], remove, clear }`). */
|
|
303
|
+
contentTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
304
|
+
/** Custom toolbar content (context: `{ $implicit: UiUploadFile[], choose, upload, clear }`). */
|
|
305
|
+
toolbarTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
306
|
+
/** Files added to the selection (validated). */
|
|
307
|
+
selected: import("@angular/core").OutputEmitterRef<UiLocalUploadFile[]>;
|
|
308
|
+
/** The full current selection changed. */
|
|
309
|
+
filesChange: import("@angular/core").OutputEmitterRef<UiUploadFile[]>;
|
|
310
|
+
/** A custom upload was requested (customUpload = true). */
|
|
311
|
+
uploadHandler: import("@angular/core").OutputEmitterRef<UiUploadHandlerEvent>;
|
|
312
|
+
/** Built-in upload completed for a batch. */
|
|
313
|
+
uploaded: import("@angular/core").OutputEmitterRef<UiUploadEvent>;
|
|
314
|
+
/** A file failed validation or upload. */
|
|
315
|
+
uploadError: import("@angular/core").OutputEmitterRef<UiUploadErrorEvent>;
|
|
316
|
+
/** A file was removed. */
|
|
317
|
+
removed: import("@angular/core").OutputEmitterRef<UiUploadFile>;
|
|
318
|
+
/** The selection was cleared. */
|
|
319
|
+
cleared: import("@angular/core").OutputEmitterRef<void>;
|
|
320
|
+
/** A file name was activated (`openable`). */
|
|
321
|
+
fileOpen: import("@angular/core").OutputEmitterRef<UiUploadFile>;
|
|
322
|
+
/** @ignore Stable id linking the visible label(s) to the native input. */
|
|
323
|
+
protected readonly inputId: string;
|
|
324
|
+
private readonly host;
|
|
325
|
+
private readonly destroyRef;
|
|
326
|
+
private readonly fileInput;
|
|
327
|
+
private readonly formValueInput;
|
|
328
|
+
/** In-flight requests, keyed by file id, so we can abort. */
|
|
329
|
+
private readonly requests;
|
|
330
|
+
/** @ignore Current selection. */
|
|
331
|
+
private readonly selection;
|
|
332
|
+
/** Read-only view of the current files. */
|
|
333
|
+
readonly files: import("@angular/core").Signal<UiUploadFile[]>;
|
|
334
|
+
/** @ignore `initialFiles` compared by content, so a list rebuilt on every check (same files)
|
|
335
|
+
* does not wipe the files the user has just added. */
|
|
336
|
+
private readonly storedFiles;
|
|
337
|
+
/** @ignore Drop-zone highlight while dragging over. */
|
|
338
|
+
protected readonly dragging: import("@angular/core").WritableSignal<boolean>;
|
|
339
|
+
/** @ignore Transient validation messages (rendered in a live region). */
|
|
340
|
+
protected readonly messages: import("@angular/core").WritableSignal<string[]>;
|
|
341
|
+
constructor();
|
|
342
|
+
/** @ignore */
|
|
343
|
+
protected readonly hasFiles: import("@angular/core").Signal<boolean>;
|
|
344
|
+
/** @ignore Files picked in the browser: what the toolbar's clear acts on. */
|
|
345
|
+
protected readonly hasLocalFiles: import("@angular/core").Signal<boolean>;
|
|
346
|
+
/** @ignore */
|
|
347
|
+
protected readonly pending: import("@angular/core").Signal<UiLocalUploadFile[]>;
|
|
348
|
+
/** @ignore File count and total size under the list (`showTotal`). */
|
|
349
|
+
protected readonly totalSummary: import("@angular/core").Signal<string>;
|
|
350
|
+
/** @ignore Single-file summary shown in field mode. */
|
|
351
|
+
protected readonly fieldSummary: import("@angular/core").Signal<string>;
|
|
352
|
+
/** @ignore */
|
|
353
|
+
protected readonly canUpload: import("@angular/core").Signal<boolean>;
|
|
354
|
+
/** @ignore */
|
|
355
|
+
protected readonly classes: import("@angular/core").Signal<string>;
|
|
356
|
+
/** @ignore */ protected readonly removeFn: (f: UiUploadFile) => void;
|
|
357
|
+
/** @ignore */ protected readonly clearFn: () => void;
|
|
358
|
+
/** @ignore */ protected readonly chooseFn: () => void;
|
|
359
|
+
/** @ignore */ protected readonly uploadFn: () => void;
|
|
360
|
+
/** @ignore */ protected readonly openFn: (f: UiUploadFile) => void;
|
|
361
|
+
/** Opens the native file picker. */
|
|
362
|
+
choose(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Adds files obtained outside the picker (e.g. a camera capture) exactly like a selection or a
|
|
365
|
+
* drop: validation and its messages, selection, then upload when `auto`.
|
|
366
|
+
*/
|
|
367
|
+
add(files: FileList | readonly File[]): void;
|
|
368
|
+
/** Uploads all pending files (built-in XHR, or emits `uploadHandler`). */
|
|
369
|
+
upload(): void;
|
|
370
|
+
/** Removes a file (aborts its upload, revokes its preview). */
|
|
371
|
+
remove(target: UiUploadFile): void;
|
|
372
|
+
/**
|
|
373
|
+
* Clears the files picked in the browser. Stored files (`initialFiles`) stay: removing one is a
|
|
374
|
+
* server deletion, done one at a time (`removed`).
|
|
375
|
+
*/
|
|
376
|
+
clear(): void;
|
|
377
|
+
/** @ignore */
|
|
378
|
+
protected onInputChange(event: Event): void;
|
|
379
|
+
/** @ignore */
|
|
380
|
+
protected onDragOver(event: DragEvent): void;
|
|
381
|
+
/** @ignore */
|
|
382
|
+
protected onDragLeave(event: DragEvent): void;
|
|
383
|
+
/** @ignore */
|
|
384
|
+
protected onDrop(event: DragEvent): void;
|
|
385
|
+
/** Validate + add files to the selection. */
|
|
386
|
+
private ingest;
|
|
387
|
+
/** Resets the selection to the stored files, keeping the unfinished local ones, without outputs. */
|
|
388
|
+
private reset;
|
|
389
|
+
private toUploadFile;
|
|
390
|
+
private fail;
|
|
391
|
+
/** Mutates one file in place (immutably) and pushes a new array reference. */
|
|
392
|
+
private patch;
|
|
393
|
+
private emitCustomUpload;
|
|
394
|
+
private xhrUpload;
|
|
395
|
+
private uploadFailed;
|
|
396
|
+
private revoke;
|
|
397
|
+
private resetInput;
|
|
398
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UiFileUpload, never>;
|
|
399
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiFileUpload, "ui-file-upload", never, {
|
|
400
|
+
"mode": {
|
|
401
|
+
"alias": "mode";
|
|
402
|
+
"required": false;
|
|
403
|
+
"isSignal": true;
|
|
404
|
+
};
|
|
405
|
+
"size": {
|
|
406
|
+
"alias": "size";
|
|
407
|
+
"required": false;
|
|
408
|
+
"isSignal": true;
|
|
409
|
+
};
|
|
410
|
+
"name": {
|
|
411
|
+
"alias": "name";
|
|
412
|
+
"required": false;
|
|
413
|
+
"isSignal": true;
|
|
414
|
+
};
|
|
415
|
+
"multiple": {
|
|
416
|
+
"alias": "multiple";
|
|
417
|
+
"required": false;
|
|
418
|
+
"isSignal": true;
|
|
419
|
+
};
|
|
420
|
+
"ripple": {
|
|
421
|
+
"alias": "ripple";
|
|
422
|
+
"required": false;
|
|
423
|
+
"isSignal": true;
|
|
424
|
+
};
|
|
425
|
+
"accept": {
|
|
426
|
+
"alias": "accept";
|
|
427
|
+
"required": false;
|
|
428
|
+
"isSignal": true;
|
|
429
|
+
};
|
|
430
|
+
"maxFileSize": {
|
|
431
|
+
"alias": "maxFileSize";
|
|
432
|
+
"required": false;
|
|
433
|
+
"isSignal": true;
|
|
434
|
+
};
|
|
435
|
+
"maxTotalSize": {
|
|
436
|
+
"alias": "maxTotalSize";
|
|
437
|
+
"required": false;
|
|
438
|
+
"isSignal": true;
|
|
439
|
+
};
|
|
440
|
+
"fileLimit": {
|
|
441
|
+
"alias": "fileLimit";
|
|
442
|
+
"required": false;
|
|
443
|
+
"isSignal": true;
|
|
444
|
+
};
|
|
445
|
+
"disabled": {
|
|
446
|
+
"alias": "disabled";
|
|
447
|
+
"required": false;
|
|
448
|
+
"isSignal": true;
|
|
449
|
+
};
|
|
450
|
+
"initialFiles": {
|
|
451
|
+
"alias": "initialFiles";
|
|
452
|
+
"required": false;
|
|
453
|
+
"isSignal": true;
|
|
454
|
+
};
|
|
455
|
+
"auto": {
|
|
456
|
+
"alias": "auto";
|
|
457
|
+
"required": false;
|
|
458
|
+
"isSignal": true;
|
|
459
|
+
};
|
|
460
|
+
"customUpload": {
|
|
461
|
+
"alias": "customUpload";
|
|
462
|
+
"required": false;
|
|
463
|
+
"isSignal": true;
|
|
464
|
+
};
|
|
465
|
+
"url": {
|
|
466
|
+
"alias": "url";
|
|
467
|
+
"required": false;
|
|
468
|
+
"isSignal": true;
|
|
469
|
+
};
|
|
470
|
+
"method": {
|
|
471
|
+
"alias": "method";
|
|
472
|
+
"required": false;
|
|
473
|
+
"isSignal": true;
|
|
474
|
+
};
|
|
475
|
+
"fieldName": {
|
|
476
|
+
"alias": "fieldName";
|
|
477
|
+
"required": false;
|
|
478
|
+
"isSignal": true;
|
|
479
|
+
};
|
|
480
|
+
"withCredentials": {
|
|
481
|
+
"alias": "withCredentials";
|
|
482
|
+
"required": false;
|
|
483
|
+
"isSignal": true;
|
|
484
|
+
};
|
|
485
|
+
"showFileList": {
|
|
486
|
+
"alias": "showFileList";
|
|
487
|
+
"required": false;
|
|
488
|
+
"isSignal": true;
|
|
489
|
+
};
|
|
490
|
+
"showControls": {
|
|
491
|
+
"alias": "showControls";
|
|
492
|
+
"required": false;
|
|
493
|
+
"isSignal": true;
|
|
494
|
+
};
|
|
495
|
+
"showTotal": {
|
|
496
|
+
"alias": "showTotal";
|
|
497
|
+
"required": false;
|
|
498
|
+
"isSignal": true;
|
|
499
|
+
};
|
|
500
|
+
"openable": {
|
|
501
|
+
"alias": "openable";
|
|
502
|
+
"required": false;
|
|
503
|
+
"isSignal": true;
|
|
504
|
+
};
|
|
505
|
+
"browseLabel": {
|
|
506
|
+
"alias": "browseLabel";
|
|
507
|
+
"required": false;
|
|
508
|
+
"isSignal": true;
|
|
509
|
+
};
|
|
510
|
+
"chooseLabel": {
|
|
511
|
+
"alias": "chooseLabel";
|
|
512
|
+
"required": false;
|
|
513
|
+
"isSignal": true;
|
|
514
|
+
};
|
|
515
|
+
"uploadLabel": {
|
|
516
|
+
"alias": "uploadLabel";
|
|
517
|
+
"required": false;
|
|
518
|
+
"isSignal": true;
|
|
519
|
+
};
|
|
520
|
+
"cancelLabel": {
|
|
521
|
+
"alias": "cancelLabel";
|
|
522
|
+
"required": false;
|
|
523
|
+
"isSignal": true;
|
|
524
|
+
};
|
|
525
|
+
"dragLinkLabel": {
|
|
526
|
+
"alias": "dragLinkLabel";
|
|
527
|
+
"required": false;
|
|
528
|
+
"isSignal": true;
|
|
529
|
+
};
|
|
530
|
+
"dragPromptLabel": {
|
|
531
|
+
"alias": "dragPromptLabel";
|
|
532
|
+
"required": false;
|
|
533
|
+
"isSignal": true;
|
|
534
|
+
};
|
|
535
|
+
"hint": {
|
|
536
|
+
"alias": "hint";
|
|
537
|
+
"required": false;
|
|
538
|
+
"isSignal": true;
|
|
539
|
+
};
|
|
540
|
+
"ariaLabel": {
|
|
541
|
+
"alias": "ariaLabel";
|
|
542
|
+
"required": false;
|
|
543
|
+
"isSignal": true;
|
|
544
|
+
};
|
|
545
|
+
"filesSummaryLabel": {
|
|
546
|
+
"alias": "filesSummaryLabel";
|
|
547
|
+
"required": false;
|
|
548
|
+
"isSignal": true;
|
|
549
|
+
};
|
|
550
|
+
"invalidTypeMessage": {
|
|
551
|
+
"alias": "invalidTypeMessage";
|
|
552
|
+
"required": false;
|
|
553
|
+
"isSignal": true;
|
|
554
|
+
};
|
|
555
|
+
"invalidSizeMessage": {
|
|
556
|
+
"alias": "invalidSizeMessage";
|
|
557
|
+
"required": false;
|
|
558
|
+
"isSignal": true;
|
|
559
|
+
};
|
|
560
|
+
"totalLabel": {
|
|
561
|
+
"alias": "totalLabel";
|
|
562
|
+
"required": false;
|
|
563
|
+
"isSignal": true;
|
|
564
|
+
};
|
|
565
|
+
"totalSizeExceededMessage": {
|
|
566
|
+
"alias": "totalSizeExceededMessage";
|
|
567
|
+
"required": false;
|
|
568
|
+
"isSignal": true;
|
|
569
|
+
};
|
|
570
|
+
"limitReachedMessage": {
|
|
571
|
+
"alias": "limitReachedMessage";
|
|
572
|
+
"required": false;
|
|
573
|
+
"isSignal": true;
|
|
574
|
+
};
|
|
575
|
+
"uploadErrorMessage": {
|
|
576
|
+
"alias": "uploadErrorMessage";
|
|
577
|
+
"required": false;
|
|
578
|
+
"isSignal": true;
|
|
579
|
+
};
|
|
580
|
+
"networkErrorMessage": {
|
|
581
|
+
"alias": "networkErrorMessage";
|
|
582
|
+
"required": false;
|
|
583
|
+
"isSignal": true;
|
|
584
|
+
};
|
|
585
|
+
"httpErrorMessage": {
|
|
586
|
+
"alias": "httpErrorMessage";
|
|
587
|
+
"required": false;
|
|
588
|
+
"isSignal": true;
|
|
589
|
+
};
|
|
590
|
+
"fileTemplate": {
|
|
591
|
+
"alias": "fileTemplate";
|
|
592
|
+
"required": false;
|
|
593
|
+
"isSignal": true;
|
|
594
|
+
};
|
|
595
|
+
"fileActionsTemplate": {
|
|
596
|
+
"alias": "fileActionsTemplate";
|
|
597
|
+
"required": false;
|
|
598
|
+
"isSignal": true;
|
|
599
|
+
};
|
|
600
|
+
"contentTemplate": {
|
|
601
|
+
"alias": "contentTemplate";
|
|
602
|
+
"required": false;
|
|
603
|
+
"isSignal": true;
|
|
604
|
+
};
|
|
605
|
+
"toolbarTemplate": {
|
|
606
|
+
"alias": "toolbarTemplate";
|
|
607
|
+
"required": false;
|
|
608
|
+
"isSignal": true;
|
|
609
|
+
};
|
|
610
|
+
}, {
|
|
611
|
+
"selected": "selected";
|
|
612
|
+
"filesChange": "filesChange";
|
|
613
|
+
"uploadHandler": "uploadHandler";
|
|
614
|
+
"uploaded": "uploaded";
|
|
615
|
+
"uploadError": "uploadError";
|
|
616
|
+
"removed": "removed";
|
|
617
|
+
"cleared": "cleared";
|
|
618
|
+
"fileOpen": "fileOpen";
|
|
619
|
+
}, never, never, true, never>;
|
|
620
|
+
}
|