@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,184 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
4
|
+
|
|
5
|
+
type SegmentControlSize = 'default' | 'small';
|
|
6
|
+
type SegmentControlOrientation = 'horizontal' | 'vertical';
|
|
7
|
+
/** Selected value: a single value (single mode) or an array (`multiple`). */
|
|
8
|
+
type SegmentControlValue<T = unknown> = T | T[] | null;
|
|
9
|
+
/**
|
|
10
|
+
* Rich option shape. Options may also be primitives (`string`/`number`) or any
|
|
11
|
+
* object, in which case the `optionLabel` / `optionValue` / `optionDisabled` /
|
|
12
|
+
* `optionIcon` field names tell the control how to read them.
|
|
13
|
+
*/
|
|
14
|
+
interface SegmentControlOption<T = unknown> {
|
|
15
|
+
/** Text shown inside the segment. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Value carried into the model when the segment is selected. */
|
|
18
|
+
value: T;
|
|
19
|
+
/** Leading icon name (design-system icon). */
|
|
20
|
+
icon?: string;
|
|
21
|
+
/** Disables just this segment. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Accessible name (required for an icon-only segment). */
|
|
24
|
+
ariaLabel?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Payload emitted when a segment is clicked. */
|
|
27
|
+
interface SegmentControlOptionClickEvent<T = unknown> {
|
|
28
|
+
/** The original option (as passed in `options`). */
|
|
29
|
+
option: T;
|
|
30
|
+
/** The resolved value of that option. */
|
|
31
|
+
value: T;
|
|
32
|
+
/** Index of the option in the list. */
|
|
33
|
+
index: number;
|
|
34
|
+
/** Originating DOM event. */
|
|
35
|
+
originalEvent: Event;
|
|
36
|
+
}
|
|
37
|
+
/** Context handed to a custom item template. */
|
|
38
|
+
interface SegmentControlItemContext<T = unknown> {
|
|
39
|
+
/** The original option (default `$implicit`). */
|
|
40
|
+
$implicit: T;
|
|
41
|
+
/** Same as `$implicit`, named for readability. */
|
|
42
|
+
option: T;
|
|
43
|
+
/** Whether this segment is currently selected. */
|
|
44
|
+
selected: boolean;
|
|
45
|
+
/** Index of the option in the list. */
|
|
46
|
+
index: number;
|
|
47
|
+
}
|
|
48
|
+
/** @ignore Internal, normalized view of an option (template + logic source). */
|
|
49
|
+
interface NormalizedSegment {
|
|
50
|
+
key: string;
|
|
51
|
+
index: number;
|
|
52
|
+
value: unknown;
|
|
53
|
+
label: string | null;
|
|
54
|
+
icon: string | null;
|
|
55
|
+
ariaLabel: string | null;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
selected: boolean;
|
|
58
|
+
original: unknown;
|
|
59
|
+
}
|
|
60
|
+
/** @ignore Measured geometry of the sliding selection indicator. */
|
|
61
|
+
interface ThumbMetrics {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
w: number;
|
|
65
|
+
h: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* ui-segment-control — headless segmented control for choosing one (or, with
|
|
69
|
+
* `multiple`, several) value(s) from a short list of inline buttons.
|
|
70
|
+
*
|
|
71
|
+
* Each segment is a real native `<button>`; the group carries WAI-ARIA semantics
|
|
72
|
+
* (`radiogroup`/`radio` in single mode with roving arrow-key navigation and
|
|
73
|
+
* select-on-arrow, `group`/`aria-pressed` in `multiple` mode) so keyboard and
|
|
74
|
+
* screen-reader support come for free. Interactive states (hover/focus/pressed/
|
|
75
|
+
* disabled) are pure CSS driven by the `actions.*` design tokens.
|
|
76
|
+
*
|
|
77
|
+
* In single mode a sliding indicator glides under the selected segment, timed by
|
|
78
|
+
* the shared motion system (honours reduced-motion and the `motion` opt-out).
|
|
79
|
+
*
|
|
80
|
+
* Works standalone, with `[(ngModel)]`, reactive forms, or signal forms
|
|
81
|
+
* (`[formField]`) — it is a `ControlValueAccessor`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```html
|
|
85
|
+
* <ui-segment-control [(ngModel)]="view" [options]="['Liste', 'Grille']" />
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
declare class UiSegmentControl<T = unknown> extends BaseFieldControl<SegmentControlValue<T>> {
|
|
89
|
+
/** Options to display, one button each. Primitives, objects, or `SegmentControlOption`. */
|
|
90
|
+
options: _angular_core.InputSignal<readonly (T | SegmentControlOption<T>)[]>;
|
|
91
|
+
/** Field name to read a label from, when options are objects. */
|
|
92
|
+
optionLabel: _angular_core.InputSignal<string | undefined>;
|
|
93
|
+
/** Field name to read the value from, when options are objects. */
|
|
94
|
+
optionValue: _angular_core.InputSignal<string | undefined>;
|
|
95
|
+
/** Field name to read the disabled flag from, when options are objects. */
|
|
96
|
+
optionDisabled: _angular_core.InputSignal<string | undefined>;
|
|
97
|
+
/** Field name to read an icon name from, when options are objects. */
|
|
98
|
+
optionIcon: _angular_core.InputSignal<string | undefined>;
|
|
99
|
+
/** Property used to compare object values for equality (selection matching). */
|
|
100
|
+
dataKey: _angular_core.InputSignal<string | undefined>;
|
|
101
|
+
/** Allow selecting several values at once (the model becomes an array). */
|
|
102
|
+
multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
103
|
+
/** Whether the selection can be fully cleared (single) / emptied (multiple). */
|
|
104
|
+
allowEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
105
|
+
/** Size. */
|
|
106
|
+
size: _angular_core.InputSignal<SegmentControlSize>;
|
|
107
|
+
/** Layout axis (drives which arrow keys navigate). */
|
|
108
|
+
orientation: _angular_core.InputSignal<SegmentControlOrientation>;
|
|
109
|
+
/** Span the full width of the parent (segments share the width evenly). */
|
|
110
|
+
fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
111
|
+
/** Animate the sliding indicator (honours reduced-motion regardless). */
|
|
112
|
+
motion: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
113
|
+
/** Custom template for a segment's content (receives `{ $implicit, option, selected, index }`). */
|
|
114
|
+
itemTemplate: _angular_core.InputSignal<TemplateRef<SegmentControlItemContext<T>> | undefined>;
|
|
115
|
+
/** Emitted on user selection with the new model value. */
|
|
116
|
+
selectionChange: _angular_core.OutputEmitterRef<SegmentControlValue<T>>;
|
|
117
|
+
/** Emitted when a segment is clicked (even if it does not change the value). */
|
|
118
|
+
optionClick: _angular_core.OutputEmitterRef<SegmentControlOptionClickEvent<T>>;
|
|
119
|
+
/** @ignore */
|
|
120
|
+
private readonly host;
|
|
121
|
+
/** @ignore */
|
|
122
|
+
private readonly hostDestroyRef;
|
|
123
|
+
/** @ignore Native segment buttons (for roving focus + indicator measurement). */
|
|
124
|
+
private readonly optionEls;
|
|
125
|
+
/** @ignore Current model value (written by the form or by user selection).
|
|
126
|
+
* Redeclared over the base signal to keep `null` (not `undefined`) as the empty value. */
|
|
127
|
+
protected readonly modelValue: _angular_core.WritableSignal<SegmentControlValue<T>>;
|
|
128
|
+
/** @ignore Index the roving focus last landed on. */
|
|
129
|
+
private readonly focusedIndex;
|
|
130
|
+
/** @ignore Measured geometry of the sliding indicator (null until first measure). */
|
|
131
|
+
protected readonly thumb: _angular_core.WritableSignal<ThumbMetrics | null>;
|
|
132
|
+
/** @ignore Bumped by the ResizeObserver to re-measure the indicator. */
|
|
133
|
+
private readonly resizeTick;
|
|
134
|
+
constructor();
|
|
135
|
+
/** @ignore Icon size derived from the control size. */
|
|
136
|
+
protected readonly iconSize: _angular_core.Signal<"default" | "sm">;
|
|
137
|
+
/** @ignore Options resolved to a flat, render-ready shape. */
|
|
138
|
+
protected readonly normalizedOptions: _angular_core.Signal<NormalizedSegment[]>;
|
|
139
|
+
/** @ignore Index of the selected segment in single mode (-1 if none / multiple). */
|
|
140
|
+
protected readonly selectedIndex: _angular_core.Signal<number>;
|
|
141
|
+
/** @ignore Whether the sliding indicator should render. */
|
|
142
|
+
protected readonly showThumb: _angular_core.Signal<boolean>;
|
|
143
|
+
/** @ignore CSS transform positioning the indicator over the selected segment. */
|
|
144
|
+
protected readonly thumbTransform: _angular_core.Signal<string | null>;
|
|
145
|
+
/** @ignore Segment that owns the group's single tab stop (roving tabindex). */
|
|
146
|
+
protected readonly rovingIndex: _angular_core.Signal<number>;
|
|
147
|
+
/** @ignore */
|
|
148
|
+
protected uidPrefix(): string;
|
|
149
|
+
/** Move focus to the group's current tab stop. */
|
|
150
|
+
focus(options?: FocusOptions): void;
|
|
151
|
+
/** @ignore The tabindex for a given segment (roving: one 0, the rest -1). */
|
|
152
|
+
protected tabindexFor(index: number): number;
|
|
153
|
+
/** @ignore Select (or toggle / clear) a segment on user interaction. */
|
|
154
|
+
protected select(option: NormalizedSegment, event: Event): void;
|
|
155
|
+
/** @ignore */
|
|
156
|
+
protected onOptionFocus(index: number): void;
|
|
157
|
+
/** @ignore Roving focus (and select-on-arrow in single mode). */
|
|
158
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
159
|
+
/** @ignore Mark touched when focus leaves the whole group. */
|
|
160
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
161
|
+
/** @ignore */
|
|
162
|
+
private isObject;
|
|
163
|
+
/** @ignore */
|
|
164
|
+
private resolveValue;
|
|
165
|
+
/** @ignore */
|
|
166
|
+
private resolveLabel;
|
|
167
|
+
/** @ignore */
|
|
168
|
+
private resolveIcon;
|
|
169
|
+
/** @ignore */
|
|
170
|
+
private resolveAriaLabel;
|
|
171
|
+
/** @ignore */
|
|
172
|
+
private resolveDisabled;
|
|
173
|
+
/** @ignore */
|
|
174
|
+
private asText;
|
|
175
|
+
/** @ignore Whether a resolved value is part of the current model. */
|
|
176
|
+
private isValueSelected;
|
|
177
|
+
/** @ignore Value equality — by `dataKey` for objects, strict otherwise. */
|
|
178
|
+
private equals;
|
|
179
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSegmentControl<any>, never>;
|
|
180
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSegmentControl<any>, "ui-segment-control", never, { "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; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "optionClick": "optionClick"; }, never, never, true, never>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { UiSegmentControl };
|
|
184
|
+
export type { SegmentControlItemContext, SegmentControlOption, SegmentControlOptionClickEvent, SegmentControlOrientation, SegmentControlSize, SegmentControlValue };
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import * as _angular_cdk_overlay from '@angular/cdk/overlay';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { TemplateRef } from '@angular/core';
|
|
4
|
+
import { BaseFormField } from '@4sh/ui-kit/forms';
|
|
5
|
+
import { UiIconSize } from '@4sh/ui-kit/ui-icon';
|
|
6
|
+
|
|
7
|
+
/** Model value: a single value, an array (`multiple`), or `null` when cleared. */
|
|
8
|
+
type SelectValue<T = unknown> = T | T[] | null;
|
|
9
|
+
/** Context handed to the `#item` template. */
|
|
10
|
+
interface SelectItemContext<T = unknown> {
|
|
11
|
+
/** The original option (default `$implicit`). */
|
|
12
|
+
$implicit: T;
|
|
13
|
+
/** Same as `$implicit`, named for readability. */
|
|
14
|
+
option: T;
|
|
15
|
+
/** Whether this option is currently selected. */
|
|
16
|
+
selected: boolean;
|
|
17
|
+
/** Index of the option in the (filtered) list. */
|
|
18
|
+
index: number;
|
|
19
|
+
}
|
|
20
|
+
/** Context handed to the `#selectedItem` template (once per selected option). */
|
|
21
|
+
interface SelectSelectedItemContext<T = unknown> {
|
|
22
|
+
/** The selected option (default `$implicit`). */
|
|
23
|
+
$implicit: T;
|
|
24
|
+
/** Same as `$implicit`, named for readability. */
|
|
25
|
+
option: T;
|
|
26
|
+
/** Index among the selected options (0 in single mode). */
|
|
27
|
+
index: number;
|
|
28
|
+
/** Deselects this option (e.g. wire it to a removable chip). */
|
|
29
|
+
remove: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** Context handed to the `#group` template. */
|
|
32
|
+
interface SelectGroupContext<G = unknown> {
|
|
33
|
+
/** The original group object (default `$implicit`). */
|
|
34
|
+
$implicit: G;
|
|
35
|
+
/** Same as `$implicit`, named for readability. */
|
|
36
|
+
group: G;
|
|
37
|
+
}
|
|
38
|
+
/** Payload of the `filterChange` output. */
|
|
39
|
+
interface SelectFilterEvent {
|
|
40
|
+
/** Originating DOM event. */
|
|
41
|
+
originalEvent: Event;
|
|
42
|
+
/** Current filter text. */
|
|
43
|
+
filter: string;
|
|
44
|
+
}
|
|
45
|
+
/** Payload of the `lazyLoad` output (rendered range of the virtual viewport). */
|
|
46
|
+
interface SelectLazyLoadEvent {
|
|
47
|
+
/** Index of the first rendered row. */
|
|
48
|
+
first: number;
|
|
49
|
+
/** Index after the last rendered row (exclusive). */
|
|
50
|
+
last: number;
|
|
51
|
+
}
|
|
52
|
+
/** @ignore Flat, unfiltered view of one option (logic source). */
|
|
53
|
+
interface SelectEntry {
|
|
54
|
+
value: unknown;
|
|
55
|
+
label: string;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
original: unknown;
|
|
58
|
+
}
|
|
59
|
+
/** @ignore Rendered row: a group header or an option. */
|
|
60
|
+
type SelectRow = {
|
|
61
|
+
kind: 'group';
|
|
62
|
+
key: string;
|
|
63
|
+
label: string;
|
|
64
|
+
original: unknown;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'option';
|
|
67
|
+
key: string;
|
|
68
|
+
id: string;
|
|
69
|
+
index: number;
|
|
70
|
+
entry: SelectEntry;
|
|
71
|
+
selected: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* ui-select — headless dropdown list built on the `ui-field` shell
|
|
75
|
+
* (label + box + helper) with a token-styled options panel in a CDK overlay.
|
|
76
|
+
*
|
|
77
|
+
* The trigger is a native element following the WAI-ARIA combobox pattern
|
|
78
|
+
* (`role="combobox"` + `aria-activedescendant`: focus never leaves the trigger
|
|
79
|
+
* or the filter input, options are only visually focused). Supports primitive
|
|
80
|
+
* or object options (`optionLabel` / `optionValue` / `optionDisabled`), grouped
|
|
81
|
+
* options, single or `multiple` selection (checkmark / checkbox display),
|
|
82
|
+
* built-in filtering, an `editable` free-text mode, `showClear`, `loading`, and
|
|
83
|
+
* CDK virtual scrolling (plus lazy loading of huge lists) — all wired through
|
|
84
|
+
* `ControlValueAccessor` on {@link BaseFormField} (shared label / helper /
|
|
85
|
+
* level / validation / states).
|
|
86
|
+
*
|
|
87
|
+
* Customisation: the `#item`, `#selectedItem`, `#group`, `#header`, `#footer`
|
|
88
|
+
* and `#empty` templates, `panelStyleClass`, and the local SCSS variables.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```html
|
|
92
|
+
* <ui-select label="Ville" [options]="cities" optionLabel="name" optionValue="code" [(ngModel)]="city" />
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare class UiSelect<T = unknown> extends BaseFormField<SelectValue<T>> {
|
|
96
|
+
/** Options to display. Primitives, objects, or groups (see `group`). */
|
|
97
|
+
options: _angular_core.InputSignal<readonly unknown[]>;
|
|
98
|
+
/** Field name (dot-path) to read a label from, when options are objects. */
|
|
99
|
+
optionLabel: _angular_core.InputSignal<string | undefined>;
|
|
100
|
+
/** Field name (dot-path) to read the value from, when options are objects. */
|
|
101
|
+
optionValue: _angular_core.InputSignal<string | undefined>;
|
|
102
|
+
/** Field name (dot-path) to read the disabled flag from, when options are objects. */
|
|
103
|
+
optionDisabled: _angular_core.InputSignal<string | undefined>;
|
|
104
|
+
/** Treat `options` as groups (`optionGroupLabel` + `optionGroupChildren`). */
|
|
105
|
+
group: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
106
|
+
/** Field name of a group's label. */
|
|
107
|
+
optionGroupLabel: _angular_core.InputSignal<string>;
|
|
108
|
+
/** Field name of a group's children array. */
|
|
109
|
+
optionGroupChildren: _angular_core.InputSignal<string>;
|
|
110
|
+
/** Property used to compare object values for equality (selection matching). */
|
|
111
|
+
dataKey: _angular_core.InputSignal<string | undefined>;
|
|
112
|
+
/** Allow selecting several values (the model becomes an array, the panel stays open). */
|
|
113
|
+
multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
114
|
+
/** Display a check indicator on the selected option(s). */
|
|
115
|
+
checkmark: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
116
|
+
/** Display a checkbox in front of each option (`multiple` mode). */
|
|
117
|
+
checkbox: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
118
|
+
/** Max number of selected items rendered in the trigger (`multiple`); the rest collapses into `overflowLabel`. */
|
|
119
|
+
maxSelectedLabels: _angular_core.InputSignal<number | undefined>;
|
|
120
|
+
/** Collapsed-count indicator — `{0}` is replaced by the number of hidden items. */
|
|
121
|
+
overflowLabel: _angular_core.InputSignal<string>;
|
|
122
|
+
/** Placeholder shown in the trigger when nothing is selected. */
|
|
123
|
+
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
124
|
+
/** Show a clear (×) action in the trigger when a value is set. */
|
|
125
|
+
showClear: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
126
|
+
/** Accessible name of the clear action. */
|
|
127
|
+
clearAriaLabel: _angular_core.InputSignal<string>;
|
|
128
|
+
/** FontAwesome icon of the dropdown chevron. */
|
|
129
|
+
icon: _angular_core.InputSignal<string>;
|
|
130
|
+
/** Show the built-in filter input inside the panel. */
|
|
131
|
+
filter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
132
|
+
/** Placeholder of the filter input. */
|
|
133
|
+
filterPlaceholder: _angular_core.InputSignal<string | undefined>;
|
|
134
|
+
/** Accessible name of the filter input. */
|
|
135
|
+
filterAriaLabel: _angular_core.InputSignal<string>;
|
|
136
|
+
/** Comma-separated field names (dot-paths) the filter matches against (defaults to the label). */
|
|
137
|
+
filterBy: _angular_core.InputSignal<string | undefined>;
|
|
138
|
+
/** Move the focus into the filter input when the panel opens. */
|
|
139
|
+
autofocusFilter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
140
|
+
/** Reset the filter text when the panel closes. */
|
|
141
|
+
resetFilterOnHide: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
142
|
+
/** Message shown when there is no option. */
|
|
143
|
+
emptyMessage: _angular_core.InputSignal<string>;
|
|
144
|
+
/** Message shown when the filter matches nothing. */
|
|
145
|
+
emptyFilterMessage: _angular_core.InputSignal<string>;
|
|
146
|
+
/** Free-text mode: the trigger becomes a real `<input>`, typing sets the value directly. */
|
|
147
|
+
editable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
148
|
+
/** Loading state: a spinner replaces the chevron and the options are not interactive. */
|
|
149
|
+
loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
150
|
+
/** Visually focus the first option when the panel opens. */
|
|
151
|
+
autoOptionFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
152
|
+
/** Select an option as soon as it is visually focused with the keyboard (single mode). */
|
|
153
|
+
selectOnFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
154
|
+
/** Visually focus the option under the mouse pointer. */
|
|
155
|
+
focusOnHover: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
156
|
+
/** Render the options through a CDK virtual-scroll viewport. */
|
|
157
|
+
virtualScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
158
|
+
/** Fixed height (px) of one row — required by the virtual scroller. */
|
|
159
|
+
virtualScrollItemSize: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
160
|
+
/** With `virtualScroll`: emit `lazyLoad` with the rendered range (lazy loading). */
|
|
161
|
+
lazy: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
162
|
+
/** Max height of the options list (CSS size, e.g. `'320px'`). Defaults from the SCSS. */
|
|
163
|
+
scrollHeight: _angular_core.InputSignal<string | undefined>;
|
|
164
|
+
/**
|
|
165
|
+
* Auto-flip the panel above the trigger when there isn't enough room below
|
|
166
|
+
* (default). Set `false` to lock it below the trigger regardless of space.
|
|
167
|
+
*/
|
|
168
|
+
autoFlip: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
169
|
+
/** Extra class(es) applied to the panel (scoped custom styling). */
|
|
170
|
+
panelStyleClass: _angular_core.InputSignal<string | undefined>;
|
|
171
|
+
/**
|
|
172
|
+
* Panel width. By default it matches the field, which is too narrow when the
|
|
173
|
+
* field is compact (a phone dialling code in a `ui-input-group`, say) but the
|
|
174
|
+
* options are not. `'auto'` sizes the panel to its content while keeping the
|
|
175
|
+
* field width as a floor; any CSS size (`'260px'`) pins it.
|
|
176
|
+
*/
|
|
177
|
+
panelWidth: _angular_core.InputSignal<string | undefined>;
|
|
178
|
+
/** Emitted whenever the value changes (selection, typing, clear). */
|
|
179
|
+
valueChange: _angular_core.OutputEmitterRef<SelectValue<T>>;
|
|
180
|
+
/** Emitted when the panel opens. */
|
|
181
|
+
opened: _angular_core.OutputEmitterRef<void>;
|
|
182
|
+
/** Emitted when the panel closes. */
|
|
183
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
184
|
+
/** Emitted when the value is cleared. */
|
|
185
|
+
cleared: _angular_core.OutputEmitterRef<void>;
|
|
186
|
+
/** Emitted on each filter keystroke. */
|
|
187
|
+
filterChange: _angular_core.OutputEmitterRef<SelectFilterEvent>;
|
|
188
|
+
/** Emitted when the virtual viewport's rendered range changes (`virtualScroll` + `lazy`). */
|
|
189
|
+
lazyLoad: _angular_core.OutputEmitterRef<SelectLazyLoadEvent>;
|
|
190
|
+
/** Emitted when the trigger receives focus. */
|
|
191
|
+
inputFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
192
|
+
/** Emitted when the trigger loses focus. */
|
|
193
|
+
inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
194
|
+
/** Custom option template: `<ng-template #item let-option let-selected="selected">`. */
|
|
195
|
+
protected readonly itemTemplate: _angular_core.Signal<TemplateRef<SelectItemContext<T>> | undefined>;
|
|
196
|
+
/** Custom selected-value template (per selected option): `<ng-template #selectedItem let-option>`. */
|
|
197
|
+
protected readonly selectedItemTemplate: _angular_core.Signal<TemplateRef<SelectSelectedItemContext<T>> | undefined>;
|
|
198
|
+
/** Custom group-header template: `<ng-template #group let-group>`. */
|
|
199
|
+
protected readonly groupTemplate: _angular_core.Signal<TemplateRef<SelectGroupContext<unknown>> | undefined>;
|
|
200
|
+
/** Free content pinned above the list (before the filter). */
|
|
201
|
+
protected readonly headerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
202
|
+
/** Free content pinned under the list. */
|
|
203
|
+
protected readonly footerTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
204
|
+
/** Custom empty-state template. */
|
|
205
|
+
protected readonly emptyTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
206
|
+
/** @ignore Component root (overlay origin + outside-focus detection). */
|
|
207
|
+
private readonly containerEl;
|
|
208
|
+
/** @ignore Focusable trigger (combobox button or editable input). */
|
|
209
|
+
private readonly triggerEl;
|
|
210
|
+
/** @ignore Panel root element (for scrolling the focused option into view). */
|
|
211
|
+
private readonly panelEl;
|
|
212
|
+
/** @ignore Filter input (auto-focused on open). */
|
|
213
|
+
private readonly filterInputEl;
|
|
214
|
+
/** @ignore Virtual-scroll viewport (lazy range + scrollToIndex). */
|
|
215
|
+
private readonly viewport;
|
|
216
|
+
/** @ignore */
|
|
217
|
+
protected readonly panelOpen: _angular_core.WritableSignal<boolean>;
|
|
218
|
+
/** @ignore Element the overlay is anchored to (the field box). */
|
|
219
|
+
protected readonly overlayOrigin: _angular_core.WritableSignal<Element | null>;
|
|
220
|
+
/** @ignore Field box width, measured on open. */
|
|
221
|
+
protected readonly overlayWidth: _angular_core.WritableSignal<number | null>;
|
|
222
|
+
/** @ignore Current filter text. */
|
|
223
|
+
protected readonly filterValue: _angular_core.WritableSignal<string>;
|
|
224
|
+
/** @ignore Raw text typed in the editable trigger (`null` when not typing) — filters the list. */
|
|
225
|
+
protected readonly editableQuery: _angular_core.WritableSignal<string | null>;
|
|
226
|
+
/** @ignore Index of the visually focused option among the visible options (-1 = none). */
|
|
227
|
+
protected readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
228
|
+
/** @ignore Type-ahead buffer. */
|
|
229
|
+
private searchBuffer;
|
|
230
|
+
/** @ignore */
|
|
231
|
+
private searchTimeout;
|
|
232
|
+
constructor();
|
|
233
|
+
/** @ignore Effective free-text mode (`multiple` wins over `editable`). */
|
|
234
|
+
protected readonly isEditable: _angular_core.Signal<boolean>;
|
|
235
|
+
/** @ignore */
|
|
236
|
+
protected readonly listboxId: _angular_core.Signal<string>;
|
|
237
|
+
/** @ignore Icon size aligned with the field size. */
|
|
238
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
239
|
+
/** @ignore Flat, unfiltered entries (no groups). */
|
|
240
|
+
private readonly flatEntries;
|
|
241
|
+
/** @ignore Unfiltered groups (when `group` is enabled). */
|
|
242
|
+
private readonly groupEntries;
|
|
243
|
+
/** @ignore Normalized filter text ('' = no filtering). */
|
|
244
|
+
private readonly normalizedFilter;
|
|
245
|
+
/** @ignore Normalized editable-typing text ('' = no filtering). */
|
|
246
|
+
private readonly normalizedEditableQuery;
|
|
247
|
+
/** @ignore Rendered rows: filtered options + their group headers, with stable ids. */
|
|
248
|
+
protected readonly visibleRows: _angular_core.Signal<SelectRow[]>;
|
|
249
|
+
/** @ignore Visible option rows only (visual-focus / type-ahead space). */
|
|
250
|
+
protected readonly visibleOptions: _angular_core.Signal<{
|
|
251
|
+
kind: "option";
|
|
252
|
+
key: string;
|
|
253
|
+
id: string;
|
|
254
|
+
index: number;
|
|
255
|
+
entry: SelectEntry;
|
|
256
|
+
selected: boolean;
|
|
257
|
+
}[]>;
|
|
258
|
+
/** @ignore aria-setsize of the visible listbox. */
|
|
259
|
+
protected readonly optionCount: _angular_core.Signal<number>;
|
|
260
|
+
/** @ignore trackBy of the virtual list. */
|
|
261
|
+
protected readonly trackRow: (_: number, row: SelectRow) => string;
|
|
262
|
+
/** @ignore Empty state: no option at all, or nothing matches the filter / typed text. */
|
|
263
|
+
protected readonly emptyLabel: _angular_core.Signal<string>;
|
|
264
|
+
/** @ignore Selected values as an array (whatever the mode). */
|
|
265
|
+
private readonly selectedValues;
|
|
266
|
+
/** @ignore Selected options resolved against the (unfiltered) entries. Falls back to the raw value. */
|
|
267
|
+
protected readonly selectedEntries: _angular_core.Signal<SelectEntry[]>;
|
|
268
|
+
/** @ignore A value is currently set. */
|
|
269
|
+
protected readonly hasValue: _angular_core.Signal<boolean>;
|
|
270
|
+
/** @ignore Selected entries actually rendered in the trigger (`maxSelectedLabels` cap). */
|
|
271
|
+
protected readonly displayedSelectedEntries: _angular_core.Signal<SelectEntry[]>;
|
|
272
|
+
/** @ignore Number of selected items collapsed behind the overflow indicator. */
|
|
273
|
+
protected readonly overflowCount: _angular_core.Signal<number>;
|
|
274
|
+
/** @ignore Rendered overflow indicator (e.g. `(+2 autres)`). */
|
|
275
|
+
protected readonly overflowText: _angular_core.Signal<string>;
|
|
276
|
+
/** @ignore Contexts handed to the `#selectedItem` template (one per displayed selection). */
|
|
277
|
+
protected readonly selectedItemContexts: _angular_core.Signal<SelectSelectedItemContext<T>[]>;
|
|
278
|
+
/** @ignore Text rendered in the trigger (and in the editable input). */
|
|
279
|
+
protected readonly selectedLabel: _angular_core.Signal<string>;
|
|
280
|
+
/** @ignore The clear action is shown. */
|
|
281
|
+
protected readonly showClearButton: _angular_core.Signal<boolean>;
|
|
282
|
+
/** @ignore id of the visually focused option (for aria-activedescendant). */
|
|
283
|
+
protected readonly activeDescendant: _angular_core.Signal<string | null>;
|
|
284
|
+
/** @ignore Below the trigger, flipping above when `autoFlip` and space is lacking. */
|
|
285
|
+
protected readonly overlayPositions: _angular_core.Signal<_angular_cdk_overlay.ConnectedPosition[]>;
|
|
286
|
+
/** @ignore Panel width: `panelWidth` when set, the field width otherwise. */
|
|
287
|
+
protected readonly panelStyleWidth: _angular_core.Signal<string | null>;
|
|
288
|
+
/** @ignore `panelWidth="auto"`: the field width becomes a floor, the content sets the rest. */
|
|
289
|
+
protected readonly panelStyleMinWidth: _angular_core.Signal<string | null>;
|
|
290
|
+
/** @ignore Concrete viewport height (px) for the virtual scroller. */
|
|
291
|
+
protected readonly viewportHeight: _angular_core.Signal<string>;
|
|
292
|
+
/** @ignore `scrollHeight` parsed to px, with size-based defaults (matches the SCSS). */
|
|
293
|
+
private readonly scrollHeightPx;
|
|
294
|
+
writeValue(value: SelectValue<T>): void;
|
|
295
|
+
/** Moves focus to the trigger. */
|
|
296
|
+
focus(options?: FocusOptions): void;
|
|
297
|
+
open(): void;
|
|
298
|
+
close(focusTrigger?: boolean): void;
|
|
299
|
+
/** @ignore */
|
|
300
|
+
protected toggle(): void;
|
|
301
|
+
/** @ignore First visually focused option when the panel opens. */
|
|
302
|
+
private initialFocusIndex;
|
|
303
|
+
/**
|
|
304
|
+
* @ignore Post-open work once the overlay is attached: focus the filter,
|
|
305
|
+
* scroll the focused option into view (the virtual viewport is re-measured
|
|
306
|
+
* by its own effect). `setTimeout` (not rAF) so it also runs in
|
|
307
|
+
* throttled/background tabs.
|
|
308
|
+
*/
|
|
309
|
+
private queueAfterOpen;
|
|
310
|
+
/** @ignore Container click: open (button mode) or toggle from the chevron (editable mode). */
|
|
311
|
+
protected onContainerClick(event: MouseEvent): void;
|
|
312
|
+
/** @ignore Clear action (does not bubble to the container, which would re-open). */
|
|
313
|
+
protected onClearClick(event: MouseEvent): void;
|
|
314
|
+
/** Clears the value. */
|
|
315
|
+
clear(): void;
|
|
316
|
+
/**
|
|
317
|
+
* @ignore Editable mode: typing sets the value directly (view → form) and
|
|
318
|
+
* surfaces the matching options (the panel opens and filters as you type).
|
|
319
|
+
*/
|
|
320
|
+
protected onEditableInput(event: Event): void;
|
|
321
|
+
/** Deselects one value (`multiple`) or clears the value (single). */
|
|
322
|
+
removeValue(value: unknown): void;
|
|
323
|
+
/** @ignore */
|
|
324
|
+
protected onTriggerFocus(event: FocusEvent): void;
|
|
325
|
+
/** @ignore Mark touched when focus leaves the component (trigger → outside, not into the panel). */
|
|
326
|
+
protected onTriggerBlur(event: FocusEvent): void;
|
|
327
|
+
/** @ignore Keyboard on the trigger (combobox pattern). */
|
|
328
|
+
protected onTriggerKeydown(event: KeyboardEvent): void;
|
|
329
|
+
/** @ignore Keyboard inside the filter input (navigation delegated, typing kept native). */
|
|
330
|
+
protected onFilterKeydown(event: KeyboardEvent): void;
|
|
331
|
+
/**
|
|
332
|
+
* @ignore Shared open/navigate/select/close keys. Returns true when handled.
|
|
333
|
+
* Focus stays on the trigger / filter input; options are focused visually
|
|
334
|
+
* through `aria-activedescendant`.
|
|
335
|
+
*/
|
|
336
|
+
private handleNavigationKey;
|
|
337
|
+
/** @ignore */
|
|
338
|
+
protected onOptionClick(row: Extract<SelectRow, {
|
|
339
|
+
kind: 'option';
|
|
340
|
+
}>, event: Event): void;
|
|
341
|
+
/** @ignore Keep the focus on the trigger / filter input when clicking an option. */
|
|
342
|
+
protected onOptionMousedown(event: MouseEvent): void;
|
|
343
|
+
/** @ignore */
|
|
344
|
+
protected onOptionMouseEnter(row: Extract<SelectRow, {
|
|
345
|
+
kind: 'option';
|
|
346
|
+
}>): void;
|
|
347
|
+
/** @ignore Select (single) or toggle (multiple) an option. */
|
|
348
|
+
private selectRow;
|
|
349
|
+
/** @ignore */
|
|
350
|
+
private selectFocused;
|
|
351
|
+
/** @ignore Propagate a user-driven value change (view → form). */
|
|
352
|
+
private commit;
|
|
353
|
+
/** @ignore Move the visual focus, skipping disabled options (no wrap). */
|
|
354
|
+
private moveFocus;
|
|
355
|
+
/** @ignore Focus the first (`1`) or last (`-1`) enabled option. */
|
|
356
|
+
private focusEdge;
|
|
357
|
+
/** @ignore Apply a visual-focus move (+ select-on-focus, + scroll into view). */
|
|
358
|
+
private setFocusedIndex;
|
|
359
|
+
/** @ignore Keep the visually focused option visible ('auto' — smooth is unreliable in throttled tabs). */
|
|
360
|
+
private scrollFocusedIntoView;
|
|
361
|
+
/** @ignore Accumulate printable characters and focus the first matching option. */
|
|
362
|
+
private searchOption;
|
|
363
|
+
/** @ignore */
|
|
364
|
+
private clearSearchBuffer;
|
|
365
|
+
/** @ignore */
|
|
366
|
+
protected onFilterInput(event: Event): void;
|
|
367
|
+
/** @ignore An entry passes the current filter(s): panel filter and/or editable typing. */
|
|
368
|
+
private matchesFilter;
|
|
369
|
+
/** @ignore Case- and diacritics-insensitive comparison text. */
|
|
370
|
+
private normalize;
|
|
371
|
+
/** @ignore Shared option resolution (see `option-resolver.ts`). */
|
|
372
|
+
private readonly resolver;
|
|
373
|
+
/** @ignore */
|
|
374
|
+
private toEntry;
|
|
375
|
+
/** @ignore Read a (dot-path) field from an object. */
|
|
376
|
+
private getField;
|
|
377
|
+
/** @ignore */
|
|
378
|
+
private resolveValue;
|
|
379
|
+
/** @ignore */
|
|
380
|
+
private resolveLabel;
|
|
381
|
+
/** @ignore */
|
|
382
|
+
private asText;
|
|
383
|
+
/** @ignore Whether a resolved value is part of the current model. */
|
|
384
|
+
private isValueSelected;
|
|
385
|
+
/** @ignore Value equality — by `dataKey` for objects, strict otherwise. */
|
|
386
|
+
private equals;
|
|
387
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSelect<any>, never>;
|
|
388
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSelect<any>, "ui-select", never, { "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; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "optionGroupLabel": { "alias": "optionGroupLabel"; "required": false; "isSignal": true; }; "optionGroupChildren": { "alias": "optionGroupChildren"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "checkmark": { "alias": "checkmark"; "required": false; "isSignal": true; }; "checkbox": { "alias": "checkbox"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "overflowLabel": { "alias": "overflowLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "filterAriaLabel": { "alias": "filterAriaLabel"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "autofocusFilter": { "alias": "autofocusFilter"; "required": false; "isSignal": true; }; "resetFilterOnHide": { "alias": "resetFilterOnHide"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "autoOptionFocus": { "alias": "autoOptionFocus"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "focusOnHover": { "alias": "focusOnHover"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "autoFlip": { "alias": "autoFlip"; "required": false; "isSignal": true; }; "panelStyleClass": { "alias": "panelStyleClass"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; "cleared": "cleared"; "filterChange": "filterChange"; "lazyLoad": "lazyLoad"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["itemTemplate", "selectedItemTemplate", "groupTemplate", "headerTemplate", "footerTemplate", "emptyTemplate"], never, true, never>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export { UiSelect };
|
|
392
|
+
export type { SelectFilterEvent, SelectGroupContext, SelectItemContext, SelectLazyLoadEvent, SelectSelectedItemContext, SelectValue };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
type SeparatorVariant = 'solid' | 'dashed';
|
|
5
|
+
type SeparatorSize = 'default' | 'small';
|
|
6
|
+
type SeparatorLabelAlign = 'start' | 'center' | 'end';
|
|
7
|
+
/**
|
|
8
|
+
* ui-separator — visual + semantic divider between content.
|
|
9
|
+
*
|
|
10
|
+
* Headless: renders a `role="separator"` element whose rule(s) come from CSS/tokens.
|
|
11
|
+
* A `label` (optional) turns it into a labelled divider; `labelAlign` places the text at
|
|
12
|
+
* the start, center or end of the line. The line style is driven by `variant` (solid/dashed)
|
|
13
|
+
* and its thickness by `size` (default 2px / small 1px).
|
|
14
|
+
*/
|
|
15
|
+
declare class UiSeparator {
|
|
16
|
+
/** Optional text label (turns the rule into a labelled divider). */
|
|
17
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
18
|
+
/** Orientation of the rule (maps to the Figma `Axe` property). */
|
|
19
|
+
orientation: _angular_core.InputSignal<SeparatorOrientation>;
|
|
20
|
+
/** Line style (maps to the Figma `Type`: Default → solid, Dashed → dashed). */
|
|
21
|
+
variant: _angular_core.InputSignal<SeparatorVariant>;
|
|
22
|
+
/** Line thickness (default 2px, small 1px). */
|
|
23
|
+
size: _angular_core.InputSignal<SeparatorSize>;
|
|
24
|
+
/** Label placement along the line (maps to Figma `Label Align`: Default/Middle/End). */
|
|
25
|
+
labelAlign: _angular_core.InputSignal<SeparatorLabelAlign>;
|
|
26
|
+
/** Accessible name override (defaults to `label` when present). */
|
|
27
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
28
|
+
/** @ignore A label is provided. */
|
|
29
|
+
protected readonly hasLabel: _angular_core.Signal<boolean>;
|
|
30
|
+
/** @ignore A line segment precedes the label (center/end alignment). */
|
|
31
|
+
protected readonly lineBeforeLabel: _angular_core.Signal<boolean>;
|
|
32
|
+
/** @ignore A line segment follows the label (center/start alignment). */
|
|
33
|
+
protected readonly lineAfterLabel: _angular_core.Signal<boolean>;
|
|
34
|
+
/** @ignore Accessible name: explicit override, else the visible label. */
|
|
35
|
+
protected readonly accessibleName: _angular_core.Signal<string | null>;
|
|
36
|
+
/** @ignore */
|
|
37
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
38
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSeparator, never>;
|
|
39
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSeparator, "ui-separator", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "labelAlign": { "alias": "labelAlign"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { UiSeparator };
|
|
43
|
+
export type { SeparatorLabelAlign, SeparatorOrientation, SeparatorSize, SeparatorVariant };
|