@fluentui/web-components 3.0.0-rc.12 → 3.0.0-rc.13

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.
@@ -0,0 +1,497 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr, FASTElement, Observable, observable, Updates } from '@microsoft/fast-element';
3
+ import { findLastIndex } from '@microsoft/fast-web-utilities';
4
+ import { isRadio } from '../radio/radio.options.js';
5
+ import { getDirection } from '../utils/direction.js';
6
+ import { getRootActiveElement } from '../utils/root-active-element.js';
7
+ import { RadioGroupOrientation } from './radio-group.options.js';
8
+ /**
9
+ * A Base Radio Group Custom HTML Element.
10
+ * Implements the {@link https://w3c.github.io/aria/#radiogroup | ARIA `radiogroup` role}.
11
+ *
12
+ * @public
13
+ */
14
+ export class BaseRadioGroup extends FASTElement {
15
+ /**
16
+ * Sets the checked state of the nearest enabled radio when the `checkedIndex` changes.
17
+ *
18
+ * @param prev - the previous index
19
+ * @param next - the current index
20
+ * @internal
21
+ */
22
+ checkedIndexChanged(prev, next) {
23
+ if (!this.enabledRadios) {
24
+ return;
25
+ }
26
+ this.checkRadio(next);
27
+ }
28
+ /**
29
+ * Sets the `disabled` attribute on all child radios when the `disabled` property changes.
30
+ *
31
+ * @param prev - the previous disabled value
32
+ * @param next - the current disabled value
33
+ * @internal
34
+ */
35
+ disabledChanged(prev, next) {
36
+ if (this.radios) {
37
+ this.checkedIndex = -1;
38
+ this.radios?.forEach(radio => {
39
+ radio.disabled = !!radio.disabledAttribute || !!this.disabled;
40
+ });
41
+ this.restrictFocus();
42
+ }
43
+ }
44
+ /**
45
+ * Sets the matching radio to checked when the value changes. If no radio matches the value, no radio will be checked.
46
+ *
47
+ * @param prev - the previous value
48
+ * @param next - the current value
49
+ */
50
+ initialValueChanged(prev, next) {
51
+ this.value = next ?? '';
52
+ }
53
+ /**
54
+ * Sets the `name` attribute on all child radios when the `name` property changes.
55
+ *
56
+ * @internal
57
+ */
58
+ nameChanged(prev, next) {
59
+ if (this.isConnected && next) {
60
+ this.radios?.forEach(radio => {
61
+ radio.name = this.name;
62
+ });
63
+ }
64
+ }
65
+ /**
66
+ * Sets the ariaOrientation attribute when the orientation changes.
67
+ *
68
+ * @param prev - the previous orientation
69
+ * @param next - the current orientation
70
+ * @internal
71
+ */
72
+ orientationChanged(prev, next) {
73
+ this.elementInternals.ariaOrientation = this.orientation ?? RadioGroupOrientation.horizontal;
74
+ }
75
+ /**
76
+ * Updates the enabled radios collection when properties on the child radios change.
77
+ *
78
+ * @param prev - the previous radios
79
+ * @param next - the current radios
80
+ */
81
+ radiosChanged(prev, next) {
82
+ const setSize = next?.length;
83
+ if (!setSize) {
84
+ return;
85
+ }
86
+ if (!this.name && next.every(x => x.name === next[0].name)) {
87
+ this.name = next[0].name;
88
+ }
89
+ const checkedIndex = findLastIndex(this.enabledRadios, x => x.initialChecked);
90
+ next.forEach((radio, index) => {
91
+ radio.ariaPosInSet = `${index + 1}`;
92
+ radio.ariaSetSize = `${setSize}`;
93
+ if (this.initialValue && !this.dirtyState) {
94
+ radio.checked = radio.value === this.initialValue;
95
+ }
96
+ else {
97
+ radio.checked = index === checkedIndex;
98
+ }
99
+ radio.name = this.name ?? radio.name;
100
+ radio.disabled = !!this.disabled || !!radio.disabledAttribute;
101
+ });
102
+ if (!this.dirtyState && this.initialValue) {
103
+ this.value = this.initialValue;
104
+ }
105
+ if (!this.value ||
106
+ // This logic covers the case when the RadioGroup doesn't have a `value`
107
+ // attribute, but does have a checked child Radio. Without this condition,
108
+ // the checked Radio's value will be assigned to `this.value`, and
109
+ // `checkedIndex` will be the checked Radio's index, but `this.checkedIndex`
110
+ // will remain `undefined`, which would cause the RadioGroup to add
111
+ // `tabindex=-1` to the checked Radio, and effectively makes the whole
112
+ // RadioGroup unfocusable.
113
+ (this.value && typeof this.checkedIndex !== 'number' && checkedIndex >= 0)) {
114
+ // TODO: Switch to standard `Array.findLastIndex` when TypeScript 5 is available
115
+ this.checkedIndex = checkedIndex;
116
+ }
117
+ // prettier-ignore
118
+ const radioIds = next.map(radio => radio.id).join(' ').trim();
119
+ if (radioIds) {
120
+ this.setAttribute('aria-owns', radioIds);
121
+ }
122
+ Updates.enqueue(() => {
123
+ this.restrictFocus();
124
+ });
125
+ }
126
+ /**
127
+ *
128
+ * @param prev - the previous required value
129
+ * @param next - the current required value
130
+ */
131
+ requiredChanged(prev, next) {
132
+ this.elementInternals.ariaRequired = next ? 'true' : null;
133
+ this.setValidity();
134
+ }
135
+ /**
136
+ * Updates the radios collection when the slotted radios change.
137
+ *
138
+ * @param prev - the previous slotted radios
139
+ * @param next - the current slotted radios
140
+ */
141
+ slottedRadiosChanged(prev, next) {
142
+ this.radios = [...this.querySelectorAll('*')].filter(x => isRadio(x));
143
+ }
144
+ /**
145
+ * A collection of child radios that are not disabled.
146
+ *
147
+ * @internal
148
+ */
149
+ get enabledRadios() {
150
+ if (this.disabled) {
151
+ return [];
152
+ }
153
+ return this.radios?.filter(x => !x.disabled) ?? [];
154
+ }
155
+ /**
156
+ * The form-associated flag.
157
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
158
+ *
159
+ * @public
160
+ */
161
+ static { this.formAssociated = true; }
162
+ /**
163
+ * The validation message. Uses the browser's default validation message for native checkboxes if not otherwise
164
+ * specified (e.g., via `setCustomValidity`).
165
+ *
166
+ * @internal
167
+ */
168
+ get validationMessage() {
169
+ if (this.elementInternals.validationMessage) {
170
+ return this.elementInternals.validationMessage;
171
+ }
172
+ if (this.enabledRadios?.[0]?.validationMessage) {
173
+ return this.enabledRadios[0].validationMessage;
174
+ }
175
+ if (!this._validationFallbackMessage) {
176
+ const validationMessageFallbackControl = document.createElement('input');
177
+ validationMessageFallbackControl.type = 'radio';
178
+ validationMessageFallbackControl.required = true;
179
+ validationMessageFallbackControl.checked = false;
180
+ this._validationFallbackMessage = validationMessageFallbackControl.validationMessage;
181
+ }
182
+ return this._validationFallbackMessage;
183
+ }
184
+ /**
185
+ * The element's validity state.
186
+ *
187
+ * @public
188
+ * @remarks
189
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
190
+ */
191
+ get validity() {
192
+ return this.elementInternals.validity;
193
+ }
194
+ /**
195
+ * The current value of the checked radio.
196
+ *
197
+ * @public
198
+ */
199
+ get value() {
200
+ Observable.notify(this, 'value');
201
+ return this.enabledRadios.find(x => x.checked)?.value ?? null;
202
+ }
203
+ set value(next) {
204
+ const index = this.enabledRadios.findIndex(x => x.value === next);
205
+ this.checkedIndex = index;
206
+ if (this.$fastController.isConnected) {
207
+ this.setFormValue(next);
208
+ this.setValidity();
209
+ }
210
+ Observable.track(this, 'value');
211
+ }
212
+ /**
213
+ * Sets the checked state of all radios when any radio emits a `change` event.
214
+ *
215
+ * @param e - the change event
216
+ */
217
+ changeHandler(e) {
218
+ if (this === e.target) {
219
+ return true;
220
+ }
221
+ this.dirtyState = true;
222
+ const radioIndex = this.enabledRadios.indexOf(e.target);
223
+ this.checkRadio(radioIndex);
224
+ this.radios
225
+ ?.filter(x => x.disabled)
226
+ ?.forEach(item => {
227
+ item.checked = false;
228
+ });
229
+ return true;
230
+ }
231
+ /**
232
+ * Checks the radio at the specified index.
233
+ *
234
+ * @param index - the index of the radio to check
235
+ * @internal
236
+ */
237
+ checkRadio(index = this.checkedIndex, shouldEmit = false) {
238
+ let checkedIndex = this.checkedIndex;
239
+ this.enabledRadios.forEach((item, i) => {
240
+ const shouldCheck = i === index;
241
+ item.checked = shouldCheck;
242
+ if (shouldCheck) {
243
+ checkedIndex = i;
244
+ if (shouldEmit) {
245
+ item.$emit('change');
246
+ }
247
+ }
248
+ });
249
+ this.checkedIndex = checkedIndex;
250
+ this.setFormValue(this.value);
251
+ this.setValidity();
252
+ }
253
+ /**
254
+ * Checks the validity of the element and returns the result.
255
+ *
256
+ * @public
257
+ * @remarks
258
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
259
+ */
260
+ checkValidity() {
261
+ return this.elementInternals.checkValidity();
262
+ }
263
+ /**
264
+ * Handles click events for the radio group.
265
+ *
266
+ * @param e - the click event
267
+ * @internal
268
+ */
269
+ clickHandler(e) {
270
+ if (this === e.target) {
271
+ this.enabledRadios[Math.max(0, this.checkedIndex)]?.focus();
272
+ }
273
+ return true;
274
+ }
275
+ constructor() {
276
+ super();
277
+ /**
278
+ * Indicates that the value has been changed by the user.
279
+ */
280
+ this.dirtyState = false;
281
+ /**
282
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
283
+ *
284
+ * @internal
285
+ */
286
+ this.elementInternals = this.attachInternals();
287
+ this.elementInternals.role = 'radiogroup';
288
+ this.elementInternals.ariaOrientation = this.orientation ?? RadioGroupOrientation.horizontal;
289
+ }
290
+ /**
291
+ * Focuses the checked radio or the first enabled radio.
292
+ *
293
+ * @internal
294
+ */
295
+ focus() {
296
+ this.enabledRadios[Math.max(0, this.checkedIndex)]?.focus();
297
+ }
298
+ /**
299
+ * Enables tabbing through the radio group when the group receives focus.
300
+ *
301
+ * @param e - the focus event
302
+ * @internal
303
+ */
304
+ focusinHandler(e) {
305
+ if (!this.disabled) {
306
+ this.enabledRadios.forEach(radio => {
307
+ radio.tabIndex = 0;
308
+ });
309
+ }
310
+ return true;
311
+ }
312
+ /**
313
+ * Sets the tabindex of the radios based on the checked state when the radio group loses focus.
314
+ *
315
+ * @param e - the focusout event
316
+ * @internal
317
+ */
318
+ focusoutHandler(e) {
319
+ if (this.radios?.includes(e.relatedTarget) && this.radios?.some(x => x.checked)) {
320
+ this.restrictFocus();
321
+ }
322
+ return true;
323
+ }
324
+ formResetCallback() {
325
+ this.dirtyState = false;
326
+ this.checkedIndex = -1;
327
+ this.setFormValue(this.value);
328
+ this.setValidity();
329
+ }
330
+ getEnabledIndexInBounds(index, upperBound = this.enabledRadios.length) {
331
+ if (upperBound === 0) {
332
+ return -1;
333
+ }
334
+ return (index + upperBound) % upperBound;
335
+ }
336
+ /**
337
+ * Handles keydown events for the radio group.
338
+ *
339
+ * @param e - the keyboard event
340
+ * @internal
341
+ */
342
+ keydownHandler(e) {
343
+ const isRtl = getDirection(this) === 'rtl';
344
+ const checkedIndex = this.enabledRadios.findIndex(x => x === getRootActiveElement(this)) ?? this.checkedIndex;
345
+ let increment = 0;
346
+ switch (e.key) {
347
+ case 'ArrowLeft': {
348
+ increment = isRtl ? 1 : -1;
349
+ break;
350
+ }
351
+ case 'ArrowUp': {
352
+ increment = -1;
353
+ break;
354
+ }
355
+ case 'ArrowRight': {
356
+ increment = isRtl ? -1 : 1;
357
+ break;
358
+ }
359
+ case 'ArrowDown': {
360
+ increment = 1;
361
+ break;
362
+ }
363
+ case 'Tab': {
364
+ this.restrictFocus();
365
+ break;
366
+ }
367
+ case ' ': {
368
+ this.checkRadio();
369
+ break;
370
+ }
371
+ }
372
+ if (!increment) {
373
+ return true;
374
+ }
375
+ const nextIndex = checkedIndex + increment;
376
+ this.checkRadio(this.getEnabledIndexInBounds(nextIndex), true);
377
+ this.enabledRadios[this.checkedIndex]?.focus();
378
+ }
379
+ /**
380
+ *
381
+ * @param e - the disabled event
382
+ */
383
+ disabledRadioHandler(e) {
384
+ if (e.detail === true && e.target.checked) {
385
+ this.checkedIndex = -1;
386
+ }
387
+ }
388
+ /**
389
+ * Reports the validity of the element.
390
+ *
391
+ * @public
392
+ * @remarks
393
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
394
+ */
395
+ reportValidity() {
396
+ return this.elementInternals.reportValidity();
397
+ }
398
+ /**
399
+ * Resets the `tabIndex` for all child radios when the radio group loses focus.
400
+ *
401
+ * @internal
402
+ */
403
+ restrictFocus() {
404
+ let activeIndex = Math.max(this.checkedIndex, 0);
405
+ const focusedRadioIndex = this.enabledRadios.indexOf(getRootActiveElement(this));
406
+ if (focusedRadioIndex !== -1) {
407
+ activeIndex = focusedRadioIndex;
408
+ }
409
+ activeIndex = this.getEnabledIndexInBounds(activeIndex);
410
+ this.enabledRadios.forEach((item, index) => {
411
+ item.tabIndex = index === activeIndex ? 0 : -1;
412
+ });
413
+ }
414
+ /**
415
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
416
+ *
417
+ * @internal
418
+ */
419
+ setFormValue(value, state) {
420
+ this.elementInternals.setFormValue(value, value ?? state);
421
+ }
422
+ /**
423
+ * Sets the validity of the element.
424
+ *
425
+ * @param flags - Validity flags to set.
426
+ * @param message - Optional message to supply. If not provided, the element's `validationMessage` will be used.
427
+ * @param anchor - Optional anchor to use for the validation message.
428
+ *
429
+ * @internal
430
+ * @remarks
431
+ * RadioGroup validation is reported through the individual Radio elements rather than the RadioGroup itself.
432
+ * This is necessary because:
433
+ * 1. Each Radio is form-associated (extends BaseCheckbox which has `formAssociated = true`)
434
+ * 2. Browser validation UIs and screen readers announce validation against individual form controls
435
+ * 3. For groups like RadioGroup, the browser needs to report the error on a specific member of the group
436
+ * 4. We anchor the error to the first Radio so it receives focus and announcement
437
+ *
438
+ * When the group is invalid (required but no selection):
439
+ * - Only the first Radio gets the invalid state with the validation message
440
+ * - Other Radios are kept valid since selecting any of them would satisfy the requirement
441
+ *
442
+ * When the group becomes valid (user selects any Radio):
443
+ * - All Radios are cleared back to valid state
444
+ * - This allows form submission to proceed
445
+ */
446
+ setValidity(flags, message, anchor) {
447
+ if (this.$fastController.isConnected) {
448
+ // Always check if still required and has no value
449
+ const isInvalid = this.required && !this.value && !this.disabled;
450
+ if (!isInvalid) {
451
+ // Clear validity on all radios when group is valid
452
+ this.enabledRadios?.forEach(radio => {
453
+ radio.elementInternals.setValidity({});
454
+ });
455
+ return;
456
+ }
457
+ // Group is invalid - set error only on first enabled radio for announcement
458
+ const validationFlags = { valueMissing: true, ...flags };
459
+ const validationMessage = message ?? this.validationMessage;
460
+ this.enabledRadios?.forEach((radio, index) => {
461
+ if (index === 0) {
462
+ // Only the first radio shows the validation error for screen reader announcement
463
+ radio.elementInternals.setValidity(validationFlags, validationMessage, radio);
464
+ }
465
+ else {
466
+ // Other radios are valid (they're just not selected yet)
467
+ radio.elementInternals.setValidity({});
468
+ }
469
+ });
470
+ }
471
+ }
472
+ }
473
+ __decorate([
474
+ observable
475
+ ], BaseRadioGroup.prototype, "checkedIndex", void 0);
476
+ __decorate([
477
+ attr({ attribute: 'disabled', mode: 'boolean' })
478
+ ], BaseRadioGroup.prototype, "disabled", void 0);
479
+ __decorate([
480
+ attr({ attribute: 'value', mode: 'fromView' })
481
+ ], BaseRadioGroup.prototype, "initialValue", void 0);
482
+ __decorate([
483
+ attr
484
+ ], BaseRadioGroup.prototype, "name", void 0);
485
+ __decorate([
486
+ attr
487
+ ], BaseRadioGroup.prototype, "orientation", void 0);
488
+ __decorate([
489
+ observable
490
+ ], BaseRadioGroup.prototype, "radios", void 0);
491
+ __decorate([
492
+ attr({ mode: 'boolean' })
493
+ ], BaseRadioGroup.prototype, "required", void 0);
494
+ __decorate([
495
+ observable
496
+ ], BaseRadioGroup.prototype, "slottedRadios", void 0);
497
+ //# sourceMappingURL=radio-group.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.base.js","sourceRoot":"","sources":["../../../src/radio-group/radio-group.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;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