@4sh/ui-kit 0.6.1 → 0.7.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/README.fr.md +46 -22
- package/README.md +45 -23
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +439 -0
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +111 -10
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +10 -4
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +457 -75
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1107 -0
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +30 -3
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +8 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +15 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +8 -4
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +40 -4
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +5 -2
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +317 -0
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +8 -2
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +372 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +44 -14
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +45 -4
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +22 -10
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +15 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +654 -74
- package/mcp/data/ui-config.json +5908 -3732
- package/mcp/index.js +682 -410
- package/mcp/package.json +1 -1
- package/package.json +17 -1
- package/schematics/index.cjs +1 -1
- package/styles/component-vars.scss +119 -2
- package/styles/generated/_tokens-breakpoint.scss +1 -1
- package/styles/generated/_tokens-metrics.scss +1 -1
- package/styles/generated/_tokens-primitives.scss +1 -1
- package/styles/generated/_tokens-responsive.scss +17 -17
- package/styles/generated/_tokens-semantics.scss +15 -15
- package/styles/generated/_tokens-styles.scss +1 -1
- package/styles/generated/_tokens-transitions.scss +1 -1
- package/styles/generated/_tokens-typography.scss +1 -1
- package/styles/generated/_tokens.scss +1 -1
- package/styles/utils/_helpers.scss +15 -0
- package/styles/utils/_mixins.scss +17 -1
- package/styles.css +1 -1
- package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +234 -0
- package/types/4sh-ui-kit-base-ui-image.d.ts +16 -3
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +4 -1
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +186 -36
- package/types/4sh-ui-kit-forms-ui-editor.d.ts +481 -0
- package/types/4sh-ui-kit-forms-ui-field.d.ts +20 -2
- package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +4 -0
- package/types/4sh-ui-kit-forms-ui-input-number.d.ts +9 -0
- package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +4 -1
- package/types/4sh-ui-kit-forms-ui-input.d.ts +28 -2
- package/types/4sh-ui-kit-forms-ui-select.d.ts +2 -0
- package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +126 -0
- package/types/4sh-ui-kit-forms-ui-textarea.d.ts +4 -0
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +220 -0
- package/types/4sh-ui-kit-forms.d.ts +34 -7
- package/types/4sh-ui-kit-layout-ui-modal.d.ts +7 -0
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +8 -3
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +14 -3
|
@@ -41,12 +41,24 @@ declare class UiInput extends BaseFormField<string> {
|
|
|
41
41
|
value: _angular_core.InputSignal<string | undefined>;
|
|
42
42
|
/** `aria-haspopup` forwarded to the native input (popup trigger hosts). */
|
|
43
43
|
ariaHasPopup: _angular_core.InputSignal<"menu" | "listbox" | "tree" | "grid" | "dialog" | undefined>;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* `aria-expanded` forwarded to the native input (popup trigger hosts).
|
|
46
|
+
* Setting it also promotes the input to `role="combobox"`: `aria-expanded`
|
|
47
|
+
* is not allowed on the implicit `textbox` role, so screen readers would
|
|
48
|
+
* silently drop the popup state without it.
|
|
49
|
+
*/
|
|
45
50
|
ariaExpanded: _angular_core.InputSignal<boolean | undefined>;
|
|
46
51
|
/** `aria-controls` forwarded to the native input (popup trigger hosts). */
|
|
47
52
|
ariaControls: _angular_core.InputSignal<string | undefined>;
|
|
48
53
|
/** Native placeholder. */
|
|
49
54
|
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* id of an external element describing this control further (e.g. a composite host's own
|
|
57
|
+
* format hint), chained onto `aria-describedby` alongside the helper/error message rather than
|
|
58
|
+
* replacing it — a plain `[attr.aria-describedby]` override on the host would clobber whichever
|
|
59
|
+
* of the two lands last.
|
|
60
|
+
*/
|
|
61
|
+
ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
50
62
|
/** Suffix unit (e.g. "%", "@domain"). Shown when provided. */
|
|
51
63
|
unit: _angular_core.InputSignal<string | undefined>;
|
|
52
64
|
/** Left FontAwesome icon name (decorative). */
|
|
@@ -82,6 +94,12 @@ declare class UiInput extends BaseFormField<string> {
|
|
|
82
94
|
private readonly inputEl;
|
|
83
95
|
/** @ignore Icon size aligned with the field size. */
|
|
84
96
|
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
97
|
+
/** @ignore Text rendered in the input: display-only `value` wins over the model. */
|
|
98
|
+
protected readonly renderedValue: _angular_core.Signal<string>;
|
|
99
|
+
/** @ignore Keeps a floating label raised once focus leaves. */
|
|
100
|
+
protected readonly isFilled: _angular_core.Signal<boolean>;
|
|
101
|
+
/** @ignore At rest the floating label already holds that spot. */
|
|
102
|
+
protected readonly effectivePlaceholder: _angular_core.Signal<string>;
|
|
85
103
|
/** @ignore Input wins over the projected `#iconLeft` template. */
|
|
86
104
|
protected readonly resolvedIconLeftTemplate: _angular_core.Signal<TemplateRef<UiInputIconContext> | undefined>;
|
|
87
105
|
/** @ignore Input wins over the projected `#iconRight` template. */
|
|
@@ -92,6 +110,14 @@ declare class UiInput extends BaseFormField<string> {
|
|
|
92
110
|
protected readonly rightIconContext: _angular_core.Signal<UiInputIconContext>;
|
|
93
111
|
/** @ignore The right icon is an action zone (has an accessible name). */
|
|
94
112
|
protected readonly hasRightAction: _angular_core.Signal<boolean>;
|
|
113
|
+
/** @ignore Full `aria-describedby`: the helper/error message id (only when a message is
|
|
114
|
+
* actually rendered) plus the externally supplied `ariaDescribedBy`, space-joined — `null`
|
|
115
|
+
* when neither applies (native attribute is then omitted, not left dangling). */
|
|
116
|
+
protected readonly resolvedAriaDescribedBy: _angular_core.Signal<string | null>;
|
|
117
|
+
/** @ignore ARIA 1.2: only `combobox` (not the implicit `textbox`) accepts
|
|
118
|
+
* `aria-expanded`. Stays null for plain text fields so their announcement
|
|
119
|
+
* ("edit text") is untouched. */
|
|
120
|
+
protected readonly nativeRole: _angular_core.Signal<"combobox" | null>;
|
|
95
121
|
/** Focuses the input. */
|
|
96
122
|
focus(options?: FocusOptions): void;
|
|
97
123
|
/** Native `<input>` element — composite hosts that own `value` (e.g. `ui-datepicker`)
|
|
@@ -102,7 +128,7 @@ declare class UiInput extends BaseFormField<string> {
|
|
|
102
128
|
/** @ignore */
|
|
103
129
|
protected onBlur(event: FocusEvent): void;
|
|
104
130
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInput, never>;
|
|
105
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInput, "ui-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaHasPopup": { "alias": "ariaHasPopup"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "iconRightAriaLabel": { "alias": "iconRightAriaLabel"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "iconLeftTemplate": { "alias": "iconLeftTemplate"; "required": false; "isSignal": true; }; "iconRightTemplate": { "alias": "iconRightTemplate"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "iconRightClick": "iconRightClick"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["iconLeftTemplateContent", "iconRightTemplateContent"], never, true, never>;
|
|
131
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInput, "ui-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaHasPopup": { "alias": "ariaHasPopup"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "iconRightAriaLabel": { "alias": "iconRightAriaLabel"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "iconLeftTemplate": { "alias": "iconLeftTemplate"; "required": false; "isSignal": true; }; "iconRightTemplate": { "alias": "iconRightTemplate"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "iconRightClick": "iconRightClick"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["iconLeftTemplateContent", "iconRightTemplateContent"], never, true, never>;
|
|
106
132
|
}
|
|
107
133
|
|
|
108
134
|
export { UiInput };
|
|
@@ -277,6 +277,8 @@ declare class UiSelect<T = unknown> extends BaseFormField<SelectValue<T>> {
|
|
|
277
277
|
protected readonly selectedItemContexts: _angular_core.Signal<SelectSelectedItemContext<T>[]>;
|
|
278
278
|
/** @ignore Text rendered in the trigger (and in the editable input). */
|
|
279
279
|
protected readonly selectedLabel: _angular_core.Signal<string>;
|
|
280
|
+
/** @ignore At rest the floating label already holds that spot. */
|
|
281
|
+
protected readonly effectivePlaceholder: _angular_core.Signal<string>;
|
|
280
282
|
/** @ignore The clear action is shown. */
|
|
281
283
|
protected readonly showClearButton: _angular_core.Signal<boolean>;
|
|
282
284
|
/** @ignore id of the visually focused option (for aria-activedescendant). */
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
3
|
+
|
|
4
|
+
/** Density: `default`, or `small` for compact toolbars/popups. */
|
|
5
|
+
type SwatchPickerSize = 'default' | 'small';
|
|
6
|
+
/** One selectable color entry. */
|
|
7
|
+
interface UiSwatch {
|
|
8
|
+
/** Stable identifier, also the value carried by `value`/`swatchSelect`. */
|
|
9
|
+
key: string;
|
|
10
|
+
/** CSS variable rendering the swatch (e.g. `--primitives-red-500`). */
|
|
11
|
+
cssVar: string;
|
|
12
|
+
/** Accessible name (never just the color: sighted/non-sighted parity). */
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
/** A labeled section of the grid (rendered as consecutive cells, same columns). */
|
|
16
|
+
interface UiSwatchGroup {
|
|
17
|
+
/** Section label (rendered for screen readers via `aria-label` on the group). */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Swatches of the section, in row-major (left-to-right, top-to-bottom) order. */
|
|
20
|
+
swatches: UiSwatch[];
|
|
21
|
+
}
|
|
22
|
+
/** @ignore Internal flat entry (real swatch, or the synthetic "no color" one). */
|
|
23
|
+
interface FlatSwatch {
|
|
24
|
+
key: string | null;
|
|
25
|
+
cssVar: string | null;
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Default palette: a 7×5 grid (7 hues × 5 shades, dark → light) derived from
|
|
30
|
+
* the `primitives.*` tokens, plus `black`/`white`. Never hardcode a hex here —
|
|
31
|
+
* every swatch is a semantic pointer to a `--primitives-*` CSS variable, so a
|
|
32
|
+
* brand rebind (Brand 2 / Brand 3) changes what the grid shows for free.
|
|
33
|
+
*/
|
|
34
|
+
declare const DEFAULT_SWATCH_PALETTE: UiSwatchGroup[];
|
|
35
|
+
/**
|
|
36
|
+
* ui-swatch-picker — headless color grid, static or popup, for a single-value
|
|
37
|
+
* choice among a `UiSwatchGroup[]` palette (see {@link DEFAULT_SWATCH_PALETTE}).
|
|
38
|
+
*
|
|
39
|
+
* No trigger button of its own — same composition contract as {@link UiMenu}:
|
|
40
|
+
* a caller wires its own `ui-button` to `toggle(event)` / `show(event)` and
|
|
41
|
+
* reads the selection from `value` (two-way) or `swatchSelect`. Reuses
|
|
42
|
+
* `ui-menu`'s overlay mechanics (`CdkConnectedOverlay`, auto-flip, scroll
|
|
43
|
+
* re-position) and the shared `overlay-panel` shell.
|
|
44
|
+
*
|
|
45
|
+
* Every swatch is a real `<button>` (`role="option"`, `aria-selected`) inside
|
|
46
|
+
* a `role="listbox"`; 2D roving-tabindex keyboard navigation (arrows,
|
|
47
|
+
* Home/End) mirrors `ui-menu`'s roving focus, adapted to a grid.
|
|
48
|
+
*/
|
|
49
|
+
declare class UiSwatchPicker {
|
|
50
|
+
/** Palette rendered as sections of swatches (see {@link UiSwatchGroup}). */
|
|
51
|
+
palette: _angular_core.InputSignal<UiSwatchGroup[]>;
|
|
52
|
+
/** Selected swatch `key` (two-way bindable), or `null` for "no color". */
|
|
53
|
+
value: _angular_core.ModelSignal<string | null>;
|
|
54
|
+
/** Popup mode: the panel opens in an overlay via `toggle(event)` / `show(event)`. */
|
|
55
|
+
popup: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
56
|
+
/** Density: `default`, or `small` for compact toolbars/popups. */
|
|
57
|
+
size: _angular_core.InputSignal<SwatchPickerSize>;
|
|
58
|
+
/** Renders a "no color" swatch at the start of the grid, emitting `null`. */
|
|
59
|
+
allowClear: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
60
|
+
/** Accessible name of the grid (`aria-label` on `role="listbox"`). */
|
|
61
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
62
|
+
/** Emitted on user selection (`null` when the "no color" swatch is picked). */
|
|
63
|
+
swatchSelect: _angular_core.OutputEmitterRef<UiSwatch | null>;
|
|
64
|
+
/** Emitted when the popup opens. */
|
|
65
|
+
opened: _angular_core.OutputEmitterRef<void>;
|
|
66
|
+
/** Emitted when the popup closes. */
|
|
67
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
68
|
+
/** @ignore Panel root (overlay or inline) — keyboard focus queries. */
|
|
69
|
+
private readonly panelEl;
|
|
70
|
+
/** @ignore The popup's overlay (repositioning on scroll). */
|
|
71
|
+
private readonly connectedOverlay;
|
|
72
|
+
/** @ignore */
|
|
73
|
+
private readonly doc;
|
|
74
|
+
/** Unique id of the panel (public: wire the trigger's `aria-controls` to it). */
|
|
75
|
+
readonly uid: string;
|
|
76
|
+
/** @ignore Popup open state. */
|
|
77
|
+
protected readonly popupOpen: _angular_core.WritableSignal<boolean>;
|
|
78
|
+
/** @ignore Element the overlay is anchored to (the `toggle(event)` trigger). */
|
|
79
|
+
protected readonly overlayOrigin: _angular_core.WritableSignal<Element | null>;
|
|
80
|
+
/** @ignore Key of the swatch owning the roving tabindex (`''` = the clear
|
|
81
|
+
* swatch, `undefined` = nothing focused yet). */
|
|
82
|
+
private readonly focusedKey;
|
|
83
|
+
constructor();
|
|
84
|
+
/** @ignore */
|
|
85
|
+
private overlayRef;
|
|
86
|
+
/** @ignore Below the trigger, flipping above when space is lacking. */
|
|
87
|
+
protected readonly overlayPositions: ConnectedPosition[];
|
|
88
|
+
/** @ignore Flat, render-ready swatch list (the synthetic "no color" one first). */
|
|
89
|
+
protected readonly flatSwatches: _angular_core.Signal<FlatSwatch[]>;
|
|
90
|
+
/** @ignore Keys of the focusable entries, in grid order (roving focus path). Uses `''` as the clear swatch's key (`null` is reserved for "nothing focused"). */
|
|
91
|
+
private readonly focusableKeys;
|
|
92
|
+
/** @ignore Key owning the tab stop: last focused, else the selected value, else first. */
|
|
93
|
+
protected readonly tabStopKey: _angular_core.Signal<string | null>;
|
|
94
|
+
/** @ignore */
|
|
95
|
+
protected readonly panelClasses: _angular_core.Signal<string>;
|
|
96
|
+
/** Toggles the popup relative to the event's `currentTarget`. */
|
|
97
|
+
toggle(event: Event): void;
|
|
98
|
+
/** Opens the popup anchored to the event's `currentTarget`. */
|
|
99
|
+
show(event: Event): void;
|
|
100
|
+
/** Closes the popup. */
|
|
101
|
+
hide(focusTrigger?: boolean): void;
|
|
102
|
+
/** @ignore Swatch key used as `data-key` / DOM id (empty string for "no color"). */
|
|
103
|
+
protected swatchKey(swatch: FlatSwatch): string;
|
|
104
|
+
/** @ignore Selection state of a swatch. */
|
|
105
|
+
protected isSelected(swatch: FlatSwatch): boolean;
|
|
106
|
+
/** @ignore Activation (click / Enter / Space): select, emit, popup auto-close. */
|
|
107
|
+
protected onSwatchClick(swatch: FlatSwatch): void;
|
|
108
|
+
/** @ignore */
|
|
109
|
+
protected onSwatchFocus(swatch: FlatSwatch): void;
|
|
110
|
+
/** @ignore 2D roving keyboard navigation (arrow grid, Home/End). */
|
|
111
|
+
protected onGridKeydown(event: KeyboardEvent): void;
|
|
112
|
+
/** @ignore Popup outside interaction. */
|
|
113
|
+
protected onPopupOutsideClick(): void;
|
|
114
|
+
/** @ignore Key of the entry currently holding DOM focus. */
|
|
115
|
+
private currentFocusKey;
|
|
116
|
+
/** @ignore Move DOM focus (and the tab stop) to the entry with the given key. */
|
|
117
|
+
private focusByKey;
|
|
118
|
+
/** @ignore Focus the roving tab stop once the panel is rendered
|
|
119
|
+
* (macrotask, not rAF: rAF never fires in throttled/background tabs). */
|
|
120
|
+
private queueFocusTabStop;
|
|
121
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSwatchPicker, never>;
|
|
122
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSwatchPicker, "ui-swatch-picker", never, { "palette": { "alias": "palette"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "popup": { "alias": "popup"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "swatchSelect": "swatchSelect"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { DEFAULT_SWATCH_PALETTE, UiSwatchPicker };
|
|
126
|
+
export type { SwatchPickerSize, UiSwatch, UiSwatchGroup };
|
|
@@ -38,6 +38,10 @@ declare class UiTextarea extends BaseFormField<string> {
|
|
|
38
38
|
protected readonly effectiveResize: _angular_core.Signal<TextareaResize>;
|
|
39
39
|
/** @ignore Current character count. */
|
|
40
40
|
protected readonly charCount: _angular_core.Signal<number>;
|
|
41
|
+
/** @ignore Keeps a floating label raised once focus leaves. */
|
|
42
|
+
protected readonly isFilled: _angular_core.Signal<boolean>;
|
|
43
|
+
/** @ignore At rest the floating label already holds that spot. */
|
|
44
|
+
protected readonly effectivePlaceholder: _angular_core.Signal<string>;
|
|
41
45
|
/** @ignore Over the maxlength (only reachable programmatically). */
|
|
42
46
|
protected readonly overLimit: _angular_core.Signal<boolean>;
|
|
43
47
|
/** @ignore id of the character counter (for `aria-describedby`). */
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
4
|
+
import { UiIconSize } from '@4sh/ui-kit/base/ui-icon';
|
|
5
|
+
import { UiLevel } from '@4sh/ui-kit/types';
|
|
6
|
+
|
|
7
|
+
type ToggleButtonSize = 'default' | 'small' | 'large';
|
|
8
|
+
/** Habillage de l'état **non** sélectionné (l'état sélectionné est toujours plein). */
|
|
9
|
+
type ToggleButtonVariant = 'outlined' | 'filled' | 'ghost';
|
|
10
|
+
type ToggleButtonIconPos = 'left' | 'right';
|
|
11
|
+
type ToggleButtonOrientation = 'horizontal' | 'vertical';
|
|
12
|
+
/** Model value: one of the `trueValue`/`falseValue` pair (single), or the array of pressed option values (group). */
|
|
13
|
+
type ToggleButtonValue<T> = T | T[] | null;
|
|
14
|
+
/**
|
|
15
|
+
* Rich option shape for the group mode. Options may also be primitives
|
|
16
|
+
* (`string`/`number`) or any object, in which case `optionLabel` /
|
|
17
|
+
* `optionValue` / `optionDisabled` / `optionIcon` tell the control how to read
|
|
18
|
+
* them.
|
|
19
|
+
*/
|
|
20
|
+
interface ToggleButtonOption<T = unknown> {
|
|
21
|
+
/** Text shown inside the button. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Value carried into the model when the button is pressed. */
|
|
24
|
+
value: T;
|
|
25
|
+
/** Icon name (design-system icon). */
|
|
26
|
+
icon?: string;
|
|
27
|
+
/** Icon substituted while the button is pressed. */
|
|
28
|
+
selectedIcon?: string;
|
|
29
|
+
/** Disables just this button. */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Accessible name (required for an icon-only button). */
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Context handed to the `icon` / `content` templates (single mode). */
|
|
35
|
+
interface ToggleButtonStateContext {
|
|
36
|
+
/** Whether the button is currently pressed (default `$implicit`). */
|
|
37
|
+
$implicit: boolean;
|
|
38
|
+
/** Same as `$implicit`, named for readability. */
|
|
39
|
+
checked: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Context handed to the `item` template (group mode). */
|
|
42
|
+
interface ToggleButtonItemContext<T = unknown> {
|
|
43
|
+
/** The original option (default `$implicit`). */
|
|
44
|
+
$implicit: T;
|
|
45
|
+
/** Same as `$implicit`, named for readability. */
|
|
46
|
+
option: T;
|
|
47
|
+
/** Whether this button is currently pressed. */
|
|
48
|
+
selected: boolean;
|
|
49
|
+
/** Index of the option in the list. */
|
|
50
|
+
index: number;
|
|
51
|
+
}
|
|
52
|
+
/** Payload emitted when a group button is clicked. */
|
|
53
|
+
interface ToggleButtonOptionClickEvent<T = unknown> {
|
|
54
|
+
/** The original option (as passed in `options`). */
|
|
55
|
+
option: T;
|
|
56
|
+
/** The resolved value of that option. */
|
|
57
|
+
value: T;
|
|
58
|
+
/** Index of the option in the list. */
|
|
59
|
+
index: number;
|
|
60
|
+
/** Pressed state after the click. */
|
|
61
|
+
selected: boolean;
|
|
62
|
+
/** Originating DOM event. */
|
|
63
|
+
originalEvent: Event;
|
|
64
|
+
}
|
|
65
|
+
/** @ignore Internal, normalized view of a group option. */
|
|
66
|
+
interface NormalizedToggle {
|
|
67
|
+
key: string;
|
|
68
|
+
index: number;
|
|
69
|
+
value: unknown;
|
|
70
|
+
label: string | null;
|
|
71
|
+
icon: string | null;
|
|
72
|
+
ariaLabel: string | null;
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
selected: boolean;
|
|
75
|
+
iconOnly: boolean;
|
|
76
|
+
original: unknown;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* ui-toggle-button — a button that holds a pressed state.
|
|
80
|
+
*
|
|
81
|
+
* Two modes, one component:
|
|
82
|
+
* - **single** (default): one native `<button aria-pressed>` backing a boolean
|
|
83
|
+
* (or the `trueValue`/`falseValue` pair). Labels and icons may differ per
|
|
84
|
+
* state (`onLabel`/`offLabel`, `onIcon`/`offIcon`).
|
|
85
|
+
* - **group** (`options` set): one button per option, `role="group"` on the
|
|
86
|
+
* host, model = the array of pressed values. Deliberately always
|
|
87
|
+
* multi-select: an exclusive choice is `ui-segment-control`'s job, which says
|
|
88
|
+
* it with `radiogroup` semantics instead of `aria-pressed`.
|
|
89
|
+
*
|
|
90
|
+
* `level` colours the pressed state, `variant` draws the released one, both
|
|
91
|
+
* from the `actions.*` token sets. Interactive states (hover/focus/pressed/
|
|
92
|
+
* disabled) are pure CSS.
|
|
93
|
+
*
|
|
94
|
+
* Works standalone, with `[(ngModel)]`, reactive forms, or signal forms
|
|
95
|
+
* (`[formField]`) — it is a `ControlValueAccessor`.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```html
|
|
99
|
+
* <ui-toggle-button [(ngModel)]="bold" label="Gras" icon="bold" />
|
|
100
|
+
* <ui-toggle-button [(ngModel)]="days" [options]="dayOptions" ariaLabel="Jours ouvrés" />
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
declare class UiToggleButton<T = boolean> extends BaseFieldControl<ToggleButtonValue<T>> {
|
|
104
|
+
/** Label shown in both states (fallback of `onLabel` / `offLabel`). */
|
|
105
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
106
|
+
/** Label shown while pressed. */
|
|
107
|
+
onLabel: _angular_core.InputSignal<string | undefined>;
|
|
108
|
+
/** Label shown while released. */
|
|
109
|
+
offLabel: _angular_core.InputSignal<string | undefined>;
|
|
110
|
+
/** Icon shown in both states (fallback of `onIcon` / `offIcon`). */
|
|
111
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
112
|
+
/** Icon shown while pressed. */
|
|
113
|
+
onIcon: _angular_core.InputSignal<string | undefined>;
|
|
114
|
+
/** Icon shown while released. */
|
|
115
|
+
offIcon: _angular_core.InputSignal<string | undefined>;
|
|
116
|
+
/** Side of the label the icon sits on. */
|
|
117
|
+
iconPos: _angular_core.InputSignal<ToggleButtonIconPos>;
|
|
118
|
+
/** Model value emitted when pressed. */
|
|
119
|
+
trueValue: _angular_core.InputSignal<T>;
|
|
120
|
+
/** Model value emitted when released. */
|
|
121
|
+
falseValue: _angular_core.InputSignal<T>;
|
|
122
|
+
/** Options to display, one button each. Presence switches the host to group mode. */
|
|
123
|
+
options: _angular_core.InputSignal<readonly (T | ToggleButtonOption<T>)[] | undefined>;
|
|
124
|
+
/** Field name to read a label from, when options are objects. */
|
|
125
|
+
optionLabel: _angular_core.InputSignal<string | undefined>;
|
|
126
|
+
/** Field name to read the value from, when options are objects. */
|
|
127
|
+
optionValue: _angular_core.InputSignal<string | undefined>;
|
|
128
|
+
/** Field name to read the disabled flag from, when options are objects. */
|
|
129
|
+
optionDisabled: _angular_core.InputSignal<string | undefined>;
|
|
130
|
+
/** Field name to read an icon name from, when options are objects. */
|
|
131
|
+
optionIcon: _angular_core.InputSignal<string | undefined>;
|
|
132
|
+
/** Property used to compare object values for equality (selection matching). */
|
|
133
|
+
dataKey: _angular_core.InputSignal<string | undefined>;
|
|
134
|
+
/** Layout axis of the group. */
|
|
135
|
+
orientation: _angular_core.InputSignal<ToggleButtonOrientation>;
|
|
136
|
+
/** Colour family of the pressed state. */
|
|
137
|
+
level: _angular_core.InputSignal<UiLevel>;
|
|
138
|
+
/** How the released state is drawn. */
|
|
139
|
+
variant: _angular_core.InputSignal<ToggleButtonVariant>;
|
|
140
|
+
/** Size. */
|
|
141
|
+
size: _angular_core.InputSignal<ToggleButtonSize>;
|
|
142
|
+
/** Span the full width of the parent (group buttons share the width evenly). */
|
|
143
|
+
fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
144
|
+
/** Pill shape. */
|
|
145
|
+
rounded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
146
|
+
/** Whether the last pressed button can be released (single), or the group emptied. */
|
|
147
|
+
allowEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
148
|
+
/** Replaces the icon, single mode (receives `{ $implicit, checked }`). */
|
|
149
|
+
iconTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonStateContext> | undefined>;
|
|
150
|
+
/** Replaces the whole button content, single mode (receives `{ $implicit, checked }`). */
|
|
151
|
+
contentTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonStateContext> | undefined>;
|
|
152
|
+
/** Replaces a group button's content (receives `{ $implicit, option, selected, index }`). */
|
|
153
|
+
itemTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonItemContext<T>> | undefined>;
|
|
154
|
+
/** Emitted on user interaction with the new model value. */
|
|
155
|
+
toggleChange: _angular_core.OutputEmitterRef<ToggleButtonValue<T>>;
|
|
156
|
+
/** Emitted when a group button is clicked (even if it does not change the value). */
|
|
157
|
+
optionClick: _angular_core.OutputEmitterRef<ToggleButtonOptionClickEvent<T>>;
|
|
158
|
+
/** Emitted when a button receives focus. */
|
|
159
|
+
toggleFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
160
|
+
/** Emitted when a button loses focus. */
|
|
161
|
+
toggleBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
162
|
+
/** @ignore */
|
|
163
|
+
private readonly buttons;
|
|
164
|
+
/** @ignore */
|
|
165
|
+
private readonly resolver;
|
|
166
|
+
constructor();
|
|
167
|
+
/** @ignore Group mode: an `options` list was provided. */
|
|
168
|
+
protected readonly isGroup: _angular_core.Signal<boolean>;
|
|
169
|
+
/** @ignore */
|
|
170
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
171
|
+
/** @ignore */
|
|
172
|
+
protected readonly hostClasses: _angular_core.Signal<string>;
|
|
173
|
+
/** @ignore Only the group carries the group-level ARIA naming. */
|
|
174
|
+
protected readonly groupAriaLabel: _angular_core.Signal<string | null>;
|
|
175
|
+
/** @ignore */
|
|
176
|
+
protected readonly groupAriaLabelledBy: _angular_core.Signal<string | null>;
|
|
177
|
+
/** @ignore */
|
|
178
|
+
protected readonly checked: _angular_core.Signal<boolean>;
|
|
179
|
+
/** @ignore */
|
|
180
|
+
protected readonly hasStateLabels: _angular_core.Signal<boolean>;
|
|
181
|
+
/** @ignore Label of the current state, falling back to the shared one. */
|
|
182
|
+
protected readonly currentLabel: _angular_core.Signal<string | null>;
|
|
183
|
+
/** @ignore Icon of the current state, falling back to the shared one. */
|
|
184
|
+
protected readonly currentIcon: _angular_core.Signal<string | null>;
|
|
185
|
+
/** @ignore Square button: an icon, no text. */
|
|
186
|
+
protected readonly isIconOnly: _angular_core.Signal<boolean>;
|
|
187
|
+
/** @ignore */
|
|
188
|
+
protected readonly iconBefore: _angular_core.Signal<boolean>;
|
|
189
|
+
/** @ignore */
|
|
190
|
+
protected readonly stateContext: _angular_core.Signal<ToggleButtonStateContext>;
|
|
191
|
+
/** @ignore Accessible name of the single button (never empty-stringed). */
|
|
192
|
+
protected readonly buttonAriaLabel: _angular_core.Signal<string | null>;
|
|
193
|
+
/** @ignore Options resolved to a flat, render-ready shape. */
|
|
194
|
+
protected readonly normalizedOptions: _angular_core.Signal<NormalizedToggle[]>;
|
|
195
|
+
/** @ignore */
|
|
196
|
+
protected itemContext(item: NormalizedToggle): ToggleButtonItemContext<T>;
|
|
197
|
+
/** @ignore */
|
|
198
|
+
protected uidPrefix(): string;
|
|
199
|
+
/** Focus the button (the first enabled one in group mode). */
|
|
200
|
+
focus(options?: FocusOptions): void;
|
|
201
|
+
/** @ignore Single mode: flip the boolean pair. */
|
|
202
|
+
protected toggle(): void;
|
|
203
|
+
/** @ignore Group mode: press / release one option. */
|
|
204
|
+
protected toggleOption(item: NormalizedToggle, event: Event): void;
|
|
205
|
+
/** @ignore */
|
|
206
|
+
protected onBlur(event: FocusEvent): void;
|
|
207
|
+
/** @ignore Rich option shape (`{ value }`) resolves without a field mapping. */
|
|
208
|
+
private resolveValue;
|
|
209
|
+
/** @ignore An option object with no label key stays label-less (icon-only button). */
|
|
210
|
+
private resolveLabel;
|
|
211
|
+
/** @ignore */
|
|
212
|
+
private resolveIcon;
|
|
213
|
+
/** @ignore A group's model is the array of pressed values. */
|
|
214
|
+
private isPressed;
|
|
215
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToggleButton<any>, never>;
|
|
216
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiToggleButton<any>, "ui-toggle-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "onLabel": { "alias": "onLabel"; "required": false; "isSignal": true; }; "offLabel": { "alias": "offLabel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "onIcon": { "alias": "onIcon"; "required": false; "isSignal": true; }; "offIcon": { "alias": "offIcon"; "required": false; "isSignal": true; }; "iconPos": { "alias": "iconPos"; "required": false; "isSignal": true; }; "trueValue": { "alias": "trueValue"; "required": false; "isSignal": true; }; "falseValue": { "alias": "falseValue"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "iconTemplate": { "alias": "iconTemplate"; "required": false; "isSignal": true; }; "contentTemplate": { "alias": "contentTemplate"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "toggleChange": "toggleChange"; "optionClick": "optionClick"; "toggleFocus": "toggleFocus"; "toggleBlur": "toggleBlur"; }, never, never, true, never>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { UiToggleButton };
|
|
220
|
+
export type { ToggleButtonIconPos, ToggleButtonItemContext, ToggleButtonOption, ToggleButtonOptionClickEvent, ToggleButtonOrientation, ToggleButtonSize, ToggleButtonStateContext, ToggleButtonValue, ToggleButtonVariant };
|
|
@@ -60,6 +60,13 @@ declare abstract class BaseControlValueAccessor<T> implements ControlValueAccess
|
|
|
60
60
|
type FieldSize = 'default' | 'small';
|
|
61
61
|
/** Visual validation status (subset of `UiFeedbackLevel`, shared with `ui-helper`). */
|
|
62
62
|
type FieldLevel = Extract<UiFeedbackLevel, 'default' | 'success' | 'error'>;
|
|
63
|
+
/**
|
|
64
|
+
* Placement of the floating label ("float label" mode):
|
|
65
|
+
* - `over`: rises above the box, where a classic label sits,
|
|
66
|
+
* - `in`: rises to a band reserved at the top **inside** the box,
|
|
67
|
+
* - `on`: rises **onto** the top border, notching it.
|
|
68
|
+
*/
|
|
69
|
+
type FieldFloatLabel = 'over' | 'in' | 'on';
|
|
63
70
|
/**
|
|
64
71
|
* Base class for every standalone form control (`ui-checkbox`, `ui-toggle`,
|
|
65
72
|
* `ui-slider`, `ui-nudger`…): the CVA plumbing shared by all of them, without
|
|
@@ -131,6 +138,15 @@ declare abstract class BaseFormField<T> extends BaseFieldControl<T> {
|
|
|
131
138
|
size: _angular_core.InputSignal<FieldSize>;
|
|
132
139
|
/** Explicit validation status (`error` is forced when the control is invalid + touched). */
|
|
133
140
|
level: _angular_core.InputSignal<FieldLevel>;
|
|
141
|
+
/**
|
|
142
|
+
* Floating label placement. Unset = classic label above the box.
|
|
143
|
+
*
|
|
144
|
+
* The label then plays the placeholder role while at rest, so the native
|
|
145
|
+
* `placeholder` is neutralised (see `hasFloatLabel`).
|
|
146
|
+
*/
|
|
147
|
+
floatLabel: _angular_core.InputSignal<FieldFloatLabel | undefined>;
|
|
148
|
+
/** @ignore There is a label to float: a `floatLabel` alone has nothing to move. */
|
|
149
|
+
protected readonly hasFloatLabel: _angular_core.Signal<boolean>;
|
|
134
150
|
/** @ignore Effective level: error when invalid, otherwise the requested `level`. */
|
|
135
151
|
protected readonly effectiveLevel: _angular_core.Signal<FieldLevel>;
|
|
136
152
|
/** @ignore Displayed message: errorText when in error (if provided), otherwise helperText. */
|
|
@@ -138,7 +154,7 @@ declare abstract class BaseFormField<T> extends BaseFieldControl<T> {
|
|
|
138
154
|
/** @ignore Value shown in the input (string). Override for specific formatting. */
|
|
139
155
|
protected readonly displayValue: _angular_core.Signal<string>;
|
|
140
156
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseFormField<any>, never>;
|
|
141
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseFormField<any>, never, never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
157
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseFormField<any>, never, never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
/**
|
|
@@ -186,11 +202,19 @@ declare function buildMaskSlots(mask: string, bounds: (MaskBounds | null)[], tok
|
|
|
186
202
|
/** Keep only the data characters (alphanumeric) of a raw input string. */
|
|
187
203
|
declare function extractMaskData(raw: string): string;
|
|
188
204
|
/**
|
|
189
|
-
* Can `ch` fill this slot? It must match the token class and — when the segment is bounded
|
|
190
|
-
* the digits typed so far plus `ch` must still admit at least one in-range
|
|
191
|
-
* remaining positions (`2` then `4` is refused on `0-23`, `2` then `3` is
|
|
205
|
+
* Can `ch` fill this slot? It must match the token class and — when the segment is bounded
|
|
206
|
+
* AND `enforceBounds` — the digits typed so far plus `ch` must still admit at least one in-range
|
|
207
|
+
* completion of the remaining positions (`2` then `4` is refused on `0-23`, `2` then `3` is
|
|
208
|
+
* accepted).
|
|
209
|
+
*
|
|
210
|
+
* `enforceBounds = false` skips that second check (still requires the token class to match):
|
|
211
|
+
* meant for re-deriving the mask after characters were REMOVED, not typed. The bounds check
|
|
212
|
+
* exists to reject an invalid *new* leading digit while typing forward (e.g. `8` can never start
|
|
213
|
+
* a valid `1-31` day, so it's skipped rather than accepted) — applied instead to the digits left
|
|
214
|
+
* over after a deletion, that same skip can discard a still-valid residual digit and misalign
|
|
215
|
+
* every segment after it. See `autoFormatSegments`.
|
|
192
216
|
*/
|
|
193
|
-
declare function acceptsMaskChar(slot: MaskSlot, segment: string, ch: string): boolean;
|
|
217
|
+
declare function acceptsMaskChar(slot: MaskSlot, segment: string, ch: string, enforceBounds?: boolean): boolean;
|
|
194
218
|
/** Apply the mask template to a sequence of data characters (fills empty positions with `slotChar`). */
|
|
195
219
|
declare function applyMaskTemplate(slots: MaskSlot[], data: string, slotChar: string): MaskBuildResult;
|
|
196
220
|
/** Caret position for `n` typed data characters (literals skipped, end-of-text once all filled). */
|
|
@@ -202,9 +226,12 @@ declare function caretForMask(tokenIndices: number[], n: number, length: number)
|
|
|
202
226
|
* template at rest). Used by `ui-datepicker`'s typeable trigger to auto-insert "/" as digits are
|
|
203
227
|
* typed, the same way a card-expiry field auto-inserts its "/".
|
|
204
228
|
*/
|
|
205
|
-
declare function autoFormatSegments(slots: MaskSlot[], data: string
|
|
229
|
+
declare function autoFormatSegments(slots: MaskSlot[], data: string, { enforceBounds }?: {
|
|
230
|
+
enforceBounds?: boolean;
|
|
231
|
+
}): {
|
|
206
232
|
text: string;
|
|
207
233
|
tokenIndices: number[];
|
|
234
|
+
dataEnd: number;
|
|
208
235
|
};
|
|
209
236
|
|
|
210
237
|
/**
|
|
@@ -257,4 +284,4 @@ declare function formatLabel(template: string, value: string | number): string;
|
|
|
257
284
|
declare function warnMissingAccessibleName(componentTag: string, message: string): void;
|
|
258
285
|
|
|
259
286
|
export { BaseControlValueAccessor, BaseFieldControl, BaseFormField, MASK_TOKENS, acceptsMaskChar, applyMaskTemplate, autoFormatSegments, buildMaskSlots, caretForMask, createOptionResolver, dropdownOverlayPositions, extractMaskData, formatLabel, parseMaskRanges, warnMissingAccessibleName };
|
|
260
|
-
export type { FieldLevel, FieldSize, MaskBounds, MaskBuildResult, MaskSlot, OptionEntry, OptionResolver, OptionResolverFields };
|
|
287
|
+
export type { FieldFloatLabel, FieldLevel, FieldSize, MaskBounds, MaskBuildResult, MaskSlot, OptionEntry, OptionResolver, OptionResolverFields };
|
|
@@ -127,6 +127,11 @@ declare class UiModal {
|
|
|
127
127
|
width: number;
|
|
128
128
|
height: number;
|
|
129
129
|
}>;
|
|
130
|
+
/** @ignore Scrollable body region (see `contentNeedsFocus`). */
|
|
131
|
+
private readonly contentRef;
|
|
132
|
+
/** @ignore The body overflows and holds no focusable element of its own — it then needs to be
|
|
133
|
+
* focusable itself so the scroll is keyboard-reachable (axe `scrollable-region-focusable`). */
|
|
134
|
+
protected readonly contentNeedsFocus: _angular_core.WritableSignal<boolean>;
|
|
130
135
|
/** @ignore */
|
|
131
136
|
private readonly dialogRef;
|
|
132
137
|
/** @ignore Scrim host (for imperative `maskStyleClass` — a bound `[class]` would
|
|
@@ -227,6 +232,8 @@ declare class UiModal {
|
|
|
227
232
|
private endResize;
|
|
228
233
|
/** @ignore */
|
|
229
234
|
private removeResizeListeners;
|
|
235
|
+
/** @ignore Recomputes `contentNeedsFocus` from the rendered body. */
|
|
236
|
+
private measureContentFocusability;
|
|
230
237
|
/** @ignore Release this instance's scroll lock, if held. */
|
|
231
238
|
private releaseLock;
|
|
232
239
|
/** @ignore Build the responsive width rules (`max-width` media queries). */
|
|
@@ -187,14 +187,19 @@ declare class UiStepper {
|
|
|
187
187
|
readonly id: string;
|
|
188
188
|
/** @ignore All steps projected under this container, in DOM order. */
|
|
189
189
|
private readonly steps;
|
|
190
|
+
/** @ignore All panels projected under this container — a stepper used as a plain "steps only"
|
|
191
|
+
* progress indicator (see `UiStepList` doc) has none at all: `aria-controls` must not point
|
|
192
|
+
* at an id that resolves to nothing. */
|
|
193
|
+
private readonly panels;
|
|
190
194
|
/** @ignore Ordered step values (the progression sequence). */
|
|
191
195
|
private readonly orderedValues;
|
|
192
196
|
/** @ignore Index of the active step in the ordered sequence (-1 when none). */
|
|
193
197
|
private readonly activeIndex;
|
|
194
198
|
/** @ignore id of the step header for a given value. */
|
|
195
199
|
stepId(value: UiStepValue | undefined): string;
|
|
196
|
-
/** @ignore id of the panel for a given value
|
|
197
|
-
|
|
200
|
+
/** @ignore id of the panel for a given value — `null` when that panel is not actually
|
|
201
|
+
* rendered (see `panels` above), so the step omits `aria-controls` rather than dangle it. */
|
|
202
|
+
panelId(value: UiStepValue | undefined): string | null;
|
|
198
203
|
/** @ignore Whether the given value is the active step. */
|
|
199
204
|
isActive(value: UiStepValue | undefined): boolean;
|
|
200
205
|
/** @ignore 1-based position of a step in the progression (0 when unknown). */
|
|
@@ -213,7 +218,7 @@ declare class UiStepper {
|
|
|
213
218
|
/** Activate the previous step in the sequence. */
|
|
214
219
|
prev(): void;
|
|
215
220
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiStepper, never>;
|
|
216
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiStepper, "ui-stepper", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "completedIcon": { "alias": "completedIcon"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "stepChange": "stepChange"; }, ["steps"], ["*"], true, never>;
|
|
221
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiStepper, "ui-stepper", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "completedIcon": { "alias": "completedIcon"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "stepChange": "stepChange"; }, ["steps", "panels"], ["*"], true, never>;
|
|
217
222
|
}
|
|
218
223
|
|
|
219
224
|
export { UiStep, UiStepItem, UiStepList, UiStepPanel, UiStepPanels, UiStepper };
|
|
@@ -208,10 +208,21 @@ declare class UiTabs {
|
|
|
208
208
|
readonly id: string;
|
|
209
209
|
/** @ignore All tabs projected under this container (across the list boundary). */
|
|
210
210
|
private readonly tabs;
|
|
211
|
+
/** @ignore Whether a `ui-tab-panels` wrapper is projected at all — some consumers use
|
|
212
|
+
* `ui-tabs` as a navigation menu with no panel (a router outlet renders the content
|
|
213
|
+
* instead, see the `TabMenu` story). `aria-controls` must not point at an id that resolves
|
|
214
|
+
* to nothing. A single presence check on the wrapper (rather than a second
|
|
215
|
+
* `contentChildren` query matched per tab value) — two sibling content-children queries on
|
|
216
|
+
* this component broke `<ng-content>` projection for every `UiTab` but the first, a real
|
|
217
|
+
* Angular/Ivy interaction, not something worth chasing further; this is the query-count-1
|
|
218
|
+
* workaround. */
|
|
219
|
+
private readonly hasPanels;
|
|
211
220
|
/** @ignore id of the tab button for a given value. */
|
|
212
221
|
tabId(value: UiTabValue): string;
|
|
213
|
-
/** @ignore id of the panel for a given value
|
|
214
|
-
|
|
222
|
+
/** @ignore id of the panel for a given value — `null` when no `ui-tab-panels` wrapper is
|
|
223
|
+
* projected at all (see `hasPanels` above), so the tab omits `aria-controls` rather than
|
|
224
|
+
* dangle it. */
|
|
225
|
+
panelId(value: UiTabValue): string | null;
|
|
215
226
|
/** @ignore Whether the given value is the active tab. */
|
|
216
227
|
isActive(value: UiTabValue): boolean;
|
|
217
228
|
/**
|
|
@@ -222,7 +233,7 @@ declare class UiTabs {
|
|
|
222
233
|
/** @ignore Activate a tab (no-op if already active); emits `tabChange`. */
|
|
223
234
|
updateValue(value: UiTabValue, event: Event): void;
|
|
224
235
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabs, never>;
|
|
225
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabs, "ui-tabs", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "showNavigators": { "alias": "showNavigators"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "tabChange": "tabChange"; }, ["tabs"], ["*"], true, never>;
|
|
236
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabs, "ui-tabs", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "showNavigators": { "alias": "showNavigators"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "tabChange": "tabChange"; }, ["tabs", "hasPanels"], ["*"], true, never>;
|
|
226
237
|
}
|
|
227
238
|
|
|
228
239
|
export { UiTab, UiTabList, UiTabPanel, UiTabPanels, UiTabs };
|