@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,235 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { QueryParamsHandling } from '@angular/router';
|
|
4
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
5
|
+
import { UiSubLevel } from '@4sh/ui-kit/types';
|
|
6
|
+
|
|
7
|
+
/** Menu density: `small` = compact rendering ("…" action menus). */
|
|
8
|
+
type MenuSize = 'default' | 'small';
|
|
9
|
+
/**
|
|
10
|
+
* How groups (`items`) render: `inline` = labeled sections / collapsible
|
|
11
|
+
* accordion groups inside the panel; `flyout` = cascading side panels
|
|
12
|
+
* (classic context-menu behavior — every group becomes a flyout).
|
|
13
|
+
*/
|
|
14
|
+
type MenuSubmenuMode = 'inline' | 'flyout';
|
|
15
|
+
/** Payload passed to `command` callbacks and emitted by `itemClick`. */
|
|
16
|
+
interface UiMenuItemCommandEvent {
|
|
17
|
+
originalEvent: Event;
|
|
18
|
+
item: UiMenuItem;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Declarative menu entry. An item is either a separator, a leaf (command /
|
|
22
|
+
* router / external link), or a group (`items`) whose header is a plain
|
|
23
|
+
* label or a collapsible toggle (see `toggleable`).
|
|
24
|
+
*/
|
|
25
|
+
interface UiMenuItem {
|
|
26
|
+
/** Stable identifier — required to drive the item through `expandedKeys`. */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Text of the item / group header. */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Leading FontAwesome icon name. */
|
|
31
|
+
icon?: string;
|
|
32
|
+
/** Child items: turns the entry into a group (labeled section or submenu). */
|
|
33
|
+
items?: UiMenuItem[];
|
|
34
|
+
/** Render a separator rule instead of a regular entry. */
|
|
35
|
+
separator?: boolean;
|
|
36
|
+
/** Disable the entry (skipped by keyboard navigation). */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/** Hide the entry entirely (default true). */
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
/** Callback invoked when the item is clicked / activated by keyboard. */
|
|
41
|
+
command?: (event: UiMenuItemCommandEvent) => void;
|
|
42
|
+
/** Angular router target — the item renders a RouterLink anchor. */
|
|
43
|
+
routerLink?: string | unknown[];
|
|
44
|
+
/** Router query params (routerLink mode). */
|
|
45
|
+
queryParams?: Record<string, unknown>;
|
|
46
|
+
/** Router queryParamsHandling (routerLink mode). */
|
|
47
|
+
queryParamsHandling?: QueryParamsHandling;
|
|
48
|
+
/** Exact matching for the active-link style (default false). */
|
|
49
|
+
routerLinkActiveExact?: boolean;
|
|
50
|
+
/** External URL — the item renders a plain anchor. */
|
|
51
|
+
url?: string;
|
|
52
|
+
/** Anchor target (e.g. `_blank`). */
|
|
53
|
+
target?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Collapsible group header. Defaults to `true` for nested groups and
|
|
56
|
+
* `false` for top-level groups (plain section headers); set it to
|
|
57
|
+
* override either way. Ignored on non-group items.
|
|
58
|
+
*/
|
|
59
|
+
toggleable?: boolean;
|
|
60
|
+
/** Initial expanded state of a toggleable group (`expandedKeys` wins). */
|
|
61
|
+
expanded?: boolean;
|
|
62
|
+
/** Native tooltip (`title` attribute). */
|
|
63
|
+
title?: string;
|
|
64
|
+
/** Accessible name override. */
|
|
65
|
+
ariaLabel?: string;
|
|
66
|
+
/** Extra class on the item's `<li>`. */
|
|
67
|
+
styleClass?: string;
|
|
68
|
+
}
|
|
69
|
+
/** @ignore Resolved render node (item + derived kind/key/children). */
|
|
70
|
+
interface UiMenuNode {
|
|
71
|
+
item: UiMenuItem;
|
|
72
|
+
/** `item.id`, or a generated positional key. */
|
|
73
|
+
key: string;
|
|
74
|
+
kind: 'separator' | 'header' | 'toggle' | 'flyout' | 'item';
|
|
75
|
+
children: UiMenuNode[];
|
|
76
|
+
expanded: boolean;
|
|
77
|
+
depth: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* ui-menu — headless navigation / command menu, static or popup.
|
|
81
|
+
*
|
|
82
|
+
* Driven by a declarative `items` model ({@link UiMenuItem}): labeled groups
|
|
83
|
+
* with separators, collapsible submenus (nested groups are toggleable by
|
|
84
|
+
* default, override per item with `toggleable`), commands, router links and
|
|
85
|
+
* external URLs. The open/closed state of toggleable groups is controllable
|
|
86
|
+
* (and two-way bindable) through `expandedKeys`, keyed by the items' `id`.
|
|
87
|
+
*
|
|
88
|
+
* `popup` mode renders the panel in a CDK overlay anchored to the element
|
|
89
|
+
* that triggered `toggle(event)` / `show(event)`.
|
|
90
|
+
*
|
|
91
|
+
* Styled 100% with the `navigation.*` tokens; the panel shell shares the
|
|
92
|
+
* structural `overlay-panel` recipe with the other floating panels.
|
|
93
|
+
*
|
|
94
|
+
* Customisation: `#item` template (menuitem content, `$implicit` = item),
|
|
95
|
+
* `#submenuheader` (group headers), `#start` / `#end` slots around the list.
|
|
96
|
+
*/
|
|
97
|
+
declare class UiMenu {
|
|
98
|
+
/** Menu entries (see {@link UiMenuItem}). */
|
|
99
|
+
items: _angular_core.InputSignal<UiMenuItem[]>;
|
|
100
|
+
/** Popup mode: the panel opens in an overlay via `toggle(event)` / `show(event)`. */
|
|
101
|
+
popup: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
102
|
+
/**
|
|
103
|
+
* Open/closed state of the toggleable groups, keyed by item `id`
|
|
104
|
+
* (`{ [id]: boolean }`). Two-way bindable; a key absent from the map
|
|
105
|
+
* falls back to the item's own `expanded`, then to closed.
|
|
106
|
+
*/
|
|
107
|
+
expandedKeys: _angular_core.ModelSignal<Record<string, boolean>>;
|
|
108
|
+
/** Accessible name of the menu list. */
|
|
109
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
110
|
+
/** id of an external element labelling the menu list. */
|
|
111
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
112
|
+
/** Extra class(es) applied to the panel (scoped custom styling). */
|
|
113
|
+
styleClass: _angular_core.InputSignal<string | undefined>;
|
|
114
|
+
/** Color family: `high` (default) or `low` navigation tokens. */
|
|
115
|
+
level: _angular_core.InputSignal<UiSubLevel>;
|
|
116
|
+
/** Density: `default`, or `small` for compact action menus ("…" buttons). */
|
|
117
|
+
size: _angular_core.InputSignal<MenuSize>;
|
|
118
|
+
/** Group rendering: `inline` sections/accordions (default) or `flyout` cascading side panels. */
|
|
119
|
+
submenus: _angular_core.InputSignal<MenuSubmenuMode>;
|
|
120
|
+
/** Animate the popup entrance and the submenu collapse (reduced-motion always wins). */
|
|
121
|
+
motion: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
122
|
+
/** Auto-flip the popup above the trigger when space is lacking below. */
|
|
123
|
+
autoFlip: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
124
|
+
/** Tabindex of the menu's roving tab stop. */
|
|
125
|
+
tabindex: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
126
|
+
/** Emitted when the popup opens. */
|
|
127
|
+
opened: _angular_core.OutputEmitterRef<void>;
|
|
128
|
+
/** Emitted when the popup closes. */
|
|
129
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
130
|
+
/** Emitted when a leaf item is clicked / keyboard-activated (never when disabled). */
|
|
131
|
+
itemClick: _angular_core.OutputEmitterRef<UiMenuItemCommandEvent>;
|
|
132
|
+
/** Menuitem content template, provided programmatically (embedding components like ui-context-menu). */
|
|
133
|
+
itemTemplate: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
134
|
+
/** Group-header content template, provided programmatically (embedding components). */
|
|
135
|
+
submenuHeaderTemplate: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
136
|
+
/** Custom menuitem content: `<ng-template #item let-item>`. */
|
|
137
|
+
private readonly itemTemplateContent;
|
|
138
|
+
/** Custom group-header content: `<ng-template #submenuheader let-item>`. */
|
|
139
|
+
private readonly submenuHeaderTemplateContent;
|
|
140
|
+
/** @ignore Input wins over the projected `#item` template. */
|
|
141
|
+
protected readonly resolvedItemTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
142
|
+
/** @ignore Input wins over the projected `#submenuheader` template. */
|
|
143
|
+
protected readonly resolvedSubmenuHeaderTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
144
|
+
/** Free content rendered before the list. */
|
|
145
|
+
protected readonly startTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
146
|
+
/** Free content rendered after the list. */
|
|
147
|
+
protected readonly endTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
148
|
+
/** @ignore Panel root (overlay or inline) — keyboard focus queries. */
|
|
149
|
+
private readonly panelEl;
|
|
150
|
+
/** Unique id of the panel (public: wire the trigger's `aria-controls` to it). */
|
|
151
|
+
readonly uid: string;
|
|
152
|
+
/** @ignore Popup open state. */
|
|
153
|
+
protected readonly popupOpen: _angular_core.WritableSignal<boolean>;
|
|
154
|
+
/** @ignore Element the overlay is anchored to (the `toggle(event)` trigger). */
|
|
155
|
+
protected readonly overlayOrigin: _angular_core.WritableSignal<Element | null>;
|
|
156
|
+
/** @ignore Key of the node owning the roving tabindex. */
|
|
157
|
+
protected readonly focusedKey: _angular_core.WritableSignal<string | null>;
|
|
158
|
+
/** @ignore Key of the open flyout submenu (one per level; children have their own). */
|
|
159
|
+
protected readonly openFlyoutKey: _angular_core.WritableSignal<string | null>;
|
|
160
|
+
/** @ignore Nested flyout menus rendered by this instance (matched by `items` reference). */
|
|
161
|
+
private readonly childMenus;
|
|
162
|
+
/** @ignore All connected overlays of this instance (popup + flyouts). */
|
|
163
|
+
private readonly connectedOverlays;
|
|
164
|
+
/** @ignore */
|
|
165
|
+
private readonly doc;
|
|
166
|
+
constructor();
|
|
167
|
+
/** @ignore Below the trigger, flipping above when `autoFlip` and space is lacking. */
|
|
168
|
+
protected readonly overlayPositions: _angular_core.Signal<ConnectedPosition[]>;
|
|
169
|
+
/** @ignore Flyout panel beside its parent item: right-start first, then flips.
|
|
170
|
+
* The vertical offset aligns the child's first item with the parent item. */
|
|
171
|
+
protected readonly flyoutPositions: ConnectedPosition[];
|
|
172
|
+
/** @ignore Resolved render tree (kinds, keys, expanded state). */
|
|
173
|
+
protected readonly nodes: _angular_core.Signal<UiMenuNode[]>;
|
|
174
|
+
/** @ignore Keys of the focusable entries, in visual order (roving focus path). */
|
|
175
|
+
private readonly focusableKeys;
|
|
176
|
+
/** @ignore Node owning the tab stop: last focused, else first focusable. */
|
|
177
|
+
protected readonly tabStopKey: _angular_core.Signal<string | null>;
|
|
178
|
+
/** @ignore */
|
|
179
|
+
protected readonly panelClasses: _angular_core.Signal<string>;
|
|
180
|
+
/** Toggles the popup relative to the event's `currentTarget`. */
|
|
181
|
+
toggle(event: Event): void;
|
|
182
|
+
/** Opens the popup anchored to the event's `currentTarget`. */
|
|
183
|
+
show(event: Event): void;
|
|
184
|
+
/** Moves focus onto the menu's roving tab stop (first focusable entry). */
|
|
185
|
+
focusFirst(): void;
|
|
186
|
+
/** Closes the popup. */
|
|
187
|
+
hide(focusTrigger?: boolean): void;
|
|
188
|
+
/** Closes any open flyout submenu (recursively, children detach with their parent). */
|
|
189
|
+
closeFlyouts(): void;
|
|
190
|
+
/** @ignore Leaf activation: command + itemClick, popup auto-close. */
|
|
191
|
+
protected onItemClick(event: Event, node: UiMenuNode): void;
|
|
192
|
+
/** @ignore Click on a flyout parent item: toggle its side panel. */
|
|
193
|
+
protected onFlyoutClick(node: UiMenuNode): void;
|
|
194
|
+
/** @ignore Hovering an entry: open its flyout, or close the sibling one. */
|
|
195
|
+
protected onEntryHover(node: UiMenuNode): void;
|
|
196
|
+
/** @ignore `ArrowLeft`/`Escape` inside a flyout panel: close it, focus its parent item. */
|
|
197
|
+
protected onFlyoutPanelKeydown(event: KeyboardEvent, node: UiMenuNode): void;
|
|
198
|
+
/** @ignore Activation bubbling up from a flyout submenu: re-emit and close. */
|
|
199
|
+
protected onChildItemClick(event: UiMenuItemCommandEvent): void;
|
|
200
|
+
/** @ignore Open a flyout and move focus onto its first entry. The overlay
|
|
201
|
+
* attaches after change detection: retry over macrotasks (NOT rAF — it
|
|
202
|
+
* never fires in throttled/background tabs). */
|
|
203
|
+
private openFlyoutAndFocus;
|
|
204
|
+
/** @ignore Expand/collapse a toggleable group (updates `expandedKeys`). */
|
|
205
|
+
protected onToggleClick(node: UiMenuNode): void;
|
|
206
|
+
/** @ignore */
|
|
207
|
+
private setExpanded;
|
|
208
|
+
/** @ignore Roving keyboard navigation (WAI-ARIA menu pattern). */
|
|
209
|
+
protected onListKeydown(event: KeyboardEvent): void;
|
|
210
|
+
/** @ignore */
|
|
211
|
+
protected onEntryFocus(node: UiMenuNode): void;
|
|
212
|
+
/** @ignore Popup outside interaction: ignore events landing in ANY overlay
|
|
213
|
+
* (our flyout side panels are separate overlay elements). */
|
|
214
|
+
protected onPopupOutsideClick(event: MouseEvent): void;
|
|
215
|
+
/** @ignore id of a header label (aria-labelledby of its group). */
|
|
216
|
+
protected headerId(node: UiMenuNode): string;
|
|
217
|
+
/** @ignore id of a collapsible group (aria-controls of its toggle). */
|
|
218
|
+
protected groupId(node: UiMenuNode): string;
|
|
219
|
+
/** @ignore */
|
|
220
|
+
private buildNodes;
|
|
221
|
+
/** @ignore */
|
|
222
|
+
private findNode;
|
|
223
|
+
/** @ignore Key of the entry currently holding DOM focus. */
|
|
224
|
+
private currentFocusKey;
|
|
225
|
+
/** @ignore Move DOM focus (and the tab stop) to the entry with the given key. */
|
|
226
|
+
private focusByKey;
|
|
227
|
+
/** @ignore Focus the roving tab stop once the panel is rendered
|
|
228
|
+
* (macrotask, not rAF: rAF never fires in throttled/background tabs). */
|
|
229
|
+
private queueFocusTabStop;
|
|
230
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiMenu, never>;
|
|
231
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiMenu, "ui-menu", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "popup": { "alias": "popup"; "required": false; "isSignal": true; }; "expandedKeys": { "alias": "expandedKeys"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "submenus": { "alias": "submenus"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "autoFlip": { "alias": "autoFlip"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; "submenuHeaderTemplate": { "alias": "submenuHeaderTemplate"; "required": false; "isSignal": true; }; }, { "expandedKeys": "expandedKeysChange"; "opened": "opened"; "closed": "closed"; "itemClick": "itemClick"; }, ["itemTemplateContent", "submenuHeaderTemplateContent", "startTemplate", "endTemplate"], never, true, never>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export { UiMenu };
|
|
235
|
+
export type { MenuSize, MenuSubmenuMode, UiMenuItem, UiMenuItemCommandEvent };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { UiMotionPreset } from '@4sh/ui-kit/motion';
|
|
4
|
+
|
|
5
|
+
/** Where the dialog is anchored inside the viewport mask. */
|
|
6
|
+
type ModalPosition = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
|
|
7
|
+
/**
|
|
8
|
+
* ui-modal — headless dialog / modal window.
|
|
9
|
+
*
|
|
10
|
+
* A token-styled floating surface rendered over a viewport mask, driven by the
|
|
11
|
+
* two-way `visible` model. Enter/leave run through the shared motion system
|
|
12
|
+
* (mask fade + dialog `zoom` by default). Built for accessibility: focus trap
|
|
13
|
+
* with focus restore (`@angular/cdk/a11y`), `aria-modal`, background scroll
|
|
14
|
+
* lock, `Escape` to close, and an optional click-outside dismiss.
|
|
15
|
+
*
|
|
16
|
+
* Composes header / content / footer regions: a plain `header` string (or the
|
|
17
|
+
* `#header` template), the default `<ng-content>` for the body, and a `#footer`
|
|
18
|
+
* template for actions. Supports `draggable`, `maximizable`, nine `position`s,
|
|
19
|
+
* modal / non-modal, and per-breakpoint widths (`breakpoints`).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <ui-button label="Ouvrir" (buttonClick)="open.set(true)" />
|
|
24
|
+
* <ui-modal [(visible)]="open" header="Titre" [dialogStyle]="{ width: '32rem' }">
|
|
25
|
+
* <p>Contenu…</p>
|
|
26
|
+
* <ng-template #footer>
|
|
27
|
+
* <ui-button label="Fermer" level="low" (buttonClick)="open.set(false)" />
|
|
28
|
+
* </ng-template>
|
|
29
|
+
* </ui-modal>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare class UiModal {
|
|
33
|
+
/** Open state (two-way). Toggling it drives the enter/leave animation. */
|
|
34
|
+
visible: _angular_core.ModelSignal<boolean>;
|
|
35
|
+
/** Simple header text (ignored when a `#header` template is projected). */
|
|
36
|
+
header: _angular_core.InputSignal<string | undefined>;
|
|
37
|
+
/** ARIA role of the dialog surface. */
|
|
38
|
+
role: _angular_core.InputSignal<string>;
|
|
39
|
+
/** Accessible name when there is no visible header to reference. */
|
|
40
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
41
|
+
/** Id of an external element naming the dialog (overrides the header title). */
|
|
42
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
43
|
+
/** Show the mask (dim + capture) and block background scroll. */
|
|
44
|
+
modal: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
45
|
+
/** Close when the mask (outside the dialog) is clicked — modal only. */
|
|
46
|
+
dismissableMask: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
47
|
+
/** Show the close (×) button and allow `Escape` to close. */
|
|
48
|
+
closable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
49
|
+
/** Close the dialog when `Escape` is pressed. */
|
|
50
|
+
closeOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
51
|
+
/** Block background scroll even for a non-modal dialog. */
|
|
52
|
+
blockScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
53
|
+
/** Render the header region (title + actions). */
|
|
54
|
+
showHeader: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
55
|
+
/** Allow dragging the dialog by its header. */
|
|
56
|
+
draggable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
57
|
+
/** Keep the dialog fully inside the viewport while dragging. */
|
|
58
|
+
keepInViewport: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
59
|
+
/** Minimum left offset kept while dragging (px). */
|
|
60
|
+
minX: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
61
|
+
/** Minimum top offset kept while dragging (px). */
|
|
62
|
+
minY: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
63
|
+
/** Show the maximize / restore toggle in the header. */
|
|
64
|
+
maximizable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
65
|
+
/** Allow resizing the dialog from its bottom-right corner (pointer only). */
|
|
66
|
+
resizable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
67
|
+
/** Minimum dialog width while resizing (px). */
|
|
68
|
+
minWidth: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
69
|
+
/** Minimum dialog height while resizing (px). */
|
|
70
|
+
minHeight: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
71
|
+
/** Anchor position inside the viewport mask. */
|
|
72
|
+
position: _angular_core.InputSignal<ModalPosition>;
|
|
73
|
+
/**
|
|
74
|
+
* Scope the dialog to the nearest positioned ancestor (`position: absolute`)
|
|
75
|
+
* instead of the viewport (`position: fixed`), and skip the body scroll lock.
|
|
76
|
+
* Useful to embed a dialog inside a bounded container (docs previews, panels).
|
|
77
|
+
*/
|
|
78
|
+
contained: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
79
|
+
/** Move focus into the dialog when it opens (auto-captured, restored on close). */
|
|
80
|
+
focusOnShow: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
81
|
+
/** Trap Tab focus inside the dialog while open. */
|
|
82
|
+
focusTrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
83
|
+
/** FontAwesome name of the close button icon. */
|
|
84
|
+
closeIcon: _angular_core.InputSignal<string>;
|
|
85
|
+
/** FontAwesome name of the maximize icon. */
|
|
86
|
+
maximizeIcon: _angular_core.InputSignal<string>;
|
|
87
|
+
/** FontAwesome name of the restore (minimize) icon. */
|
|
88
|
+
minimizeIcon: _angular_core.InputSignal<string>;
|
|
89
|
+
/** Accessible name of the close button. */
|
|
90
|
+
closeAriaLabel: _angular_core.InputSignal<string>;
|
|
91
|
+
/** Accessible name of the maximize / restore button. */
|
|
92
|
+
maximizeAriaLabel: _angular_core.InputSignal<string>;
|
|
93
|
+
/** Extra class(es) merged onto the dialog surface. */
|
|
94
|
+
styleClass: _angular_core.InputSignal<string | undefined>;
|
|
95
|
+
/** Extra class(es) merged onto the mask. */
|
|
96
|
+
maskStyleClass: _angular_core.InputSignal<string | undefined>;
|
|
97
|
+
/** Inline styles applied to the dialog (e.g. `{ width: '32rem' }`). */
|
|
98
|
+
dialogStyle: _angular_core.InputSignal<Record<string, string> | undefined>;
|
|
99
|
+
/** Per-breakpoint widths, keyed by a `max-width` (e.g. `{ '960px': '75vw' }`). */
|
|
100
|
+
breakpoints: _angular_core.InputSignal<Record<string, string> | undefined>;
|
|
101
|
+
/** Layer this dialog above earlier overlays automatically. */
|
|
102
|
+
autoZIndex: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
103
|
+
/** Floor z-index (added to the auto value, or used as-is when `autoZIndex=false`). */
|
|
104
|
+
baseZIndex: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
105
|
+
/** Enter/leave preset for the dialog surface (mask always fades). */
|
|
106
|
+
motion: _angular_core.InputSignal<UiMotionPreset>;
|
|
107
|
+
/** Disable the open/close animation for this dialog. */
|
|
108
|
+
motionDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
109
|
+
/** Custom header template (replaces the `header` string). */
|
|
110
|
+
protected readonly headerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
111
|
+
/** Footer template (actions row). */
|
|
112
|
+
protected readonly footerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
113
|
+
/** Custom close-icon template (replaces `closeIcon`). */
|
|
114
|
+
protected readonly closeIconTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
115
|
+
/** Emitted after the dialog becomes visible. */
|
|
116
|
+
shown: _angular_core.OutputEmitterRef<void>;
|
|
117
|
+
/** Emitted after the dialog is hidden. */
|
|
118
|
+
hidden: _angular_core.OutputEmitterRef<void>;
|
|
119
|
+
/** Emitted when the maximize state is toggled. */
|
|
120
|
+
maximizedChange: _angular_core.OutputEmitterRef<{
|
|
121
|
+
maximized: boolean;
|
|
122
|
+
}>;
|
|
123
|
+
/** Emitted when a drag gesture ends. */
|
|
124
|
+
dragEnd: _angular_core.OutputEmitterRef<void>;
|
|
125
|
+
/** Emitted when a resize gesture ends. */
|
|
126
|
+
resizeEnd: _angular_core.OutputEmitterRef<{
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
}>;
|
|
130
|
+
/** @ignore */
|
|
131
|
+
private readonly dialogRef;
|
|
132
|
+
/** @ignore Scrim host (for imperative `maskStyleClass` — a bound `[class]` would
|
|
133
|
+
* fight the motion classes and break the leave animation). */
|
|
134
|
+
private readonly scrimRef;
|
|
135
|
+
/** @ignore Classes currently applied to the scrim by `maskStyleClass`. */
|
|
136
|
+
private appliedMaskClasses;
|
|
137
|
+
/** @ignore */
|
|
138
|
+
private readonly document;
|
|
139
|
+
/** @ignore */
|
|
140
|
+
private readonly isBrowser;
|
|
141
|
+
/** @ignore Per-instance layering rank for `autoZIndex`. */
|
|
142
|
+
private readonly zSeq;
|
|
143
|
+
/** @ignore */
|
|
144
|
+
protected readonly uid: string;
|
|
145
|
+
/** @ignore */
|
|
146
|
+
protected readonly titleId: string;
|
|
147
|
+
/** @ignore Maximized (fills the viewport). */
|
|
148
|
+
protected readonly maximized: _angular_core.WritableSignal<boolean>;
|
|
149
|
+
/** @ignore Cumulative drag offset applied via the independent `translate` property
|
|
150
|
+
* (does not clash with the `zoom` animation, which drives `transform`). */
|
|
151
|
+
protected readonly dragOffset: _angular_core.WritableSignal<{
|
|
152
|
+
x: number;
|
|
153
|
+
y: number;
|
|
154
|
+
} | null>;
|
|
155
|
+
/** @ignore Explicit dialog size while resizing (overrides `dialogStyle` width/height). */
|
|
156
|
+
protected readonly resizeSize: _angular_core.WritableSignal<{
|
|
157
|
+
w: number;
|
|
158
|
+
h: number;
|
|
159
|
+
} | null>;
|
|
160
|
+
/** @ignore This instance currently holds a body scroll lock. */
|
|
161
|
+
private locked;
|
|
162
|
+
/** @ignore Runtime `<style>` element backing `breakpoints`. */
|
|
163
|
+
private styleEl;
|
|
164
|
+
/** @ignore Effective stacking level. */
|
|
165
|
+
protected readonly zIndex: _angular_core.Signal<number>;
|
|
166
|
+
/** @ignore Cross-axis alignment of the dialog inside the frame. */
|
|
167
|
+
protected readonly alignItems: _angular_core.Signal<"center" | "flex-start" | "flex-end">;
|
|
168
|
+
/** @ignore Main-axis alignment of the dialog inside the frame. */
|
|
169
|
+
protected readonly justifyContent: _angular_core.Signal<"center" | "flex-start" | "flex-end">;
|
|
170
|
+
/** @ignore */
|
|
171
|
+
protected readonly dialogClasses: _angular_core.Signal<string>;
|
|
172
|
+
/** @ignore Header is draggable when enabled and not maximized. */
|
|
173
|
+
protected readonly headerDraggable: _angular_core.Signal<boolean>;
|
|
174
|
+
/** @ignore Drag offset serialised for the `translate` CSS property. */
|
|
175
|
+
protected readonly dragTranslate: _angular_core.Signal<string | null>;
|
|
176
|
+
/** @ignore Inline styles for the dialog: `dialogStyle` plus the resize size
|
|
177
|
+
* (which wins), dropped entirely while maximized. */
|
|
178
|
+
protected readonly resolvedDialogStyle: _angular_core.Signal<Record<string, string> | null>;
|
|
179
|
+
/** @ignore The resize grip shows when resizable and not maximized. */
|
|
180
|
+
protected readonly showResizeHandle: _angular_core.Signal<boolean>;
|
|
181
|
+
/** @ignore Id of the element naming the dialog (header title, or an external id). */
|
|
182
|
+
protected readonly labelledBy: _angular_core.Signal<string | null>;
|
|
183
|
+
/** @ignore Fallback accessible name when nothing is referenced. */
|
|
184
|
+
protected readonly resolvedAriaLabel: _angular_core.Signal<string | null | undefined>;
|
|
185
|
+
constructor();
|
|
186
|
+
/** Close the dialog. */
|
|
187
|
+
close(): void;
|
|
188
|
+
/** Move focus onto the dialog surface. */
|
|
189
|
+
focus(): void;
|
|
190
|
+
/** @ignore Toggle maximized; lock scroll for a non-modal dialog that now fills the screen. */
|
|
191
|
+
protected toggleMaximize(): void;
|
|
192
|
+
/** @ignore Escape-to-close (bubbles from any focused control inside the dialog). */
|
|
193
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
194
|
+
/** @ignore Click-outside dismiss (mask target only, modal + dismissable). */
|
|
195
|
+
protected onMaskPointerdown(event: PointerEvent): void;
|
|
196
|
+
/** @ignore */
|
|
197
|
+
private dragging;
|
|
198
|
+
/** @ignore */
|
|
199
|
+
private lastX;
|
|
200
|
+
/** @ignore */
|
|
201
|
+
private lastY;
|
|
202
|
+
/** @ignore */
|
|
203
|
+
private readonly moveHandler;
|
|
204
|
+
/** @ignore */
|
|
205
|
+
private readonly upHandler;
|
|
206
|
+
/** @ignore */
|
|
207
|
+
protected onHeaderPointerdown(event: PointerEvent): void;
|
|
208
|
+
/** @ignore */
|
|
209
|
+
private onDrag;
|
|
210
|
+
/** @ignore */
|
|
211
|
+
private endDrag;
|
|
212
|
+
/** @ignore */
|
|
213
|
+
private removeDragListeners;
|
|
214
|
+
/** @ignore */
|
|
215
|
+
private resizing;
|
|
216
|
+
/** @ignore Pointer + size captured when the resize gesture starts. */
|
|
217
|
+
private resizeStart;
|
|
218
|
+
/** @ignore */
|
|
219
|
+
private readonly resizeMoveHandler;
|
|
220
|
+
/** @ignore */
|
|
221
|
+
private readonly resizeUpHandler;
|
|
222
|
+
/** @ignore Start a corner resize (seeds from the current rendered size). */
|
|
223
|
+
protected onResizeStart(event: PointerEvent): void;
|
|
224
|
+
/** @ignore */
|
|
225
|
+
private onResize;
|
|
226
|
+
/** @ignore */
|
|
227
|
+
private endResize;
|
|
228
|
+
/** @ignore */
|
|
229
|
+
private removeResizeListeners;
|
|
230
|
+
/** @ignore Release this instance's scroll lock, if held. */
|
|
231
|
+
private releaseLock;
|
|
232
|
+
/** @ignore Build the responsive width rules (`max-width` media queries). */
|
|
233
|
+
private applyBreakpoints;
|
|
234
|
+
/** @ignore */
|
|
235
|
+
private removeStyleElement;
|
|
236
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiModal, never>;
|
|
237
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiModal, "ui-modal", never, { "visible": { "alias": "visible"; "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; }; "draggable": { "alias": "draggable"; "required": false; "isSignal": true; }; "keepInViewport": { "alias": "keepInViewport"; "required": false; "isSignal": true; }; "minX": { "alias": "minX"; "required": false; "isSignal": true; }; "minY": { "alias": "minY"; "required": false; "isSignal": true; }; "maximizable": { "alias": "maximizable"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "contained": { "alias": "contained"; "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; }; "maximizeIcon": { "alias": "maximizeIcon"; "required": false; "isSignal": true; }; "minimizeIcon": { "alias": "minimizeIcon"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; "maximizeAriaLabel": { "alias": "maximizeAriaLabel"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "maskStyleClass": { "alias": "maskStyleClass"; "required": false; "isSignal": true; }; "dialogStyle": { "alias": "dialogStyle"; "required": false; "isSignal": true; }; "breakpoints": { "alias": "breakpoints"; "required": false; "isSignal": true; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "motionDisabled": { "alias": "motionDisabled"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "shown": "shown"; "hidden": "hidden"; "maximizedChange": "maximizedChange"; "dragEnd": "dragEnd"; "resizeEnd": "resizeEnd"; }, ["headerTemplate", "footerTemplate", "closeIconTemplate"], ["*"], true, never>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export { UiModal };
|
|
241
|
+
export type { ModalPosition };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
3
|
+
import { UiLevel } from '@4sh/ui-kit/types';
|
|
4
|
+
import { ButtonVariant, ButtonOnColor } from '@4sh/ui-kit/ui-button';
|
|
5
|
+
|
|
6
|
+
type NudgerSize = 'default' | 'small';
|
|
7
|
+
/**
|
|
8
|
+
* ui-nudger : headless numeric stepper (`[−] value [+]`).
|
|
9
|
+
*
|
|
10
|
+
* Composes two icon-only `ui-button` instances around a read-only value
|
|
11
|
+
* display. Holds a `number` value via `ControlValueAccessor` (standalone,
|
|
12
|
+
* `[(ngModel)]`, Reactive Forms, Signal Forms). `min`/`max` disable the
|
|
13
|
+
* relevant button at the bound (the Figma `interaction` states Min/Max are
|
|
14
|
+
* **derived** from the value here, never a prop); `step` sizes each nudge.
|
|
15
|
+
*
|
|
16
|
+
* Keyboard: each button is a real `<button>` (Tab + Enter/Space). The value
|
|
17
|
+
* is a live region announced on change.
|
|
18
|
+
*/
|
|
19
|
+
declare class UiNudger extends BaseFieldControl<number> {
|
|
20
|
+
/** Minimum value (disables "−" at the bound). */
|
|
21
|
+
min: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
22
|
+
/** Maximum value (disables "+" at the bound). */
|
|
23
|
+
max: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
24
|
+
/** Increment/decrement step. */
|
|
25
|
+
step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
26
|
+
/** Value used when the model is empty (also the standalone default). */
|
|
27
|
+
defaultValue: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
28
|
+
/** Size. */
|
|
29
|
+
size: _angular_core.InputSignal<NudgerSize>;
|
|
30
|
+
/** Color family of the two buttons. */
|
|
31
|
+
level: _angular_core.InputSignal<UiLevel>;
|
|
32
|
+
/** Appearance applied to the two buttons. */
|
|
33
|
+
variant: _angular_core.InputSignal<ButtonVariant>;
|
|
34
|
+
/** Luminosité du fond de couleur sur lequel le nudger est posé (voir `ui-button.onColor`). */
|
|
35
|
+
onColor: _angular_core.InputSignal<ButtonOnColor | null>;
|
|
36
|
+
/** Accessible label of the decrement button. */
|
|
37
|
+
decrementAriaLabel: _angular_core.InputSignal<string>;
|
|
38
|
+
/** Accessible label of the increment button. */
|
|
39
|
+
incrementAriaLabel: _angular_core.InputSignal<string>;
|
|
40
|
+
/** FontAwesome icon name of the decrement button. */
|
|
41
|
+
decrementIcon: _angular_core.InputSignal<string>;
|
|
42
|
+
/** FontAwesome icon name of the increment button. */
|
|
43
|
+
incrementIcon: _angular_core.InputSignal<string>;
|
|
44
|
+
/** Optional display formatter for the value (e.g. `(v) => v + ' kg'`). */
|
|
45
|
+
formatValue: _angular_core.InputSignal<((value: number) => string) | undefined>;
|
|
46
|
+
/** Emitted on each value change. */
|
|
47
|
+
valueChange: _angular_core.OutputEmitterRef<number>;
|
|
48
|
+
constructor();
|
|
49
|
+
/** @ignore Effective numeric value (falls back to `defaultValue`). */
|
|
50
|
+
protected readonly currentValue: _angular_core.Signal<number>;
|
|
51
|
+
/** @ignore Bounds reached. */
|
|
52
|
+
protected readonly atMin: _angular_core.Signal<boolean>;
|
|
53
|
+
protected readonly atMax: _angular_core.Signal<boolean>;
|
|
54
|
+
/** @ignore Per-button disabled state. */
|
|
55
|
+
protected readonly decrementDisabled: _angular_core.Signal<boolean>;
|
|
56
|
+
protected readonly incrementDisabled: _angular_core.Signal<boolean>;
|
|
57
|
+
/** @ignore Value shown (custom formatter or plain number). */
|
|
58
|
+
protected readonly displayValue: _angular_core.Signal<string>;
|
|
59
|
+
/** @ignore */
|
|
60
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
61
|
+
writeValue(value: number | null): void;
|
|
62
|
+
/** @ignore */
|
|
63
|
+
protected uidPrefix(): string;
|
|
64
|
+
/** Increments the value by one `step` (clamped to `max`). */
|
|
65
|
+
increment(): void;
|
|
66
|
+
/** Decrements the value by one `step` (clamped to `min`). */
|
|
67
|
+
decrement(): void;
|
|
68
|
+
/** @ignore Apply a signed step, clamp, emit. */
|
|
69
|
+
protected stepBy(direction: 1 | -1): void;
|
|
70
|
+
/** @ignore Mark as touched when focus leaves the stepper. */
|
|
71
|
+
protected onBlur(event: FocusEvent): void;
|
|
72
|
+
/** @ignore Clamp a value into [min, max]. */
|
|
73
|
+
private clamp;
|
|
74
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiNudger, never>;
|
|
75
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiNudger, "ui-nudger", never, { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "onColor": { "alias": "onColor"; "required": false; "isSignal": true; }; "decrementAriaLabel": { "alias": "decrementAriaLabel"; "required": false; "isSignal": true; }; "incrementAriaLabel": { "alias": "incrementAriaLabel"; "required": false; "isSignal": true; }; "decrementIcon": { "alias": "decrementIcon"; "required": false; "isSignal": true; }; "incrementIcon": { "alias": "incrementIcon"; "required": false; "isSignal": true; }; "formatValue": { "alias": "formatValue"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { UiNudger };
|
|
79
|
+
export type { NudgerSize };
|