@ids-group-ltd/ids-design-system 0.12.2 → 0.12.3
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/CHANGELOG.md +148 -0
- package/components.md +3 -1
- package/docs/agent/forms/ds-button.md +3 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +20 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +57 -40
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +12 -12
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +17 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/migrations/0.12.3.json +83 -0
- package/package.json +1 -1
- package/styles/_control-line.scss +45 -0
- package/styles/_field-state.scss +14 -15
- package/styles/_focus.scss +31 -60
- package/styles/_tokens.scss +22 -31
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +8 -17
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +26 -29
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +10 -10
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,154 @@ While the package is on `0.x`, minor releases may contain breaking changes.
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 0.12.3 — 2026-09-10
|
|
12
|
+
|
|
13
|
+
### Breaking
|
|
14
|
+
|
|
15
|
+
- **`ds-button`'s `buttonRef` is `controlRef`, and it is typed `HTMLElement`.** The element the
|
|
16
|
+
component renders now follows its destination, so the old name described one of three cases and
|
|
17
|
+
the old type described the same one. Rename the reference; the property behind it is unchanged.
|
|
18
|
+
A read of `.nativeElement` that expects a `<button>` — `.disabled`, `.form`, `.type` — no longer
|
|
19
|
+
type-checks and needs a narrow of your own, because the element may be an `<a>`.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// before
|
|
23
|
+
trigger.buttonRef().nativeElement.focus();
|
|
24
|
+
// after
|
|
25
|
+
trigger.controlRef().nativeElement.focus();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **`ds-button` takes `routerLink` and `href`, so a call-to-action can stay a real link.** Three
|
|
31
|
+
elements, decided by destination: `routerLink` renders an `<a [routerLink]>` that also carries
|
|
32
|
+
`routerLinkActive`, `href` renders a plain `<a href>`, and neither renders the
|
|
33
|
+
`<button type="button">` it always did. Unset — the default — nothing changes.
|
|
34
|
+
|
|
35
|
+
The look is identical across all three, because the styling is class-based rather than keyed to
|
|
36
|
+
the tag. What you get back is what the element decides: middle-click, open-in-new-tab,
|
|
37
|
+
copy-link-address and the `link` role a screen reader announces.
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<ds-button routerLink="/reports" icon="arrowRight">Go to reports</ds-button>
|
|
41
|
+
<ds-button href="https://example.com" variant="outline">Read the spec</ds-button>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`routerLink` takes the shapes a router link takes anywhere, a string or a command array.
|
|
45
|
+
**`type` and `loading` are button-only** and are ignored on a link with a dev-mode warning: an
|
|
46
|
+
anchor has no form to submit, and a navigation cannot be in flight before it starts. `disabled`
|
|
47
|
+
works on all three, but an anchor has no native disabled state, so it takes `aria-disabled` plus
|
|
48
|
+
`tabindex="-1"` — and its click is swallowed, which is what stops an `href` from navigating
|
|
49
|
+
anyway. `disabledReason` reads the same on a link as on a button.
|
|
50
|
+
|
|
51
|
+
- **`ds-checkbox`, `ds-radio` and `ds-switch` take `ariaLabel`.** A control rendered with no
|
|
52
|
+
visible label — no `label`, nothing projected — had no accessible name and nothing a consumer
|
|
53
|
+
could set to give it one, while `ds-select` and `ds-number-stepper` had taken this input all
|
|
54
|
+
along. The row's `<label>` collapses when empty, so on a bare box the `aria-label` is the whole
|
|
55
|
+
name.
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<ds-checkbox ariaLabel="Select all rows" />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
It applies only when there is no visible label; set it beside one and it overrides what the label
|
|
62
|
+
says, which is the ARIA rule rather than a choice this makes.
|
|
63
|
+
|
|
64
|
+
- **`--ds-field-group-focus-shadow-error` — the halo a `ds-field-group` draws while invalid and
|
|
65
|
+
focused.** Defaults to `--ds-field-focus-shadow-error`, the same halo a single error field uses,
|
|
66
|
+
so a focused invalid group reads as one state instead of a red border with a blue glow around it.
|
|
67
|
+
|
|
68
|
+
- **`BreadcrumbItem` takes `ariaLabel`, for the icon-only crumb.** A crumb with an `icon` and no
|
|
69
|
+
`label` — the usual home crumb — rendered as a link with no accessible name at all. Nothing is
|
|
70
|
+
derived from `icon`: `home` is a glyph id, not a word for the user, so a crumb in that shape now
|
|
71
|
+
dev-warns until it is given a name.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
items = [{ icon: 'home', href: '/', ariaLabel: 'Home' }, { label: 'Records' }];
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- **`--focus-ring-radius` — the radius a box takes when it exists only to carry a focus ring.**
|
|
78
|
+
Follows `--ds-radius-inner`, 4px, so retuning the inner radius moves these rings with it. There
|
|
79
|
+
is no `outline-radius` in CSS: an outline follows the
|
|
80
|
+
`border-radius` of the box it is painted on, so a ring host with no radius of its own draws a 90°
|
|
81
|
+
rectangle beside the rounded controls around it. Set this to reshape every such ring at once, or
|
|
82
|
+
give the host its own radius to override it locally.
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
|
|
86
|
+
- **A clickable `ds-table` row, a `ds-tree` row and a `ds-list` activator draw a rounded focus
|
|
87
|
+
ring.** All three ringed a square-cornered box while every control around them was rounded; they
|
|
88
|
+
now carry `--focus-ring-radius`. None of the three paints anything itself — the table row's tints
|
|
89
|
+
sit on its cells — so the radius shapes the ring and nothing else, and it sits on the resting rule
|
|
90
|
+
rather than inside `:focus-visible`, or the shape would appear only while focused. Reachable by
|
|
91
|
+
keyboard only.
|
|
92
|
+
|
|
93
|
+
- **`ds-checkbox`, `ds-radio` and `ds-switch` draw a rounded focus ring.** The ring goes on the row
|
|
94
|
+
that holds the glyph and its label, and that row had no radius, so it came out square while the
|
|
95
|
+
glyph inside it was rounded. The row now takes `--focus-ring-radius`. The row paints nothing else,
|
|
96
|
+
so this changes the ring and nothing besides it — no fill, no border, no layout. Reachable by
|
|
97
|
+
keyboard only; the resting state of all three is unchanged.
|
|
98
|
+
|
|
99
|
+
- **Four exported classes grew members — only matters if you SUBCLASS one.** `ButtonComponent`
|
|
100
|
+
gained `routerLink`, `href`, `controlRef` and `destination`, which decides which of the three
|
|
101
|
+
elements renders; `buttonRef` is gone from its surface, so a subclass that overrode it now
|
|
102
|
+
overrides nothing. `CheckboxComponent`, `RadioComponent` and `SwitchComponent` each gained
|
|
103
|
+
`ariaLabel` and `resolvedAriaLabel`. Being public API or not is no protection: `private` and
|
|
104
|
+
`protected` collide with TS2415 exactly as a public name does. Nothing changes for a consumer who
|
|
105
|
+
only uses the elements.
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- **`ds-field-group[invalid]` keeps its error border under the cursor and under focus.** Both
|
|
110
|
+
`:hover` and `:focus-within` carried one class more than `.invalid` did, so they out-ranked it —
|
|
111
|
+
and the border is the group's ONLY error affordance, because a segment's own label and message are
|
|
112
|
+
hidden to keep the glued row intact. The error vanished at exactly the moment the user reached the
|
|
113
|
+
control. Hover and focus now do not match an invalid group at all, and its focus halo takes the
|
|
114
|
+
error tint through the new `--ds-field-group-focus-shadow-error`. A valid group hovers and focuses
|
|
115
|
+
exactly as before.
|
|
116
|
+
|
|
117
|
+
`.invalid` also stops depending on line order to lose to `.disabled`: both sat at the same
|
|
118
|
+
specificity and only the order of the two rules decided it. Disabled takes no state paint, the
|
|
119
|
+
same rule the nine single fields now follow.
|
|
120
|
+
|
|
121
|
+
- **`ds-stat variant="error"` recolours the value.** `:host(.error) .value` and the later
|
|
122
|
+
`.stat .value` land on the same specificity once emulated encapsulation adds its attribute to
|
|
123
|
+
each, so the default colour won on source order and the error variant changed nothing at all.
|
|
124
|
+
Error now moves the `--_stat-value-color` resolver, which is how the size variants already work,
|
|
125
|
+
so a consumer's `--ds-stat-value-color` still overrides it.
|
|
126
|
+
|
|
127
|
+
- **`ds-sidenav-footer`'s collapse button has an accessible name.** Its only name was the
|
|
128
|
+
`Collapse` text beside the chevron, and the collapsed rail hides that text — so on the rail, which
|
|
129
|
+
is the state the button exists to leave, it announced as an unlabelled button. It now carries
|
|
130
|
+
`aria-label`, and both the label and the name say `Expand` while collapsed, because that is what
|
|
131
|
+
the button does from there. The placeholder search row rendered when there are no search items had
|
|
132
|
+
no name either and now matches its live twin.
|
|
133
|
+
|
|
134
|
+
- **An icon-only `ds-breadcrumbs` crumb has an accessible name.** The crumb rendered an `<a>` around
|
|
135
|
+
a decorative icon and nothing else, so a screen reader announced a link with no name and a
|
|
136
|
+
keyboard user tabbed onto an anonymous stop. Give it `ariaLabel` (above); in dev mode a crumb
|
|
137
|
+
still missing one says so.
|
|
138
|
+
|
|
139
|
+
- **A disabled field no longer paints its `data-field-state`.** An `error`, `warning` or `success`
|
|
140
|
+
state used to out-rank the disabled look in all nine field components — `ds-input`, `ds-textarea`,
|
|
141
|
+
`ds-select`, `ds-multi-select`, `ds-autocomplete`, `ds-date-picker`, `ds-time-picker`,
|
|
142
|
+
`ds-color-picker` and `ds-otp-input` — so a field left invalid and then disabled kept a red border
|
|
143
|
+
and fill while being unfocusable. It was pure specificity: the state selector carried one more
|
|
144
|
+
class than the disabled rule it landed on. A disabled control is not submitted and is not
|
|
145
|
+
validated, so the error promised a correction that could not be made; ARIA settles the same
|
|
146
|
+
conflict the same way, ignoring an ARIA state that a native attribute contradicts.
|
|
147
|
+
|
|
148
|
+
**A read-only field still paints it, deliberately.** `readonly` is submitted where `disabled` is
|
|
149
|
+
not, so a wrong value there does reach the server and is worth flagging. Both skip browser
|
|
150
|
+
validation; only one of them can still send something invalid.
|
|
151
|
+
|
|
152
|
+
- **A `ds-multi-select` panel's filter row draws a rounded focus ring.** It came out as a hard
|
|
153
|
+
rectangle the full width of the panel, inside a panel whose every other control is rounded,
|
|
154
|
+
because an `outline` has no radius of its own — it follows the box it is drawn on, and that row
|
|
155
|
+
had none. It now carries `--ds-radius-inner`, which is the radius the panel's option rows and
|
|
156
|
+
clear button already use. `ds-sidenav-footer`'s search box was always drawn this way and is
|
|
157
|
+
unchanged.
|
|
158
|
+
|
|
11
159
|
## 0.12.2 — 2026-09-09
|
|
12
160
|
|
|
13
161
|
### Breaking
|
package/components.md
CHANGED
|
@@ -153,9 +153,11 @@ text rather than a state. Retune app-wide with `DS_CONFIG.field.stateIcons` (per
|
|
|
153
153
|
is not a validated field; where a search needs a label or an error line, use `ds-input`.
|
|
154
154
|
|
|
155
155
|
#### `<ds-button>` — `ButtonComponent`
|
|
156
|
-
Inputs: **two orthogonal axes** — `color: ButtonColor = 'primary'` (`'primary' | 'secondary' | 'tertiary' | 'neutral' | 'error' | 'success' | 'warning'`) and `variant: ButtonVariant = 'solid'` (`'solid' | 'tonal' | 'outline' | 'ghost' | 'text'`). Plus `size: DsSize | null = null` (unset resolves `DS_CONFIG.control.size`, then `md`), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled`, `loading`, `fullWidth`, `icon: IconName | null`. Plus the refusal pair below: `disabledReason`, and the field message inputs `hint` / `warning` / `error` / `messageIcon` / `reserveMessage` / `ariaDescribedBy`.
|
|
156
|
+
Inputs: **two orthogonal axes** — `color: ButtonColor = 'primary'` (`'primary' | 'secondary' | 'tertiary' | 'neutral' | 'error' | 'success' | 'warning'`) and `variant: ButtonVariant = 'solid'` (`'solid' | 'tonal' | 'outline' | 'ghost' | 'text'`). Plus `size: DsSize | null = null` (unset resolves `DS_CONFIG.control.size`, then `md`), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled`, `loading`, `fullWidth`, `icon: IconName | null`, and the destination pair `routerLink: string | readonly unknown[] | null = null` / `href: string = ''`. Plus the refusal pair below: `disabledReason`, and the field message inputs `hint` / `warning` / `error` / `messageIcon` / `reserveMessage` / `ariaDescribedBy`.
|
|
157
157
|
Axis meaning: **variant is loudness** (solid > tonal > outline/ghost/text), **color is hue** — every pair renders, and the UX-discouraged ones dev-warn with the reason. Only solid and tonal paint a fill: outline, ghost and text are TRANSPARENT, so they adopt the surface they sit on. Disabled splits by whether the fill can carry the state: `solid` and `tonal` keep `oklch(from accent 70% 0.035 h)`, while `outline`, `ghost` and `text` — the three with no fill of their own — mix the label toward the surface, `color-mix(in srgb, <label> 40%, var(--surface-default))`, because a fixed lightness cannot serve both themes. (History: the single `variant` axis was split into color × variant in 2026-06; `danger`→`error`, `link`→`text`, the old `ghost`→`outline`.)
|
|
158
158
|
Output: `(pressed): MouseEvent` — only fires when not disabled and not loading
|
|
159
|
+
**Three elements, decided by destination.** `routerLink` → an `<a [routerLink]>` with `routerLinkActive`; `href` → a plain `<a href>`; **neither → a `<button type="button">`** — the same rule `ds-sidenav-item` follows, and for the same reason: a control that navigates has to BE a link, or middle-click, open-in-new-tab, copy-link-address and the `link` role a screen reader announces are all gone. Styling is identical across all three (class-based on `.button`, and the anchor's UA underline is reset), so target the class, never the tag — measured at zero differences across eleven computed properties, focus ring included. `type` and `loading` are button-only and dev-warn if set on a link: an anchor has no form to submit, and a navigation cannot be in flight before it starts. A disabled link takes `aria-disabled` plus `tabindex="-1"` — an anchor has no native disabled state — and its click is swallowed, which is what stops an `href` from navigating anyway. **`controlRef`** (was `buttonRef` before 0.12.3) is typed `ElementRef<HTMLElement>` for that reason: it resolves whichever element rendered.
|
|
160
|
+
**A link-STYLED action is still the global `.link` class on a `<button>`**, not this. Destination inputs give a navigation the button's LOOK; `.link` gives an action the link's look. `variant="text"` dev-warns in favour of `.link`.
|
|
159
161
|
Content slots: default (label / leading or trailing icon), plus `[dsButtonSubtext]` for a projected second line. For icon-only actions use `<ds-icon-button>`.
|
|
160
162
|
**Saying WHY a button is refused, and the two kinds of refusal.** A greyed control that does not say why is a dead end, and until 0.10.4 the only way to explain one was a tooltip — mouse-only. Which input to reach for is decided by whether the user can lift the refusal on this screen:
|
|
161
163
|
- **Standing** (no permission, no integration — nothing here will change it): `disabledReason` beside `disabled`. The reason renders as a second line INSIDE the button, and setting it flips how the button is disabled — `aria-disabled="true"` instead of the native attribute, because a natively disabled button never takes focus and its description would never be announced (measured; Chrome's a11y tree reports name `"Approve invoice"`, description `"Needs the Finance role"`, state disabled). The click is swallowed in the handler instead, so `(pressed)` still never fires. Leave `disabledReason` unset and NOTHING changes: the native attribute stays, and so does every existing layout. Length is deliberately uncapped — the text wraps and the button grows.
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
Group: Form & input
|
|
5
5
|
|
|
6
|
-
Inputs: **two orthogonal axes** — `color: ButtonColor = 'primary'` (`'primary' | 'secondary' | 'tertiary' | 'neutral' | 'error' | 'success' | 'warning'`) and `variant: ButtonVariant = 'solid'` (`'solid' | 'tonal' | 'outline' | 'ghost' | 'text'`). Plus `size: DsSize | null = null` (unset resolves `DS_CONFIG.control.size`, then `md`), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled`, `loading`, `fullWidth`, `icon: IconName | null`. Plus the refusal pair below: `disabledReason`, and the field message inputs `hint` / `warning` / `error` / `messageIcon` / `reserveMessage` / `ariaDescribedBy`.
|
|
6
|
+
Inputs: **two orthogonal axes** — `color: ButtonColor = 'primary'` (`'primary' | 'secondary' | 'tertiary' | 'neutral' | 'error' | 'success' | 'warning'`) and `variant: ButtonVariant = 'solid'` (`'solid' | 'tonal' | 'outline' | 'ghost' | 'text'`). Plus `size: DsSize | null = null` (unset resolves `DS_CONFIG.control.size`, then `md`), `type: 'button' | 'submit' | 'reset' = 'button'`, `disabled`, `loading`, `fullWidth`, `icon: IconName | null`, and the destination pair `routerLink: string | readonly unknown[] | null = null` / `href: string = ''`. Plus the refusal pair below: `disabledReason`, and the field message inputs `hint` / `warning` / `error` / `messageIcon` / `reserveMessage` / `ariaDescribedBy`.
|
|
7
7
|
Axis meaning: **variant is loudness** (solid > tonal > outline/ghost/text), **color is hue** — every pair renders, and the UX-discouraged ones dev-warn with the reason. Only solid and tonal paint a fill: outline, ghost and text are TRANSPARENT, so they adopt the surface they sit on. Disabled splits by whether the fill can carry the state: `solid` and `tonal` keep `oklch(from accent 70% 0.035 h)`, while `outline`, `ghost` and `text` — the three with no fill of their own — mix the label toward the surface, `color-mix(in srgb, <label> 40%, var(--surface-default))`, because a fixed lightness cannot serve both themes. (History: the single `variant` axis was split into color × variant in 2026-06; `danger`→`error`, `link`→`text`, the old `ghost`→`outline`.)
|
|
8
8
|
Output: `(pressed): MouseEvent` — only fires when not disabled and not loading
|
|
9
|
+
**Three elements, decided by destination.** `routerLink` → an `<a [routerLink]>` with `routerLinkActive`; `href` → a plain `<a href>`; **neither → a `<button type="button">`** — the same rule `ds-sidenav-item` follows, and for the same reason: a control that navigates has to BE a link, or middle-click, open-in-new-tab, copy-link-address and the `link` role a screen reader announces are all gone. Styling is identical across all three (class-based on `.button`, and the anchor's UA underline is reset), so target the class, never the tag — measured at zero differences across eleven computed properties, focus ring included. `type` and `loading` are button-only and dev-warn if set on a link: an anchor has no form to submit, and a navigation cannot be in flight before it starts. A disabled link takes `aria-disabled` plus `tabindex="-1"` — an anchor has no native disabled state — and its click is swallowed, which is what stops an `href` from navigating anyway. **`controlRef`** (was `buttonRef` before 0.12.3) is typed `ElementRef<HTMLElement>` for that reason: it resolves whichever element rendered.
|
|
10
|
+
**A link-STYLED action is still the global `.link` class on a `<button>`**, not this. Destination inputs give a navigation the button's LOOK; `.link` gives an action the link's look. `variant="text"` dev-warns in favour of `.link`.
|
|
9
11
|
Content slots: default (label / leading or trailing icon), plus `[dsButtonSubtext]` for a projected second line. For icon-only actions use `<ds-icon-button>`.
|
|
10
12
|
**Saying WHY a button is refused, and the two kinds of refusal.** A greyed control that does not say why is a dead end, and until 0.10.4 the only way to explain one was a tooltip — mouse-only. Which input to reach for is decided by whether the user can lift the refusal on this screen:
|
|
11
13
|
- **Standing** (no permission, no integration — nothing here will change it): `disabledReason` beside `disabled`. The reason renders as a second line INSIDE the button, and setting it flips how the button is disabled — `aria-disabled="true"` instead of the native attribute, because a natively disabled button never takes focus and its description would never be announced (measured; Chrome's a11y tree reports name `"Approve invoice"`, description `"Needs the Finance role"`, state disabled). The click is swallowed in the handler instead, so `(pressed)` still never fires. Leave `disabledReason` unset and NOTHING changes: the native attribute stays, and so does every existing layout. Length is deliberately uncapped — the text wraps and the button grows.
|
|
@@ -570,7 +570,7 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
570
570
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
571
571
|
multi: true,
|
|
572
572
|
},
|
|
573
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "createTemplate", first: true, predicate: DsCreateTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.disabled]=\"isDisabled()\"\n (click)=\"onTriggerClick()\">\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\" />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\" />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\">\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\" />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\" />\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query(),\n query: query(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \">\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\" />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\" />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 40px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.autocomplete-trigger .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.autocomplete-trigger .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.autocomplete-trigger .autocomplete-input:where(:focus-visible){outline:none}}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow)}@media not (forced-colors:active){.autocomplete-trigger:focus-within:not(.disabled){outline:none}}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0}@media not (forced-colors:active){.autocomplete-input{outline:none}}.autocomplete-input{background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);border-radius:var(--ds-radius-inner);background-color:var(--surface-default);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .check-box .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.dropdown-panel .check-box .tick{background-color:CanvasText}}.dropdown-panel .check-box .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.dropdown-panel .check-box.checked .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
573
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "createTemplate", first: true, predicate: DsCreateTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.disabled]=\"isDisabled()\"\n (click)=\"onTriggerClick()\">\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\" />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\" />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\">\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\" />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\" />\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query(),\n query: query(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \">\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\" />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\" />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 40px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.autocomplete-trigger .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.autocomplete-trigger .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.autocomplete-trigger .autocomplete-input:where(:focus-visible){outline:none}}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow)}@media not (forced-colors:active){.autocomplete-trigger:focus-within:not(.disabled){outline:none}}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0}@media not (forced-colors:active){.autocomplete-input{outline:none}}.autocomplete-input{background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);border-radius:var(--ds-radius-inner);background-color:var(--surface-default);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .check-box .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.dropdown-panel .check-box .tick{background-color:CanvasText}}.dropdown-panel .check-box .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.dropdown-panel .check-box.checked .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled):focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled):focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
574
574
|
}
|
|
575
575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
576
576
|
type: Component,
|
|
@@ -591,7 +591,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
591
591
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
592
592
|
multi: true,
|
|
593
593
|
},
|
|
594
|
-
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.disabled]=\"isDisabled()\"\n (click)=\"onTriggerClick()\">\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\" />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\" />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\">\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\" />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\" />\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query(),\n query: query(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \">\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\" />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\" />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 40px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.autocomplete-trigger .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.autocomplete-trigger .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.autocomplete-trigger .autocomplete-input:where(:focus-visible){outline:none}}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow)}@media not (forced-colors:active){.autocomplete-trigger:focus-within:not(.disabled){outline:none}}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0}@media not (forced-colors:active){.autocomplete-input{outline:none}}.autocomplete-input{background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);border-radius:var(--ds-radius-inner);background-color:var(--surface-default);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .check-box .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.dropdown-panel .check-box .tick{background-color:CanvasText}}.dropdown-panel .check-box .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.dropdown-panel .check-box.checked .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"] }]
|
|
594
|
+
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.disabled]=\"isDisabled()\"\n (click)=\"onTriggerClick()\">\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\" />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\" />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\">\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\" />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\" />\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \">\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\">\n <span class=\"tick\"></span>\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple()) {\n <span\n class=\"option-check\"\n [class.is-shown]=\"isSelected(option)\">\n </span>\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query(),\n query: query(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \">\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\" />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\" />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 40px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.autocomplete-trigger .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.autocomplete-trigger .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.autocomplete-trigger .autocomplete-input:where(:focus-visible){outline:none}}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow)}@media not (forced-colors:active){.autocomplete-trigger:focus-within:not(.disabled){outline:none}}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0}@media not (forced-colors:active){.autocomplete-input{outline:none}}.autocomplete-input{background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);border-radius:var(--ds-radius-inner);background-color:var(--surface-default);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .check-box .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.dropdown-panel .check-box .tick{background-color:CanvasText}}.dropdown-panel .check-box .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.dropdown-panel .check-box.checked .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled):focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled):focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger:not(.disabled):not(:disabled){border-color:var(--success)}\n"] }]
|
|
595
595
|
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showChevron: [{ type: i0.Input, args: [{ isSignal: true, alias: "showChevron", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], valueOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueOverflow", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], allowCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCreate", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], create: [{ type: i0.Output, args: ["create"] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
596
596
|
read: TemplateRef,
|
|
597
597
|
}, isSignal: true }] }], chipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsChipTemplateDirective), { ...{
|