@helixui/library 3.3.1-next.115 → 3.3.1-next.118
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/custom-elements.json +445 -276
- package/dist/components/hx-accordion/hx-accordion-item.d.ts +35 -0
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts +153 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +151 -2
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
- package/dist/components/hx-checkbox-group/index.js +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts +163 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-color-picker/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts +311 -2
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-combobox/index.js +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.d.ts +182 -56
- package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-dialog/hx-dialog.d.ts +240 -0
- package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
- package/dist/components/hx-dialog/index.js +1 -1
- package/dist/components/hx-dropdown/hx-dropdown.d.ts +80 -0
- package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
- package/dist/components/hx-dropdown/index.js +1 -1
- package/dist/components/hx-field/hx-field.d.ts +109 -0
- package/dist/components/hx-field/hx-field.d.ts.map +1 -1
- package/dist/components/hx-field/index.js +1 -1
- package/dist/components/hx-popover/hx-popover.d.ts +91 -0
- package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
- package/dist/components/hx-popover/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts +152 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
- package/dist/components/hx-radio-group/hx-radio.d.ts +14 -0
- package/dist/components/hx-radio-group/hx-radio.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-select/hx-select.d.ts +303 -2
- package/dist/components/hx-select/hx-select.d.ts.map +1 -1
- package/dist/components/hx-select/hx-select.styles.d.ts.map +1 -1
- package/dist/components/hx-select/index.js +1 -1
- package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-switch/hx-switch.d.ts +78 -1
- package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
- package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
- package/dist/components/hx-switch/index.js +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +110 -0
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/index.js +1 -1
- package/dist/components/hx-tooltip/hx-tooltip.d.ts +52 -0
- package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
- package/dist/components/hx-tooltip/index.js +1 -1
- package/dist/css/helix-all.css +98 -1
- package/dist/css/helix-forms.css +98 -1
- package/dist/css/hx-checkbox.css +18 -0
- package/dist/css/hx-color-picker.css +25 -0
- package/dist/css/hx-date-picker.css +2 -1
- package/dist/css/hx-select.css +19 -0
- package/dist/css/hx-switch.css +17 -0
- package/dist/css/hx-toggle-button.css +17 -0
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +2 -1
- package/dist/index.js +15 -15
- package/dist/shared/aria-flatten-DY6v2vah.js +22 -0
- package/dist/shared/aria-flatten-DY6v2vah.js.map +1 -0
- package/dist/shared/aria-idref-Q0yiSR3p.js +104 -0
- package/dist/shared/aria-idref-Q0yiSR3p.js.map +1 -0
- package/dist/shared/hx-accordion-ZVzgDzTG.js.map +1 -1
- package/dist/shared/hx-checkbox-BdgoUeWi.js +696 -0
- package/dist/shared/hx-checkbox-BdgoUeWi.js.map +1 -0
- package/dist/shared/hx-checkbox-group-LWezHrvS.js +496 -0
- package/dist/shared/hx-checkbox-group-LWezHrvS.js.map +1 -0
- package/dist/shared/hx-color-picker-DVhZl88b.js +1221 -0
- package/dist/shared/hx-color-picker-DVhZl88b.js.map +1 -0
- package/dist/shared/hx-combobox-DvlezcDV.js +1359 -0
- package/dist/shared/hx-combobox-DvlezcDV.js.map +1 -0
- package/dist/shared/{hx-date-picker-2iRG1p74.js → hx-date-picker-N-0aG5XL.js} +542 -206
- package/dist/shared/hx-date-picker-N-0aG5XL.js.map +1 -0
- package/dist/shared/hx-dialog-DzB7VytW.js +717 -0
- package/dist/shared/hx-dialog-DzB7VytW.js.map +1 -0
- package/dist/shared/{hx-dropdown-LyaRc8Rf.js → hx-dropdown-DJWlF94E.js} +130 -77
- package/dist/shared/hx-dropdown-DJWlF94E.js.map +1 -0
- package/dist/shared/{hx-field-B3Qo8OLS.js → hx-field-zw0U1KVi.js} +99 -38
- package/dist/shared/hx-field-zw0U1KVi.js.map +1 -0
- package/dist/shared/{hx-nav-item-xqRPOCWX.js → hx-nav-item-CODtUlew.js} +13 -9
- package/dist/shared/{hx-nav-item-xqRPOCWX.js.map → hx-nav-item-CODtUlew.js.map} +1 -1
- package/dist/shared/{hx-popover-B-FP3-wW.js → hx-popover-CHxWY_cd.js} +123 -66
- package/dist/shared/hx-popover-CHxWY_cd.js.map +1 -0
- package/dist/shared/hx-radio-CeGzARNk.js +822 -0
- package/dist/shared/hx-radio-CeGzARNk.js.map +1 -0
- package/dist/shared/hx-select-DrcS-YRJ.js +1089 -0
- package/dist/shared/hx-select-DrcS-YRJ.js.map +1 -0
- package/dist/shared/hx-switch-BX_8uNUs.js +540 -0
- package/dist/shared/hx-switch-BX_8uNUs.js.map +1 -0
- package/dist/shared/{hx-toggle-button-iLiYrMbD.js → hx-toggle-button-Dcz9IlUm.js} +226 -65
- package/dist/shared/hx-toggle-button-Dcz9IlUm.js.map +1 -0
- package/dist/shared/{hx-tooltip-nYOv9OLu.js → hx-tooltip-DVqtKPCD.js} +68 -46
- package/dist/shared/hx-tooltip-DVqtKPCD.js.map +1 -0
- package/dist/utils/aria-flatten.d.ts +56 -0
- package/dist/utils/aria-flatten.d.ts.map +1 -0
- package/dist/utils/aria-idref.d.ts +127 -0
- package/dist/utils/aria-idref.d.ts.map +1 -0
- package/figma-inventory.json +64 -1
- package/package.json +2 -2
- package/dist/shared/hx-checkbox-D7xma9YH.js +0 -524
- package/dist/shared/hx-checkbox-D7xma9YH.js.map +0 -1
- package/dist/shared/hx-checkbox-group-C9n315Ju.js +0 -323
- package/dist/shared/hx-checkbox-group-C9n315Ju.js.map +0 -1
- package/dist/shared/hx-color-picker-uRc865FJ.js +0 -882
- package/dist/shared/hx-color-picker-uRc865FJ.js.map +0 -1
- package/dist/shared/hx-combobox-DDzqNKEW.js +0 -924
- package/dist/shared/hx-combobox-DDzqNKEW.js.map +0 -1
- package/dist/shared/hx-date-picker-2iRG1p74.js.map +0 -1
- package/dist/shared/hx-dialog-DRN_1-Y-.js +0 -514
- package/dist/shared/hx-dialog-DRN_1-Y-.js.map +0 -1
- package/dist/shared/hx-dropdown-LyaRc8Rf.js.map +0 -1
- package/dist/shared/hx-field-B3Qo8OLS.js.map +0 -1
- package/dist/shared/hx-popover-B-FP3-wW.js.map +0 -1
- package/dist/shared/hx-radio-CJvNU2yP.js +0 -621
- package/dist/shared/hx-radio-CJvNU2yP.js.map +0 -1
- package/dist/shared/hx-select-C8fEHQhC.js +0 -807
- package/dist/shared/hx-select-C8fEHQhC.js.map +0 -1
- package/dist/shared/hx-switch-BrZFaRue.js +0 -420
- package/dist/shared/hx-switch-BrZFaRue.js.map +0 -1
- package/dist/shared/hx-toggle-button-iLiYrMbD.js.map +0 -1
- package/dist/shared/hx-tooltip-nYOv9OLu.js.map +0 -1
|
@@ -0,0 +1,1089 @@
|
|
|
1
|
+
import { css as F, html as b, nothing as _ } from "lit";
|
|
2
|
+
import { property as n, state as c, query as D, customElement as W } from "lit/decorators.js";
|
|
3
|
+
import { classMap as y } from "lit/directives/class-map.js";
|
|
4
|
+
import { ifDefined as C } from "lit/directives/if-defined.js";
|
|
5
|
+
import { repeat as V } from "lit/directives/repeat.js";
|
|
6
|
+
import { F as j } from "./FormMixin-B8PXk5RQ.js";
|
|
7
|
+
import { d as U } from "./dev-warn-YlwPHjtX.js";
|
|
8
|
+
import { s as G, i as K, r as A } from "./aria-idref-Q0yiSR3p.js";
|
|
9
|
+
import { H as P } from "./helix-element-BNEYeiys.js";
|
|
10
|
+
import { c as X } from "./id-counter-DuX8vsui.js";
|
|
11
|
+
const J = F`
|
|
12
|
+
/* ─── 3-tier token cascade: component → semantic → hardcoded fallback ─── */
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
/* Round-3 finding 1: host is the canonical combobox surface, so it owns
|
|
16
|
+
keyboard focus. Suppress the UA default outline; the custom focus ring
|
|
17
|
+
is painted on the inner trigger via :host(:focus-visible)
|
|
18
|
+
.field__trigger so visual feedback follows the host's focus state. */
|
|
19
|
+
outline: none;
|
|
20
|
+
|
|
21
|
+
/* Background & foreground */
|
|
22
|
+
--_bg: var(--hx-select-bg, var(--hx-color-surface-default, #ffffff));
|
|
23
|
+
--_color: var(--hx-select-color, var(--hx-color-text-strong, #202b39));
|
|
24
|
+
--_placeholder-color: var(
|
|
25
|
+
--hx-select-placeholder-color,
|
|
26
|
+
var(--hx-color-text-placeholder, #66787b)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/* Label */
|
|
30
|
+
--_label-color: var(--hx-select-label-color, var(--hx-color-text-strong, #202b39));
|
|
31
|
+
|
|
32
|
+
/* Border */
|
|
33
|
+
--_border-color: var(--hx-select-border-color, var(--hx-color-border-strong, #66787b));
|
|
34
|
+
--_border-radius: var(--hx-select-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
35
|
+
|
|
36
|
+
/* Focus ring */
|
|
37
|
+
--_focus-ring-color: var(--hx-select-focus-ring-color, var(--hx-focus-ring-color, #0f7078));
|
|
38
|
+
|
|
39
|
+
/* Error */
|
|
40
|
+
--_error-color: var(--hx-select-error-color, var(--hx-color-error-500, #e5493e));
|
|
41
|
+
|
|
42
|
+
/* Chevron */
|
|
43
|
+
--_chevron-color: var(--hx-select-chevron-color, var(--hx-color-text-muted, #4a5362));
|
|
44
|
+
--_chevron-size: var(--hx-select-chevron-size, 0.5rem);
|
|
45
|
+
|
|
46
|
+
/* Listbox */
|
|
47
|
+
--_listbox-bg: var(--hx-select-listbox-bg, var(--hx-color-surface-default, #ffffff));
|
|
48
|
+
--_option-hover-bg: var(--hx-select-option-hover-bg, var(--hx-color-primary-50, #ebf8f8));
|
|
49
|
+
--_option-selected-bg: var(
|
|
50
|
+
--hx-select-option-selected-bg,
|
|
51
|
+
var(--hx-color-primary-100, #dbf0f0)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
/* Typography */
|
|
55
|
+
--_font-family: var(--hx-select-font-family, var(--hx-font-family-sans, sans-serif));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([disabled]) {
|
|
59
|
+
opacity: var(--hx-opacity-disabled, 0.5);
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
* {
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.field {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: var(--hx-space-1, 0.25rem);
|
|
71
|
+
font-family: var(--_font-family);
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.field__label {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: baseline;
|
|
78
|
+
gap: var(--hx-space-1, 0.25rem);
|
|
79
|
+
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
80
|
+
font-weight: var(--hx-font-weight-medium, 500);
|
|
81
|
+
color: var(--_label-color);
|
|
82
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.field__required-marker {
|
|
86
|
+
color: var(--hx-select-error-color, var(--hx-color-error-text, #c92a2a));
|
|
87
|
+
font-weight: var(--hx-font-weight-bold, 700);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.field__select-wrapper {
|
|
91
|
+
position: relative;
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.field__trigger {
|
|
96
|
+
/* Round-3 finding 1 / CodeRabbit F1: trigger is a <button type="button">
|
|
97
|
+
(labelable) so native <label for> click activation works for mouse
|
|
98
|
+
users. Reset native button chrome before applying field styles. */
|
|
99
|
+
appearance: none;
|
|
100
|
+
-webkit-appearance: none;
|
|
101
|
+
margin: 0;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
gap: var(--hx-space-2, 0.5rem);
|
|
106
|
+
width: 100%;
|
|
107
|
+
min-height: var(--hx-input-height-md, var(--hx-size-10, 2.5rem));
|
|
108
|
+
border: var(--hx-border-width-thin, 1px) solid var(--_border-color);
|
|
109
|
+
border-radius: var(--_border-radius);
|
|
110
|
+
background-color: var(--_bg);
|
|
111
|
+
color: var(--_color);
|
|
112
|
+
font: inherit;
|
|
113
|
+
font-family: inherit;
|
|
114
|
+
font-size: var(--hx-font-size-md, 1rem);
|
|
115
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
116
|
+
padding: var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
text-align: start;
|
|
119
|
+
transition:
|
|
120
|
+
border-color var(--hx-transition-fast, 150ms ease),
|
|
121
|
+
box-shadow var(--hx-transition-fast, 150ms ease);
|
|
122
|
+
outline: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Round-3 finding 1: host is the canonical focusable surface. Both the
|
|
126
|
+
:host(:focus-visible) descendant selector AND the legacy
|
|
127
|
+
.field__trigger:focus-visible (kept for forced-colors regression test
|
|
128
|
+
parity) paint the focus ring on the visual trigger. */
|
|
129
|
+
:host(:focus-visible) .field__trigger,
|
|
130
|
+
.field__trigger:focus-visible {
|
|
131
|
+
border-color: var(--_focus-ring-color);
|
|
132
|
+
box-shadow: 0 0 0 var(--hx-focus-ring-width, 2px)
|
|
133
|
+
color-mix(
|
|
134
|
+
in srgb,
|
|
135
|
+
var(--_focus-ring-color) calc(var(--hx-focus-ring-opacity, 0.25) * 100%),
|
|
136
|
+
transparent
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.field__trigger[aria-disabled='true'] {
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.field__trigger--sm {
|
|
145
|
+
min-height: var(--hx-input-height-sm, var(--hx-size-8, 2rem));
|
|
146
|
+
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
147
|
+
padding: var(--hx-space-1, 0.25rem) var(--hx-space-3, 0.75rem);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.field__trigger--lg {
|
|
151
|
+
min-height: var(--hx-input-height-lg, var(--hx-size-12, 3rem));
|
|
152
|
+
font-size: var(--hx-font-size-lg, 1.125rem);
|
|
153
|
+
padding: var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.field__trigger-value {
|
|
157
|
+
flex: 1;
|
|
158
|
+
min-width: 0;
|
|
159
|
+
white-space: nowrap;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.field__trigger--placeholder .field__trigger-value {
|
|
165
|
+
color: var(--_placeholder-color);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.field__chevron {
|
|
169
|
+
flex-shrink: 0;
|
|
170
|
+
width: calc(var(--_chevron-size) * 1.5);
|
|
171
|
+
height: var(--_chevron-size);
|
|
172
|
+
position: relative;
|
|
173
|
+
color: var(--_chevron-color);
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
transition: transform var(--hx-transition-fast, 150ms ease);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.field__chevron::after {
|
|
179
|
+
content: '';
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: 0;
|
|
182
|
+
left: var(--hx-space-px, 2px);
|
|
183
|
+
width: var(--_chevron-size);
|
|
184
|
+
height: var(--_chevron-size);
|
|
185
|
+
border-inline-end: var(--hx-border-width-thin, 1.5px) solid currentColor;
|
|
186
|
+
border-bottom: var(--hx-border-width-thin, 1.5px) solid currentColor;
|
|
187
|
+
transform: rotate(45deg);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.field--open .field__chevron {
|
|
191
|
+
transform: rotate(180deg);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.field--error .field__trigger {
|
|
195
|
+
border-color: var(--_error-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:host(:focus-visible) .field--error .field__trigger,
|
|
199
|
+
.field--error .field__trigger:focus-visible {
|
|
200
|
+
border-color: var(--_error-color);
|
|
201
|
+
box-shadow: 0 0 0 var(--hx-focus-ring-width, 2px)
|
|
202
|
+
color-mix(
|
|
203
|
+
in srgb,
|
|
204
|
+
var(--_error-color) calc(var(--hx-focus-ring-opacity, 0.25) * 100%),
|
|
205
|
+
transparent
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.field__listbox {
|
|
210
|
+
position: absolute;
|
|
211
|
+
top: calc(100% + var(--hx-space-1, 0.25rem));
|
|
212
|
+
left: 0;
|
|
213
|
+
right: 0;
|
|
214
|
+
z-index: var(--hx-z-index-dropdown, 1000);
|
|
215
|
+
background-color: var(--_listbox-bg);
|
|
216
|
+
border: var(--hx-border-width-thin, 1px) solid var(--_border-color);
|
|
217
|
+
border-radius: var(--_border-radius);
|
|
218
|
+
box-shadow: var(
|
|
219
|
+
--hx-select-listbox-shadow,
|
|
220
|
+
0 4px 16px var(--hx-overlay-neutral-12, rgba(13, 17, 23, 0.12))
|
|
221
|
+
);
|
|
222
|
+
max-height: var(--hx-select-listbox-max-height, 16rem);
|
|
223
|
+
overflow: hidden;
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.field__listbox[hidden] {
|
|
229
|
+
display: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.field__options {
|
|
233
|
+
overflow-y: auto;
|
|
234
|
+
flex: 1;
|
|
235
|
+
padding: var(--hx-space-1, 0.25rem) 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.field__option {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: var(--hx-space-2, 0.5rem);
|
|
242
|
+
padding: var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem);
|
|
243
|
+
font-size: var(--hx-font-size-md, 1rem);
|
|
244
|
+
color: var(--_color);
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
user-select: none;
|
|
247
|
+
-webkit-user-select: none;
|
|
248
|
+
transition: background-color var(--hx-transition-fast, 150ms ease);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.field__option:hover {
|
|
252
|
+
background-color: var(--_option-hover-bg);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.field__option--selected {
|
|
256
|
+
background-color: var(--_option-selected-bg);
|
|
257
|
+
font-weight: var(--hx-font-weight-medium, 500);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.field__option--focused {
|
|
261
|
+
background-color: var(--_option-hover-bg);
|
|
262
|
+
outline: var(--hx-focus-ring-width, 2px) solid var(--_focus-ring-color);
|
|
263
|
+
outline-offset: var(--hx-select-option-focus-ring-offset, -2px);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.field__option--focused.field__option--selected {
|
|
267
|
+
background-color: var(--_option-selected-bg);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.field__option--disabled {
|
|
271
|
+
opacity: var(--hx-opacity-disabled, 0.5);
|
|
272
|
+
cursor: not-allowed;
|
|
273
|
+
pointer-events: none;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.field__option-label {
|
|
277
|
+
flex: 1;
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
text-overflow: ellipsis;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.field__no-options {
|
|
284
|
+
padding: var(--hx-space-3, 0.75rem);
|
|
285
|
+
text-align: center;
|
|
286
|
+
color: var(--_placeholder-color);
|
|
287
|
+
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.field__select {
|
|
291
|
+
position: absolute;
|
|
292
|
+
width: 1px;
|
|
293
|
+
height: 1px;
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
opacity: 0;
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
clip: rect(0, 0, 0, 0);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.field__help-text,
|
|
301
|
+
.field__error {
|
|
302
|
+
font-size: var(--hx-font-size-xs, 0.75rem);
|
|
303
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.field__help-text {
|
|
307
|
+
color: var(--hx-color-text-muted, #4a5362);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.field__error {
|
|
311
|
+
color: var(--hx-select-error-color, var(--hx-color-error-text, #c92a2a));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@media (prefers-reduced-motion: reduce) {
|
|
315
|
+
.field__trigger,
|
|
316
|
+
.field__chevron,
|
|
317
|
+
.field__option {
|
|
318
|
+
transition: none;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* ─── High Contrast Mode (forced-colors) ─── */
|
|
323
|
+
|
|
324
|
+
@media (forced-colors: active) {
|
|
325
|
+
.field__trigger {
|
|
326
|
+
forced-color-adjust: none;
|
|
327
|
+
background-color: Field;
|
|
328
|
+
color: FieldText;
|
|
329
|
+
border: 2px solid ButtonText;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
:host(:focus-visible) .field__trigger,
|
|
333
|
+
.field__trigger:focus-visible {
|
|
334
|
+
outline: 3px solid Highlight;
|
|
335
|
+
outline-offset: 2px;
|
|
336
|
+
box-shadow: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.field__trigger[aria-disabled='true'] {
|
|
340
|
+
color: GrayText;
|
|
341
|
+
border-color: GrayText;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.field__trigger--placeholder .field__trigger-value {
|
|
345
|
+
color: GrayText;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.field__chevron::after {
|
|
349
|
+
border-color: FieldText;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.field__listbox {
|
|
353
|
+
forced-color-adjust: none;
|
|
354
|
+
background-color: Canvas;
|
|
355
|
+
border: 2px solid CanvasText;
|
|
356
|
+
box-shadow: none;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.field__option {
|
|
360
|
+
color: CanvasText;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.field__option:hover {
|
|
364
|
+
background-color: Highlight;
|
|
365
|
+
color: HighlightText;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.field__option--selected {
|
|
369
|
+
background-color: Highlight;
|
|
370
|
+
color: HighlightText;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.field__option--focused {
|
|
374
|
+
outline-color: Highlight;
|
|
375
|
+
background-color: Highlight;
|
|
376
|
+
color: HighlightText;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.field__option--disabled {
|
|
380
|
+
color: GrayText;
|
|
381
|
+
opacity: 1;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.field--error .field__trigger {
|
|
385
|
+
border-color: LinkText;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
:host([disabled]) {
|
|
389
|
+
opacity: 1;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.field__label {
|
|
393
|
+
color: CanvasText;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.field__help-text {
|
|
397
|
+
color: GrayText;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.field__error {
|
|
401
|
+
color: LinkText;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
`;
|
|
405
|
+
var Q = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, l = (e, t, i, r) => {
|
|
406
|
+
for (var s = r > 1 ? void 0 : r ? Y(t, i) : t, a = e.length - 1, h; a >= 0; a--)
|
|
407
|
+
(h = e[a]) && (s = (r ? h(t, i, s) : h(s)) || s);
|
|
408
|
+
return r && s && Q(t, i, s), s;
|
|
409
|
+
};
|
|
410
|
+
function $(e) {
|
|
411
|
+
const t = e.querySelector("slot");
|
|
412
|
+
if (t) {
|
|
413
|
+
const i = t.assignedNodes({ flatten: !0 });
|
|
414
|
+
if (i.length > 0)
|
|
415
|
+
return i.map((r) => r.textContent ?? "").join("").trim();
|
|
416
|
+
}
|
|
417
|
+
return (e.textContent ?? "").trim();
|
|
418
|
+
}
|
|
419
|
+
const Z = X("hx-select");
|
|
420
|
+
let o = class extends j(P) {
|
|
421
|
+
constructor() {
|
|
422
|
+
super(...arguments), this._selectId = Z(), this._listboxId = `${this._selectId}-listbox`, this._labelId = `${this._selectId}-label`, this._helpTextId = `${this._selectId}-help`, this._errorId = `${this._selectId}-error`, this.label = "", this.placeholder = "", this.value = "", this.required = !1, this.disabled = !1, this.name = "", this.error = "", this.helpText = "", this.size = "md", this.accessibleLabel = null, this.open = !1, this.labelRequired = "Please select an option.", this.labelNoOptions = "No options found", this._options = [], this._hasErrorSlot = !1, this._hasLabelSlot = !1, this._labelSource = "none", this._labelSlotText = "", this._hasHelpSlot = !1, this._slottedLabelEl = null, this._focusedOptionIndex = -1, this._supportsIdrefRefs = !0, this._announcedError = "", this._invalid = !1, this._ariaMirror = null, this._helpSlotTextObserver = null, this._errorSlotTextObserver = null, this._hostDescribedByObserver = null, this._lastWrittenLabelledBy = null, this._lastWrittenDescribedBy = null, this._lastWrittenAriaLabel = null, this._consumerLabelledBy = null, this._consumerDescribedBy = null, this._handleHostClick = (e) => {
|
|
423
|
+
var s, a;
|
|
424
|
+
const t = e.composedPath(), i = ((s = this.shadowRoot) == null ? void 0 : s.querySelector(".field__listbox")) ?? null;
|
|
425
|
+
if (i && t.includes(i))
|
|
426
|
+
return;
|
|
427
|
+
const r = this._trigger ?? ((a = this.shadowRoot) == null ? void 0 : a.querySelector(".field__trigger")) ?? null;
|
|
428
|
+
!r || !t.includes(r) || this._toggleDropdown();
|
|
429
|
+
}, this._handleKeydown = (e) => {
|
|
430
|
+
if (this.disabled) return;
|
|
431
|
+
const t = this._options.map((i, r) => ({ o: i, i: r })).filter(({ o: i }) => !i.disabled).map(({ i }) => i);
|
|
432
|
+
switch (e.key) {
|
|
433
|
+
case "ArrowDown": {
|
|
434
|
+
if (e.preventDefault(), !this.open) {
|
|
435
|
+
this.open = !0, this._focusedOptionIndex = t.length > 0 ? t[0] ?? 0 : 0;
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
const i = t.find((r) => r > this._focusedOptionIndex);
|
|
439
|
+
this._focusedOptionIndex = i !== void 0 ? i : t[0] ?? this._focusedOptionIndex;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
case "ArrowUp": {
|
|
443
|
+
if (e.preventDefault(), !this.open) {
|
|
444
|
+
this.open = !0;
|
|
445
|
+
const s = t[t.length - 1];
|
|
446
|
+
this._focusedOptionIndex = s !== void 0 ? s : 0;
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
const i = [...t].reverse().find((s) => s < this._focusedOptionIndex), r = t[t.length - 1];
|
|
450
|
+
this._focusedOptionIndex = i !== void 0 ? i : r ?? this._focusedOptionIndex;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
case "Home": {
|
|
454
|
+
e.preventDefault(), this.open || (this.open = !0), this._focusedOptionIndex = t.length > 0 ? t[0] ?? 0 : 0;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
case "End": {
|
|
458
|
+
e.preventDefault(), this.open || (this.open = !0);
|
|
459
|
+
const i = t[t.length - 1];
|
|
460
|
+
this._focusedOptionIndex = i !== void 0 ? i : 0;
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
case "Enter":
|
|
464
|
+
case " ": {
|
|
465
|
+
if (e.preventDefault(), !this.open) {
|
|
466
|
+
this.open = !0;
|
|
467
|
+
const i = this._options.findIndex((r) => r.value === this.value);
|
|
468
|
+
this._focusedOptionIndex = i >= 0 ? i : t[0] ?? 0;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
if (this._focusedOptionIndex >= 0 && this._focusedOptionIndex < this._options.length) {
|
|
472
|
+
const i = this._options[this._focusedOptionIndex];
|
|
473
|
+
i && this._selectOption(i);
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
case "Escape": {
|
|
478
|
+
e.preventDefault(), this.open = !1, this._focusedOptionIndex = -1, this.focus();
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
case "Tab": {
|
|
482
|
+
this.open && (this.open = !1, this._focusedOptionIndex = -1);
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
default: {
|
|
486
|
+
if (!e.ctrlKey && !e.metaKey && !e.altKey && e.key.length === 1) {
|
|
487
|
+
const i = e.key.toLowerCase(), r = this.open ? this._focusedOptionIndex + 1 : 0, s = this._options.map((d, v) => ({ o: d, i: v })).filter(({ o: d }) => !d.disabled && d.label.toLowerCase().startsWith(i)), h = s.find(({ i: d }) => d >= r) ?? s[0];
|
|
488
|
+
h && (this.open || (this.open = !0), this._focusedOptionIndex = h.i, e.preventDefault());
|
|
489
|
+
}
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}, this._handleOutsideClick = (e) => {
|
|
494
|
+
this.open && !e.composedPath().includes(this) && (this.open = !1);
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
// ─── Computed helpers ───
|
|
498
|
+
/** @internal */
|
|
499
|
+
get _displayValue() {
|
|
500
|
+
if (!this.value) return "";
|
|
501
|
+
const e = this._options.find((t) => t.value === this.value);
|
|
502
|
+
return e ? e.label : this.value;
|
|
503
|
+
}
|
|
504
|
+
// ─── Lifecycle ───
|
|
505
|
+
connectedCallback() {
|
|
506
|
+
super.connectedCallback();
|
|
507
|
+
const e = this.constructor;
|
|
508
|
+
this._supportsIdrefRefs = e.__testSupportsIdrefRefsOverride !== null ? e.__testSupportsIdrefRefsOverride : G(this._internals), this.addEventListener("click", this._handleHostClick), this.addEventListener("keydown", this._handleKeydown), this._hostDescribedByObserver = new MutationObserver((t) => {
|
|
509
|
+
let i = !1;
|
|
510
|
+
for (const r of t) {
|
|
511
|
+
if (r.attributeName !== "aria-describedby") continue;
|
|
512
|
+
const s = r.oldValue, a = this.getAttribute("aria-describedby");
|
|
513
|
+
s !== null && a === null && (this._consumerDescribedBy = null, i = !0);
|
|
514
|
+
}
|
|
515
|
+
i && this._syncHostAriaSemantics();
|
|
516
|
+
}), this._hostDescribedByObserver.observe(this, {
|
|
517
|
+
attributes: !0,
|
|
518
|
+
attributeFilter: ["aria-describedby"],
|
|
519
|
+
attributeOldValue: !0
|
|
520
|
+
}), this._syncHostAriaSemantics(), this._ariaMirror = K(this, () => {
|
|
521
|
+
this._syncHostAriaSemantics();
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
disconnectedCallback() {
|
|
525
|
+
var e, t, i, r;
|
|
526
|
+
super.disconnectedCallback(), document.removeEventListener("click", this._handleOutsideClick), this.removeEventListener("click", this._handleHostClick), this.removeEventListener("keydown", this._handleKeydown), this.open && (this.open = !1, this._focusedOptionIndex = -1), (e = this._ariaMirror) == null || e.disconnect(), this._ariaMirror = null, (t = this._helpSlotTextObserver) == null || t.disconnect(), this._helpSlotTextObserver = null, (i = this._errorSlotTextObserver) == null || i.disconnect(), this._errorSlotTextObserver = null, (r = this._hostDescribedByObserver) == null || r.disconnect(), this._hostDescribedByObserver = null;
|
|
527
|
+
}
|
|
528
|
+
updated(e) {
|
|
529
|
+
if (super.updated(e), e.has("open") && (this.open ? document.addEventListener("click", this._handleOutsideClick) : document.removeEventListener("click", this._handleOutsideClick)), e.has("value") && (this._syncNativeSelect(), this._updateFormValue()), e.has("label") && this._refreshLabelSource(), e.has("size")) {
|
|
530
|
+
const t = ["sm", "md", "lg"];
|
|
531
|
+
t.includes(this.size) || U(
|
|
532
|
+
"hx-select",
|
|
533
|
+
`Invalid size "${this.size}". Expected one of: ${t.join(", ")}.`
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
this._syncHostAriaSemantics(), e.has("error") && (e.get("error") && this.error ? (this._announcedError = "", requestAnimationFrame(() => {
|
|
537
|
+
this._announcedError = this.error;
|
|
538
|
+
})) : this._announcedError = this.error);
|
|
539
|
+
}
|
|
540
|
+
firstUpdated(e) {
|
|
541
|
+
var r;
|
|
542
|
+
super.firstUpdated(e);
|
|
543
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector('slot[name="label"]'), i = t ? this._readLabelSlotState(t).hasUsefulName : !1;
|
|
544
|
+
!this.label && !this.accessibleLabel && !i && !this.getAttribute("aria-label") && this.getAttribute("aria-labelledby");
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Reads the label slot's assigned nodes and computes the discriminated
|
|
548
|
+
* naming state. Round-3 finding 3 + 5 + 8: an empty whitespace-only slot
|
|
549
|
+
* does NOT count as a useful name; the first labellable element is
|
|
550
|
+
* captured by reference (no consumer-DOM mutation); the result drives a
|
|
551
|
+
* discriminated `_labelSource` rather than a magic `'*slotted*'` string.
|
|
552
|
+
* @internal
|
|
553
|
+
*/
|
|
554
|
+
_readLabelSlotState(e) {
|
|
555
|
+
const t = e.assignedNodes({ flatten: !0 });
|
|
556
|
+
let i = null, r = "";
|
|
557
|
+
for (const a of t)
|
|
558
|
+
a.nodeType === Node.ELEMENT_NODE && !i ? i = a : a.nodeType === Node.TEXT_NODE && (r += a.textContent ?? "");
|
|
559
|
+
const s = r.trim();
|
|
560
|
+
return {
|
|
561
|
+
hasUsefulName: i !== null || s.length > 0,
|
|
562
|
+
element: i,
|
|
563
|
+
text: s
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
// ─── Host-canonical ARIA sync ───
|
|
567
|
+
/**
|
|
568
|
+
* Mirrors combobox semantics onto the host via ElementInternals so that the
|
|
569
|
+
* host IS the canonical announced surface on BOTH the modern (IDL element
|
|
570
|
+
* references) and fallback paths. Round-3 finding 1: codex round-2
|
|
571
|
+
* demonstrated that putting `role="combobox"` on the host on fallback while
|
|
572
|
+
* leaving focus/click/keyboard/validity anchored to the inner trigger
|
|
573
|
+
* created a "named surface ≠ focused surface" gap. Round-3 collapses both
|
|
574
|
+
* paths to the host-canonical model used by Group 2's `hx-radio-group` /
|
|
575
|
+
* `hx-checkbox-group` (PR #1625):
|
|
576
|
+
*
|
|
577
|
+
* - `internals.role = 'combobox'` so AT advertises the combobox role.
|
|
578
|
+
* - Host attribute `role="combobox"` mirror so legacy engines, axe-core,
|
|
579
|
+
* and `getAttribute('role')` agree with the internals default.
|
|
580
|
+
* - Host attribute `tabindex="0"` so the host is the focusable surface.
|
|
581
|
+
* - Host attributes `aria-expanded`, `aria-haspopup`, `aria-controls`,
|
|
582
|
+
* `aria-activedescendant`, `aria-required`, `aria-invalid`,
|
|
583
|
+
* `aria-disabled` so AT walking the host's attribute graph sees the
|
|
584
|
+
* combobox state without depending on internals defaults.
|
|
585
|
+
* - Modern path additionally sets `internals.ariaLabelledByElements` /
|
|
586
|
+
* `internals.ariaDescribedByElements` so consumer light-DOM IDREFs cross
|
|
587
|
+
* the shadow boundary into the host's accessible node.
|
|
588
|
+
* - Fallback path mirrors consumer label/desc tokens onto the host
|
|
589
|
+
* attribute and text-mirrors shadow help/error wrappers via
|
|
590
|
+
* `internals.ariaDescription`.
|
|
591
|
+
* @internal
|
|
592
|
+
*/
|
|
593
|
+
_syncHostAriaSemantics() {
|
|
594
|
+
var L, O, E, T, k;
|
|
595
|
+
const e = this._internals;
|
|
596
|
+
e.role = "combobox", e.ariaRequired = this.required ? "true" : "false";
|
|
597
|
+
const t = !e.validity.valid;
|
|
598
|
+
this._invalid = t, e.ariaInvalid = t ? "true" : "false", e.ariaDisabled = this.disabled ? "true" : "false", e.ariaExpanded = this.open ? "true" : "false", e.ariaHasPopup = "listbox";
|
|
599
|
+
const i = this.getAttribute("aria-label"), r = i !== null && i !== this._lastWrittenAriaLabel && i.trim() || "", s = ((L = this.shadowRoot) == null ? void 0 : L.getElementById(this._labelId)) ?? null, a = this._slottedLabelEl, h = ((O = this.shadowRoot) == null ? void 0 : O.getElementById(this._helpTextId)) ?? null, d = ((E = this.shadowRoot) == null ? void 0 : E.getElementById(this._errorId)) ?? null, v = this.getAttribute("aria-labelledby");
|
|
600
|
+
v !== this._lastWrittenLabelledBy && (this._consumerLabelledBy = v);
|
|
601
|
+
const w = this.getAttribute("aria-describedby");
|
|
602
|
+
w !== this._lastWrittenDescribedBy && (this._consumerDescribedBy = w);
|
|
603
|
+
const B = this._consumerLabelledBy, I = this._consumerDescribedBy, u = A(this, B), S = u.length > 0;
|
|
604
|
+
r ? e.ariaLabel = r : S ? e.ariaLabel = null : this._labelSource === "slot" ? a ? e.ariaLabel = null : e.ariaLabel = this._labelSlotText || this.accessibleLabel || null : this._labelSource === "string" ? e.ariaLabel = this.label || this.accessibleLabel || null : e.ariaLabel = this.accessibleLabel || null, !S && !r && (this._labelSource === "slot" && a ? u.push(a) : this._labelSource === "string" && s && u.push(s));
|
|
605
|
+
const g = A(this, I), x = !!(this.error || this._hasErrorSlot);
|
|
606
|
+
if (h && !x && (this.helpText || this._hasHelpSlot) && g.push(h), d && x && g.push(d), this._supportsIdrefRefs) {
|
|
607
|
+
const p = e;
|
|
608
|
+
p.ariaLabelledByElements = u.length > 0 ? u : null, p.ariaDescribedByElements = g.length > 0 ? g : null, e.ariaDescription = null;
|
|
609
|
+
} else {
|
|
610
|
+
const p = e;
|
|
611
|
+
p.ariaLabelledByElements = null, p.ariaDescribedByElements = null;
|
|
612
|
+
const z = u.map((f) => f.id).filter((f) => !!f), m = S ? z.join(" ") : "", H = this.getAttribute("aria-labelledby");
|
|
613
|
+
m ? (H !== m && this.setAttribute("aria-labelledby", m), this._lastWrittenLabelledBy = m) : H !== null && (this.removeAttribute("aria-labelledby"), this._lastWrittenLabelledBy = null), this.hasAttribute("aria-describedby") && ((T = this._hostDescribedByObserver) == null || T.disconnect(), this.removeAttribute("aria-describedby"), (k = this._hostDescribedByObserver) == null || k.observe(this, {
|
|
614
|
+
attributes: !0,
|
|
615
|
+
attributeFilter: ["aria-describedby"],
|
|
616
|
+
attributeOldValue: !0
|
|
617
|
+
})), this._lastWrittenDescribedBy = null;
|
|
618
|
+
const R = A(this, I).map((f) => (f.textContent ?? "").trim()).filter(Boolean).join(" "), q = h && !x && (this.helpText || this._hasHelpSlot) ? $(h) : "", N = d && x ? $(d) : "", M = [R, q, N].filter(Boolean).join(" ").trim();
|
|
619
|
+
e.ariaDescription = M || null, this._writeHostAttributeMirror({ hostAriaLabel: r, isInvalid: t });
|
|
620
|
+
}
|
|
621
|
+
this._writeHostRoleAndTabindex(), this._writeHostComboboxStateAttributes();
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Writes host `role="combobox"` and `tabindex` so the host is the
|
|
625
|
+
* focusable, AT-visible canonical surface. Round-3 finding 1.
|
|
626
|
+
* @internal
|
|
627
|
+
*/
|
|
628
|
+
_writeHostRoleAndTabindex() {
|
|
629
|
+
this.getAttribute("role") !== "combobox" && this.setAttribute("role", "combobox");
|
|
630
|
+
const e = this.disabled ? "-1" : "0";
|
|
631
|
+
this.getAttribute("tabindex") !== e && this.setAttribute("tabindex", e);
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Writes the host's combobox state attributes (`aria-expanded`,
|
|
635
|
+
* `aria-haspopup`, `aria-controls`, `aria-activedescendant`,
|
|
636
|
+
* `aria-required`, `aria-invalid`, `aria-disabled`) on every sync. CSS
|
|
637
|
+
* selectors and AT inspecting the live attribute graph read these — the
|
|
638
|
+
* `internals.aria*` defaults are invisible. Round-3 finding 1.
|
|
639
|
+
* @internal
|
|
640
|
+
*/
|
|
641
|
+
_writeHostComboboxStateAttributes() {
|
|
642
|
+
this.getAttribute("aria-haspopup") !== "listbox" && this.setAttribute("aria-haspopup", "listbox"), this.getAttribute("aria-controls") !== this._listboxId && this.setAttribute("aria-controls", this._listboxId);
|
|
643
|
+
const e = this.open ? "true" : "false";
|
|
644
|
+
this.getAttribute("aria-expanded") !== e && this.setAttribute("aria-expanded", e);
|
|
645
|
+
const t = this.open && this._focusedOptionIndex >= 0 ? this._optionId(this._focusedOptionIndex) : null;
|
|
646
|
+
t ? this.getAttribute("aria-activedescendant") !== t && this.setAttribute("aria-activedescendant", t) : this.hasAttribute("aria-activedescendant") && this.removeAttribute("aria-activedescendant"), this.required ? this.getAttribute("aria-required") !== "true" && this.setAttribute("aria-required", "true") : this.hasAttribute("aria-required") && this.removeAttribute("aria-required"), this._invalid ? this.getAttribute("aria-invalid") !== "true" && this.setAttribute("aria-invalid", "true") : this.hasAttribute("aria-invalid") && this.removeAttribute("aria-invalid"), this.disabled ? this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true") : this.hasAttribute("aria-disabled") && this.removeAttribute("aria-disabled");
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Writes a host `aria-label` attribute mirror on the fallback path so AT
|
|
650
|
+
* inspecting the live attribute graph sees the resolved name even when
|
|
651
|
+
* the platform lacks IDL element references. Skip when an effective
|
|
652
|
+
* `aria-labelledby` is already set on the host (labelledby > label by
|
|
653
|
+
* ARIA priority). Round-3 finding 1 + round-2 finding 5.
|
|
654
|
+
* @internal
|
|
655
|
+
*/
|
|
656
|
+
_writeHostAttributeMirror(e) {
|
|
657
|
+
const { hostAriaLabel: t } = e;
|
|
658
|
+
if (t) {
|
|
659
|
+
this._lastWrittenAriaLabel = null;
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
const i = this.accessibleLabel || this.label || (this._labelSource === "slot" ? this._labelSlotText : "") || "", r = this.hasAttribute("aria-labelledby"), s = this.getAttribute("aria-label");
|
|
663
|
+
!r && i ? (s !== i && this.setAttribute("aria-label", i), this._lastWrittenAriaLabel = i) : s !== null && s === this._lastWrittenAriaLabel ? (this.removeAttribute("aria-label"), this._lastWrittenAriaLabel = null) : this.hasAttribute("aria-label") && !(s != null && s.trim()) ? (this.removeAttribute("aria-label"), this._lastWrittenAriaLabel = null) : this.hasAttribute("aria-label") || (this._lastWrittenAriaLabel = null);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* (Re-)installs the mutation observer over the current set of assigned
|
|
667
|
+
* help-text-slot nodes. Aligned with Group 2 round-23 P2 (Finding C).
|
|
668
|
+
* @internal
|
|
669
|
+
*/
|
|
670
|
+
_installHelpSlotTextObserver(e) {
|
|
671
|
+
var i;
|
|
672
|
+
if ((i = this._helpSlotTextObserver) == null || i.disconnect(), !e) {
|
|
673
|
+
this._helpSlotTextObserver = null;
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const t = new MutationObserver(() => {
|
|
677
|
+
this._syncHostAriaSemantics();
|
|
678
|
+
});
|
|
679
|
+
e.assignedNodes().forEach((r) => {
|
|
680
|
+
t.observe(r, {
|
|
681
|
+
characterData: !0,
|
|
682
|
+
childList: !0,
|
|
683
|
+
subtree: !0
|
|
684
|
+
});
|
|
685
|
+
}), this._helpSlotTextObserver = t;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* (Re-)installs the mutation observer over the current set of assigned
|
|
689
|
+
* error-slot nodes. Aligned with Group 2 round-23 P2 (Finding C).
|
|
690
|
+
* @internal
|
|
691
|
+
*/
|
|
692
|
+
_installErrorSlotTextObserver(e) {
|
|
693
|
+
var i;
|
|
694
|
+
if ((i = this._errorSlotTextObserver) == null || i.disconnect(), !e) {
|
|
695
|
+
this._errorSlotTextObserver = null;
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
const t = new MutationObserver(() => {
|
|
699
|
+
this._syncHostAriaSemantics();
|
|
700
|
+
});
|
|
701
|
+
e.assignedNodes().forEach((r) => {
|
|
702
|
+
t.observe(r, {
|
|
703
|
+
characterData: !0,
|
|
704
|
+
childList: !0,
|
|
705
|
+
subtree: !0
|
|
706
|
+
});
|
|
707
|
+
}), this._errorSlotTextObserver = t;
|
|
708
|
+
}
|
|
709
|
+
// ─── Form Integration ───
|
|
710
|
+
/** @internal */
|
|
711
|
+
_updateFormValue() {
|
|
712
|
+
this._internals.setFormValue(this.value || null);
|
|
713
|
+
}
|
|
714
|
+
/** @internal */
|
|
715
|
+
_updateValidity() {
|
|
716
|
+
this.required && !this.value ? this._internals.setValidity({ valueMissing: !0 }, this.error || this.labelRequired, this) : this._internals.setValidity({}), this._syncHostAriaSemantics();
|
|
717
|
+
}
|
|
718
|
+
// ─── Form Lifecycle Hooks ───
|
|
719
|
+
_onFormReset() {
|
|
720
|
+
this.value = "", this._internals.setFormValue(null), this._resetInteractionState();
|
|
721
|
+
}
|
|
722
|
+
_onFormStateRestore(e, t) {
|
|
723
|
+
typeof e == "string" && (this.value = e);
|
|
724
|
+
}
|
|
725
|
+
_onFormDisabled(e) {
|
|
726
|
+
this.disabled = e;
|
|
727
|
+
}
|
|
728
|
+
// ─── Native Select Sync ───
|
|
729
|
+
/** @internal */
|
|
730
|
+
_syncNativeSelect() {
|
|
731
|
+
this._select && this.value && (this._select.value = this.value);
|
|
732
|
+
}
|
|
733
|
+
// ─── Option Syncing from Slot ───
|
|
734
|
+
/** @internal */
|
|
735
|
+
_parseOption(e) {
|
|
736
|
+
var t;
|
|
737
|
+
return { value: e.value, label: ((t = e.textContent) == null ? void 0 : t.trim()) ?? e.value, disabled: e.disabled };
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Single-pass slot handler: reads options into _options for the custom
|
|
741
|
+
* listbox AND clones them into the native <select> for form participation.
|
|
742
|
+
* Handles both top-level <option> and <optgroup> children.
|
|
743
|
+
*/
|
|
744
|
+
/** @internal */
|
|
745
|
+
_handleSlotChange() {
|
|
746
|
+
var r;
|
|
747
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot:not([name])");
|
|
748
|
+
if (!e) return;
|
|
749
|
+
const t = [];
|
|
750
|
+
this._select && this._select.querySelectorAll("option[data-cloned]").forEach((s) => s.remove());
|
|
751
|
+
const i = (s) => {
|
|
752
|
+
if (!this._select) return;
|
|
753
|
+
const a = s.cloneNode(!0);
|
|
754
|
+
a.setAttribute("data-cloned", ""), this._select.appendChild(a);
|
|
755
|
+
};
|
|
756
|
+
for (const s of e.assignedElements({ flatten: !0 }))
|
|
757
|
+
if (s instanceof HTMLOptionElement)
|
|
758
|
+
t.push(this._parseOption(s)), i(s);
|
|
759
|
+
else if (s instanceof HTMLOptGroupElement)
|
|
760
|
+
for (const a of Array.from(s.children))
|
|
761
|
+
a instanceof HTMLOptionElement && (t.push(this._parseOption(a)), i(a));
|
|
762
|
+
this._options = t, t.length, this._select && (this.value ? this._select.value = this.value : !this.placeholder && t.length > 0 && (this.value = this._select.value, this._updateFormValue()));
|
|
763
|
+
}
|
|
764
|
+
// ─── Slot Change Handlers ───
|
|
765
|
+
/**
|
|
766
|
+
* Tracks the slotted label so projected `<span slot="label">` content joins
|
|
767
|
+
* the accessible-name chain without forcing the consumer to also pass the
|
|
768
|
+
* `label` property.
|
|
769
|
+
*
|
|
770
|
+
* Round-3 findings 3, 5, 6, 8:
|
|
771
|
+
* - 3: count whitespace-only text as "no useful name" (devWarn must fire).
|
|
772
|
+
* - 5: hold the slotted element by direct reference instead of mutating
|
|
773
|
+
* consumer light DOM with a tracked id.
|
|
774
|
+
* - 6: lookup is by reference, so it survives nested shadow roots without
|
|
775
|
+
* the fragile `getElementById` chain.
|
|
776
|
+
* - 8: discriminated `_labelSource` replaces the magic `'*slotted*'`
|
|
777
|
+
* sentinel string.
|
|
778
|
+
* @internal
|
|
779
|
+
*/
|
|
780
|
+
_handleLabelSlotChange(e) {
|
|
781
|
+
if (!(e.target instanceof HTMLSlotElement)) return;
|
|
782
|
+
const t = this._readLabelSlotState(e.target);
|
|
783
|
+
this._hasLabelSlot = t.hasUsefulName, this._slottedLabelEl = t.element, this._labelSlotText = t.text, this._refreshLabelSource(), this._syncHostAriaSemantics();
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Recomputes the discriminated label source. Round-3 finding 8.
|
|
787
|
+
*
|
|
788
|
+
* CodeRabbit F2: slotted label wins over the `label` prop. When a
|
|
789
|
+
* consumer provides BOTH a `<span slot="label">` AND a `label="..."`
|
|
790
|
+
* attribute the visible label is the slotted node (rendered by the
|
|
791
|
+
* named slot's default content branch never firing). Preferring the
|
|
792
|
+
* string form here would route the accessible name through the prop
|
|
793
|
+
* and diverge from the rendered text. The slot is the canonical
|
|
794
|
+
* source whenever it has useful content.
|
|
795
|
+
* @internal
|
|
796
|
+
*/
|
|
797
|
+
_refreshLabelSource() {
|
|
798
|
+
this._hasLabelSlot ? this._labelSource = "slot" : this.label ? this._labelSource = "string" : this._labelSource = "none";
|
|
799
|
+
}
|
|
800
|
+
/** @internal */
|
|
801
|
+
_handleErrorSlotChange(e) {
|
|
802
|
+
e.target instanceof HTMLSlotElement && (this._hasErrorSlot = e.target.assignedNodes({ flatten: !0 }).length > 0, this._installErrorSlotTextObserver(e.target), this._syncHostAriaSemantics());
|
|
803
|
+
}
|
|
804
|
+
/** @internal */
|
|
805
|
+
_handleHelpSlotChange(e) {
|
|
806
|
+
e.target instanceof HTMLSlotElement && (this._hasHelpSlot = e.target.assignedNodes({ flatten: !0 }).length > 0, this._installHelpSlotTextObserver(e.target), this._syncHostAriaSemantics());
|
|
807
|
+
}
|
|
808
|
+
// ─── Dropdown Control ───
|
|
809
|
+
/** @internal */
|
|
810
|
+
_toggleDropdown() {
|
|
811
|
+
if (!this.disabled)
|
|
812
|
+
if (this.open = !this.open, this.open) {
|
|
813
|
+
const e = this._options.findIndex((t) => t.value === this.value);
|
|
814
|
+
this._focusedOptionIndex = e >= 0 ? e : 0;
|
|
815
|
+
} else
|
|
816
|
+
this._focusedOptionIndex = -1;
|
|
817
|
+
}
|
|
818
|
+
// ─── Selection ───
|
|
819
|
+
/** @internal */
|
|
820
|
+
_selectOption(e) {
|
|
821
|
+
e.disabled || (this.value = e.value, this._handleInteractionInput(), this._handleInteractionBlur(), this._dispatchChange(), this.open = !1, this._focusedOptionIndex = -1);
|
|
822
|
+
}
|
|
823
|
+
// ─── Event Dispatchers ───
|
|
824
|
+
/** @internal */
|
|
825
|
+
_dispatchChange() {
|
|
826
|
+
this.dispatchEvent(
|
|
827
|
+
new CustomEvent("hx-change", {
|
|
828
|
+
bubbles: !0,
|
|
829
|
+
composed: !0,
|
|
830
|
+
detail: { value: this.value }
|
|
831
|
+
})
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
/** @internal */
|
|
835
|
+
_handleNativeChange(e) {
|
|
836
|
+
this.value = e.target.value, this._handleInteractionInput(), this._handleInteractionBlur(), this._dispatchChange();
|
|
837
|
+
}
|
|
838
|
+
// ─── Public Methods ───
|
|
839
|
+
/**
|
|
840
|
+
* Moves focus to the host. Round-3 finding 1: the host is the canonical
|
|
841
|
+
* combobox surface (`role="combobox"`, `tabindex="0"`), so programmatic
|
|
842
|
+
* focus must land there to match where AT routes focus and where
|
|
843
|
+
* `setValidity()` anchors recovery.
|
|
844
|
+
*/
|
|
845
|
+
focus(e) {
|
|
846
|
+
HTMLElement.prototype.focus.call(this, e);
|
|
847
|
+
}
|
|
848
|
+
// ─── Render Helpers ───
|
|
849
|
+
/** @internal */
|
|
850
|
+
_optionId(e) {
|
|
851
|
+
return `hx-select-option-${this._selectId}-${e}`;
|
|
852
|
+
}
|
|
853
|
+
/** @internal */
|
|
854
|
+
_renderOptions() {
|
|
855
|
+
return this._options.length === 0 ? b`<div class="field__no-options">${this.labelNoOptions}</div>` : V(
|
|
856
|
+
this._options,
|
|
857
|
+
(e) => e.value,
|
|
858
|
+
(e, t) => {
|
|
859
|
+
const i = e.value === this.value, r = t === this._focusedOptionIndex;
|
|
860
|
+
return b`
|
|
861
|
+
<div
|
|
862
|
+
id=${this._optionId(t)}
|
|
863
|
+
part="option"
|
|
864
|
+
role="option"
|
|
865
|
+
class=${y({
|
|
866
|
+
field__option: !0,
|
|
867
|
+
"field__option--selected": i,
|
|
868
|
+
"field__option--focused": r,
|
|
869
|
+
"field__option--disabled": e.disabled
|
|
870
|
+
})}
|
|
871
|
+
aria-selected=${i ? "true" : "false"}
|
|
872
|
+
aria-disabled=${e.disabled ? "true" : _}
|
|
873
|
+
@click=${() => this._selectOption(e)}
|
|
874
|
+
>
|
|
875
|
+
<span class="field__option-label">${e.label}</span>
|
|
876
|
+
</div>
|
|
877
|
+
`;
|
|
878
|
+
}
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
// ─── Main Render ───
|
|
882
|
+
render() {
|
|
883
|
+
const e = !!this.error || this._hasErrorSlot, t = !!this.helpText || this._hasHelpSlot, i = {
|
|
884
|
+
field: !0,
|
|
885
|
+
"field--error": e,
|
|
886
|
+
"field--disabled": this.disabled,
|
|
887
|
+
"field--required": this.required,
|
|
888
|
+
"field--open": this.open
|
|
889
|
+
}, r = {
|
|
890
|
+
field__trigger: !0,
|
|
891
|
+
[`field__trigger--${this.size}`]: !0,
|
|
892
|
+
"field__trigger--placeholder": !this.value
|
|
893
|
+
}, s = {
|
|
894
|
+
field__select: !0,
|
|
895
|
+
[`field__select--${this.size}`]: !0
|
|
896
|
+
};
|
|
897
|
+
return b`
|
|
898
|
+
<div part="field" class=${y(i)}>
|
|
899
|
+
<!-- Label -->
|
|
900
|
+
<slot name="label" @slotchange=${this._handleLabelSlotChange}>
|
|
901
|
+
${this.label ? b`<label
|
|
902
|
+
part="label"
|
|
903
|
+
class="field__label"
|
|
904
|
+
id=${this._labelId}
|
|
905
|
+
for=${this._selectId}
|
|
906
|
+
>
|
|
907
|
+
${this.label}
|
|
908
|
+
${this.required ? b`<span class="field__required-marker" aria-hidden="true">*</span>` : _}
|
|
909
|
+
</label>` : _}
|
|
910
|
+
</slot>
|
|
911
|
+
|
|
912
|
+
<!-- Select Wrapper: trigger + listbox -->
|
|
913
|
+
<div part="select-wrapper" class="field__select-wrapper">
|
|
914
|
+
<!--
|
|
915
|
+
Visual trigger surface. Round-3 finding 1: role, tabindex,
|
|
916
|
+
and combobox ARIA all live on the host so AT sees a single
|
|
917
|
+
announced + focused surface. The trigger is rendered as a
|
|
918
|
+
<button type="button"> (a labelable element) so the visible
|
|
919
|
+
label[for=selectId] performs native click activation —
|
|
920
|
+
mouse users clicking the label focus the trigger which
|
|
921
|
+
bubbles to the host click handler and toggles the dropdown.
|
|
922
|
+
type="button" prevents implicit form submission. The trigger
|
|
923
|
+
has no role and no ARIA, so AT walks its subtree text as
|
|
924
|
+
the combobox's value content (host carries the real
|
|
925
|
+
association via internals.ariaLabel*).
|
|
926
|
+
-->
|
|
927
|
+
<button
|
|
928
|
+
type="button"
|
|
929
|
+
part="trigger"
|
|
930
|
+
id=${this._selectId}
|
|
931
|
+
class=${y(r)}
|
|
932
|
+
>
|
|
933
|
+
<span class="field__trigger-value"
|
|
934
|
+
>${this._displayValue || this.placeholder || _}</span
|
|
935
|
+
>
|
|
936
|
+
<span class="field__chevron" aria-hidden="true"></span>
|
|
937
|
+
</button>
|
|
938
|
+
|
|
939
|
+
<!-- Custom Listbox Panel -->
|
|
940
|
+
<div
|
|
941
|
+
part="listbox"
|
|
942
|
+
role="listbox"
|
|
943
|
+
id=${this._listboxId}
|
|
944
|
+
class="field__listbox"
|
|
945
|
+
aria-label=${C(this.label || this.accessibleLabel || void 0)}
|
|
946
|
+
?hidden=${!this.open}
|
|
947
|
+
>
|
|
948
|
+
<div class="field__options">${this._renderOptions()}</div>
|
|
949
|
+
</div>
|
|
950
|
+
|
|
951
|
+
<!-- Hidden native select (form participation + test compat) -->
|
|
952
|
+
<select
|
|
953
|
+
part="select"
|
|
954
|
+
class=${y(s)}
|
|
955
|
+
tabindex="-1"
|
|
956
|
+
aria-hidden="true"
|
|
957
|
+
?required=${this.required}
|
|
958
|
+
?disabled=${this.disabled}
|
|
959
|
+
name=${C(this.name || void 0)}
|
|
960
|
+
@change=${this._handleNativeChange}
|
|
961
|
+
>
|
|
962
|
+
${this.placeholder ? b`<option value="" disabled selected>${this.placeholder}</option>` : _}
|
|
963
|
+
</select>
|
|
964
|
+
</div>
|
|
965
|
+
|
|
966
|
+
<!-- Hidden slot (options are read from here) -->
|
|
967
|
+
<slot @slotchange=${this._handleSlotChange} style="display:none;"></slot>
|
|
968
|
+
|
|
969
|
+
<!--
|
|
970
|
+
Persistent error live region. role="alert" is set from first paint
|
|
971
|
+
so the WAI-ARIA contract for live updates is honoured: content
|
|
972
|
+
changes in place rather than the container being toggled. Aligned
|
|
973
|
+
with Group 2 round-1 finding #10.
|
|
974
|
+
-->
|
|
975
|
+
<div
|
|
976
|
+
part="error"
|
|
977
|
+
class="field__error"
|
|
978
|
+
id=${this._errorId}
|
|
979
|
+
role="alert"
|
|
980
|
+
?hidden=${!e}
|
|
981
|
+
>
|
|
982
|
+
<slot name="error" @slotchange=${this._handleErrorSlotChange}
|
|
983
|
+
>${this._announcedError}</slot
|
|
984
|
+
>
|
|
985
|
+
</div>
|
|
986
|
+
|
|
987
|
+
<!--
|
|
988
|
+
Persistent help-text container. Rendered whenever the property OR
|
|
989
|
+
the slot has content; hidden when an error is present so guidance
|
|
990
|
+
does not compete with validation feedback. Always in the shadow
|
|
991
|
+
tree so the host's aria-describedby chain is stable.
|
|
992
|
+
-->
|
|
993
|
+
<div
|
|
994
|
+
part="help-text"
|
|
995
|
+
class="field__help-text"
|
|
996
|
+
id=${this._helpTextId}
|
|
997
|
+
?hidden=${!t || e}
|
|
998
|
+
>
|
|
999
|
+
<slot name="help-text" @slotchange=${this._handleHelpSlotChange}>${this.helpText}</slot>
|
|
1000
|
+
</div>
|
|
1001
|
+
</div>
|
|
1002
|
+
`;
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
o.styles = J;
|
|
1006
|
+
o.formAssociated = !0;
|
|
1007
|
+
o.__testSupportsIdrefRefsOverride = null;
|
|
1008
|
+
l([
|
|
1009
|
+
n({ type: String })
|
|
1010
|
+
], o.prototype, "label", 2);
|
|
1011
|
+
l([
|
|
1012
|
+
n({ type: String })
|
|
1013
|
+
], o.prototype, "placeholder", 2);
|
|
1014
|
+
l([
|
|
1015
|
+
n({ type: String, reflect: !0 })
|
|
1016
|
+
], o.prototype, "value", 2);
|
|
1017
|
+
l([
|
|
1018
|
+
n({ type: Boolean, reflect: !0 })
|
|
1019
|
+
], o.prototype, "required", 2);
|
|
1020
|
+
l([
|
|
1021
|
+
n({ type: Boolean, reflect: !0 })
|
|
1022
|
+
], o.prototype, "disabled", 2);
|
|
1023
|
+
l([
|
|
1024
|
+
n({ type: String, reflect: !0 })
|
|
1025
|
+
], o.prototype, "name", 2);
|
|
1026
|
+
l([
|
|
1027
|
+
n({ type: String })
|
|
1028
|
+
], o.prototype, "error", 2);
|
|
1029
|
+
l([
|
|
1030
|
+
n({ type: String, attribute: "help-text" })
|
|
1031
|
+
], o.prototype, "helpText", 2);
|
|
1032
|
+
l([
|
|
1033
|
+
n({ type: String, attribute: "hx-size", reflect: !0 })
|
|
1034
|
+
], o.prototype, "size", 2);
|
|
1035
|
+
l([
|
|
1036
|
+
n({ type: String, attribute: "accessible-label" })
|
|
1037
|
+
], o.prototype, "accessibleLabel", 2);
|
|
1038
|
+
l([
|
|
1039
|
+
n({ type: Boolean, reflect: !0 })
|
|
1040
|
+
], o.prototype, "open", 2);
|
|
1041
|
+
l([
|
|
1042
|
+
n({ attribute: "label-required" })
|
|
1043
|
+
], o.prototype, "labelRequired", 2);
|
|
1044
|
+
l([
|
|
1045
|
+
n({ attribute: "label-no-options" })
|
|
1046
|
+
], o.prototype, "labelNoOptions", 2);
|
|
1047
|
+
l([
|
|
1048
|
+
c()
|
|
1049
|
+
], o.prototype, "_options", 2);
|
|
1050
|
+
l([
|
|
1051
|
+
c()
|
|
1052
|
+
], o.prototype, "_hasErrorSlot", 2);
|
|
1053
|
+
l([
|
|
1054
|
+
c()
|
|
1055
|
+
], o.prototype, "_hasLabelSlot", 2);
|
|
1056
|
+
l([
|
|
1057
|
+
c()
|
|
1058
|
+
], o.prototype, "_labelSource", 2);
|
|
1059
|
+
l([
|
|
1060
|
+
c()
|
|
1061
|
+
], o.prototype, "_labelSlotText", 2);
|
|
1062
|
+
l([
|
|
1063
|
+
c()
|
|
1064
|
+
], o.prototype, "_hasHelpSlot", 2);
|
|
1065
|
+
l([
|
|
1066
|
+
c()
|
|
1067
|
+
], o.prototype, "_focusedOptionIndex", 2);
|
|
1068
|
+
l([
|
|
1069
|
+
c()
|
|
1070
|
+
], o.prototype, "_supportsIdrefRefs", 2);
|
|
1071
|
+
l([
|
|
1072
|
+
c()
|
|
1073
|
+
], o.prototype, "_announcedError", 2);
|
|
1074
|
+
l([
|
|
1075
|
+
c()
|
|
1076
|
+
], o.prototype, "_invalid", 2);
|
|
1077
|
+
l([
|
|
1078
|
+
D(".field__select")
|
|
1079
|
+
], o.prototype, "_select", 2);
|
|
1080
|
+
l([
|
|
1081
|
+
D(".field__trigger")
|
|
1082
|
+
], o.prototype, "_trigger", 2);
|
|
1083
|
+
o = l([
|
|
1084
|
+
W("hx-select")
|
|
1085
|
+
], o);
|
|
1086
|
+
export {
|
|
1087
|
+
o as H
|
|
1088
|
+
};
|
|
1089
|
+
//# sourceMappingURL=hx-select-DrcS-YRJ.js.map
|