@4sh/ui-kit 0.1.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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +229 -0
- package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-types.mjs +12 -0
- package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit.mjs +16 -0
- package/fesm2022/4sh-ui-kit.mjs.map +1 -0
- package/package.json +287 -0
- package/styles/base/_base.scss +19 -0
- package/styles/base/_motion.scss +144 -0
- package/styles/base/_typography.scss +99 -0
- package/styles/generated/_tokens-breakpoint.scss +8 -0
- package/styles/generated/_tokens-metrics.scss +37 -0
- package/styles/generated/_tokens-primitives.scss +284 -0
- package/styles/generated/_tokens-responsive.scss +99 -0
- package/styles/generated/_tokens-semantics.scss +1274 -0
- package/styles/generated/_tokens-styles.scss +35 -0
- package/styles/generated/_tokens-transitions.scss +11 -0
- package/styles/generated/_tokens-typography.scss +14 -0
- package/styles/generated/_tokens.scss +10 -0
- package/styles/index.scss +25 -0
- package/styles/settings/_ui-config.scss +67 -0
- package/styles/utils/_functions.scss +67 -0
- package/styles/utils/_helpers.scss +129 -0
- package/styles/utils/_mixins.scss +186 -0
- package/styles/utils/_motion.scss +47 -0
- package/styles/utils/_overlay.scss +26 -0
- package/styles/utils.scss +15 -0
- package/styles.css +1 -0
- package/types/4sh-ui-kit-forms.d.ts +259 -0
- package/types/4sh-ui-kit-motion.d.ts +111 -0
- package/types/4sh-ui-kit-overlay.d.ts +31 -0
- package/types/4sh-ui-kit-theming.d.ts +54 -0
- package/types/4sh-ui-kit-types.d.ts +13 -0
- package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
- package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
- package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
- package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
- package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
- package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
- package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
- package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
- package/types/4sh-ui-kit-ui-button.d.ts +91 -0
- package/types/4sh-ui-kit-ui-card.d.ts +102 -0
- package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
- package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
- package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
- package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
- package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
- package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
- package/types/4sh-ui-kit-ui-field.d.ts +53 -0
- package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
- package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
- package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
- package/types/4sh-ui-kit-ui-image.d.ts +88 -0
- package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
- package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
- package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
- package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
- package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
- package/types/4sh-ui-kit-ui-input.d.ts +78 -0
- package/types/4sh-ui-kit-ui-label.d.ts +36 -0
- package/types/4sh-ui-kit-ui-link.d.ts +72 -0
- package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
- package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
- package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
- package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
- package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
- package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
- package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
- package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
- package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
- package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
- package/types/4sh-ui-kit-ui-select.d.ts +392 -0
- package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
- package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
- package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
- package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
- package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
- package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
- package/types/4sh-ui-kit-ui-table.d.ts +570 -0
- package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
- package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
- package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
- package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
- package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
- package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
- package/types/4sh-ui-kit.d.ts +4 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { UiMotionPreset } from '@4sh/ui-kit/motion';
|
|
4
|
+
|
|
5
|
+
/** Edge the drawer is anchored to (and slides in from). */
|
|
6
|
+
type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
7
|
+
/**
|
|
8
|
+
* ui-drawer — headless slide-in panel anchored to a screen edge.
|
|
9
|
+
*
|
|
10
|
+
* A token-styled surface docked to an edge (`left` / `right` / `top` / `bottom`)
|
|
11
|
+
* and rendered over an optional viewport mask, driven by the two-way `visible`
|
|
12
|
+
* model. Enter/leave run through the shared motion system: the mask fades while
|
|
13
|
+
* the panel slides in from its edge (the slide direction is derived from
|
|
14
|
+
* `position`, the offset stretched to the panel's own size). Built for
|
|
15
|
+
* accessibility: focus trap with focus restore (`@angular/cdk/a11y`),
|
|
16
|
+
* `aria-modal`, background scroll lock, `Escape` to close, and an optional
|
|
17
|
+
* click-outside dismiss.
|
|
18
|
+
*
|
|
19
|
+
* Composes header / content / footer regions: a plain `header` string (or the
|
|
20
|
+
* `#header` template), the default `<ng-content>` for the body, and a `#footer`
|
|
21
|
+
* template for actions. A `#headless` template takes over the whole panel when
|
|
22
|
+
* total control of the interface is required (the drawer still owns the overlay
|
|
23
|
+
* mechanics: mask, motion, focus trap, `Escape`).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <ui-button label="Ouvrir" (buttonClick)="open.set(true)" />
|
|
28
|
+
* <ui-drawer [(visible)]="open" header="Menu" position="right">
|
|
29
|
+
* <p>Contenu…</p>
|
|
30
|
+
* </ui-drawer>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare class UiDrawer {
|
|
34
|
+
/** Open state (two-way). Toggling it drives the enter/leave animation. */
|
|
35
|
+
visible: _angular_core.ModelSignal<boolean>;
|
|
36
|
+
/** Edge the drawer docks to and slides in from. */
|
|
37
|
+
position: _angular_core.InputSignal<DrawerPosition>;
|
|
38
|
+
/** Fill the whole viewport (the panel fades in instead of sliding). */
|
|
39
|
+
fullScreen: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
40
|
+
/** Simple header text (ignored when a `#header` template is projected). */
|
|
41
|
+
header: _angular_core.InputSignal<string | undefined>;
|
|
42
|
+
/** ARIA role of the panel surface. */
|
|
43
|
+
role: _angular_core.InputSignal<string>;
|
|
44
|
+
/** Accessible name when there is no visible header to reference. */
|
|
45
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
46
|
+
/** Id of an external element naming the panel (overrides the header title). */
|
|
47
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
48
|
+
/** Show the mask (dim + capture) and block background scroll. */
|
|
49
|
+
modal: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
50
|
+
/** Close when the mask (outside the panel) is clicked — modal only. */
|
|
51
|
+
dismissableMask: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
52
|
+
/** Show the close (×) button. */
|
|
53
|
+
closable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
54
|
+
/** Close the drawer when `Escape` is pressed. */
|
|
55
|
+
closeOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
56
|
+
/** Block background scroll even for a non-modal drawer. */
|
|
57
|
+
blockScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
58
|
+
/** Render the header region (title + close button). */
|
|
59
|
+
showHeader: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
60
|
+
/** Move focus into the panel when it opens (auto-captured, restored on close). */
|
|
61
|
+
focusOnShow: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
62
|
+
/** Trap Tab focus inside the panel while open. */
|
|
63
|
+
focusTrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
64
|
+
/** FontAwesome name of the close button icon. */
|
|
65
|
+
closeIcon: _angular_core.InputSignal<string>;
|
|
66
|
+
/** Accessible name of the close button. */
|
|
67
|
+
closeAriaLabel: _angular_core.InputSignal<string>;
|
|
68
|
+
/** Extra class(es) merged onto the panel surface. */
|
|
69
|
+
styleClass: _angular_core.InputSignal<string | undefined>;
|
|
70
|
+
/** Extra class(es) merged onto the mask. */
|
|
71
|
+
maskStyleClass: _angular_core.InputSignal<string | undefined>;
|
|
72
|
+
/** Inline styles applied to the panel (e.g. `{ width: '30rem' }`). */
|
|
73
|
+
drawerStyle: _angular_core.InputSignal<Record<string, string> | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Scope the drawer to the nearest positioned ancestor (`position: absolute`)
|
|
76
|
+
* instead of the viewport (`position: fixed`), and skip the body scroll lock.
|
|
77
|
+
* Useful to embed a drawer inside a bounded container (docs previews, panels).
|
|
78
|
+
*/
|
|
79
|
+
contained: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
80
|
+
/** Layer this drawer above earlier overlays automatically. */
|
|
81
|
+
autoZIndex: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
82
|
+
/** Floor z-index (added to the auto value, or used as-is when `autoZIndex=false`). */
|
|
83
|
+
baseZIndex: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
84
|
+
/** Disable the open/close animation for this drawer. */
|
|
85
|
+
motionDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
86
|
+
/** Custom header template (replaces the `header` string). */
|
|
87
|
+
protected readonly headerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
88
|
+
/** Footer template (actions row). */
|
|
89
|
+
protected readonly footerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
90
|
+
/** Custom close-icon template (replaces `closeIcon`). */
|
|
91
|
+
protected readonly closeIconTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
92
|
+
/** Headless template — takes over the entire panel interior when provided. */
|
|
93
|
+
protected readonly headlessTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
94
|
+
/** Emitted after the drawer becomes visible. */
|
|
95
|
+
shown: _angular_core.OutputEmitterRef<void>;
|
|
96
|
+
/** Emitted after the drawer is hidden. */
|
|
97
|
+
hidden: _angular_core.OutputEmitterRef<void>;
|
|
98
|
+
/** @ignore */
|
|
99
|
+
private readonly panelRef;
|
|
100
|
+
/** @ignore Scrim host (for imperative `maskStyleClass` — a bound `[class]` would
|
|
101
|
+
* fight the motion classes and break the leave animation). */
|
|
102
|
+
private readonly scrimRef;
|
|
103
|
+
/** @ignore Classes currently applied to the scrim by `maskStyleClass`. */
|
|
104
|
+
private appliedMaskClasses;
|
|
105
|
+
/** @ignore */
|
|
106
|
+
private readonly document;
|
|
107
|
+
/** @ignore */
|
|
108
|
+
private readonly isBrowser;
|
|
109
|
+
/** @ignore Per-instance layering rank for `autoZIndex`. */
|
|
110
|
+
private readonly zSeq;
|
|
111
|
+
/** @ignore */
|
|
112
|
+
protected readonly uid: string;
|
|
113
|
+
/** @ignore */
|
|
114
|
+
protected readonly titleId: string;
|
|
115
|
+
/** @ignore This instance currently holds a body scroll lock. */
|
|
116
|
+
private locked;
|
|
117
|
+
/** @ignore Effective stacking level. */
|
|
118
|
+
protected readonly zIndex: _angular_core.Signal<number>;
|
|
119
|
+
/**
|
|
120
|
+
* @ignore Slide preset derived from the anchored edge (offset stretched to 100%
|
|
121
|
+
* of the panel's own size so it travels fully off-screen). A full-screen drawer
|
|
122
|
+
* fades instead of sliding a whole viewport of content.
|
|
123
|
+
*/
|
|
124
|
+
protected readonly motionPreset: _angular_core.Signal<UiMotionPreset>;
|
|
125
|
+
/** @ignore Slide offset: the panel's full extent (omitted for the fade-only full-screen). */
|
|
126
|
+
protected readonly motionDistance: _angular_core.Signal<"100%" | undefined>;
|
|
127
|
+
/** @ignore Id of the element naming the panel (header title, or an external id). */
|
|
128
|
+
protected readonly labelledBy: _angular_core.Signal<string | null>;
|
|
129
|
+
/** @ignore Fallback accessible name when nothing is referenced. */
|
|
130
|
+
protected readonly resolvedAriaLabel: _angular_core.Signal<string | null | undefined>;
|
|
131
|
+
constructor();
|
|
132
|
+
/** Close the drawer. */
|
|
133
|
+
close(): void;
|
|
134
|
+
/** Move focus onto the panel surface. */
|
|
135
|
+
focus(): void;
|
|
136
|
+
/** @ignore Escape-to-close (bubbles from any focused control inside the panel). */
|
|
137
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
138
|
+
/** @ignore Click-outside dismiss (mask target only, modal + dismissable). */
|
|
139
|
+
protected onMaskPointerdown(event: PointerEvent): void;
|
|
140
|
+
/** @ignore Release this instance's scroll lock, if held. */
|
|
141
|
+
private releaseLock;
|
|
142
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiDrawer, never>;
|
|
143
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiDrawer, "ui-drawer", never, { "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "fullScreen": { "alias": "fullScreen"; "required": false; "isSignal": true; }; "header": { "alias": "header"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "dismissableMask": { "alias": "dismissableMask"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "blockScroll": { "alias": "blockScroll"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "focusOnShow": { "alias": "focusOnShow"; "required": false; "isSignal": true; }; "focusTrap": { "alias": "focusTrap"; "required": false; "isSignal": true; }; "closeIcon": { "alias": "closeIcon"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "maskStyleClass": { "alias": "maskStyleClass"; "required": false; "isSignal": true; }; "drawerStyle": { "alias": "drawerStyle"; "required": false; "isSignal": true; }; "contained": { "alias": "contained"; "required": false; "isSignal": true; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; "motionDisabled": { "alias": "motionDisabled"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "shown": "shown"; "hidden": "hidden"; }, ["headerTemplate", "footerTemplate", "closeIconTemplate", "headlessTemplate"], ["*"], true, never>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { UiDrawer };
|
|
147
|
+
export type { DrawerPosition };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { UiIconType } from '@4sh/ui-kit/ui-icon';
|
|
3
|
+
|
|
4
|
+
type EmptyStateSize = 'default' | 'small';
|
|
5
|
+
/**
|
|
6
|
+
* Slot markers — apply them (attribute or element form) on the content you project
|
|
7
|
+
* into a `<ui-empty-state>` to route it to the matching region. They carry no
|
|
8
|
+
* behaviour; the component queries their presence to render the surrounding structure.
|
|
9
|
+
*
|
|
10
|
+
* <ui-empty-state title="Aucun résultat" description="Essayez d'élargir vos filtres.">
|
|
11
|
+
* <img uiEmptyStateMedia src="/illustrations/empty.svg" alt="" />
|
|
12
|
+
* <div uiEmptyStateActions>
|
|
13
|
+
* <ui-button label="Réinitialiser les filtres" level="low" />
|
|
14
|
+
* </div>
|
|
15
|
+
* </ui-empty-state>
|
|
16
|
+
*/
|
|
17
|
+
/** Visual region (illustration, image, custom SVG…). Overrides the `icon` shortcut. */
|
|
18
|
+
declare class UiEmptyStateMedia {
|
|
19
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiEmptyStateMedia, never>;
|
|
20
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiEmptyStateMedia, "[uiEmptyStateMedia], ui-empty-state-media", never, {}, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
22
|
+
/** Actions region (buttons, links…), rendered below the text. */
|
|
23
|
+
declare class UiEmptyStateActions {
|
|
24
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiEmptyStateActions, never>;
|
|
25
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiEmptyStateActions, "[uiEmptyStateActions], ui-empty-state-actions", never, {}, {}, never, never, true, never>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* ui-empty-state — communicates the absence of content (empty list, no search
|
|
29
|
+
* result, cleared inbox…) and offers a way forward.
|
|
30
|
+
*
|
|
31
|
+
* Headless: a centered vertical stack composing an optional visual (illustration
|
|
32
|
+
* slot or `icon` shortcut), a title, a description, an optional free body slot and
|
|
33
|
+
* an actions slot. Every region renders only when it holds content, so no empty
|
|
34
|
+
* wrapper (and no phantom gap) is emitted. All values come from design tokens.
|
|
35
|
+
*
|
|
36
|
+
* The most common case needs no imports — pass `title`/`description`/`icon` and drop
|
|
37
|
+
* actions into the default flow via the `uiEmptyStateActions` marker.
|
|
38
|
+
*/
|
|
39
|
+
declare class UiEmptyState {
|
|
40
|
+
/** Main line — what is empty / why (recommended). */
|
|
41
|
+
title: _angular_core.InputSignal<string | undefined>;
|
|
42
|
+
/** Supporting line under the title (guidance, next step). */
|
|
43
|
+
description: _angular_core.InputSignal<string | undefined>;
|
|
44
|
+
/** FontAwesome icon name — shortcut for the visual (ignored if a media slot is projected). */
|
|
45
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
46
|
+
/** Icon variant, forwarded to `ui-icon`. */
|
|
47
|
+
iconType: _angular_core.InputSignal<UiIconType>;
|
|
48
|
+
/** Density. */
|
|
49
|
+
size: _angular_core.InputSignal<EmptyStateSize>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the visual region is shown. `true` by default; set `false` to keep a
|
|
52
|
+
* text-only empty state without removing the projected media / `icon` from markup.
|
|
53
|
+
*/
|
|
54
|
+
showMedia: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
55
|
+
/** Accessible name for the region landmark (adds `role="region"`). */
|
|
56
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
57
|
+
/** Id of the element labelling the region landmark (adds `role="region"`). */
|
|
58
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
59
|
+
/** @ignore */
|
|
60
|
+
protected readonly mediaSlot: _angular_core.Signal<UiEmptyStateMedia | undefined>;
|
|
61
|
+
/** @ignore */
|
|
62
|
+
protected readonly actionsSlot: _angular_core.Signal<UiEmptyStateActions | undefined>;
|
|
63
|
+
/** @ignore */
|
|
64
|
+
private readonly bodyWrap;
|
|
65
|
+
/** @ignore Default (body) content actually projected (detected after rendering). */
|
|
66
|
+
private readonly hasProjectedBody;
|
|
67
|
+
constructor();
|
|
68
|
+
/** @ignore An icon shortcut is provided. */
|
|
69
|
+
protected readonly hasIcon: _angular_core.Signal<boolean>;
|
|
70
|
+
/** @ignore A media slot is projected. */
|
|
71
|
+
protected readonly hasMedia: _angular_core.Signal<boolean>;
|
|
72
|
+
/** @ignore The visual region is shown and has something to render. */
|
|
73
|
+
protected readonly showVisual: _angular_core.Signal<boolean>;
|
|
74
|
+
/** @ignore */
|
|
75
|
+
protected readonly hasTitle: _angular_core.Signal<boolean>;
|
|
76
|
+
/** @ignore */
|
|
77
|
+
protected readonly hasDescription: _angular_core.Signal<boolean>;
|
|
78
|
+
/** @ignore Free body content projected between the description and the actions. */
|
|
79
|
+
protected readonly hasBody: _angular_core.Signal<boolean>;
|
|
80
|
+
/** @ignore The text region (title / description / body) has content. */
|
|
81
|
+
protected readonly hasText: _angular_core.Signal<boolean>;
|
|
82
|
+
/** @ignore An actions slot is projected. */
|
|
83
|
+
protected readonly hasActions: _angular_core.Signal<boolean>;
|
|
84
|
+
/** @ignore Landmark role only when the region carries an accessible name. */
|
|
85
|
+
protected readonly role: _angular_core.Signal<"region" | null>;
|
|
86
|
+
/** @ignore */
|
|
87
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
88
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiEmptyState, never>;
|
|
89
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiEmptyState, "ui-empty-state", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconType": { "alias": "iconType"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showMedia": { "alias": "showMedia"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; }, {}, ["mediaSlot", "actionsSlot"], ["[uiEmptyStateMedia], ui-empty-state-media", "*", "[uiEmptyStateActions], ui-empty-state-actions"], true, never>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { UiEmptyState, UiEmptyStateActions, UiEmptyStateMedia };
|
|
93
|
+
export type { EmptyStateSize };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { FieldSize, FieldLevel } from '@4sh/ui-kit/forms';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ui-field — shared presentational shell for "box" fields.
|
|
6
|
+
*
|
|
7
|
+
* Renders: `ui-label` (top) + a bordered box (states/levels via `form.*` tokens)
|
|
8
|
+
* + `ui-helper` (bottom). The field content is **projected**:
|
|
9
|
+
* - `[uiFieldPrefix]`: element(s) before the input (left icon…),
|
|
10
|
+
* - default: the native `<input>`/`<textarea>`,
|
|
11
|
+
* - `[uiFieldSuffix]`: element(s) after (unit, action, spinner…).
|
|
12
|
+
*
|
|
13
|
+
* Purely visual (no `ControlValueAccessor`): the concrete components
|
|
14
|
+
* (`ui-input`, `ui-input-number`, `ui-input-mask`) own the value and provide the
|
|
15
|
+
* computed `id`/`level`/`message` (via `BaseFormField`).
|
|
16
|
+
*/
|
|
17
|
+
declare class UiField {
|
|
18
|
+
/** Label (rendered via `ui-label`). */
|
|
19
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
20
|
+
/** Label `for` = id of the projected input. */
|
|
21
|
+
for: _angular_core.InputSignal<string | undefined>;
|
|
22
|
+
/** Required marker (*). */
|
|
23
|
+
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
24
|
+
/** Size. */
|
|
25
|
+
size: _angular_core.InputSignal<FieldSize>;
|
|
26
|
+
/** Effective level (drives the border + message color). */
|
|
27
|
+
level: _angular_core.InputSignal<FieldLevel>;
|
|
28
|
+
/** Disabled state (visual). */
|
|
29
|
+
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
30
|
+
/** Read-only state (visual). */
|
|
31
|
+
readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
32
|
+
/** Multiline box (top-aligned, auto-height with min-height) — used by `ui-textarea`. */
|
|
33
|
+
multiline: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Auto-height box (grows with wrapping content, keeps padding + centering) —
|
|
36
|
+
* used by `ui-select` in `multiple` mode so chips/values can wrap.
|
|
37
|
+
*/
|
|
38
|
+
autoHeight: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
39
|
+
/** Message under the field (helper or error, already resolved by the component). */
|
|
40
|
+
message: _angular_core.InputSignal<string | undefined>;
|
|
41
|
+
/** id of the message (for `aria-describedby`, set by the component on the input). */
|
|
42
|
+
messageId: _angular_core.InputSignal<string | undefined>;
|
|
43
|
+
/** Renders the footer row even without a message (e.g. to host a `[uiFieldFooter]` counter). */
|
|
44
|
+
hasFooter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
45
|
+
/** @ignore */
|
|
46
|
+
protected onBoxMouseDown(event: MouseEvent): void;
|
|
47
|
+
/** @ignore */
|
|
48
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
49
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiField, never>;
|
|
50
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiField, "ui-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "for": { "alias": "for"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "multiline": { "alias": "multiline"; "required": false; "isSignal": true; }; "autoHeight": { "alias": "autoHeight"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "messageId": { "alias": "messageId"; "required": false; "isSignal": true; }; "hasFooter": { "alias": "hasFooter"; "required": false; "isSignal": true; }; }, {}, never, ["[uiFieldPrefix]", "*", "[uiFieldSuffix]", "[uiFieldFooter]"], true, never>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { UiField };
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { UiIconSize } from '@4sh/ui-kit/ui-icon';
|
|
4
|
+
|
|
5
|
+
/** Lifecycle of a selected file. */
|
|
6
|
+
type UiUploadStatus = 'pending' | 'uploading' | 'completed' | 'error';
|
|
7
|
+
/** A file selected in the uploader, plus its upload/validation state. */
|
|
8
|
+
interface UiUploadFile {
|
|
9
|
+
/** Stable id for tracking (kept across re-renders). */
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** The underlying browser File. */
|
|
12
|
+
readonly file: File;
|
|
13
|
+
/** File name (from the File, exposed for template convenience). */
|
|
14
|
+
readonly name: string;
|
|
15
|
+
/** Size in bytes. */
|
|
16
|
+
readonly size: number;
|
|
17
|
+
/** MIME type reported by the browser. */
|
|
18
|
+
readonly type: string;
|
|
19
|
+
/** Current lifecycle state. */
|
|
20
|
+
status: UiUploadStatus;
|
|
21
|
+
/** Upload progress, 0–100 (meaningful while `status === 'uploading'`). */
|
|
22
|
+
progress: number;
|
|
23
|
+
/** Object URL for image previews — MUST be revoked when the file is removed. */
|
|
24
|
+
objectUrl?: string;
|
|
25
|
+
/** Validation or upload error message, when `status === 'error'`. */
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Payload for the custom upload handler (customUpload = true). */
|
|
29
|
+
interface UiUploadHandlerEvent {
|
|
30
|
+
/** Files awaiting upload (status `pending`). */
|
|
31
|
+
files: UiUploadFile[];
|
|
32
|
+
/** Marks a file as uploaded (sets status `completed`, progress 100). */
|
|
33
|
+
markUploaded: (file: UiUploadFile) => void;
|
|
34
|
+
/** Marks a file as failed with an optional message. */
|
|
35
|
+
markError: (file: UiUploadFile, message?: string) => void;
|
|
36
|
+
/** Updates a file's progress (0–100). */
|
|
37
|
+
setProgress: (file: UiUploadFile, progress: number) => void;
|
|
38
|
+
}
|
|
39
|
+
/** Emitted when files finish uploading (built-in uploader). */
|
|
40
|
+
interface UiUploadEvent {
|
|
41
|
+
files: UiUploadFile[];
|
|
42
|
+
/** Raw XHR of the last request (built-in uploader only). */
|
|
43
|
+
xhr?: XMLHttpRequest;
|
|
44
|
+
}
|
|
45
|
+
/** Emitted on a validation or upload error. */
|
|
46
|
+
interface UiUploadErrorEvent {
|
|
47
|
+
file: UiUploadFile;
|
|
48
|
+
/** 'type' | 'size' | 'limit' | 'upload'. */
|
|
49
|
+
reason: 'type' | 'size' | 'limit' | 'upload';
|
|
50
|
+
message: string;
|
|
51
|
+
}
|
|
52
|
+
/** Human-readable file size (e.g. "2.5 MB"). Base-1024. */
|
|
53
|
+
declare function formatFileSize(bytes: number): string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether a File matches an `accept` string (e.g. "image/*,.pdf").
|
|
56
|
+
* Empty/absent accept means everything is allowed.
|
|
57
|
+
*/
|
|
58
|
+
declare function isFileTypeAccepted(file: File, accept: string | undefined): boolean;
|
|
59
|
+
/** Whether a File is a previewable image. */
|
|
60
|
+
declare function isImageFile(file: File): boolean;
|
|
61
|
+
|
|
62
|
+
type UiFileUploadListSize = 'default' | 'small';
|
|
63
|
+
/**
|
|
64
|
+
* ui-file-upload-list — a single file row (the repeatable unit of an upload list).
|
|
65
|
+
*
|
|
66
|
+
* Presentational: shows a leading thumbnail (for images) or file icon, the file
|
|
67
|
+
* name + size/status, and a remove button. While the file is uploading it swaps
|
|
68
|
+
* the leading icon for a `ui-spinner` and reveals a slim progress bar.
|
|
69
|
+
*
|
|
70
|
+
* Named to mirror the Figma component; the uploader stacks one row per file.
|
|
71
|
+
*/
|
|
72
|
+
declare class UiFileUploadList {
|
|
73
|
+
/** The file to display (name/size/status/progress/preview). */
|
|
74
|
+
file: _angular_core.InputSignal<UiUploadFile>;
|
|
75
|
+
size: _angular_core.InputSignal<UiFileUploadListSize>;
|
|
76
|
+
/** FontAwesome icon for non-image files. */
|
|
77
|
+
icon: _angular_core.InputSignal<string>;
|
|
78
|
+
/** Whether the remove button is shown. */
|
|
79
|
+
removable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
80
|
+
/** Accessible name of the remove button (raw text — the file name is appended in the template). */
|
|
81
|
+
removeAriaLabel: _angular_core.InputSignal<string>;
|
|
82
|
+
/** Fallback error text when the file carries no message. */
|
|
83
|
+
failedLabel: _angular_core.InputSignal<string>;
|
|
84
|
+
/** Accessible name of the upload spinner — `{0}` is the file name. */
|
|
85
|
+
uploadingLabel: _angular_core.InputSignal<string>;
|
|
86
|
+
/** Accessible name of the progress bar — `{0}` is the file name. */
|
|
87
|
+
progressLabel: _angular_core.InputSignal<string>;
|
|
88
|
+
/** Emitted when the remove button is activated. */
|
|
89
|
+
remove: _angular_core.OutputEmitterRef<UiUploadFile>;
|
|
90
|
+
/** @ignore Formatted size (e.g. "2.5 MB"). */
|
|
91
|
+
protected readonly sizeLabel: _angular_core.Signal<string>;
|
|
92
|
+
/** @ignore Accessible name of the upload spinner (`{0}` filled with the file name). */
|
|
93
|
+
protected readonly uploadingAriaLabel: _angular_core.Signal<string>;
|
|
94
|
+
/** @ignore Accessible name of the progress bar (`{0}` filled with the file name). */
|
|
95
|
+
protected readonly progressAriaLabel: _angular_core.Signal<string>;
|
|
96
|
+
/** @ignore Uploading in progress → show the spinner + progress bar. */
|
|
97
|
+
protected readonly isUploading: _angular_core.Signal<boolean>;
|
|
98
|
+
/** @ignore Error state → surface the message + error styling. */
|
|
99
|
+
protected readonly isError: _angular_core.Signal<boolean>;
|
|
100
|
+
/** @ignore Image with a usable preview URL → render a thumbnail. */
|
|
101
|
+
protected readonly thumbnail: _angular_core.Signal<string | null>;
|
|
102
|
+
/** @ignore Secondary line: error message, else size (+ status hint). */
|
|
103
|
+
protected readonly infoLabel: _angular_core.Signal<string>;
|
|
104
|
+
/** @ignore */
|
|
105
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
106
|
+
/** @ignore */
|
|
107
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
108
|
+
/** @ignore */
|
|
109
|
+
protected onRemove(): void;
|
|
110
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiFileUploadList, never>;
|
|
111
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiFileUploadList, "ui-file-upload-list", never, { "file": { "alias": "file"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "removeAriaLabel": { "alias": "removeAriaLabel"; "required": false; "isSignal": true; }; "failedLabel": { "alias": "failedLabel"; "required": false; "isSignal": true; }; "uploadingLabel": { "alias": "uploadingLabel"; "required": false; "isSignal": true; }; "progressLabel": { "alias": "progressLabel"; "required": false; "isSignal": true; }; }, { "remove": "remove"; }, never, never, true, never>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type UiFileUploadMode = 'field' | 'drag';
|
|
115
|
+
type UiFileUploadSize = 'default' | 'small';
|
|
116
|
+
/**
|
|
117
|
+
* ui-file-upload — headless file uploader (field + drag-and-drop).
|
|
118
|
+
*
|
|
119
|
+
* A native `<input type="file">` (visually hidden) drives selection, so the OS
|
|
120
|
+
* picker, keyboard and screen readers work natively; the whole component is also
|
|
121
|
+
* a drop target. Selection is validated client-side (type / size / count) and
|
|
122
|
+
* files can be uploaded automatically (`auto`), on demand, or via a custom
|
|
123
|
+
* handler (`customUpload`). Progress is tracked with `XMLHttpRequest` so no
|
|
124
|
+
* global HTTP provider is required.
|
|
125
|
+
*
|
|
126
|
+
* Security notes: client-side validation is a UX convenience — always re-validate
|
|
127
|
+
* server-side. Image previews use object URLs that are revoked on removal/clear.
|
|
128
|
+
*/
|
|
129
|
+
declare class UiFileUpload {
|
|
130
|
+
/** `field` = compact input + Browse button; `drag` = full drop zone. */
|
|
131
|
+
mode: _angular_core.InputSignal<UiFileUploadMode>;
|
|
132
|
+
size: _angular_core.InputSignal<UiFileUploadSize>;
|
|
133
|
+
/** Native input `name` (submitted with a surrounding form). */
|
|
134
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
135
|
+
/** Allow selecting more than one file. */
|
|
136
|
+
multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
137
|
+
/** Native `accept` filter, e.g. "image/*,.pdf". Also enforced on drop. */
|
|
138
|
+
accept: _angular_core.InputSignal<string | undefined>;
|
|
139
|
+
/** Max size per file, in bytes. */
|
|
140
|
+
maxFileSize: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
141
|
+
/** Max number of files kept at once. */
|
|
142
|
+
fileLimit: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
143
|
+
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
144
|
+
/** Upload each file as soon as it is selected. */
|
|
145
|
+
auto: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
146
|
+
/** Delegate uploading to the `uploadHandler` output instead of the built-in XHR. */
|
|
147
|
+
customUpload: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
148
|
+
/** Endpoint for the built-in uploader. */
|
|
149
|
+
url: _angular_core.InputSignal<string | undefined>;
|
|
150
|
+
/** HTTP method for the built-in uploader. */
|
|
151
|
+
method: _angular_core.InputSignal<"post" | "put">;
|
|
152
|
+
/** Field name used for each file in the multipart body. */
|
|
153
|
+
fieldName: _angular_core.InputSignal<string>;
|
|
154
|
+
/** Send credentials (cookies) with the built-in upload request. */
|
|
155
|
+
withCredentials: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
156
|
+
/** Show the file list under the control. */
|
|
157
|
+
showFileList: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
158
|
+
/** Show the Upload/Cancel toolbar buttons (drag mode). */
|
|
159
|
+
showControls: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
160
|
+
browseLabel: _angular_core.InputSignal<string>;
|
|
161
|
+
/** Placeholder shown in field mode before any selection. */
|
|
162
|
+
chooseLabel: _angular_core.InputSignal<string>;
|
|
163
|
+
uploadLabel: _angular_core.InputSignal<string>;
|
|
164
|
+
cancelLabel: _angular_core.InputSignal<string>;
|
|
165
|
+
/** Drag-zone link + prompt. */
|
|
166
|
+
dragLinkLabel: _angular_core.InputSignal<string>;
|
|
167
|
+
dragPromptLabel: _angular_core.InputSignal<string>;
|
|
168
|
+
/** Small hint under the drag prompt (e.g. "JPG, PNG (max 5 MB)"). */
|
|
169
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
170
|
+
/** Accessible name for the whole control. */
|
|
171
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
172
|
+
/** Multi-file summary in field mode — `{0}` is replaced by the file count. */
|
|
173
|
+
filesSummaryLabel: _angular_core.InputSignal<string>;
|
|
174
|
+
/** Rejection message: file type not accepted — `{0}` is the file name. */
|
|
175
|
+
invalidTypeMessage: _angular_core.InputSignal<string>;
|
|
176
|
+
/** Rejection message: file too large — `{0}` is the file name. */
|
|
177
|
+
invalidSizeMessage: _angular_core.InputSignal<string>;
|
|
178
|
+
/** Rejection message: `fileLimit` reached — `{0}` is the limit. */
|
|
179
|
+
limitReachedMessage: _angular_core.InputSignal<string>;
|
|
180
|
+
/** Error shown when an upload fails without a server message. */
|
|
181
|
+
uploadErrorMessage: _angular_core.InputSignal<string>;
|
|
182
|
+
/** Error shown when the upload request fails at the network level. */
|
|
183
|
+
networkErrorMessage: _angular_core.InputSignal<string>;
|
|
184
|
+
/** Error shown on a non-2xx response — `{0}` is the HTTP status. */
|
|
185
|
+
httpErrorMessage: _angular_core.InputSignal<string>;
|
|
186
|
+
/** Overrides a single file row (context: `{ $implicit: UiUploadFile, remove }`). */
|
|
187
|
+
fileTemplate: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
188
|
+
/** Overrides the content section (context: `{ $implicit: UiUploadFile[], remove, clear }`). */
|
|
189
|
+
contentTemplate: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
190
|
+
/** Custom toolbar content (context: `{ $implicit: UiUploadFile[], choose, upload, clear }`). */
|
|
191
|
+
toolbarTemplate: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
192
|
+
/** Files added to the selection (validated). */
|
|
193
|
+
selected: _angular_core.OutputEmitterRef<UiUploadFile[]>;
|
|
194
|
+
/** The full current selection changed. */
|
|
195
|
+
filesChange: _angular_core.OutputEmitterRef<UiUploadFile[]>;
|
|
196
|
+
/** A custom upload was requested (customUpload = true). */
|
|
197
|
+
uploadHandler: _angular_core.OutputEmitterRef<UiUploadHandlerEvent>;
|
|
198
|
+
/** Built-in upload completed for a batch. */
|
|
199
|
+
uploaded: _angular_core.OutputEmitterRef<UiUploadEvent>;
|
|
200
|
+
/** A file failed validation or upload. */
|
|
201
|
+
uploadError: _angular_core.OutputEmitterRef<UiUploadErrorEvent>;
|
|
202
|
+
/** A file was removed. */
|
|
203
|
+
removed: _angular_core.OutputEmitterRef<UiUploadFile>;
|
|
204
|
+
/** The selection was cleared. */
|
|
205
|
+
cleared: _angular_core.OutputEmitterRef<void>;
|
|
206
|
+
/** @ignore Stable id linking the visible label(s) to the native input. */
|
|
207
|
+
protected readonly inputId: string;
|
|
208
|
+
private readonly host;
|
|
209
|
+
private readonly destroyRef;
|
|
210
|
+
private readonly fileInput;
|
|
211
|
+
/** In-flight requests, keyed by file id, so we can abort. */
|
|
212
|
+
private readonly requests;
|
|
213
|
+
/** @ignore Current selection. */
|
|
214
|
+
private readonly selection;
|
|
215
|
+
/** Read-only view of the current files. */
|
|
216
|
+
readonly files: _angular_core.Signal<UiUploadFile[]>;
|
|
217
|
+
/** @ignore Drop-zone highlight while dragging over. */
|
|
218
|
+
protected readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
219
|
+
/** @ignore Transient validation messages (rendered in a live region). */
|
|
220
|
+
protected readonly messages: _angular_core.WritableSignal<string[]>;
|
|
221
|
+
constructor();
|
|
222
|
+
/** @ignore */
|
|
223
|
+
protected readonly hasFiles: _angular_core.Signal<boolean>;
|
|
224
|
+
/** @ignore */
|
|
225
|
+
protected readonly pending: _angular_core.Signal<UiUploadFile[]>;
|
|
226
|
+
/** @ignore Single-file summary shown in field mode. */
|
|
227
|
+
protected readonly fieldSummary: _angular_core.Signal<string>;
|
|
228
|
+
/** @ignore */
|
|
229
|
+
protected readonly canUpload: _angular_core.Signal<boolean>;
|
|
230
|
+
/** @ignore */
|
|
231
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
232
|
+
/** @ignore */ protected readonly removeFn: (f: UiUploadFile) => void;
|
|
233
|
+
/** @ignore */ protected readonly clearFn: () => void;
|
|
234
|
+
/** @ignore */ protected readonly chooseFn: () => void;
|
|
235
|
+
/** @ignore */ protected readonly uploadFn: () => void;
|
|
236
|
+
/** Opens the native file picker. */
|
|
237
|
+
choose(): void;
|
|
238
|
+
/** Uploads all pending files (built-in XHR, or emits `uploadHandler`). */
|
|
239
|
+
upload(): void;
|
|
240
|
+
/** Removes a file (aborts its upload, revokes its preview). */
|
|
241
|
+
remove(target: UiUploadFile): void;
|
|
242
|
+
/** Clears the whole selection. */
|
|
243
|
+
clear(): void;
|
|
244
|
+
/** @ignore */
|
|
245
|
+
protected onInputChange(event: Event): void;
|
|
246
|
+
/** @ignore */
|
|
247
|
+
protected onDragOver(event: DragEvent): void;
|
|
248
|
+
/** @ignore */
|
|
249
|
+
protected onDragLeave(event: DragEvent): void;
|
|
250
|
+
/** @ignore */
|
|
251
|
+
protected onDrop(event: DragEvent): void;
|
|
252
|
+
/** Validate + add a FileList to the selection. */
|
|
253
|
+
private ingest;
|
|
254
|
+
private toUploadFile;
|
|
255
|
+
private fail;
|
|
256
|
+
/** Mutates one file in place (immutably) and pushes a new array reference. */
|
|
257
|
+
private patch;
|
|
258
|
+
private emitCustomUpload;
|
|
259
|
+
private xhrUpload;
|
|
260
|
+
private uploadFailed;
|
|
261
|
+
private revoke;
|
|
262
|
+
private resetInput;
|
|
263
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiFileUpload, never>;
|
|
264
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiFileUpload, "ui-file-upload", never, { "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "fileLimit": { "alias": "fileLimit"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "auto": { "alias": "auto"; "required": false; "isSignal": true; }; "customUpload": { "alias": "customUpload"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; "method": { "alias": "method"; "required": false; "isSignal": true; }; "fieldName": { "alias": "fieldName"; "required": false; "isSignal": true; }; "withCredentials": { "alias": "withCredentials"; "required": false; "isSignal": true; }; "showFileList": { "alias": "showFileList"; "required": false; "isSignal": true; }; "showControls": { "alias": "showControls"; "required": false; "isSignal": true; }; "browseLabel": { "alias": "browseLabel"; "required": false; "isSignal": true; }; "chooseLabel": { "alias": "chooseLabel"; "required": false; "isSignal": true; }; "uploadLabel": { "alias": "uploadLabel"; "required": false; "isSignal": true; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; "isSignal": true; }; "dragLinkLabel": { "alias": "dragLinkLabel"; "required": false; "isSignal": true; }; "dragPromptLabel": { "alias": "dragPromptLabel"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "filesSummaryLabel": { "alias": "filesSummaryLabel"; "required": false; "isSignal": true; }; "invalidTypeMessage": { "alias": "invalidTypeMessage"; "required": false; "isSignal": true; }; "invalidSizeMessage": { "alias": "invalidSizeMessage"; "required": false; "isSignal": true; }; "limitReachedMessage": { "alias": "limitReachedMessage"; "required": false; "isSignal": true; }; "uploadErrorMessage": { "alias": "uploadErrorMessage"; "required": false; "isSignal": true; }; "networkErrorMessage": { "alias": "networkErrorMessage"; "required": false; "isSignal": true; }; "httpErrorMessage": { "alias": "httpErrorMessage"; "required": false; "isSignal": true; }; "fileTemplate": { "alias": "fileTemplate"; "required": false; "isSignal": true; }; "contentTemplate": { "alias": "contentTemplate"; "required": false; "isSignal": true; }; "toolbarTemplate": { "alias": "toolbarTemplate"; "required": false; "isSignal": true; }; }, { "selected": "selected"; "filesChange": "filesChange"; "uploadHandler": "uploadHandler"; "uploaded": "uploaded"; "uploadError": "uploadError"; "removed": "removed"; "cleared": "cleared"; }, never, never, true, never>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export { UiFileUpload, UiFileUploadList, formatFileSize, isFileTypeAccepted, isImageFile };
|
|
268
|
+
export type { UiFileUploadListSize, UiFileUploadMode, UiFileUploadSize, UiUploadErrorEvent, UiUploadEvent, UiUploadFile, UiUploadHandlerEvent, UiUploadStatus };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { UiFeedbackLevel } from '@4sh/ui-kit/types';
|
|
3
|
+
|
|
4
|
+
type HelperSize = 'default' | 'small';
|
|
5
|
+
type HelperAriaLive = 'off' | 'polite' | 'assertive';
|
|
6
|
+
/**
|
|
7
|
+
* ui-helper — contextual help/feedback text.
|
|
8
|
+
*
|
|
9
|
+
* Displays a message preceded by an icon whose meaning depends on the `level`
|
|
10
|
+
* (question, info, success, alert, error). Used below a form field
|
|
11
|
+
* (linked via `aria-describedby` on the input) or as a standalone hint.
|
|
12
|
+
*
|
|
13
|
+
* A11y: The text message conveys the information; the icon is decorative
|
|
14
|
+
* (`aria-hidden`). For feedback that appears or changes dynamically (field validation
|
|
15
|
+
*), set `ariaLive=“polite”` (or `“assertive”` for an error) so
|
|
16
|
+
* that screen readers announce the change.
|
|
17
|
+
*/
|
|
18
|
+
declare class UiHelper {
|
|
19
|
+
/** Help message displayed. */
|
|
20
|
+
message: _angular_core.InputSignal<string>;
|
|
21
|
+
/** Feedback level (controls the default color and icon). */
|
|
22
|
+
level: _angular_core.InputSignal<UiFeedbackLevel>;
|
|
23
|
+
/** Text and icon size. */
|
|
24
|
+
size: _angular_core.InputSignal<HelperSize>;
|
|
25
|
+
/** Displays the level icon. */
|
|
26
|
+
showIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
/** Overrides the icon name derived from `level`. */
|
|
28
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
29
|
+
/** Live region for dynamic feedback (default: `off`). */
|
|
30
|
+
ariaLive: _angular_core.InputSignal<HelperAriaLive>;
|
|
31
|
+
/** @ignore Actual icon: explicit overlay, otherwise the icon for that level. */
|
|
32
|
+
protected readonly resolvedIcon: _angular_core.Signal<string>;
|
|
33
|
+
/** @ignore An icon is displayed. */
|
|
34
|
+
protected readonly hasIcon: _angular_core.Signal<boolean>;
|
|
35
|
+
/** @ignore Icon size aligned with text size. */
|
|
36
|
+
protected readonly iconSize: _angular_core.Signal<"default" | "sm">;
|
|
37
|
+
/** @ignore native aria-live (null when `off` to avoid polluting the DOM). */
|
|
38
|
+
protected readonly liveRegion: _angular_core.Signal<"polite" | "assertive" | null>;
|
|
39
|
+
/** @ignore */
|
|
40
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
41
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiHelper, never>;
|
|
42
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiHelper, "ui-helper", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "ariaLive": { "alias": "ariaLive"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { UiHelper };
|
|
46
|
+
export type { HelperAriaLive, HelperSize };
|