@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,386 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, inject, ElementRef, DestroyRef, viewChildren, signal, computed, afterNextRender, afterRenderEffect, untracked, isDevMode, effect, forwardRef, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
6
|
+
import { UiIcon } from '@4sh/ui-kit/ui-icon';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ui-segment-control — headless segmented control for choosing one (or, with
|
|
10
|
+
* `multiple`, several) value(s) from a short list of inline buttons.
|
|
11
|
+
*
|
|
12
|
+
* Each segment is a real native `<button>`; the group carries WAI-ARIA semantics
|
|
13
|
+
* (`radiogroup`/`radio` in single mode with roving arrow-key navigation and
|
|
14
|
+
* select-on-arrow, `group`/`aria-pressed` in `multiple` mode) so keyboard and
|
|
15
|
+
* screen-reader support come for free. Interactive states (hover/focus/pressed/
|
|
16
|
+
* disabled) are pure CSS driven by the `actions.*` design tokens.
|
|
17
|
+
*
|
|
18
|
+
* In single mode a sliding indicator glides under the selected segment, timed by
|
|
19
|
+
* the shared motion system (honours reduced-motion and the `motion` opt-out).
|
|
20
|
+
*
|
|
21
|
+
* Works standalone, with `[(ngModel)]`, reactive forms, or signal forms
|
|
22
|
+
* (`[formField]`) — it is a `ControlValueAccessor`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <ui-segment-control [(ngModel)]="view" [options]="['Liste', 'Grille']" />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
class UiSegmentControl extends BaseFieldControl {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
/** Options to display, one button each. Primitives, objects, or `SegmentControlOption`. */
|
|
33
|
+
this.options = input([], /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Field name to read a label from, when options are objects. */
|
|
36
|
+
this.optionLabel = input(/* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [undefined, { debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Field name to read the value from, when options are objects. */
|
|
39
|
+
this.optionValue = input(/* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [undefined, { debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Field name to read the disabled flag from, when options are objects. */
|
|
42
|
+
this.optionDisabled = input(/* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [undefined, { debugName: "optionDisabled" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Field name to read an icon name from, when options are objects. */
|
|
45
|
+
this.optionIcon = input(/* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [undefined, { debugName: "optionIcon" }] : /* istanbul ignore next */ []));
|
|
47
|
+
/** Property used to compare object values for equality (selection matching). */
|
|
48
|
+
this.dataKey = input(/* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [undefined, { debugName: "dataKey" }] : /* istanbul ignore next */ []));
|
|
50
|
+
/** Allow selecting several values at once (the model becomes an array). */
|
|
51
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
52
|
+
/** Whether the selection can be fully cleared (single) / emptied (multiple). */
|
|
53
|
+
this.allowEmpty = input(true, { ...(ngDevMode ? { debugName: "allowEmpty" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
54
|
+
/** Size. */
|
|
55
|
+
this.size = input('default', /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
57
|
+
/** Layout axis (drives which arrow keys navigate). */
|
|
58
|
+
this.orientation = input('horizontal', /* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
60
|
+
/** Span the full width of the parent (segments share the width evenly). */
|
|
61
|
+
this.fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
62
|
+
/** Animate the sliding indicator (honours reduced-motion regardless). */
|
|
63
|
+
this.motion = input(true, { ...(ngDevMode ? { debugName: "motion" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
64
|
+
/** Custom template for a segment's content (receives `{ $implicit, option, selected, index }`). */
|
|
65
|
+
this.itemTemplate = input(/* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [undefined, { debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
67
|
+
/** Emitted on user selection with the new model value. */
|
|
68
|
+
this.selectionChange = output();
|
|
69
|
+
/** Emitted when a segment is clicked (even if it does not change the value). */
|
|
70
|
+
this.optionClick = output();
|
|
71
|
+
/** @ignore */
|
|
72
|
+
this.host = inject(ElementRef);
|
|
73
|
+
/** @ignore */
|
|
74
|
+
this.hostDestroyRef = inject(DestroyRef);
|
|
75
|
+
/** @ignore Native segment buttons (for roving focus + indicator measurement). */
|
|
76
|
+
this.optionEls = viewChildren('optionBtn', /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "optionEls" }] : /* istanbul ignore next */ []));
|
|
78
|
+
/** @ignore Current model value (written by the form or by user selection).
|
|
79
|
+
* Redeclared over the base signal to keep `null` (not `undefined`) as the empty value. */
|
|
80
|
+
this.modelValue = signal(null, /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "modelValue" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/** @ignore Index the roving focus last landed on. */
|
|
83
|
+
this.focusedIndex = signal(0, /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
|
|
85
|
+
/** @ignore Measured geometry of the sliding indicator (null until first measure). */
|
|
86
|
+
this.thumb = signal(null, /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "thumb" }] : /* istanbul ignore next */ []));
|
|
88
|
+
/** @ignore Bumped by the ResizeObserver to re-measure the indicator. */
|
|
89
|
+
this.resizeTick = signal(0, /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "resizeTick" }] : /* istanbul ignore next */ []));
|
|
91
|
+
/** @ignore Icon size derived from the control size. */
|
|
92
|
+
this.iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'default'), /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
94
|
+
/** @ignore Options resolved to a flat, render-ready shape. */
|
|
95
|
+
this.normalizedOptions = computed(() => {
|
|
96
|
+
const raw = this.options() ?? [];
|
|
97
|
+
const model = this.modelValue();
|
|
98
|
+
const groupDisabled = this.isDisabled();
|
|
99
|
+
return raw.map((option, index) => {
|
|
100
|
+
const value = this.resolveValue(option);
|
|
101
|
+
const label = this.resolveLabel(option);
|
|
102
|
+
return {
|
|
103
|
+
key: `${this.uid}-${index}`,
|
|
104
|
+
index,
|
|
105
|
+
value,
|
|
106
|
+
label,
|
|
107
|
+
icon: this.resolveIcon(option),
|
|
108
|
+
ariaLabel: this.resolveAriaLabel(option),
|
|
109
|
+
disabled: groupDisabled || this.resolveDisabled(option),
|
|
110
|
+
selected: this.isValueSelected(value, model),
|
|
111
|
+
original: option,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "normalizedOptions" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/** @ignore Index of the selected segment in single mode (-1 if none / multiple). */
|
|
117
|
+
this.selectedIndex = computed(() => this.multiple() ? -1 : this.normalizedOptions().findIndex((o) => o.selected), /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
119
|
+
/** @ignore Whether the sliding indicator should render. */
|
|
120
|
+
this.showThumb = computed(() => !this.multiple() && this.selectedIndex() !== -1 && this.thumb() !== null, /* @ts-ignore */
|
|
121
|
+
...(ngDevMode ? [{ debugName: "showThumb" }] : /* istanbul ignore next */ []));
|
|
122
|
+
/** @ignore CSS transform positioning the indicator over the selected segment. */
|
|
123
|
+
this.thumbTransform = computed(() => {
|
|
124
|
+
const t = this.thumb();
|
|
125
|
+
return t ? `translate(${t.x}px, ${t.y}px)` : null;
|
|
126
|
+
}, /* @ts-ignore */
|
|
127
|
+
...(ngDevMode ? [{ debugName: "thumbTransform" }] : /* istanbul ignore next */ []));
|
|
128
|
+
/** @ignore Segment that owns the group's single tab stop (roving tabindex). */
|
|
129
|
+
this.rovingIndex = computed(() => {
|
|
130
|
+
const opts = this.normalizedOptions();
|
|
131
|
+
if (!opts.length)
|
|
132
|
+
return -1;
|
|
133
|
+
if (!this.multiple()) {
|
|
134
|
+
const selected = opts.findIndex((o) => o.selected && !o.disabled);
|
|
135
|
+
if (selected !== -1)
|
|
136
|
+
return selected;
|
|
137
|
+
}
|
|
138
|
+
const focused = this.focusedIndex();
|
|
139
|
+
if (opts[focused] && !opts[focused].disabled)
|
|
140
|
+
return focused;
|
|
141
|
+
return opts.findIndex((o) => !o.disabled);
|
|
142
|
+
}, /* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
|
|
144
|
+
// Re-measure the sliding indicator whenever the observed geometry changes.
|
|
145
|
+
afterNextRender(() => {
|
|
146
|
+
const ro = new ResizeObserver(() => this.resizeTick.update((v) => v + 1));
|
|
147
|
+
ro.observe(this.host.nativeElement);
|
|
148
|
+
this.hostDestroyRef.onDestroy(() => ro.disconnect());
|
|
149
|
+
});
|
|
150
|
+
// Track the selected segment with the indicator (single mode only).
|
|
151
|
+
afterRenderEffect(() => {
|
|
152
|
+
const index = this.selectedIndex();
|
|
153
|
+
this.resizeTick();
|
|
154
|
+
// Track layout-affecting inputs so the indicator follows re-layouts.
|
|
155
|
+
this.size();
|
|
156
|
+
this.orientation();
|
|
157
|
+
this.fluid();
|
|
158
|
+
this.normalizedOptions();
|
|
159
|
+
if (this.multiple() || index === -1)
|
|
160
|
+
return;
|
|
161
|
+
const el = this.optionEls()[index]?.nativeElement;
|
|
162
|
+
const track = this.host.nativeElement;
|
|
163
|
+
if (!el)
|
|
164
|
+
return;
|
|
165
|
+
const next = {
|
|
166
|
+
x: el.offsetLeft - track.clientLeft,
|
|
167
|
+
y: el.offsetTop - track.clientTop,
|
|
168
|
+
w: el.offsetWidth,
|
|
169
|
+
h: el.offsetHeight,
|
|
170
|
+
};
|
|
171
|
+
const cur = untracked(this.thumb);
|
|
172
|
+
if (!cur || cur.x !== next.x || cur.y !== next.y || cur.w !== next.w || cur.h !== next.h) {
|
|
173
|
+
this.thumb.set(next);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
// A11y safeguards (dev only).
|
|
177
|
+
if (isDevMode()) {
|
|
178
|
+
effect(() => {
|
|
179
|
+
if (!this.ariaLabel() && !this.ariaLabelledBy()) {
|
|
180
|
+
console.warn('[ui-segment-control] Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).');
|
|
181
|
+
}
|
|
182
|
+
const iconOnly = this.normalizedOptions().some((o) => o.icon && !o.label && !o.ariaLabel);
|
|
183
|
+
if (iconOnly) {
|
|
184
|
+
console.warn('[ui-segment-control] Icon-only segment has no accessible name: add `ariaLabel` on the option.');
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** @ignore */
|
|
190
|
+
uidPrefix() {
|
|
191
|
+
return 'ui-segment-control';
|
|
192
|
+
}
|
|
193
|
+
/** Move focus to the group's current tab stop. */
|
|
194
|
+
focus(options) {
|
|
195
|
+
const index = this.rovingIndex();
|
|
196
|
+
if (index !== -1)
|
|
197
|
+
this.optionEls()[index]?.nativeElement.focus(options);
|
|
198
|
+
}
|
|
199
|
+
/** @ignore The tabindex for a given segment (roving: one 0, the rest -1). */
|
|
200
|
+
tabindexFor(index) {
|
|
201
|
+
return index === this.rovingIndex() ? 0 : -1;
|
|
202
|
+
}
|
|
203
|
+
/** @ignore Select (or toggle / clear) a segment on user interaction. */
|
|
204
|
+
select(option, event) {
|
|
205
|
+
if (option.disabled || this.readonly())
|
|
206
|
+
return;
|
|
207
|
+
const value = option.value;
|
|
208
|
+
let next;
|
|
209
|
+
if (this.multiple()) {
|
|
210
|
+
const current = Array.isArray(this.modelValue()) ? [...this.modelValue()] : [];
|
|
211
|
+
const at = current.findIndex((v) => this.equals(v, value));
|
|
212
|
+
if (at !== -1) {
|
|
213
|
+
if (!this.allowEmpty() && current.length === 1)
|
|
214
|
+
return; // keep at least one
|
|
215
|
+
current.splice(at, 1);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
current.push(value);
|
|
219
|
+
}
|
|
220
|
+
next = current;
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
if (option.selected) {
|
|
224
|
+
if (!this.allowEmpty())
|
|
225
|
+
return; // cannot clear the selection
|
|
226
|
+
next = null;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
next = value;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
this.focusedIndex.set(option.index);
|
|
233
|
+
this.modelValue.set(next);
|
|
234
|
+
this.emitChange(next);
|
|
235
|
+
this.selectionChange.emit(next);
|
|
236
|
+
this.optionClick.emit({ option: option.original, value, index: option.index, originalEvent: event });
|
|
237
|
+
}
|
|
238
|
+
/** @ignore */
|
|
239
|
+
onOptionFocus(index) {
|
|
240
|
+
this.focusedIndex.set(index);
|
|
241
|
+
}
|
|
242
|
+
/** @ignore Roving focus (and select-on-arrow in single mode). */
|
|
243
|
+
onKeydown(event) {
|
|
244
|
+
const horizontal = this.orientation() === 'horizontal';
|
|
245
|
+
const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';
|
|
246
|
+
const prevKey = horizontal ? 'ArrowLeft' : 'ArrowUp';
|
|
247
|
+
if (![nextKey, prevKey, 'Home', 'End'].includes(event.key))
|
|
248
|
+
return;
|
|
249
|
+
const opts = this.normalizedOptions();
|
|
250
|
+
const enabled = opts.filter((o) => !o.disabled);
|
|
251
|
+
if (!enabled.length)
|
|
252
|
+
return;
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
let pos = enabled.findIndex((o) => o.index === this.focusedIndex());
|
|
255
|
+
if (pos === -1)
|
|
256
|
+
pos = 0;
|
|
257
|
+
switch (event.key) {
|
|
258
|
+
case nextKey:
|
|
259
|
+
pos = (pos + 1) % enabled.length;
|
|
260
|
+
break;
|
|
261
|
+
case prevKey:
|
|
262
|
+
pos = (pos - 1 + enabled.length) % enabled.length;
|
|
263
|
+
break;
|
|
264
|
+
case 'Home':
|
|
265
|
+
pos = 0;
|
|
266
|
+
break;
|
|
267
|
+
case 'End':
|
|
268
|
+
pos = enabled.length - 1;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
const target = enabled[pos];
|
|
272
|
+
this.focusedIndex.set(target.index);
|
|
273
|
+
this.optionEls()[target.index]?.nativeElement.focus();
|
|
274
|
+
// Single mode follows the radio pattern: arrows move AND select.
|
|
275
|
+
if (!this.multiple())
|
|
276
|
+
this.select(target, event);
|
|
277
|
+
}
|
|
278
|
+
/** @ignore Mark touched when focus leaves the whole group. */
|
|
279
|
+
onFocusOut(event) {
|
|
280
|
+
const next = event.relatedTarget;
|
|
281
|
+
if (!next || !this.host.nativeElement.contains(next))
|
|
282
|
+
this.emitTouch();
|
|
283
|
+
}
|
|
284
|
+
// --- Option resolution -------------------------------------------------
|
|
285
|
+
/** @ignore */
|
|
286
|
+
isObject(option) {
|
|
287
|
+
return typeof option === 'object' && option !== null;
|
|
288
|
+
}
|
|
289
|
+
/** @ignore */
|
|
290
|
+
resolveValue(option) {
|
|
291
|
+
const field = this.optionValue();
|
|
292
|
+
if (field && this.isObject(option))
|
|
293
|
+
return option[field];
|
|
294
|
+
if (this.isObject(option) && 'value' in option)
|
|
295
|
+
return option['value'];
|
|
296
|
+
return option;
|
|
297
|
+
}
|
|
298
|
+
/** @ignore */
|
|
299
|
+
resolveLabel(option) {
|
|
300
|
+
const field = this.optionLabel();
|
|
301
|
+
if (field && this.isObject(option))
|
|
302
|
+
return this.asText(option[field]);
|
|
303
|
+
if (this.isObject(option))
|
|
304
|
+
return 'label' in option ? this.asText(option['label']) : null;
|
|
305
|
+
return this.asText(option);
|
|
306
|
+
}
|
|
307
|
+
/** @ignore */
|
|
308
|
+
resolveIcon(option) {
|
|
309
|
+
const field = this.optionIcon();
|
|
310
|
+
if (field && this.isObject(option))
|
|
311
|
+
return this.asText(option[field]);
|
|
312
|
+
if (this.isObject(option) && 'icon' in option)
|
|
313
|
+
return this.asText(option['icon']);
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
/** @ignore */
|
|
317
|
+
resolveAriaLabel(option) {
|
|
318
|
+
if (this.isObject(option) && 'ariaLabel' in option)
|
|
319
|
+
return this.asText(option['ariaLabel']);
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
/** @ignore */
|
|
323
|
+
resolveDisabled(option) {
|
|
324
|
+
const field = this.optionDisabled();
|
|
325
|
+
if (field && this.isObject(option))
|
|
326
|
+
return !!option[field];
|
|
327
|
+
if (this.isObject(option) && 'disabled' in option)
|
|
328
|
+
return !!option['disabled'];
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
/** @ignore */
|
|
332
|
+
asText(value) {
|
|
333
|
+
return value === null || value === undefined ? null : String(value);
|
|
334
|
+
}
|
|
335
|
+
/** @ignore Whether a resolved value is part of the current model. */
|
|
336
|
+
isValueSelected(value, model) {
|
|
337
|
+
if (this.multiple()) {
|
|
338
|
+
return Array.isArray(model) && model.some((v) => this.equals(v, value));
|
|
339
|
+
}
|
|
340
|
+
return this.equals(model, value);
|
|
341
|
+
}
|
|
342
|
+
/** @ignore Value equality — by `dataKey` for objects, strict otherwise. */
|
|
343
|
+
equals(a, b) {
|
|
344
|
+
const key = this.dataKey();
|
|
345
|
+
if (key && this.isObject(a) && this.isObject(b))
|
|
346
|
+
return a[key] === b[key];
|
|
347
|
+
return a === b;
|
|
348
|
+
}
|
|
349
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiSegmentControl, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
350
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiSegmentControl, isStandalone: true, selector: "ui-segment-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", optionClick: "optionClick" }, host: { listeners: { "keydown": "onKeydown($event)", "focusout": "onFocusOut($event)" }, properties: { "class._small": "size() === 'small'", "class._vertical": "orientation() === 'vertical'", "class._fluid": "fluid()", "class._multiple": "multiple()", "class._disabled": "isDisabled()", "class._invalid": "isInvalid()", "class._no-motion": "!motion()", "attr.role": "multiple() ? 'group' : 'radiogroup'", "attr.aria-label": "ariaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy() || null", "attr.aria-invalid": "isInvalid() ? 'true' : null", "attr.aria-disabled": "isDisabled() ? 'true' : null" }, classAttribute: "ui-segment-control" }, providers: [
|
|
351
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSegmentControl), multi: true },
|
|
352
|
+
], viewQueries: [{ propertyName: "optionEls", predicate: ["optionBtn"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{ option.label }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--units-xs);gap:0;border-radius:var(--radius-md);box-shadow:inset 0 0 0 var(--stroke-default) var(--global-border-default);font-family:var(--fontfamily-base);-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:2.75rem}:host .ui-segment-control-option{min-height:2.25rem;min-width:2.25rem;padding:0 var(--units-default);font-size:var(--size-typography-text-default)}:host._small{min-height:2.5rem}:host._small .ui-segment-control-option{min-height:2rem;min-width:2rem;padding:0 var(--units-md);font-size:var(--size-typography-text-md)}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--radius-sm);background-color:var(--actions-high-surface-default);pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--weight-bold);visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--units-sm);box-sizing:border-box;border:0;border-radius:var(--radius-sm);background-color:transparent;color:var(--actions-low-content-default);font-family:inherit;font-weight:var(--weight-regular);line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--actions-low-surface-hover);color:var(--actions-low-content-hover)}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--actions-low-surface-pressed);color:var(--actions-low-content-pressed)}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--actions-low-stroke-focused)}.ui-segment-control-option._selected{color:var(--actions-high-content-default);font-weight:var(--weight-bold)}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--units-2xs) var(--actions-high-stroke-focused)}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--actions-low-content-disabled)}.ui-segment-control-option:disabled._selected{color:var(--actions-high-content-disabled)}:host._multiple .ui-segment-control-option._selected{background-color:var(--actions-high-surface-default)}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--actions-high-surface-hover);color:var(--actions-high-content-hover)}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--actions-high-surface-pressed);color:var(--actions-high-content-pressed)}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--actions-high-surface-disabled)}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--stroke-default) var(--form-error-stroke-default)}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--actions-high-surface-disabled)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
353
|
+
}
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiSegmentControl, decorators: [{
|
|
355
|
+
type: Component,
|
|
356
|
+
args: [{ selector: 'ui-segment-control', imports: [UiIcon, NgTemplateOutlet], providers: [
|
|
357
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSegmentControl), multi: true },
|
|
358
|
+
], host: {
|
|
359
|
+
class: 'ui-segment-control',
|
|
360
|
+
'[class._small]': "size() === 'small'",
|
|
361
|
+
'[class._vertical]': "orientation() === 'vertical'",
|
|
362
|
+
'[class._fluid]': 'fluid()',
|
|
363
|
+
'[class._multiple]': 'multiple()',
|
|
364
|
+
'[class._disabled]': 'isDisabled()',
|
|
365
|
+
'[class._invalid]': 'isInvalid()',
|
|
366
|
+
'[class._no-motion]': '!motion()',
|
|
367
|
+
'[attr.role]': "multiple() ? 'group' : 'radiogroup'",
|
|
368
|
+
'[attr.aria-label]': 'ariaLabel() || null',
|
|
369
|
+
'[attr.aria-labelledby]': 'ariaLabelledBy() || null',
|
|
370
|
+
'[attr.aria-invalid]': "isInvalid() ? 'true' : null",
|
|
371
|
+
'[attr.aria-disabled]': "isDisabled() ? 'true' : null",
|
|
372
|
+
'(keydown)': 'onKeydown($event)',
|
|
373
|
+
'(focusout)': 'onFocusOut($event)',
|
|
374
|
+
}, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{ option.label }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--units-xs);gap:0;border-radius:var(--radius-md);box-shadow:inset 0 0 0 var(--stroke-default) var(--global-border-default);font-family:var(--fontfamily-base);-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:2.75rem}:host .ui-segment-control-option{min-height:2.25rem;min-width:2.25rem;padding:0 var(--units-default);font-size:var(--size-typography-text-default)}:host._small{min-height:2.5rem}:host._small .ui-segment-control-option{min-height:2rem;min-width:2rem;padding:0 var(--units-md);font-size:var(--size-typography-text-md)}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--radius-sm);background-color:var(--actions-high-surface-default);pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--weight-bold);visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--units-sm);box-sizing:border-box;border:0;border-radius:var(--radius-sm);background-color:transparent;color:var(--actions-low-content-default);font-family:inherit;font-weight:var(--weight-regular);line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--actions-low-surface-hover);color:var(--actions-low-content-hover)}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--actions-low-surface-pressed);color:var(--actions-low-content-pressed)}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--actions-low-stroke-focused)}.ui-segment-control-option._selected{color:var(--actions-high-content-default);font-weight:var(--weight-bold)}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--units-2xs) var(--actions-high-stroke-focused)}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--actions-low-content-disabled)}.ui-segment-control-option:disabled._selected{color:var(--actions-high-content-disabled)}:host._multiple .ui-segment-control-option._selected{background-color:var(--actions-high-surface-default)}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--actions-high-surface-hover);color:var(--actions-high-content-hover)}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--actions-high-surface-pressed);color:var(--actions-high-content-pressed)}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--actions-high-surface-disabled)}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--stroke-default) var(--form-error-stroke-default)}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--actions-high-surface-disabled)}\n"] }]
|
|
375
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], optionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionIcon", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], optionClick: [{ type: i0.Output, args: ["optionClick"] }], optionEls: [{ type: i0.ViewChildren, args: ['optionBtn', { isSignal: true }] }] } });
|
|
376
|
+
|
|
377
|
+
/*
|
|
378
|
+
* Public API Surface of ui-kit/ui-segment-control
|
|
379
|
+
*/
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Generated bundle index. Do not edit.
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
export { UiSegmentControl };
|
|
386
|
+
//# sourceMappingURL=4sh-ui-kit-ui-segment-control.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-ui-segment-control.mjs","sources":["../../../projects/ui-kit/ui-segment-control/src/lib/ui-segment-control.ts","../../../projects/ui-kit/ui-segment-control/src/lib/ui-segment-control.html","../../../projects/ui-kit/ui-segment-control/src/public-api.ts","../../../projects/ui-kit/ui-segment-control/src/4sh-ui-kit-ui-segment-control.ts"],"sourcesContent":["import {\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n effect,\n forwardRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n TemplateRef,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon } from '@4sh/ui-kit/ui-icon';\n\nexport type SegmentControlSize = 'default' | 'small';\nexport type SegmentControlOrientation = 'horizontal' | 'vertical';\n\n/** Selected value: a single value (single mode) or an array (`multiple`). */\nexport type SegmentControlValue<T = unknown> = T | T[] | null;\n\n/**\n * Rich option shape. Options may also be primitives (`string`/`number`) or any\n * object, in which case the `optionLabel` / `optionValue` / `optionDisabled` /\n * `optionIcon` field names tell the control how to read them.\n */\nexport interface SegmentControlOption<T = unknown> {\n /** Text shown inside the segment. */\n label?: string;\n /** Value carried into the model when the segment is selected. */\n value: T;\n /** Leading icon name (design-system icon). */\n icon?: string;\n /** Disables just this segment. */\n disabled?: boolean;\n /** Accessible name (required for an icon-only segment). */\n ariaLabel?: string;\n}\n\n/** Payload emitted when a segment is clicked. */\nexport interface SegmentControlOptionClickEvent<T = unknown> {\n /** The original option (as passed in `options`). */\n option: T;\n /** The resolved value of that option. */\n value: T;\n /** Index of the option in the list. */\n index: number;\n /** Originating DOM event. */\n originalEvent: Event;\n}\n\n/** Context handed to a custom item template. */\nexport interface SegmentControlItemContext<T = unknown> {\n /** The original option (default `$implicit`). */\n $implicit: T;\n /** Same as `$implicit`, named for readability. */\n option: T;\n /** Whether this segment is currently selected. */\n selected: boolean;\n /** Index of the option in the list. */\n index: number;\n}\n\n/** @ignore Internal, normalized view of an option (template + logic source). */\ninterface NormalizedSegment {\n key: string;\n index: number;\n value: unknown;\n label: string | null;\n icon: string | null;\n ariaLabel: string | null;\n disabled: boolean;\n selected: boolean;\n original: unknown;\n}\n\n/** @ignore Measured geometry of the sliding selection indicator. */\ninterface ThumbMetrics {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\n/**\n * ui-segment-control — headless segmented control for choosing one (or, with\n * `multiple`, several) value(s) from a short list of inline buttons.\n *\n * Each segment is a real native `<button>`; the group carries WAI-ARIA semantics\n * (`radiogroup`/`radio` in single mode with roving arrow-key navigation and\n * select-on-arrow, `group`/`aria-pressed` in `multiple` mode) so keyboard and\n * screen-reader support come for free. Interactive states (hover/focus/pressed/\n * disabled) are pure CSS driven by the `actions.*` design tokens.\n *\n * In single mode a sliding indicator glides under the selected segment, timed by\n * the shared motion system (honours reduced-motion and the `motion` opt-out).\n *\n * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms\n * (`[formField]`) — it is a `ControlValueAccessor`.\n *\n * @example\n * ```html\n * <ui-segment-control [(ngModel)]=\"view\" [options]=\"['Liste', 'Grille']\" />\n * ```\n */\n@Component({\n selector: 'ui-segment-control',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-segment-control.html',\n styleUrl: './ui-segment-control.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSegmentControl), multi: true },\n ],\n host: {\n class: 'ui-segment-control',\n '[class._small]': \"size() === 'small'\",\n '[class._vertical]': \"orientation() === 'vertical'\",\n '[class._fluid]': 'fluid()',\n '[class._multiple]': 'multiple()',\n '[class._disabled]': 'isDisabled()',\n '[class._invalid]': 'isInvalid()',\n '[class._no-motion]': '!motion()',\n '[attr.role]': \"multiple() ? 'group' : 'radiogroup'\",\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'ariaLabelledBy() || null',\n '[attr.aria-invalid]': \"isInvalid() ? 'true' : null\",\n '[attr.aria-disabled]': \"isDisabled() ? 'true' : null\",\n '(keydown)': 'onKeydown($event)',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class UiSegmentControl<T = unknown> extends BaseFieldControl<SegmentControlValue<T>> {\n /** Options to display, one button each. Primitives, objects, or `SegmentControlOption`. */\n options = input<readonly (T | SegmentControlOption<T>)[]>([]);\n /** Field name to read a label from, when options are objects. */\n optionLabel = input<string>();\n /** Field name to read the value from, when options are objects. */\n optionValue = input<string>();\n /** Field name to read the disabled flag from, when options are objects. */\n optionDisabled = input<string>();\n /** Field name to read an icon name from, when options are objects. */\n optionIcon = input<string>();\n /** Property used to compare object values for equality (selection matching). */\n dataKey = input<string>();\n /** Allow selecting several values at once (the model becomes an array). */\n multiple = input(false, { transform: booleanAttribute });\n /** Whether the selection can be fully cleared (single) / emptied (multiple). */\n allowEmpty = input(true, { transform: booleanAttribute });\n /** Size. */\n size = input<SegmentControlSize>('default');\n /** Layout axis (drives which arrow keys navigate). */\n orientation = input<SegmentControlOrientation>('horizontal');\n /** Span the full width of the parent (segments share the width evenly). */\n fluid = input(false, { transform: booleanAttribute });\n /** Animate the sliding indicator (honours reduced-motion regardless). */\n motion = input(true, { transform: booleanAttribute });\n /** Custom template for a segment's content (receives `{ $implicit, option, selected, index }`). */\n itemTemplate = input<TemplateRef<SegmentControlItemContext<T>>>();\n\n /** Emitted on user selection with the new model value. */\n selectionChange = output<SegmentControlValue<T>>();\n /** Emitted when a segment is clicked (even if it does not change the value). */\n optionClick = output<SegmentControlOptionClickEvent<T>>();\n\n /** @ignore */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** @ignore */\n private readonly hostDestroyRef = inject(DestroyRef);\n /** @ignore Native segment buttons (for roving focus + indicator measurement). */\n private readonly optionEls = viewChildren<ElementRef<HTMLButtonElement>>('optionBtn');\n /** @ignore Current model value (written by the form or by user selection).\n * Redeclared over the base signal to keep `null` (not `undefined`) as the empty value. */\n protected override readonly modelValue = signal<SegmentControlValue<T>>(null);\n /** @ignore Index the roving focus last landed on. */\n private readonly focusedIndex = signal(0);\n /** @ignore Measured geometry of the sliding indicator (null until first measure). */\n protected readonly thumb = signal<ThumbMetrics | null>(null);\n /** @ignore Bumped by the ResizeObserver to re-measure the indicator. */\n private readonly resizeTick = signal(0);\n\n constructor() {\n super();\n\n // Re-measure the sliding indicator whenever the observed geometry changes.\n afterNextRender(() => {\n const ro = new ResizeObserver(() => this.resizeTick.update((v) => v + 1));\n ro.observe(this.host.nativeElement);\n this.hostDestroyRef.onDestroy(() => ro.disconnect());\n });\n\n // Track the selected segment with the indicator (single mode only).\n afterRenderEffect(() => {\n const index = this.selectedIndex();\n this.resizeTick();\n // Track layout-affecting inputs so the indicator follows re-layouts.\n this.size();\n this.orientation();\n this.fluid();\n this.normalizedOptions();\n\n if (this.multiple() || index === -1) return;\n const el = this.optionEls()[index]?.nativeElement;\n const track = this.host.nativeElement;\n if (!el) return;\n\n const next: ThumbMetrics = {\n x: el.offsetLeft - track.clientLeft,\n y: el.offsetTop - track.clientTop,\n w: el.offsetWidth,\n h: el.offsetHeight,\n };\n const cur = untracked(this.thumb);\n if (!cur || cur.x !== next.x || cur.y !== next.y || cur.w !== next.w || cur.h !== next.h) {\n this.thumb.set(next);\n }\n });\n\n // A11y safeguards (dev only).\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n console.warn(\n '[ui-segment-control] Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n const iconOnly = this.normalizedOptions().some((o) => o.icon && !o.label && !o.ariaLabel);\n if (iconOnly) {\n console.warn(\n '[ui-segment-control] Icon-only segment has no accessible name: add `ariaLabel` on the option.',\n );\n }\n });\n }\n }\n\n /** @ignore Icon size derived from the control size. */\n protected readonly iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'default'));\n\n /** @ignore Options resolved to a flat, render-ready shape. */\n protected readonly normalizedOptions = computed<NormalizedSegment[]>(() => {\n const raw = this.options() ?? [];\n const model = this.modelValue();\n const groupDisabled = this.isDisabled();\n return raw.map((option, index) => {\n const value = this.resolveValue(option);\n const label = this.resolveLabel(option);\n return {\n key: `${this.uid}-${index}`,\n index,\n value,\n label,\n icon: this.resolveIcon(option),\n ariaLabel: this.resolveAriaLabel(option),\n disabled: groupDisabled || this.resolveDisabled(option),\n selected: this.isValueSelected(value, model),\n original: option,\n };\n });\n });\n\n /** @ignore Index of the selected segment in single mode (-1 if none / multiple). */\n protected readonly selectedIndex = computed(() =>\n this.multiple() ? -1 : this.normalizedOptions().findIndex((o) => o.selected),\n );\n\n /** @ignore Whether the sliding indicator should render. */\n protected readonly showThumb = computed(\n () => !this.multiple() && this.selectedIndex() !== -1 && this.thumb() !== null,\n );\n\n /** @ignore CSS transform positioning the indicator over the selected segment. */\n protected readonly thumbTransform = computed(() => {\n const t = this.thumb();\n return t ? `translate(${t.x}px, ${t.y}px)` : null;\n });\n\n /** @ignore Segment that owns the group's single tab stop (roving tabindex). */\n protected readonly rovingIndex = computed(() => {\n const opts = this.normalizedOptions();\n if (!opts.length) return -1;\n if (!this.multiple()) {\n const selected = opts.findIndex((o) => o.selected && !o.disabled);\n if (selected !== -1) return selected;\n }\n const focused = this.focusedIndex();\n if (opts[focused] && !opts[focused].disabled) return focused;\n return opts.findIndex((o) => !o.disabled);\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-segment-control';\n }\n\n /** Move focus to the group's current tab stop. */\n focus(options?: FocusOptions): void {\n const index = this.rovingIndex();\n if (index !== -1) this.optionEls()[index]?.nativeElement.focus(options);\n }\n\n /** @ignore The tabindex for a given segment (roving: one 0, the rest -1). */\n protected tabindexFor(index: number): number {\n return index === this.rovingIndex() ? 0 : -1;\n }\n\n /** @ignore Select (or toggle / clear) a segment on user interaction. */\n protected select(option: NormalizedSegment, event: Event): void {\n if (option.disabled || this.readonly()) return;\n const value = option.value as T;\n\n let next: SegmentControlValue<T>;\n if (this.multiple()) {\n const current = Array.isArray(this.modelValue()) ? [...(this.modelValue() as T[])] : [];\n const at = current.findIndex((v) => this.equals(v, value));\n if (at !== -1) {\n if (!this.allowEmpty() && current.length === 1) return; // keep at least one\n current.splice(at, 1);\n } else {\n current.push(value);\n }\n next = current;\n } else {\n if (option.selected) {\n if (!this.allowEmpty()) return; // cannot clear the selection\n next = null;\n } else {\n next = value;\n }\n }\n\n this.focusedIndex.set(option.index);\n this.modelValue.set(next);\n this.emitChange(next);\n this.selectionChange.emit(next);\n this.optionClick.emit({ option: option.original as T, value, index: option.index, originalEvent: event });\n }\n\n /** @ignore */\n protected onOptionFocus(index: number): void {\n this.focusedIndex.set(index);\n }\n\n /** @ignore Roving focus (and select-on-arrow in single mode). */\n protected onKeydown(event: KeyboardEvent): void {\n const horizontal = this.orientation() === 'horizontal';\n const nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n const prevKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n if (![nextKey, prevKey, 'Home', 'End'].includes(event.key)) return;\n\n const opts = this.normalizedOptions();\n const enabled = opts.filter((o) => !o.disabled);\n if (!enabled.length) return;\n\n event.preventDefault();\n let pos = enabled.findIndex((o) => o.index === this.focusedIndex());\n if (pos === -1) pos = 0;\n\n switch (event.key) {\n case nextKey: pos = (pos + 1) % enabled.length; break;\n case prevKey: pos = (pos - 1 + enabled.length) % enabled.length; break;\n case 'Home': pos = 0; break;\n case 'End': pos = enabled.length - 1; break;\n }\n\n const target = enabled[pos];\n this.focusedIndex.set(target.index);\n this.optionEls()[target.index]?.nativeElement.focus();\n // Single mode follows the radio pattern: arrows move AND select.\n if (!this.multiple()) this.select(target, event);\n }\n\n /** @ignore Mark touched when focus leaves the whole group. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.emitTouch();\n }\n\n // --- Option resolution -------------------------------------------------\n\n /** @ignore */\n private isObject(option: unknown): option is Record<string, unknown> {\n return typeof option === 'object' && option !== null;\n }\n\n /** @ignore */\n private resolveValue(option: unknown): unknown {\n const field = this.optionValue();\n if (field && this.isObject(option)) return option[field];\n if (this.isObject(option) && 'value' in option) return option['value'];\n return option;\n }\n\n /** @ignore */\n private resolveLabel(option: unknown): string | null {\n const field = this.optionLabel();\n if (field && this.isObject(option)) return this.asText(option[field]);\n if (this.isObject(option)) return 'label' in option ? this.asText(option['label']) : null;\n return this.asText(option);\n }\n\n /** @ignore */\n private resolveIcon(option: unknown): string | null {\n const field = this.optionIcon();\n if (field && this.isObject(option)) return this.asText(option[field]);\n if (this.isObject(option) && 'icon' in option) return this.asText(option['icon']);\n return null;\n }\n\n /** @ignore */\n private resolveAriaLabel(option: unknown): string | null {\n if (this.isObject(option) && 'ariaLabel' in option) return this.asText(option['ariaLabel']);\n return null;\n }\n\n /** @ignore */\n private resolveDisabled(option: unknown): boolean {\n const field = this.optionDisabled();\n if (field && this.isObject(option)) return !!option[field];\n if (this.isObject(option) && 'disabled' in option) return !!option['disabled'];\n return false;\n }\n\n /** @ignore */\n private asText(value: unknown): string | null {\n return value === null || value === undefined ? null : String(value);\n }\n\n /** @ignore Whether a resolved value is part of the current model. */\n private isValueSelected(value: unknown, model: SegmentControlValue<T>): boolean {\n if (this.multiple()) {\n return Array.isArray(model) && model.some((v) => this.equals(v, value));\n }\n return this.equals(model, value);\n }\n\n /** @ignore Value equality — by `dataKey` for objects, strict otherwise. */\n private equals(a: unknown, b: unknown): boolean {\n const key = this.dataKey();\n if (key && this.isObject(a) && this.isObject(b)) return a[key] === b[key];\n return a === b;\n }\n}\n","@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{ option.label }}</span>\n }\n }\n </button>\n}\n","/*\n * Public API Surface of ui-kit/ui-segment-control\n */\n\nexport * from './lib/ui-segment-control';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA6FA;;;;;;;;;;;;;;;;;;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