@ni/fast-foundation 10.1.4 → 10.1.5

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.
Files changed (40) hide show
  1. package/dist/esm/accordion/accordion.js +1 -2
  2. package/dist/esm/anchor/anchor.js +2 -4
  3. package/dist/esm/anchored-region/anchored-region-config.js +32 -6
  4. package/dist/esm/anchored-region/anchored-region.js +1 -1
  5. package/dist/esm/breadcrumb/breadcrumb.js +2 -3
  6. package/dist/esm/button/button.js +5 -10
  7. package/dist/esm/calendar/calendar.template.js +1 -2
  8. package/dist/esm/calendar/date-formatter.js +4 -1
  9. package/dist/esm/combobox/combobox.js +7 -11
  10. package/dist/esm/data-grid/data-grid-cell.js +1 -2
  11. package/dist/esm/data-grid/data-grid.js +11 -11
  12. package/dist/esm/design-system/design-system.js +4 -1
  13. package/dist/esm/design-token/custom-property-manager.js +2 -2
  14. package/dist/esm/design-token/design-token.js +16 -17
  15. package/dist/esm/di/di.js +2 -3
  16. package/dist/esm/dialog/dialog.js +2 -4
  17. package/dist/esm/directives/reflect-attributes.js +1 -1
  18. package/dist/esm/form-associated/form-associated.js +3 -5
  19. package/dist/esm/foundation-element/foundation-element.js +4 -1
  20. package/dist/esm/horizontal-scroll/horizontal-scroll.js +6 -9
  21. package/dist/esm/horizontal-scroll/horizontal-scroll.template.js +8 -11
  22. package/dist/esm/listbox/listbox.element.js +5 -10
  23. package/dist/esm/listbox/listbox.js +21 -28
  24. package/dist/esm/listbox-option/listbox-option.js +4 -7
  25. package/dist/esm/menu/menu.js +1 -1
  26. package/dist/esm/number-field/number-field.js +2 -4
  27. package/dist/esm/picker/picker-list-item.js +3 -4
  28. package/dist/esm/picker/picker-menu-option.js +3 -4
  29. package/dist/esm/picker/picker.js +12 -9
  30. package/dist/esm/radio/radio.js +3 -5
  31. package/dist/esm/radio-group/radio-group.js +4 -8
  32. package/dist/esm/select/select.js +12 -20
  33. package/dist/esm/tabs/tabs.js +2 -4
  34. package/dist/esm/test-utilities/fixture.js +57 -60
  35. package/dist/esm/test-utilities/timeout.js +5 -8
  36. package/dist/esm/toolbar/toolbar.js +7 -9
  37. package/dist/esm/utilities/intersection-service.js +2 -4
  38. package/dist/fast-foundation.js +243 -262
  39. package/dist/fast-foundation.min.js +88 -88
  40. package/package.json +2 -2
@@ -3,9 +3,7 @@ import { endSlotTemplate, startSlotTemplate } from "../patterns/start-end.js";
3
3
  /**
4
4
  * @public
5
5
  */
6
- export const horizontalScrollTemplate = (context, definition) => {
7
- var _a, _b;
8
- return html `
6
+ export const horizontalScrollTemplate = (context, definition) => html `
9
7
  <template
10
8
  class="horizontal-scroll"
11
9
  @keyup="${(x, c) => x.keyupHandler(c.event)}"
@@ -21,9 +19,9 @@ export const horizontalScrollTemplate = (context, definition) => {
21
19
  <div class="content-container" part="content-container" ${ref("content")}>
22
20
  <slot
23
21
  ${slotted({
24
- property: "scrollItems",
25
- filter: elements(),
26
- })}
22
+ property: "scrollItems",
23
+ filter: elements(),
24
+ })}
27
25
  ></slot>
28
26
  </div>
29
27
  </div>
@@ -36,8 +34,8 @@ export const horizontalScrollTemplate = (context, definition) => {
36
34
  <div class="scroll-action" part="scroll-action-previous">
37
35
  <slot name="previous-flipper">
38
36
  ${definition.previousFlipper instanceof Function
39
- ? definition.previousFlipper(context, definition)
40
- : (_a = definition.previousFlipper) !== null && _a !== void 0 ? _a : ""}
37
+ ? definition.previousFlipper(context, definition)
38
+ : definition.previousFlipper ?? ""}
41
39
  </slot>
42
40
  </div>
43
41
  </div>
@@ -49,8 +47,8 @@ export const horizontalScrollTemplate = (context, definition) => {
49
47
  <div class="scroll-action" part="scroll-action-next">
50
48
  <slot name="next-flipper">
51
49
  ${definition.nextFlipper instanceof Function
52
- ? definition.nextFlipper(context, definition)
53
- : (_b = definition.nextFlipper) !== null && _b !== void 0 ? _b : ""}
50
+ ? definition.nextFlipper(context, definition)
51
+ : definition.nextFlipper ?? ""}
54
52
  </slot>
55
53
  </div>
56
54
  </div>
@@ -59,4 +57,3 @@ export const horizontalScrollTemplate = (context, definition) => {
59
57
  ${endSlotTemplate(context, definition)}
60
58
  </template>
61
59
  `;
62
- };
@@ -40,8 +40,7 @@ export class ListboxElement extends Listbox {
40
40
  * @internal
41
41
  */
42
42
  get checkedOptions() {
43
- var _a;
44
- return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter(o => o.checked);
43
+ return this.options?.filter(o => o.checked);
45
44
  }
46
45
  /**
47
46
  * Returns the index of the first selected option.
@@ -60,8 +59,7 @@ export class ListboxElement extends Listbox {
60
59
  * @internal
61
60
  */
62
61
  activeIndexChanged(prev, next) {
63
- var _a, _b;
64
- this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : "";
62
+ this.ariaActiveDescendant = this.options[next]?.id ?? "";
65
63
  this.focusAndScrollOptionIntoView();
66
64
  }
67
65
  /**
@@ -209,11 +207,10 @@ export class ListboxElement extends Listbox {
209
207
  * @internal
210
208
  */
211
209
  clickHandler(e) {
212
- var _a;
213
210
  if (!this.multiple) {
214
211
  return super.clickHandler(e);
215
212
  }
216
- const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`);
213
+ const captured = e.target?.closest(`[role=option]`);
217
214
  if (!captured || captured.disabled) {
218
215
  return;
219
216
  }
@@ -346,9 +343,8 @@ export class ListboxElement extends Listbox {
346
343
  * @internal
347
344
  */
348
345
  multipleChanged(prev, next) {
349
- var _a;
350
346
  this.ariaMultiSelectable = next ? "true" : null;
351
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {
347
+ this.options?.forEach(o => {
352
348
  o.checked = next ? false : undefined;
353
349
  });
354
350
  this.setSelectedOptions();
@@ -378,8 +374,7 @@ export class ListboxElement extends Listbox {
378
374
  * @internal
379
375
  */
380
376
  sizeChanged(prev, next) {
381
- var _a;
382
- const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10));
377
+ const size = Math.max(0, parseInt(next?.toFixed() ?? "", 10));
383
378
  if (size !== next) {
384
379
  DOM.queueUpdate(() => {
385
380
  this.size = size;
@@ -66,8 +66,7 @@ export class Listbox extends FoundationElement {
66
66
  * @internal
67
67
  */
68
68
  get firstSelectedOption() {
69
- var _a;
70
- return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null;
69
+ return this.selectedOptions[0] ?? null;
71
70
  }
72
71
  /**
73
72
  * Returns true if there is one or more selectable option.
@@ -83,8 +82,7 @@ export class Listbox extends FoundationElement {
83
82
  * @public
84
83
  */
85
84
  get length() {
86
- var _a, _b;
87
- return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
85
+ return this.options?.length ?? 0;
88
86
  }
89
87
  /**
90
88
  * The list of options.
@@ -111,6 +109,19 @@ export class Listbox extends FoundationElement {
111
109
  set typeAheadExpired(value) {
112
110
  this.typeaheadExpired = value;
113
111
  }
112
+ /**
113
+ * A static filter to include only selectable options.
114
+ *
115
+ * @param n - element to filter
116
+ * @public
117
+ */
118
+ static { this.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; }
119
+ /**
120
+ * Typeahead timeout in milliseconds.
121
+ *
122
+ * @internal
123
+ */
124
+ static { this.TYPE_AHEAD_TIMEOUT_MS = 1000; }
114
125
  /**
115
126
  * Handle click events for listbox options.
116
127
  *
@@ -331,12 +342,11 @@ export class Listbox extends FoundationElement {
331
342
  * @internal
332
343
  */
333
344
  selectedIndexChanged(prev, next) {
334
- var _a;
335
345
  if (!this.hasSelectableOptions) {
336
346
  this.selectedIndex = -1;
337
347
  return;
338
348
  }
339
- if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") {
349
+ if (this.options[this.selectedIndex]?.disabled && typeof prev === "number") {
340
350
  const selectableIndex = this.getSelectableIndex(prev, next);
341
351
  const newNext = selectableIndex > -1 ? selectableIndex : prev;
342
352
  this.selectedIndex = newNext;
@@ -356,9 +366,8 @@ export class Listbox extends FoundationElement {
356
366
  * @internal
357
367
  */
358
368
  selectedOptionsChanged(prev, next) {
359
- var _a;
360
369
  const filteredNext = next.filter(Listbox.slottedOptionFilter);
361
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {
370
+ this.options?.forEach(o => {
362
371
  const notifier = Observable.getNotifier(o);
363
372
  notifier.unsubscribe(this, "selected");
364
373
  o.selected = filteredNext.includes(o);
@@ -371,9 +380,8 @@ export class Listbox extends FoundationElement {
371
380
  * @public
372
381
  */
373
382
  selectFirstOption() {
374
- var _a, _b;
375
383
  if (!this.disabled) {
376
- this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex(o => !o.disabled)) !== null && _b !== void 0 ? _b : -1;
384
+ this.selectedIndex = this.options?.findIndex(o => !o.disabled) ?? -1;
377
385
  }
378
386
  }
379
387
  /**
@@ -412,8 +420,7 @@ export class Listbox extends FoundationElement {
412
420
  * @internal
413
421
  */
414
422
  setDefaultSelectedOption() {
415
- var _a, _b;
416
- this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex(el => el.defaultSelected)) !== null && _b !== void 0 ? _b : -1;
423
+ this.selectedIndex = this.options?.findIndex(el => el.defaultSelected) ?? -1;
417
424
  }
418
425
  /**
419
426
  * Sets an option as selected and gives it focus.
@@ -421,10 +428,9 @@ export class Listbox extends FoundationElement {
421
428
  * @public
422
429
  */
423
430
  setSelectedOptions() {
424
- var _a, _b, _c;
425
- if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) {
431
+ if (this.options?.length) {
426
432
  this.selectedOptions = [this.options[this.selectedIndex]];
427
- this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : "";
433
+ this.ariaActiveDescendant = this.firstSelectedOption?.id ?? "";
428
434
  this.focusAndScrollOptionIntoView();
429
435
  }
430
436
  }
@@ -477,19 +483,6 @@ export class Listbox extends FoundationElement {
477
483
  }
478
484
  }
479
485
  }
480
- /**
481
- * A static filter to include only selectable options.
482
- *
483
- * @param n - element to filter
484
- * @public
485
- */
486
- Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden;
487
- /**
488
- * Typeahead timeout in milliseconds.
489
- *
490
- * @internal
491
- */
492
- Listbox.TYPE_AHEAD_TIMEOUT_MS = 1000;
493
486
  __decorate([
494
487
  attr({ mode: "boolean" })
495
488
  ], Listbox.prototype, "disabled", void 0);
@@ -94,15 +94,13 @@ export class ListboxOption extends FoundationElement {
94
94
  }
95
95
  }
96
96
  get label() {
97
- var _a;
98
- return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
97
+ return this.value ?? this.text;
99
98
  }
100
99
  get text() {
101
- var _a, _b;
102
- return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
100
+ return this.textContent?.replace(/\s+/g, " ").trim() ?? "";
103
101
  }
104
102
  set value(next) {
105
- const newValue = `${next !== null && next !== void 0 ? next : ""}`;
103
+ const newValue = `${next ?? ""}`;
106
104
  this._value = newValue;
107
105
  this.dirtyValue = true;
108
106
  if (this.proxy instanceof HTMLOptionElement) {
@@ -111,9 +109,8 @@ export class ListboxOption extends FoundationElement {
111
109
  Observable.notify(this, "value");
112
110
  }
113
111
  get value() {
114
- var _a;
115
112
  Observable.track(this, "value");
116
- return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
113
+ return this._value ?? this.text;
117
114
  }
118
115
  get form() {
119
116
  return this.proxy ? this.proxy.form : null;
@@ -185,6 +185,7 @@ export class Menu extends FoundationElement {
185
185
  this.setItems();
186
186
  }
187
187
  }
188
+ static { this.focusableElementRoles = roleForMenuItem; }
188
189
  /**
189
190
  * @internal
190
191
  */
@@ -284,7 +285,6 @@ export class Menu extends FoundationElement {
284
285
  }
285
286
  }
286
287
  }
287
- Menu.focusableElementRoles = roleForMenuItem;
288
288
  __decorate([
289
289
  observable
290
290
  ], Menu.prototype, "items", void 0);
@@ -57,8 +57,7 @@ export class NumberField extends FormAssociatedNumberField {
57
57
  * @internal
58
58
  */
59
59
  maxChanged(previous, next) {
60
- var _a;
61
- this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
60
+ this.max = Math.max(next, this.min ?? next);
62
61
  const min = Math.min(this.min, this.max);
63
62
  if (this.min !== undefined && this.min !== min) {
64
63
  this.min = min;
@@ -74,8 +73,7 @@ export class NumberField extends FormAssociatedNumberField {
74
73
  * @internal
75
74
  */
76
75
  minChanged(previous, next) {
77
- var _a;
78
- this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
76
+ this.min = Math.min(next, this.max ?? next);
79
77
  const max = Math.max(this.min, this.max);
80
78
  if (this.max !== undefined && this.max !== max) {
81
79
  this.max = max;
@@ -52,14 +52,13 @@ export class PickerListItem extends FoundationElement {
52
52
  this.$emit("pickeriteminvoked");
53
53
  }
54
54
  updateView() {
55
- var _a, _b;
56
55
  this.disconnectView();
57
56
  this.customView =
58
- (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this);
57
+ this.contentsTemplate?.render(this, this) ??
58
+ defaultContentsTemplate.render(this, this);
59
59
  }
60
60
  disconnectView() {
61
- var _a;
62
- (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose();
61
+ this.customView?.dispose();
63
62
  this.customView = undefined;
64
63
  }
65
64
  }
@@ -42,14 +42,13 @@ export class PickerMenuOption extends FoundationElement {
42
42
  this.$emit("pickeroptioninvoked");
43
43
  }
44
44
  updateView() {
45
- var _a, _b;
46
45
  this.disconnectView();
47
46
  this.customView =
48
- (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this);
47
+ this.contentsTemplate?.render(this, this) ??
48
+ defaultContentsTemplate.render(this, this);
49
49
  }
50
50
  disconnectView() {
51
- var _a;
52
- (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose();
51
+ this.customView?.dispose();
53
52
  this.customView = undefined;
54
53
  }
55
54
  }
@@ -583,12 +583,11 @@ export class Picker extends FormAssociatedPicker {
583
583
  * Disables the menu. Note that the menu can be open, just doens't have any valid options on display.
584
584
  */
585
585
  disableMenu() {
586
- var _a, _b, _c;
587
586
  this.menuFocusIndex = -1;
588
587
  this.menuFocusOptionId = undefined;
589
- (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant");
590
- (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns");
591
- (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded");
588
+ this.inputElement?.removeAttribute("aria-activedescendant");
589
+ this.inputElement?.removeAttribute("aria-owns");
590
+ this.inputElement?.removeAttribute("aria-expanded");
592
591
  }
593
592
  /**
594
593
  * Sets the currently focused menu option by index
@@ -623,17 +622,15 @@ export class Picker extends FormAssociatedPicker {
623
622
  * Updates the template used for the list item repeat behavior
624
623
  */
625
624
  updateListItemTemplate() {
626
- var _a;
627
625
  this.activeListItemTemplate =
628
- (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate;
626
+ this.listItemTemplate ?? this.defaultListItemTemplate;
629
627
  }
630
628
  /**
631
629
  * Updates the template used for the menu option repeat behavior
632
630
  */
633
631
  updateOptionTemplate() {
634
- var _a;
635
632
  this.activeMenuOptionTemplate =
636
- (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate;
633
+ this.menuOptionTemplate ?? this.defaultMenuOptionTemplate;
637
634
  }
638
635
  /**
639
636
  * Updates the filtered options array
@@ -655,7 +652,13 @@ export class Picker extends FormAssociatedPicker {
655
652
  if (newConfig === null) {
656
653
  newConfig = FlyoutPosBottomFill;
657
654
  }
658
- this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false });
655
+ this.menuConfig = {
656
+ ...newConfig,
657
+ autoUpdateMode: "auto",
658
+ fixedPlacement: true,
659
+ horizontalViewportLock: false,
660
+ verticalViewportLock: false,
661
+ };
659
662
  }
660
663
  }
661
664
  __decorate([
@@ -24,13 +24,12 @@ export class Radio extends FormAssociatedRadio {
24
24
  * @internal
25
25
  */
26
26
  defaultCheckedChanged() {
27
- var _a;
28
27
  if (this.$fastController.isConnected && !this.dirtyChecked) {
29
28
  // Setting this.checked will cause us to enter a dirty state,
30
29
  // but if we are clean when defaultChecked is changed, we want to stay
31
30
  // in a clean state, so reset this.dirtyChecked
32
31
  if (!this.isInsideRadioGroup()) {
33
- this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;
32
+ this.checked = this.defaultChecked ?? false;
34
33
  this.dirtyChecked = false;
35
34
  }
36
35
  }
@@ -63,10 +62,9 @@ export class Radio extends FormAssociatedRadio {
63
62
  * @internal
64
63
  */
65
64
  connectedCallback() {
66
- var _a, _b;
67
65
  super.connectedCallback();
68
66
  this.validate();
69
- if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" &&
67
+ if (this.parentElement?.getAttribute("role") !== "radiogroup" &&
70
68
  this.getAttribute("tabindex") === null) {
71
69
  if (!this.disabled) {
72
70
  this.setAttribute("tabindex", "0");
@@ -78,7 +76,7 @@ export class Radio extends FormAssociatedRadio {
78
76
  // but if we are clean when defaultChecked is changed, we want to stay
79
77
  // in a clean state, so reset this.dirtyChecked
80
78
  if (!this.isInsideRadioGroup()) {
81
- this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;
79
+ this.checked = this.defaultChecked ?? false;
82
80
  this.dirtyChecked = false;
83
81
  }
84
82
  }
@@ -63,12 +63,10 @@ export class RadioGroup extends FoundationElement {
63
63
  radio.focus();
64
64
  };
65
65
  this.moveRightOffGroup = () => {
66
- var _a;
67
- (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
66
+ this.nextElementSibling?.focus();
68
67
  };
69
68
  this.moveLeftOffGroup = () => {
70
- var _a;
71
- (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
69
+ this.previousElementSibling?.focus();
72
70
  };
73
71
  /**
74
72
  * @internal
@@ -294,12 +292,10 @@ export class RadioGroup extends FoundationElement {
294
292
  return this.closest('[role="toolbar"]');
295
293
  }
296
294
  get isInsideToolbar() {
297
- var _a;
298
- return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);
295
+ return (this.parentToolbar ?? false);
299
296
  }
300
297
  get isInsideFoundationToolbar() {
301
- var _a;
302
- return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]);
298
+ return !!this.parentToolbar?.["$fastController"];
303
299
  }
304
300
  /**
305
301
  * @internal
@@ -98,17 +98,16 @@ export class Select extends FormAssociatedSelect {
98
98
  return this._value;
99
99
  }
100
100
  set value(next) {
101
- var _a, _b, _c, _d, _e, _f, _g;
102
101
  const prev = `${this._value}`;
103
- if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
102
+ if (this._options?.length) {
104
103
  const selectedIndex = this._options.findIndex(el => el.value === next);
105
- const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
106
- const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
104
+ const prevSelectedValue = this._options[this.selectedIndex]?.value ?? null;
105
+ const nextSelectedValue = this._options[selectedIndex]?.value ?? null;
107
106
  if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
108
107
  next = "";
109
108
  this.selectedIndex = selectedIndex;
110
109
  }
111
- next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
110
+ next = this.firstSelectedOption?.value ?? next;
112
111
  }
113
112
  if (prev !== next) {
114
113
  this._value = next;
@@ -125,9 +124,8 @@ export class Select extends FormAssociatedSelect {
125
124
  * @internal
126
125
  */
127
126
  updateValue(shouldEmit) {
128
- var _a, _b;
129
127
  if (this.$fastController.isConnected) {
130
- this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
128
+ this.value = this.firstSelectedOption?.value ?? "";
131
129
  }
132
130
  if (shouldEmit) {
133
131
  this.$emit("input");
@@ -179,9 +177,8 @@ export class Select extends FormAssociatedSelect {
179
177
  * @public
180
178
  */
181
179
  get displayValue() {
182
- var _a, _b;
183
180
  Observable.track(this, "displayValue");
184
- return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
181
+ return this.firstSelectedOption?.text ?? "";
185
182
  }
186
183
  /**
187
184
  * Synchronize the `aria-disabled` property when the `disabled` property changes.
@@ -242,7 +239,6 @@ export class Select extends FormAssociatedSelect {
242
239
  * @internal
243
240
  */
244
241
  focusoutHandler(e) {
245
- var _a;
246
242
  super.focusoutHandler(e);
247
243
  if (!this.open) {
248
244
  return true;
@@ -252,7 +248,7 @@ export class Select extends FormAssociatedSelect {
252
248
  this.focus();
253
249
  return;
254
250
  }
255
- if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
251
+ if (!this.options?.includes(focusTarget)) {
256
252
  this.open = false;
257
253
  if (this.indexWhenOpened !== this.selectedIndex) {
258
254
  this.updateValue(true);
@@ -304,8 +300,7 @@ export class Select extends FormAssociatedSelect {
304
300
  * @internal
305
301
  */
306
302
  mousedownHandler(e) {
307
- var _a;
308
- if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
303
+ if (e.offsetX >= 0 && e.offsetX <= this.listbox?.scrollWidth) {
309
304
  return super.mousedownHandler(e);
310
305
  }
311
306
  return this.collapsible;
@@ -332,11 +327,9 @@ export class Select extends FormAssociatedSelect {
332
327
  * @internal
333
328
  */
334
329
  selectedOptionsChanged(prev, next) {
335
- var _a;
336
330
  super.selectedOptionsChanged(prev, next);
337
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
338
- var _a;
339
- const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
331
+ this.options?.forEach((o, i) => {
332
+ const proxyOption = this.proxy?.options.item(i);
340
333
  if (proxyOption) {
341
334
  proxyOption.selected = o.selected;
342
335
  }
@@ -350,9 +343,8 @@ export class Select extends FormAssociatedSelect {
350
343
  * @internal
351
344
  */
352
345
  setDefaultSelectedOption() {
353
- var _a;
354
- const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
355
- const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
346
+ const options = this.options ?? Array.from(this.children).filter(Listbox.slottedOptionFilter);
347
+ const selectedIndex = options?.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
356
348
  if (selectedIndex !== -1) {
357
349
  this.selectedIndex = selectedIndex;
358
350
  return;
@@ -273,14 +273,12 @@ export class Tabs extends FoundationElement {
273
273
  }
274
274
  getTabIds() {
275
275
  return this.tabs.map((tab) => {
276
- var _a;
277
- return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`;
276
+ return tab.getAttribute("id") ?? `tab-${uniqueId()}`;
278
277
  });
279
278
  }
280
279
  getTabPanelIds() {
281
280
  return this.tabpanels.map((tabPanel) => {
282
- var _a;
283
- return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`;
281
+ return tabPanel.getAttribute("id") ?? `panel-${uniqueId()}`;
284
282
  });
285
283
  }
286
284
  setComponent() {