@fluentui/web-components 2.5.1 → 2.5.4

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.
@@ -321,36 +321,6 @@ const DOM = Object.freeze({
321
321
 
322
322
  });
323
323
 
324
- function spilloverSubscribe(subscriber) {
325
- const spillover = this.spillover;
326
- const index = spillover.indexOf(subscriber);
327
-
328
- if (index === -1) {
329
- spillover.push(subscriber);
330
- }
331
- }
332
-
333
- function spilloverUnsubscribe(subscriber) {
334
- const spillover = this.spillover;
335
- const index = spillover.indexOf(subscriber);
336
-
337
- if (index !== -1) {
338
- spillover.splice(index, 1);
339
- }
340
- }
341
-
342
- function spilloverNotifySubscribers(args) {
343
- const spillover = this.spillover;
344
- const source = this.source;
345
-
346
- for (let i = 0, ii = spillover.length; i < ii; ++i) {
347
- spillover[i].handleChange(source, args);
348
- }
349
- }
350
-
351
- function spilloverHas(subscriber) {
352
- return this.spillover.indexOf(subscriber) !== -1;
353
- }
354
324
  /**
355
325
  * An implementation of {@link Notifier} that efficiently keeps track of
356
326
  * subscribers interested in a specific change notification on an
@@ -362,8 +332,6 @@ function spilloverHas(subscriber) {
362
332
  * If the set ever exceeds two subscribers, it upgrades to an array automatically.
363
333
  * @public
364
334
  */
365
-
366
-
367
335
  class SubscriberSet {
368
336
  /**
369
337
  * Creates an instance of SubscriberSet for the specified source.
@@ -384,7 +352,7 @@ class SubscriberSet {
384
352
 
385
353
 
386
354
  has(subscriber) {
387
- return this.sub1 === subscriber || this.sub2 === subscriber;
355
+ return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1;
388
356
  }
389
357
  /**
390
358
  * Subscribes to notification of changes in an object's state.
@@ -393,27 +361,33 @@ class SubscriberSet {
393
361
 
394
362
 
395
363
  subscribe(subscriber) {
396
- if (this.has(subscriber)) {
397
- return;
398
- }
364
+ const spillover = this.spillover;
399
365
 
400
- if (this.sub1 === void 0) {
401
- this.sub1 = subscriber;
402
- return;
403
- }
366
+ if (spillover === void 0) {
367
+ if (this.has(subscriber)) {
368
+ return;
369
+ }
404
370
 
405
- if (this.sub2 === void 0) {
406
- this.sub2 = subscriber;
407
- return;
408
- }
371
+ if (this.sub1 === void 0) {
372
+ this.sub1 = subscriber;
373
+ return;
374
+ }
409
375
 
410
- this.spillover = [this.sub1, this.sub2, subscriber];
411
- this.subscribe = spilloverSubscribe;
412
- this.unsubscribe = spilloverUnsubscribe;
413
- this.notify = spilloverNotifySubscribers;
414
- this.has = spilloverHas;
415
- this.sub1 = void 0;
416
- this.sub2 = void 0;
376
+ if (this.sub2 === void 0) {
377
+ this.sub2 = subscriber;
378
+ return;
379
+ }
380
+
381
+ this.spillover = [this.sub1, this.sub2, subscriber];
382
+ this.sub1 = void 0;
383
+ this.sub2 = void 0;
384
+ } else {
385
+ const index = spillover.indexOf(subscriber);
386
+
387
+ if (index === -1) {
388
+ spillover.push(subscriber);
389
+ }
390
+ }
417
391
  }
418
392
  /**
419
393
  * Unsubscribes from notification of changes in an object's state.
@@ -422,10 +396,20 @@ class SubscriberSet {
422
396
 
423
397
 
424
398
  unsubscribe(subscriber) {
425
- if (this.sub1 === subscriber) {
426
- this.sub1 = void 0;
427
- } else if (this.sub2 === subscriber) {
428
- this.sub2 = void 0;
399
+ const spillover = this.spillover;
400
+
401
+ if (spillover === void 0) {
402
+ if (this.sub1 === subscriber) {
403
+ this.sub1 = void 0;
404
+ } else if (this.sub2 === subscriber) {
405
+ this.sub2 = void 0;
406
+ }
407
+ } else {
408
+ const index = spillover.indexOf(subscriber);
409
+
410
+ if (index !== -1) {
411
+ spillover.splice(index, 1);
412
+ }
429
413
  }
430
414
  }
431
415
  /**
@@ -435,16 +419,24 @@ class SubscriberSet {
435
419
 
436
420
 
437
421
  notify(args) {
438
- const sub1 = this.sub1;
439
- const sub2 = this.sub2;
422
+ const spillover = this.spillover;
440
423
  const source = this.source;
441
424
 
442
- if (sub1 !== void 0) {
443
- sub1.handleChange(source, args);
444
- }
425
+ if (spillover === void 0) {
426
+ const sub1 = this.sub1;
427
+ const sub2 = this.sub2;
428
+
429
+ if (sub1 !== void 0) {
430
+ sub1.handleChange(source, args);
431
+ }
445
432
 
446
- if (sub2 !== void 0) {
447
- sub2.handleChange(source, args);
433
+ if (sub2 !== void 0) {
434
+ sub2.handleChange(source, args);
435
+ }
436
+ } else {
437
+ for (let i = 0, ii = spillover.length; i < ii; ++i) {
438
+ spillover[i].handleChange(source, args);
439
+ }
448
440
  }
449
441
  }
450
442
 
@@ -677,6 +669,8 @@ const Observable = FAST.getById(2
677
669
  /* eslint-disable-next-line */
678
670
 
679
671
  prevValue = prev.propertySource[prev.propertyName];
672
+ /* eslint-disable-next-line @typescript-eslint/no-this-alias */
673
+
680
674
  watcher = this;
681
675
 
682
676
  if (propertySource === prevValue) {
@@ -1362,6 +1356,7 @@ class CompilationContext {
1362
1356
  }
1363
1357
 
1364
1358
  release() {
1359
+ /* eslint-disable-next-line @typescript-eslint/no-this-alias */
1365
1360
  sharedContext = this;
1366
1361
  }
1367
1362
 
@@ -1929,9 +1924,6 @@ function html(strings, ...values) {
1929
1924
  class ElementStyles {
1930
1925
  constructor() {
1931
1926
  this.targets = new WeakSet();
1932
- /** @internal */
1933
-
1934
- this.behaviors = null;
1935
1927
  }
1936
1928
  /** @internal */
1937
1929
 
@@ -3505,6 +3497,11 @@ class ArrayObserver extends SubscriberSet {
3505
3497
  });
3506
3498
  }
3507
3499
 
3500
+ subscribe(subscriber) {
3501
+ this.flush();
3502
+ super.subscribe(subscriber);
3503
+ }
3504
+
3508
3505
  addSplice(splice) {
3509
3506
  if (this.splices === void 0) {
3510
3507
  this.splices = [splice];
@@ -3864,37 +3861,54 @@ class RepeatBehavior {
3864
3861
  updateViews(splices) {
3865
3862
  const childContext = this.childContext;
3866
3863
  const views = this.views;
3867
- const totalRemoved = [];
3868
3864
  const bindView = this.bindView;
3869
- let removeDelta = 0;
3870
-
3871
- for (let i = 0, ii = splices.length; i < ii; ++i) {
3872
- const splice = splices[i];
3873
- const removed = splice.removed;
3874
- totalRemoved.push(...views.splice(splice.index + removeDelta, removed.length));
3875
- removeDelta -= splice.addedCount;
3876
- }
3877
-
3878
3865
  const items = this.items;
3879
3866
  const template = this.template;
3867
+ const recycle = this.options.recycle;
3868
+ const leftoverViews = [];
3869
+ let leftoverIndex = 0;
3870
+ let availableViews = 0;
3880
3871
 
3881
3872
  for (let i = 0, ii = splices.length; i < ii; ++i) {
3882
3873
  const splice = splices[i];
3874
+ const removed = splice.removed;
3875
+ let removeIndex = 0;
3883
3876
  let addIndex = splice.index;
3884
3877
  const end = addIndex + splice.addedCount;
3878
+ const removedViews = views.splice(splice.index, removed.length);
3879
+ availableViews = leftoverViews.length + removedViews.length;
3885
3880
 
3886
3881
  for (; addIndex < end; ++addIndex) {
3887
3882
  const neighbor = views[addIndex];
3888
3883
  const location = neighbor ? neighbor.firstChild : this.location;
3889
- const view = this.options.recycle && totalRemoved.length > 0 ? totalRemoved.shift() : template.create();
3884
+ let view;
3885
+
3886
+ if (recycle && availableViews > 0) {
3887
+ if (removeIndex <= availableViews && removedViews.length > 0) {
3888
+ view = removedViews[removeIndex];
3889
+ removeIndex++;
3890
+ } else {
3891
+ view = leftoverViews[leftoverIndex];
3892
+ leftoverIndex++;
3893
+ }
3894
+
3895
+ availableViews--;
3896
+ } else {
3897
+ view = template.create();
3898
+ }
3899
+
3890
3900
  views.splice(addIndex, 0, view);
3891
3901
  bindView(view, items, addIndex, childContext);
3892
3902
  view.insertBefore(location);
3893
3903
  }
3904
+
3905
+ if (removedViews[removeIndex]) {
3906
+ leftoverViews.push(...removedViews.slice(removeIndex));
3907
+ }
3894
3908
  }
3895
3909
 
3896
- for (let i = 0, ii = totalRemoved.length; i < ii; ++i) {
3897
- totalRemoved[i].dispose();
3910
+ for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) {
3911
+ leftoverViews[i].dispose();
3898
3912
  }
3899
3913
 
3900
3914
  if (this.options.positioning) {
@@ -3916,7 +3930,7 @@ class RepeatBehavior {
3916
3930
  let views = this.views;
3917
3931
  let viewsLength = views.length;
3918
3932
 
3919
- if (itemsLength === 0 || templateChanged) {
3933
+ if (itemsLength === 0 || templateChanged || !this.options.recycle) {
3920
3934
  // all views need to be removed
3921
3935
  HTMLView.disposeContiguousBatch(views);
3922
3936
  viewsLength = 0;
@@ -4014,7 +4028,7 @@ class RepeatDirective extends HTMLDirective {
4014
4028
 
4015
4029
  function repeat(itemsBinding, templateOrTemplateBinding, options = defaultRepeatOptions) {
4016
4030
  const templateBinding = typeof templateOrTemplateBinding === "function" ? templateOrTemplateBinding : () => templateOrTemplateBinding;
4017
- return new RepeatDirective(itemsBinding, templateBinding, options);
4031
+ return new RepeatDirective(itemsBinding, templateBinding, Object.assign(Object.assign({}, defaultRepeatOptions), options));
4018
4032
  }
4019
4033
 
4020
4034
  /**
@@ -5951,6 +5965,22 @@ function applyMixins(derivedCtor, ...baseCtors) {
5951
5965
 
5952
5966
  /**
5953
5967
  * An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
5968
+ *
5969
+ * @slot start - Content which can be provided between the heading and the icon
5970
+ * @slot end - Content which can be provided between the start slot and icon
5971
+ * @slot heading - Content which serves as the accordion item heading and text of the expand button
5972
+ * @slot - The default slot for accordion item content
5973
+ * @slot expanded-icon - The expanded icon
5974
+ * @slot collapsed-icon - The collapsed icon
5975
+ * @fires change - Fires a custom 'change' event when the button is invoked
5976
+ * @csspart heading - Wraps the button
5977
+ * @csspart button - The button which serves to invoke the item
5978
+ * @csspart heading-content - Wraps the slot for the heading content within the button
5979
+ * @csspart icon - The icon container
5980
+ * @csspart expanded-icon - The expanded icon slot
5981
+ * @csspart collapsed-icon - The collapsed icon
5982
+ * @csspart region - The wrapper for the accordion item content
5983
+ *
5954
5984
  * @public
5955
5985
  */
5956
5986
 
@@ -6019,12 +6049,13 @@ html`<template><slot ${slotted({
6019
6049
  filter: elements()
6020
6050
  })}></slot><slot name="item" part="item" ${slotted("accordionItems")}></slot></template>`;
6021
6051
 
6022
- var Orientation;
6023
-
6024
- (function (Orientation) {
6025
- Orientation["horizontal"] = "horizontal";
6026
- Orientation["vertical"] = "vertical";
6027
- })(Orientation || (Orientation = {}));
6052
+ /**
6053
+ * Standard orientation values
6054
+ */
6055
+ const Orientation = {
6056
+ horizontal: "horizontal",
6057
+ vertical: "vertical"
6058
+ };
6028
6059
 
6029
6060
  /**
6030
6061
  * Returns the index of the last element in the array where predicate is true, and -1 otherwise.
@@ -6321,29 +6352,29 @@ var SystemColors;
6321
6352
  * @public
6322
6353
  */
6323
6354
 
6324
- var AccordionExpandMode;
6325
-
6326
- (function (AccordionExpandMode) {
6355
+ const AccordionExpandMode = {
6327
6356
  /**
6328
6357
  * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.
6329
6358
  */
6330
- AccordionExpandMode["single"] = "single";
6359
+ single: "single",
6360
+
6331
6361
  /**
6332
6362
  * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously.
6333
6363
  */
6334
-
6335
- AccordionExpandMode["multi"] = "multi";
6336
- })(AccordionExpandMode || (AccordionExpandMode = {}));
6364
+ multi: "multi"
6365
+ };
6337
6366
  /**
6338
6367
  * An Accordion Custom HTML Element
6339
6368
  * Implements {@link https://www.w3.org/TR/wai-aria-practices-1.1/#accordion | ARIA Accordion}.
6369
+ *
6370
+ * @fires change - Fires a custom 'change' event when the active item changes
6371
+ * @csspart item - The slot for the accordion items
6340
6372
  * @public
6341
6373
  *
6342
6374
  * @remarks
6343
6375
  * Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(AccordionItem:class)}.
6344
6376
  */
6345
6377
 
6346
-
6347
6378
  class Accordion extends FoundationElement {
6348
6379
  constructor() {
6349
6380
  super(...arguments);
@@ -6624,6 +6655,12 @@ __decorate$1([attr({
6624
6655
  * An Anchor Custom HTML Element.
6625
6656
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
6626
6657
  *
6658
+ * @slot start - Content which can be provided before the anchor content
6659
+ * @slot end - Content which can be provided after the anchor content
6660
+ * @slot - The default slot for anchor content
6661
+ * @csspart control - The anchor element
6662
+ * @csspart content - The element wrapping anchor content
6663
+ *
6627
6664
  * @public
6628
6665
  */
6629
6666
 
@@ -6825,6 +6862,10 @@ class IntersectionService {
6825
6862
  /**
6826
6863
  * An anchored region Custom HTML Element.
6827
6864
  *
6865
+ * @slot - The default slot for the content
6866
+ * @fires loaded - Fires a custom 'loaded' event when the region is loaded and visible
6867
+ * @fires positionchange - Fires a custom 'positionchange' event when the position has changed
6868
+ *
6828
6869
  * @public
6829
6870
  */
6830
6871
 
@@ -7357,7 +7398,7 @@ class AnchoredRegion extends FoundationElement {
7357
7398
  switch (this.horizontalScaling) {
7358
7399
  case "anchor":
7359
7400
  case "fill":
7360
- nextRegionWidth = nextPositionerDimension.width;
7401
+ nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width;
7361
7402
  this.regionWidth = `${nextRegionWidth}px`;
7362
7403
  break;
7363
7404
 
@@ -7441,7 +7482,7 @@ class AnchoredRegion extends FoundationElement {
7441
7482
  switch (this.verticalScaling) {
7442
7483
  case "anchor":
7443
7484
  case "fill":
7444
- nextRegionHeight = nextPositionerDimension.height;
7485
+ nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height;
7445
7486
  this.regionHeight = `${nextRegionHeight}px`;
7446
7487
  break;
7447
7488
 
@@ -7894,6 +7935,8 @@ const badgeTemplate = (context, definition) => html`<template class="${x => x.ci
7894
7935
 
7895
7936
  /**
7896
7937
  * A Badge Custom HTML Element.
7938
+ * @slot - The default slot for the badge
7939
+ * @csspart control - The element representing the badge, which wraps the default slot
7897
7940
  *
7898
7941
  * @public
7899
7942
  */
@@ -7975,6 +8018,8 @@ const breadcrumbTemplate = (context, definition) => html`<template role="navigat
7975
8018
 
7976
8019
  /**
7977
8020
  * A Breadcrumb Custom HTML Element.
8021
+ * @slot - The default slot for the breadcrumb items
8022
+ * @csspart list - The element wrapping the slotted items
7978
8023
  *
7979
8024
  * @public
7980
8025
  */
@@ -8422,15 +8467,12 @@ function FormAssociated(BaseCtor) {
8422
8467
  this.removeChild(this.proxy);
8423
8468
  (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);
8424
8469
  }
8425
- /**
8426
- * Sets the validity of the custom element. By default this uses the proxy element to determine
8427
- * validity, but this can be extended or replaced in implementation.
8428
- */
8470
+ /** {@inheritDoc (FormAssociated:interface).validate} */
8429
8471
 
8430
8472
 
8431
- validate() {
8473
+ validate(anchor) {
8432
8474
  if (this.proxy instanceof HTMLElement) {
8433
- this.setValidity(this.proxy.validity, this.proxy.validationMessage);
8475
+ this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor);
8434
8476
  }
8435
8477
  }
8436
8478
  /**
@@ -8617,6 +8659,12 @@ class FormAssociatedButton extends FormAssociated(_Button) {
8617
8659
  * A Button Custom HTML Element.
8618
8660
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
8619
8661
  *
8662
+ * @slot start - Content which can be provided before the button content
8663
+ * @slot end - Content which can be provided after the button content
8664
+ * @slot - The default slot for button content
8665
+ * @csspart control - The button element
8666
+ * @csspart content - The element wrapping button content
8667
+ *
8620
8668
  * @public
8621
8669
  */
8622
8670
 
@@ -8728,6 +8776,12 @@ class Button$1 extends FormAssociatedButton {
8728
8776
  next === "reset" && this.addEventListener("click", this.handleFormReset);
8729
8777
  previous === "reset" && this.removeEventListener("click", this.handleFormReset);
8730
8778
  }
8779
+ /** {@inheritDoc (FormAssociated:interface).validate} */
8780
+
8781
+
8782
+ validate() {
8783
+ super.validate(this.control);
8784
+ }
8731
8785
  /**
8732
8786
  * @internal
8733
8787
  */
@@ -9000,6 +9054,10 @@ class DateFormatter {
9000
9054
 
9001
9055
  /**
9002
9056
  * Calendar component
9057
+ *
9058
+ * @slot - The default slot for calendar content
9059
+ * @fires dateselected - Fires a custom 'dateselected' event when Enter is invoked via keyboard on a date
9060
+ *
9003
9061
  * @public
9004
9062
  */
9005
9063
 
@@ -9326,50 +9384,44 @@ __decorate$1([attr({
9326
9384
  })], Calendar$1.prototype, "selectedDates", void 0);
9327
9385
 
9328
9386
  /**
9329
- * Enumerates auto generated header options
9387
+ * Enumerates the data grid auto generated header options
9330
9388
  * default option generates a non-sticky header row
9331
9389
  *
9332
9390
  * @public
9333
9391
  */
9334
- var GenerateHeaderOptions;
9335
-
9336
- (function (GenerateHeaderOptions) {
9337
- GenerateHeaderOptions["none"] = "none";
9338
- GenerateHeaderOptions["default"] = "default";
9339
- GenerateHeaderOptions["sticky"] = "sticky";
9340
- })(GenerateHeaderOptions || (GenerateHeaderOptions = {}));
9392
+ const GenerateHeaderOptions = {
9393
+ none: "none",
9394
+ default: "default",
9395
+ sticky: "sticky"
9396
+ };
9341
9397
  /**
9342
- * Enumerates possible cell types.
9398
+ * Enumerates possible data grid cell types.
9343
9399
  *
9344
9400
  * @public
9345
9401
  */
9346
9402
 
9347
-
9348
- var DataGridCellTypes;
9349
-
9350
- (function (DataGridCellTypes) {
9351
- DataGridCellTypes["default"] = "default";
9352
- DataGridCellTypes["columnHeader"] = "columnheader";
9353
- DataGridCellTypes["rowHeader"] = "rowheader";
9354
- })(DataGridCellTypes || (DataGridCellTypes = {}));
9403
+ const DataGridCellTypes = {
9404
+ default: "default",
9405
+ columnHeader: "columnheader",
9406
+ rowHeader: "rowheader"
9407
+ };
9355
9408
  /**
9356
- * Enumerates possible row types
9409
+ * Enumerates possible data grid row types
9357
9410
  *
9358
9411
  * @public
9359
9412
  */
9360
9413
 
9361
-
9362
- var DataGridRowTypes;
9363
-
9364
- (function (DataGridRowTypes) {
9365
- DataGridRowTypes["default"] = "default";
9366
- DataGridRowTypes["header"] = "header";
9367
- DataGridRowTypes["stickyHeader"] = "sticky-header";
9368
- })(DataGridRowTypes || (DataGridRowTypes = {}));
9414
+ const DataGridRowTypes = {
9415
+ default: "default",
9416
+ header: "header",
9417
+ stickyHeader: "sticky-header"
9418
+ };
9369
9419
 
9370
9420
  /**
9371
9421
  * A Data Grid Row Custom HTML Element.
9372
9422
  *
9423
+ * @fires row-focused - Fires a custom 'row-focused' event when focus is on an element (usually a cell or its contents) in the row
9424
+ * @slot - The default slot for custom cell elements
9373
9425
  * @public
9374
9426
  */
9375
9427
 
@@ -9605,6 +9657,7 @@ const dataGridTemplate = (context, definition) => {
9605
9657
  /**
9606
9658
  * A Data Grid Custom HTML Element.
9607
9659
  *
9660
+ * @slot - The default slot for custom row elements
9608
9661
  * @public
9609
9662
  */
9610
9663
 
@@ -10103,6 +10156,8 @@ const defaultHeaderCellContentsTemplate = html`<template>${x => x.columnDefiniti
10103
10156
  /**
10104
10157
  * A Data Grid Cell Custom HTML Element.
10105
10158
  *
10159
+ * @fires cell-focused - Fires a custom 'cell-focused' event when focus is on the cell or its contents
10160
+ * @slot - The default slot for cell contents. The "cell contents template" renders here.
10106
10161
  * @public
10107
10162
  */
10108
10163
 
@@ -10473,6 +10528,8 @@ const cardTemplate = (context, definition) => html`<slot></slot>`;
10473
10528
  /**
10474
10529
  * An Card Custom HTML Element.
10475
10530
  *
10531
+ * @slot - The default slot for the card content
10532
+ *
10476
10533
  * @public
10477
10534
  */
10478
10535
 
@@ -10505,6 +10562,13 @@ class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
10505
10562
  * A Checkbox Custom HTML Element.
10506
10563
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
10507
10564
  *
10565
+ * @slot checked-indicator - The checked indicator
10566
+ * @slot indeterminate-indicator - The indeterminate indicator
10567
+ * @slot - The default slot for the label
10568
+ * @csspart control - The element representing the visual checkbox control
10569
+ * @csspart label - The label
10570
+ * @fires change - Emits a custom change event when the checked state changes
10571
+ *
10508
10572
  * @public
10509
10573
  */
10510
10574
 
@@ -10529,8 +10593,16 @@ class Checkbox extends FormAssociatedCheckbox {
10529
10593
  */
10530
10594
 
10531
10595
  this.keypressHandler = e => {
10596
+ if (this.readOnly) {
10597
+ return;
10598
+ }
10599
+
10532
10600
  switch (e.key) {
10533
10601
  case keySpace:
10602
+ if (this.indeterminate) {
10603
+ this.indeterminate = false;
10604
+ }
10605
+
10534
10606
  this.checked = !this.checked;
10535
10607
  break;
10536
10608
  }
@@ -10542,6 +10614,10 @@ class Checkbox extends FormAssociatedCheckbox {
10542
10614
 
10543
10615
  this.clickHandler = e => {
10544
10616
  if (!this.disabled && !this.readOnly) {
10617
+ if (this.indeterminate) {
10618
+ this.indeterminate = false;
10619
+ }
10620
+
10545
10621
  this.checked = !this.checked;
10546
10622
  }
10547
10623
  };
@@ -10580,6 +10656,11 @@ function isListboxOption(el) {
10580
10656
  * An Option Custom HTML Element.
10581
10657
  * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
10582
10658
  *
10659
+ * @slot start - Content which can be provided before the listbox option content
10660
+ * @slot end - Content which can be provided after the listbox option content
10661
+ * @slot - The default slot for listbox option content
10662
+ * @csspart content - Wraps the listbox option content
10663
+ *
10583
10664
  * @public
10584
10665
  */
10585
10666
 
@@ -10646,7 +10727,25 @@ class ListboxOption extends FoundationElement {
10646
10727
  return;
10647
10728
  }
10648
10729
 
10649
- this.ariaChecked = undefined;
10730
+ this.ariaChecked = null;
10731
+ }
10732
+ /**
10733
+ * Updates the proxy's text content when the default slot changes.
10734
+ * @param prev - the previous content value
10735
+ * @param next - the current content value
10736
+ *
10737
+ * @internal
10738
+ */
10739
+
10740
+
10741
+ contentChanged(prev, next) {
10742
+ if (this.proxy instanceof HTMLOptionElement) {
10743
+ this.proxy.textContent = this.textContent;
10744
+ }
10745
+
10746
+ this.$emit("contentchange", null, {
10747
+ bubbles: true
10748
+ });
10650
10749
  }
10651
10750
 
10652
10751
  defaultSelectedChanged() {
@@ -10697,31 +10796,34 @@ class ListboxOption extends FoundationElement {
10697
10796
  }
10698
10797
 
10699
10798
  get label() {
10700
- var _a, _b;
10799
+ var _a;
10701
10800
 
10702
- return (_b = (_a = this.value) !== null && _a !== void 0 ? _a : this.textContent) !== null && _b !== void 0 ? _b : "";
10801
+ return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
10703
10802
  }
10704
10803
 
10705
10804
  get text() {
10706
- return this.textContent;
10805
+ var _a, _b;
10806
+
10807
+ return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
10707
10808
  }
10708
10809
 
10709
10810
  set value(next) {
10710
- this._value = next;
10811
+ const newValue = `${next !== null && next !== void 0 ? next : ""}`;
10812
+ this._value = newValue;
10711
10813
  this.dirtyValue = true;
10712
10814
 
10713
- if (this.proxy instanceof HTMLElement) {
10714
- this.proxy.value = next;
10815
+ if (this.proxy instanceof HTMLOptionElement) {
10816
+ this.proxy.value = newValue;
10715
10817
  }
10716
10818
 
10717
10819
  Observable.notify(this, "value");
10718
10820
  }
10719
10821
 
10720
10822
  get value() {
10721
- var _a, _b;
10823
+ var _a;
10722
10824
 
10723
10825
  Observable.track(this, "value");
10724
- return (_b = (_a = this._value) !== null && _a !== void 0 ? _a : this.textContent) !== null && _b !== void 0 ? _b : "";
10826
+ return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
10725
10827
  }
10726
10828
 
10727
10829
  get form() {
@@ -10732,6 +10834,8 @@ class ListboxOption extends FoundationElement {
10732
10834
 
10733
10835
  __decorate$1([observable], ListboxOption.prototype, "checked", void 0);
10734
10836
 
10837
+ __decorate$1([observable], ListboxOption.prototype, "content", void 0);
10838
+
10735
10839
  __decorate$1([observable], ListboxOption.prototype, "defaultSelected", void 0);
10736
10840
 
10737
10841
  __decorate$1([attr({
@@ -10773,6 +10877,8 @@ applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption);
10773
10877
  * A Listbox Custom HTML Element.
10774
10878
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#listbox | ARIA listbox }.
10775
10879
  *
10880
+ * @slot - The default slot for the listbox options
10881
+ *
10776
10882
  * @public
10777
10883
  */
10778
10884
 
@@ -11140,6 +11246,19 @@ class Listbox$1 extends FoundationElement {
11140
11246
  this.shouldSkipFocus = !this.contains(document.activeElement);
11141
11247
  return true;
11142
11248
  }
11249
+ /**
11250
+ * Switches between single-selection and multi-selection mode.
11251
+ *
11252
+ * @param prev - the previous value of the `multiple` attribute
11253
+ * @param next - the next value of the `multiple` attribute
11254
+ *
11255
+ * @internal
11256
+ */
11257
+
11258
+
11259
+ multipleChanged(prev, next) {
11260
+ this.ariaMultiSelectable = next ? "true" : null;
11261
+ }
11143
11262
  /**
11144
11263
  * Updates the list of selected options when the `selectedIndex` changes.
11145
11264
  *
@@ -11338,7 +11457,7 @@ class Listbox$1 extends FoundationElement {
11338
11457
  * @public
11339
11458
  */
11340
11459
 
11341
- Listbox$1.slottedOptionFilter = n => isListboxOption(n) && !n.disabled && !n.hidden;
11460
+ Listbox$1.slottedOptionFilter = n => isListboxOption(n) && !n.hidden;
11342
11461
  /**
11343
11462
  * Typeahead timeout in milliseconds.
11344
11463
  *
@@ -11383,12 +11502,10 @@ applyMixins(Listbox$1, DelegatesARIAListbox);
11383
11502
  * Positioning directions for the listbox when a select is open.
11384
11503
  * @public
11385
11504
  */
11386
- var SelectPosition;
11387
-
11388
- (function (SelectPosition) {
11389
- SelectPosition["above"] = "above";
11390
- SelectPosition["below"] = "below";
11391
- })(SelectPosition || (SelectPosition = {}));
11505
+ const SelectPosition = {
11506
+ above: "above",
11507
+ below: "below"
11508
+ };
11392
11509
 
11393
11510
  class _Combobox extends Listbox$1 {}
11394
11511
  /**
@@ -11410,19 +11527,28 @@ class FormAssociatedCombobox extends FormAssociated(_Combobox) {
11410
11527
  * Autocomplete values for combobox.
11411
11528
  * @public
11412
11529
  */
11413
- var ComboboxAutocomplete;
11414
-
11415
- (function (ComboboxAutocomplete) {
11416
- ComboboxAutocomplete["inline"] = "inline";
11417
- ComboboxAutocomplete["list"] = "list";
11418
- ComboboxAutocomplete["both"] = "both";
11419
- ComboboxAutocomplete["none"] = "none";
11420
- })(ComboboxAutocomplete || (ComboboxAutocomplete = {}));
11530
+ const ComboboxAutocomplete = {
11531
+ inline: "inline",
11532
+ list: "list",
11533
+ both: "both",
11534
+ none: "none"
11535
+ };
11421
11536
 
11422
11537
  /**
11423
11538
  * A Combobox Custom HTML Element.
11424
11539
  * Implements the {@link https://w3c.github.io/aria-practices/#combobox | ARIA combobox }.
11425
11540
  *
11541
+ * @slot start - Content which can be provided before the input
11542
+ * @slot end - Content which can be provided after the input
11543
+ * @slot control - Used to replace the input element representing the combobox
11544
+ * @slot indicator - The visual indicator representing the expanded state
11545
+ * @slot - The default slot for the options
11546
+ * @csspart control - The wrapper element containing the input area, including start and end
11547
+ * @csspart selected-value - The input element representing the selected value
11548
+ * @csspart indicator - The element wrapping the indicator slot
11549
+ * @csspart listbox - The wrapper for the listbox slotted options
11550
+ * @fires change - Fires a custom 'change' event when the value updates
11551
+ *
11426
11552
  * @public
11427
11553
  */
11428
11554
 
@@ -11480,13 +11606,6 @@ class Combobox$1 extends FormAssociatedCombobox {
11480
11606
  */
11481
11607
 
11482
11608
  this.open = false;
11483
- /**
11484
- * The current state of the calculated position of the listbox.
11485
- *
11486
- * @public
11487
- */
11488
-
11489
- this.position = SelectPosition.below;
11490
11609
  }
11491
11610
  /**
11492
11611
  * Reset the element to its first selectable option when its parent form is reset.
@@ -11500,6 +11619,12 @@ class Combobox$1 extends FormAssociatedCombobox {
11500
11619
  this.setDefaultSelectedOption();
11501
11620
  this.updateValue();
11502
11621
  }
11622
+ /** {@inheritDoc (FormAssociated:interface).validate} */
11623
+
11624
+
11625
+ validate() {
11626
+ super.validate(this.control);
11627
+ }
11503
11628
 
11504
11629
  get isAutocompleteInline() {
11505
11630
  return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth;
@@ -11566,8 +11691,8 @@ class Combobox$1 extends FormAssociatedCombobox {
11566
11691
  }
11567
11692
  }
11568
11693
 
11569
- positionChanged() {
11570
- this.positionAttribute = this.position;
11694
+ positionChanged(prev, next) {
11695
+ this.positionAttribute = next;
11571
11696
  this.setPositioning();
11572
11697
  }
11573
11698
  /**
@@ -11623,6 +11748,7 @@ class Combobox$1 extends FormAssociatedCombobox {
11623
11748
 
11624
11749
  this.selectedOptions = [captured];
11625
11750
  this.control.value = captured.text;
11751
+ this.clearSelectionRange();
11626
11752
  this.updateValue(true);
11627
11753
  }
11628
11754
 
@@ -11718,7 +11844,7 @@ class Combobox$1 extends FormAssociatedCombobox {
11718
11844
 
11719
11845
 
11720
11846
  focusoutHandler(e) {
11721
- this.updateValue();
11847
+ this.syncValue();
11722
11848
 
11723
11849
  if (!this.open) {
11724
11850
  return true;
@@ -11747,7 +11873,11 @@ class Combobox$1 extends FormAssociatedCombobox {
11747
11873
  this.filter = this.control.value;
11748
11874
  this.filterOptions();
11749
11875
 
11750
- if (e.inputType === "deleteContentBackward" || !this.filter.length) {
11876
+ if (!this.isAutocompleteInline) {
11877
+ this.selectedIndex = this.options.map(option => option.text).indexOf(this.control.value);
11878
+ }
11879
+
11880
+ if (e.inputType.includes("deleteContent") || !this.filter.length) {
11751
11881
  return true;
11752
11882
  }
11753
11883
 
@@ -11755,10 +11885,14 @@ class Combobox$1 extends FormAssociatedCombobox {
11755
11885
  this.open = true;
11756
11886
  }
11757
11887
 
11758
- if (this.isAutocompleteInline && this.filteredOptions.length) {
11759
- this.selectedOptions = [this.filteredOptions[0]];
11760
- this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
11761
- this.setInlineSelection();
11888
+ if (this.isAutocompleteInline) {
11889
+ if (this.filteredOptions.length) {
11890
+ this.selectedOptions = [this.filteredOptions[0]];
11891
+ this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
11892
+ this.setInlineSelection();
11893
+ } else {
11894
+ this.selectedIndex = -1;
11895
+ }
11762
11896
  }
11763
11897
 
11764
11898
  return;
@@ -11781,15 +11915,14 @@ class Combobox$1 extends FormAssociatedCombobox {
11781
11915
  switch (key) {
11782
11916
  case "Enter":
11783
11917
  {
11784
- this.updateValue(true);
11918
+ this.syncValue();
11785
11919
 
11786
11920
  if (this.isAutocompleteInline) {
11787
11921
  this.filter = this.value;
11788
11922
  }
11789
11923
 
11790
11924
  this.open = false;
11791
- const controlValueLength = this.control.value.length;
11792
- this.control.setSelectionRange(controlValueLength, controlValueLength);
11925
+ this.clearSelectionRange();
11793
11926
  break;
11794
11927
  }
11795
11928
 
@@ -11813,7 +11946,7 @@ class Combobox$1 extends FormAssociatedCombobox {
11813
11946
 
11814
11947
  case "Tab":
11815
11948
  {
11816
- this.updateValue();
11949
+ this.setInputToSelection();
11817
11950
 
11818
11951
  if (!this.open) {
11819
11952
  return true;
@@ -11839,7 +11972,6 @@ class Combobox$1 extends FormAssociatedCombobox {
11839
11972
  }
11840
11973
 
11841
11974
  if (this.isAutocompleteInline) {
11842
- this.updateValue();
11843
11975
  this.setInlineSelection();
11844
11976
  }
11845
11977
 
@@ -11936,20 +12068,44 @@ class Combobox$1 extends FormAssociatedCombobox {
11936
12068
  }
11937
12069
  }
11938
12070
  /**
11939
- * Focus and select the content of the control based on the first selected option.
12071
+ * Focus and set the content of the control based on the first selected option.
11940
12072
  *
11941
- * @param start - The index for the starting range
11942
12073
  * @internal
11943
12074
  */
11944
12075
 
11945
12076
 
11946
- setInlineSelection() {
12077
+ setInputToSelection() {
11947
12078
  if (this.firstSelectedOption) {
11948
12079
  this.control.value = this.firstSelectedOption.text;
11949
12080
  this.control.focus();
12081
+ }
12082
+ }
12083
+ /**
12084
+ * Focus, set and select the content of the control based on the first selected option.
12085
+ *
12086
+ * @internal
12087
+ */
12088
+
12089
+
12090
+ setInlineSelection() {
12091
+ if (this.firstSelectedOption) {
12092
+ this.setInputToSelection();
11950
12093
  this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward");
11951
12094
  }
11952
12095
  }
12096
+ /**
12097
+ * Determines if a value update should involve emitting a change event, then updates the value.
12098
+ *
12099
+ * @internal
12100
+ */
12101
+
12102
+
12103
+ syncValue() {
12104
+ var _a;
12105
+
12106
+ const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value;
12107
+ this.updateValue(this.value !== newValue);
12108
+ }
11953
12109
  /**
11954
12110
  * Calculate and apply listbox positioning based on available viewport space.
11955
12111
  *
@@ -12013,12 +12169,22 @@ class Combobox$1 extends FormAssociatedCombobox {
12013
12169
 
12014
12170
  if (this.$fastController.isConnected) {
12015
12171
  this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value;
12172
+ this.control.value = this.value;
12016
12173
  }
12017
12174
 
12018
12175
  if (shouldEmit) {
12019
12176
  this.$emit("change");
12020
12177
  }
12021
12178
  }
12179
+ /**
12180
+ * @internal
12181
+ */
12182
+
12183
+
12184
+ clearSelectionRange() {
12185
+ const controlValueLength = this.control.value.length;
12186
+ this.control.setSelectionRange(controlValueLength, controlValueLength);
12187
+ }
12022
12188
 
12023
12189
  }
12024
12190
 
@@ -13586,6 +13752,13 @@ var isFocusable = function isFocusable(node, options) {
13586
13752
  * A Switch Custom HTML Element.
13587
13753
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#dialog | ARIA dialog }.
13588
13754
  *
13755
+ * @slot - The default slot for the dialog content
13756
+ * @csspart positioning-region - A wrapping element used to center the dialog and position the modal overlay
13757
+ * @csspart overlay - The modal dialog overlay
13758
+ * @csspart control - The dialog element
13759
+ * @fires cancel - Fires a custom 'cancel' event when the modal overlay is clicked
13760
+ * @fires close - Fires a custom 'close' event when the dialog is hidden
13761
+ *
13589
13762
  * @public
13590
13763
  */
13591
13764
 
@@ -13912,19 +14085,17 @@ const dividerTemplate = (context, definition) => html`<template role="${x => x.r
13912
14085
  * Divider roles
13913
14086
  * @public
13914
14087
  */
13915
- var DividerRole;
13916
-
13917
- (function (DividerRole) {
14088
+ const DividerRole = {
13918
14089
  /**
13919
14090
  * The divider semantically separates content
13920
14091
  */
13921
- DividerRole["separator"] = "separator";
14092
+ separator: "separator",
14093
+
13922
14094
  /**
13923
14095
  * The divider has no semantic value and is for visual presentation only.
13924
14096
  */
13925
-
13926
- DividerRole["presentation"] = "presentation";
13927
- })(DividerRole || (DividerRole = {}));
14097
+ presentation: "presentation"
14098
+ };
13928
14099
 
13929
14100
  /**
13930
14101
  * A Divider Custom HTML Element.
@@ -13940,7 +14111,6 @@ class Divider extends FoundationElement {
13940
14111
  * The role of the element.
13941
14112
  *
13942
14113
  * @public
13943
- * @defaultValue - {@link DividerRole.separator}
13944
14114
  * @remarks
13945
14115
  * HTML Attribute: role
13946
14116
  */
@@ -13967,12 +14137,10 @@ __decorate$1([attr], Divider.prototype, "orientation", void 0);
13967
14137
  * The direction options for flipper.
13968
14138
  * @public
13969
14139
  */
13970
- var FlipperDirection;
13971
-
13972
- (function (FlipperDirection) {
13973
- FlipperDirection["next"] = "next";
13974
- FlipperDirection["previous"] = "previous";
13975
- })(FlipperDirection || (FlipperDirection = {}));
14140
+ const FlipperDirection = {
14141
+ next: "next",
14142
+ previous: "previous"
14143
+ };
13976
14144
 
13977
14145
  /**
13978
14146
  * The template for the {@link @microsoft/fast-foundation#Flipper} component.
@@ -13985,6 +14153,12 @@ const flipperTemplate = (context, definition) => html`<template role="button" ar
13985
14153
  * A Flipper Custom HTML Element.
13986
14154
  * Flippers are a form of button that implies directional content navigation, such as in a carousel.
13987
14155
  *
14156
+ * @slot next - The next flipper content
14157
+ * @slot previous - The previous flipper content
14158
+ * @csspart next - Wraps the next flipper content
14159
+ * @csspart previous - Wraps the previous flipper content
14160
+ * @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.
14161
+ *
13988
14162
  * @public
13989
14163
  */
13990
14164
 
@@ -14023,7 +14197,7 @@ class Flipper extends FoundationElement {
14023
14197
  if (!this.hiddenFromAT) {
14024
14198
  const key = e.key;
14025
14199
 
14026
- if (key === "Enter") {
14200
+ if (key === "Enter" || key === "Space") {
14027
14201
  this.$emit("click", e);
14028
14202
  }
14029
14203
 
@@ -14051,7 +14225,7 @@ __decorate$1([attr], Flipper.prototype, "direction", void 0);
14051
14225
  * @public
14052
14226
  */
14053
14227
 
14054
- const listboxOptionTemplate = (context, definition) => html`<template aria-checked="${x => x.ariaChecked}" aria-disabled="${x => x.ariaDisabled}" aria-posinset="${x => x.ariaPosInSet}" aria-selected="${x => x.ariaSelected}" aria-setsize="${x => x.ariaSetSize}" class="${x => [x.checked && "checked", x.selected && "selected", x.disabled && "disabled"].filter(Boolean).join(" ")}" role="option">${startSlotTemplate(context, definition)}<span class="content" part="content"><slot></slot></span>${endSlotTemplate(context, definition)}</template>`;
14228
+ const listboxOptionTemplate = (context, definition) => html`<template aria-checked="${x => x.ariaChecked}" aria-disabled="${x => x.ariaDisabled}" aria-posinset="${x => x.ariaPosInSet}" aria-selected="${x => x.ariaSelected}" aria-setsize="${x => x.ariaSetSize}" class="${x => [x.checked && "checked", x.selected && "selected", x.disabled && "disabled"].filter(Boolean).join(" ")}" role="option">${startSlotTemplate(context, definition)}<span class="content" part="content"><slot ${slotted("content")}></slot></span>${endSlotTemplate(context, definition)}</template>`;
14055
14229
 
14056
14230
  /**
14057
14231
  * A Listbox Custom HTML Element.
@@ -14475,7 +14649,7 @@ class ListboxElement extends Listbox$1 {
14475
14649
  multipleChanged(prev, next) {
14476
14650
  var _a;
14477
14651
 
14478
- this.ariaMultiSelectable = next ? "true" : undefined;
14652
+ this.ariaMultiSelectable = next ? "true" : null;
14479
14653
  (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {
14480
14654
  o.checked = next ? false : undefined;
14481
14655
  });
@@ -14609,29 +14783,26 @@ const listboxTemplate = (context, definition) => html`<template aria-activedesce
14609
14783
  * Menu items roles.
14610
14784
  * @public
14611
14785
  */
14612
- var MenuItemRole;
14613
-
14614
- (function (MenuItemRole) {
14786
+ const MenuItemRole = {
14615
14787
  /**
14616
14788
  * The menu item has a "menuitem" role
14617
14789
  */
14618
- MenuItemRole["menuitem"] = "menuitem";
14790
+ menuitem: "menuitem",
14791
+
14619
14792
  /**
14620
14793
  * The menu item has a "menuitemcheckbox" role
14621
14794
  */
14795
+ menuitemcheckbox: "menuitemcheckbox",
14622
14796
 
14623
- MenuItemRole["menuitemcheckbox"] = "menuitemcheckbox";
14624
14797
  /**
14625
14798
  * The menu item has a "menuitemradio" role
14626
14799
  */
14627
-
14628
- MenuItemRole["menuitemradio"] = "menuitemradio";
14629
- })(MenuItemRole || (MenuItemRole = {}));
14800
+ menuitemradio: "menuitemradio"
14801
+ };
14630
14802
  /**
14631
14803
  * @internal
14632
14804
  */
14633
14805
 
14634
-
14635
14806
  const roleForMenuItem = {
14636
14807
  [MenuItemRole.menuitem]: "menuitem",
14637
14808
  [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
@@ -14642,6 +14813,23 @@ const roleForMenuItem = {
14642
14813
  * A Switch Custom HTML Element.
14643
14814
  * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
14644
14815
  *
14816
+ * @slot checked-indicator - The checked indicator
14817
+ * @slot radio-indicator - The radio indicator
14818
+ * @slot start - Content which can be provided before the menu item content
14819
+ * @slot end - Content which can be provided after the menu item content
14820
+ * @slot - The default slot for menu item content
14821
+ * @slot expand-collapse-indicator - The expand/collapse indicator
14822
+ * @slot submenu - Used to nest menu's within menu items
14823
+ * @csspart input-container - The element representing the visual checked or radio indicator
14824
+ * @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
14825
+ * @csspart radio - The element wrapping the `menuitemradio` indicator
14826
+ * @csspart content - The element wrapping the menu item content
14827
+ * @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
14828
+ * @csspart expand-collapse - The expand/collapse element
14829
+ * @csspart submenu-region - The container for the submenu, used for positioning
14830
+ * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
14831
+ * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
14832
+ *
14645
14833
  * @public
14646
14834
  */
14647
14835
 
@@ -14932,6 +15120,8 @@ const menuTemplate = (context, definition) => html`<template slot="${x => x.slot
14932
15120
  * A Menu Custom HTML Element.
14933
15121
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.
14934
15122
  *
15123
+ * @slot - The default slot for the menu items
15124
+ *
14935
15125
  * @public
14936
15126
  */
14937
15127
 
@@ -15280,39 +15470,45 @@ class FormAssociatedTextField extends FormAssociated(_TextField) {
15280
15470
  * Text field sub-types
15281
15471
  * @public
15282
15472
  */
15283
- var TextFieldType;
15284
-
15285
- (function (TextFieldType) {
15473
+ const TextFieldType = {
15286
15474
  /**
15287
15475
  * An email TextField
15288
15476
  */
15289
- TextFieldType["email"] = "email";
15477
+ email: "email",
15478
+
15290
15479
  /**
15291
15480
  * A password TextField
15292
15481
  */
15482
+ password: "password",
15293
15483
 
15294
- TextFieldType["password"] = "password";
15295
15484
  /**
15296
15485
  * A telephone TextField
15297
15486
  */
15487
+ tel: "tel",
15298
15488
 
15299
- TextFieldType["tel"] = "tel";
15300
15489
  /**
15301
15490
  * A text TextField
15302
15491
  */
15492
+ text: "text",
15303
15493
 
15304
- TextFieldType["text"] = "text";
15305
15494
  /**
15306
15495
  * A URL TextField
15307
15496
  */
15308
-
15309
- TextFieldType["url"] = "url";
15310
- })(TextFieldType || (TextFieldType = {}));
15497
+ url: "url"
15498
+ };
15311
15499
 
15312
15500
  /**
15313
15501
  * A Text Field Custom HTML Element.
15314
15502
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
15315
15503
  *
15504
+ * @slot start - Content which can be provided before the number field input
15505
+ * @slot end - Content which can be provided after the number field input
15506
+ * @slot - The default slot for the label
15507
+ * @csspart label - The label
15508
+ * @csspart root - The element wrapping the control, including start and end slots
15509
+ * @csspart control - The text field element
15510
+ * @fires change - Fires a custom 'change' event when the value has changed
15511
+ *
15316
15512
  * @public
15317
15513
  */
15318
15514
 
@@ -15411,6 +15607,24 @@ class TextField$1 extends FormAssociatedTextField {
15411
15607
  });
15412
15608
  }
15413
15609
  }
15610
+ /**
15611
+ * Selects all the text in the text field
15612
+ *
15613
+ * @public
15614
+ */
15615
+
15616
+
15617
+ select() {
15618
+ this.control.select();
15619
+ /**
15620
+ * The select event does not permeate the shadow DOM boundary.
15621
+ * This fn effectively proxies the select event,
15622
+ * emitting a `select` event whenever the internal
15623
+ * control emits a `select` event
15624
+ */
15625
+
15626
+ this.$emit("select");
15627
+ }
15414
15628
  /**
15415
15629
  * Handles the internal control's `input` event
15416
15630
  * @internal
@@ -15434,6 +15648,12 @@ class TextField$1 extends FormAssociatedTextField {
15434
15648
  handleChange() {
15435
15649
  this.$emit("change");
15436
15650
  }
15651
+ /** {@inheritDoc (FormAssociated:interface).validate} */
15652
+
15653
+
15654
+ validate() {
15655
+ super.validate(this.control);
15656
+ }
15437
15657
 
15438
15658
  }
15439
15659
 
@@ -15502,6 +15722,20 @@ class FormAssociatedNumberField extends FormAssociated(_NumberField) {
15502
15722
  * A Number Field Custom HTML Element.
15503
15723
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
15504
15724
  *
15725
+ * @slot start - Content which can be provided before the number field input
15726
+ * @slot end - Content which can be provided after the number field input
15727
+ * @slot - The default slot for the label
15728
+ * @slot step-up-glyph - The glyph for the step up control
15729
+ * @slot step-down-glyph - The glyph for the step down control
15730
+ * @csspart label - The label
15731
+ * @csspart root - The element wrapping the control, including start and end slots
15732
+ * @csspart control - The element representing the input
15733
+ * @csspart controls - The step up and step down controls
15734
+ * @csspart step-up - The step up control
15735
+ * @csspart step-down - The step down control
15736
+ * @fires input - Fires a custom 'input' event when the value has changed
15737
+ * @fires change - Fires a custom 'change' event when the value has changed
15738
+ *
15505
15739
  * @public
15506
15740
  */
15507
15741
 
@@ -15618,6 +15852,12 @@ class NumberField$1 extends FormAssociatedNumberField {
15618
15852
 
15619
15853
  this.isUserInput = false;
15620
15854
  }
15855
+ /** {@inheritDoc (FormAssociated:interface).validate} */
15856
+
15857
+
15858
+ validate() {
15859
+ super.validate(this.control);
15860
+ }
15621
15861
  /**
15622
15862
  * Sets the internal value to a valid number between the min and max properties
15623
15863
  * @param value - user input
@@ -15682,6 +15922,24 @@ class NumberField$1 extends FormAssociatedNumberField {
15682
15922
  });
15683
15923
  }
15684
15924
  }
15925
+ /**
15926
+ * Selects all the text in the number field
15927
+ *
15928
+ * @public
15929
+ */
15930
+
15931
+
15932
+ select() {
15933
+ this.control.select();
15934
+ /**
15935
+ * The select event does not permeate the shadow DOM boundary.
15936
+ * This fn effectively proxies the select event,
15937
+ * emitting a `select` event whenever the internal
15938
+ * control emits a `select` event
15939
+ */
15940
+
15941
+ this.$emit("select");
15942
+ }
15685
15943
  /**
15686
15944
  * Handles the internal control's `input` event
15687
15945
  * @internal
@@ -15799,6 +16057,11 @@ const progressRingTemplate = (context, definition) => html`<template role="progr
15799
16057
  * An Progress HTML Element.
15800
16058
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
15801
16059
  *
16060
+ * @slot indeterminate - The slot for a custom indeterminate indicator
16061
+ * @csspart progress - Represents the progress element
16062
+ * @csspart determinate - The determinate indicator
16063
+ * @csspart indeterminate - The indeterminate indicator
16064
+ *
15802
16065
  * @public
15803
16066
  */
15804
16067
 
@@ -15889,6 +16152,11 @@ const radioGroupTemplate = (context, definition) => html`<template role="radiogr
15889
16152
  * An Radio Group Custom HTML Element.
15890
16153
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.
15891
16154
  *
16155
+ * @slot label - The slot for the label
16156
+ * @slot - The default slot for radio buttons
16157
+ * @csspart positioning-region - The positioning region for laying out the radios
16158
+ * @fires change - Fires a custom 'change' event when the value changes
16159
+ *
15892
16160
  * @public
15893
16161
  */
15894
16162
 
@@ -16188,7 +16456,7 @@ class RadioGroup extends FoundationElement {
16188
16456
  valueChanged() {
16189
16457
  if (this.slottedRadioButtons) {
16190
16458
  this.slottedRadioButtons.forEach(radio => {
16191
- if (radio.getAttribute("value") === this.value) {
16459
+ if (radio.value === this.value) {
16192
16460
  radio.checked = true;
16193
16461
  this.selectedRadio = radio;
16194
16462
  }
@@ -16345,6 +16613,12 @@ class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
16345
16613
  * A Radio Custom HTML Element.
16346
16614
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.
16347
16615
  *
16616
+ * @slot checked-indicator - The checked indicator
16617
+ * @slot - The default slot for the label
16618
+ * @csspart control - The element representing the visual radio control
16619
+ * @csspart label - The label
16620
+ * @fires change - Emits a custom change event when the checked state changes
16621
+ *
16348
16622
  * @public
16349
16623
  */
16350
16624
 
@@ -16460,6 +16734,19 @@ __decorate$1([observable], Radio.prototype, "defaultSlottedNodes", void 0);
16460
16734
 
16461
16735
  /**
16462
16736
  * A HorizontalScroll Custom HTML Element
16737
+ *
16738
+ * @slot start - Content which can be provided before the scroll area
16739
+ * @slot end - Content which can be provided after the scroll area
16740
+ * @csspart scroll-area - Wraps the entire scrollable region
16741
+ * @csspart scroll-view - The visible scroll area
16742
+ * @csspart content-container - The container for the content
16743
+ * @csspart scroll-prev - The previous flipper container
16744
+ * @csspart scroll-action-previous - The element wrapping the previous flipper
16745
+ * @csspart scroll-next - The next flipper container
16746
+ * @csspart scroll-action-next - The element wrapping the next flipper
16747
+ * @fires scrollstart - Fires a custom 'scrollstart' event when scrolling
16748
+ * @fires scrollend - Fires a custom 'scrollend' event when scrolling stops
16749
+ *
16463
16750
  * @public
16464
16751
  */
16465
16752
 
@@ -16613,20 +16900,32 @@ class HorizontalScroll$1 extends FoundationElement {
16613
16900
 
16614
16901
  setStops() {
16615
16902
  this.updateScrollStops();
16616
- this.width = this.offsetWidth;
16903
+ const {
16904
+ scrollContainer: container
16905
+ } = this;
16906
+ const {
16907
+ scrollLeft
16908
+ } = container;
16909
+ const {
16910
+ width: containerWidth,
16911
+ left: containerLeft
16912
+ } = container.getBoundingClientRect();
16913
+ this.width = containerWidth;
16617
16914
  let lastStop = 0;
16618
- let stops = this.scrollItems.map(({
16619
- offsetLeft: left,
16620
- offsetWidth: width
16621
- }, index) => {
16622
- const right = left + width;
16915
+ let stops = this.scrollItems.map((item, index) => {
16916
+ const {
16917
+ left,
16918
+ width
16919
+ } = item.getBoundingClientRect();
16920
+ const leftPosition = Math.round(left + scrollLeft - containerLeft);
16921
+ const right = Math.round(leftPosition + width);
16623
16922
 
16624
16923
  if (this.isRtl) {
16625
16924
  return -right;
16626
16925
  }
16627
16926
 
16628
16927
  lastStop = right;
16629
- return index === 0 ? 0 : left;
16928
+ return index === 0 ? 0 : leftPosition;
16630
16929
  }).concat(lastStop);
16631
16930
  /* Fixes a FireFox bug where it doesn't scroll to the start */
16632
16931
 
@@ -16668,6 +16967,50 @@ class HorizontalScroll$1 extends FoundationElement {
16668
16967
  (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", Math.abs(position) + this.width >= lastStop);
16669
16968
  }
16670
16969
  }
16970
+ /**
16971
+ * Function that can scroll an item into view.
16972
+ * @param item - An item index, a scroll item or a child of one of the scroll items
16973
+ * @param padding - Padding of the viewport where the active item shouldn't be
16974
+ * @param rightPadding - Optional right padding. Uses the padding if not defined
16975
+ *
16976
+ * @public
16977
+ */
16978
+
16979
+
16980
+ scrollInView(item, padding = 0, rightPadding) {
16981
+ var _a;
16982
+
16983
+ if (typeof item !== "number" && item) {
16984
+ item = this.scrollItems.findIndex(scrollItem => scrollItem === item || scrollItem.contains(item));
16985
+ }
16986
+
16987
+ if (item !== undefined) {
16988
+ rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding;
16989
+ const {
16990
+ scrollContainer: container,
16991
+ scrollStops,
16992
+ scrollItems: items
16993
+ } = this;
16994
+ const {
16995
+ scrollLeft
16996
+ } = this.scrollContainer;
16997
+ const {
16998
+ width: containerWidth
16999
+ } = container.getBoundingClientRect();
17000
+ const itemStart = scrollStops[item];
17001
+ const {
17002
+ width
17003
+ } = items[item].getBoundingClientRect();
17004
+ const itemEnd = itemStart + width;
17005
+ const isBefore = scrollLeft + padding > itemStart;
17006
+
17007
+ if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) {
17008
+ const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b);
17009
+ const scrollTo = (_a = stops.find(position => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0;
17010
+ this.scrollToPosition(scrollTo);
17011
+ }
17012
+ }
17013
+ }
16671
17014
  /**
16672
17015
  * Lets the user arrow left and right through the horizontal scroll
16673
17016
  * @param e - Keyboard event
@@ -16789,7 +17132,7 @@ class HorizontalScroll$1 extends FoundationElement {
16789
17132
  }
16790
17133
 
16791
17134
  this.resizeTimeout = setTimeout(() => {
16792
- this.width = this.offsetWidth;
17135
+ this.width = this.scrollContainer.offsetWidth;
16793
17136
  this.setFlippers();
16794
17137
  }, this.frameTime);
16795
17138
  }
@@ -16877,6 +17220,16 @@ class FormAssociatedSearch extends FormAssociated(_Search) {
16877
17220
  * A Search Custom HTML Element.
16878
17221
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search | <input type="search" /> element }.
16879
17222
  *
17223
+ * @slot start - Content which can be provided before the search input
17224
+ * @slot end - Content which can be provided after the search clear button
17225
+ * @slot - The default slot for the label
17226
+ * @slot close-button - The clear button
17227
+ * @slot close-glyph - The clear glyph
17228
+ * @csspart label - The label
17229
+ * @csspart root - The element wrapping the control, including start and end slots
17230
+ * @csspart control - The element representing the input
17231
+ * @csspart clear-button - The button to clear the input
17232
+ *
16880
17233
  * @public
16881
17234
  */
16882
17235
 
@@ -16955,6 +17308,12 @@ class Search$1 extends FormAssociatedSearch {
16955
17308
  });
16956
17309
  }
16957
17310
  }
17311
+ /** {@inheritDoc (FormAssociated:interface).validate} */
17312
+
17313
+
17314
+ validate() {
17315
+ super.validate(this.control);
17316
+ }
16958
17317
  /**
16959
17318
  * Handles the internal control's `input` event
16960
17319
  * @internal
@@ -17054,6 +17413,19 @@ class FormAssociatedSelect extends FormAssociated(_Select) {
17054
17413
  * A Select Custom HTML Element.
17055
17414
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
17056
17415
  *
17416
+ * @slot start - Content which can be provided before the button content
17417
+ * @slot end - Content which can be provided after the button content
17418
+ * @slot button-container - The element representing the select button
17419
+ * @slot selected-value - The selected value
17420
+ * @slot indicator - The visual indicator for the expand/collapse state of the button
17421
+ * @slot - The default slot for slotted options
17422
+ * @csspart control - The element representing the select invoking element
17423
+ * @csspart selected-value - The element wrapping the selected value
17424
+ * @csspart indicator - The element wrapping the visual indicator
17425
+ * @csspart listbox - The listbox element
17426
+ * @fires input - Fires a custom 'input' event when the value updates
17427
+ * @fires change - Fires a custom 'change' event when the value updates
17428
+ *
17057
17429
  * @public
17058
17430
  */
17059
17431
 
@@ -17076,13 +17448,6 @@ class Select$1 extends FormAssociatedSelect {
17076
17448
  */
17077
17449
 
17078
17450
  this.forcedPosition = false;
17079
- /**
17080
- * Holds the current state for the calculated position of the listbox.
17081
- *
17082
- * @public
17083
- */
17084
-
17085
- this.position = SelectPosition.below;
17086
17451
  /**
17087
17452
  * The unique id for the internal listbox element.
17088
17453
  *
@@ -17097,13 +17462,6 @@ class Select$1 extends FormAssociatedSelect {
17097
17462
  */
17098
17463
 
17099
17464
  this.maxHeight = 0;
17100
- /**
17101
- * The value displayed on the button.
17102
- *
17103
- * @public
17104
- */
17105
-
17106
- this.displayValue = "";
17107
17465
  }
17108
17466
  /**
17109
17467
  * Sets focus and synchronizes ARIA attributes when the open property changes.
@@ -17157,31 +17515,29 @@ class Select$1 extends FormAssociatedSelect {
17157
17515
  }
17158
17516
 
17159
17517
  set value(next) {
17160
- var _a;
17518
+ var _a, _b, _c, _d, _e, _f, _g;
17161
17519
 
17162
17520
  const prev = `${this._value}`;
17163
17521
 
17164
- if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) {
17165
- const selectedIndex = this.options.findIndex(el => el.value === next);
17166
- const prevSelectedOption = this.options[this.selectedIndex];
17167
- const nextSelectedOption = this.options[selectedIndex];
17168
- const prevSelectedValue = prevSelectedOption ? prevSelectedOption.value : null;
17169
- const nextSelectedValue = nextSelectedOption ? nextSelectedOption.value : null;
17522
+ if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
17523
+ const selectedIndex = this._options.findIndex(el => el.value === next);
17524
+
17525
+ const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
17526
+ const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
17170
17527
 
17171
17528
  if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
17172
17529
  next = "";
17173
17530
  this.selectedIndex = selectedIndex;
17174
17531
  }
17175
17532
 
17176
- if (this.firstSelectedOption) {
17177
- next = this.firstSelectedOption.value;
17178
- }
17533
+ next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
17179
17534
  }
17180
17535
 
17181
17536
  if (prev !== next) {
17182
17537
  this._value = next;
17183
17538
  super.valueChanged(prev, next);
17184
17539
  Observable.notify(this, "value");
17540
+ this.updateDisplayValue();
17185
17541
  }
17186
17542
  }
17187
17543
  /**
@@ -17194,9 +17550,10 @@ class Select$1 extends FormAssociatedSelect {
17194
17550
 
17195
17551
 
17196
17552
  updateValue(shouldEmit) {
17553
+ var _a, _b;
17554
+
17197
17555
  if (this.$fastController.isConnected) {
17198
- this.value = this.firstSelectedOption ? this.firstSelectedOption.value : "";
17199
- this.displayValue = this.firstSelectedOption ? this.firstSelectedOption.textContent || this.firstSelectedOption.value : this.value;
17556
+ this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
17200
17557
  }
17201
17558
 
17202
17559
  if (shouldEmit) {
@@ -17222,8 +17579,8 @@ class Select$1 extends FormAssociatedSelect {
17222
17579
  this.updateValue();
17223
17580
  }
17224
17581
 
17225
- positionChanged() {
17226
- this.positionAttribute = this.position;
17582
+ positionChanged(prev, next) {
17583
+ this.positionAttribute = next;
17227
17584
  this.setPositioning();
17228
17585
  }
17229
17586
  /**
@@ -17241,6 +17598,19 @@ class Select$1 extends FormAssociatedSelect {
17241
17598
  this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position;
17242
17599
  this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
17243
17600
  }
17601
+ /**
17602
+ * The value displayed on the button.
17603
+ *
17604
+ * @public
17605
+ */
17606
+
17607
+
17608
+ get displayValue() {
17609
+ var _a, _b;
17610
+
17611
+ Observable.track(this, "displayValue");
17612
+ return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
17613
+ }
17244
17614
  /**
17245
17615
  * Synchronize the `aria-disabled` property when the `disabled` property changes.
17246
17616
  *
@@ -17338,6 +17708,24 @@ class Select$1 extends FormAssociatedSelect {
17338
17708
  }
17339
17709
  }
17340
17710
  }
17711
+ /**
17712
+ * Updates the value when an option's value changes.
17713
+ *
17714
+ * @param source - the source object
17715
+ * @param propertyName - the property to evaluate
17716
+ *
17717
+ * @internal
17718
+ * @override
17719
+ */
17720
+
17721
+
17722
+ handleChange(source, propertyName) {
17723
+ super.handleChange(source, propertyName);
17724
+
17725
+ if (propertyName === "value") {
17726
+ this.updateValue();
17727
+ }
17728
+ }
17341
17729
  /**
17342
17730
  * Synchronize the form-associated proxy and updates the value property of the element.
17343
17731
  *
@@ -17349,7 +17737,15 @@ class Select$1 extends FormAssociatedSelect {
17349
17737
 
17350
17738
 
17351
17739
  slottedOptionsChanged(prev, next) {
17740
+ this.options.forEach(o => {
17741
+ const notifier = Observable.getNotifier(o);
17742
+ notifier.unsubscribe(this, "value");
17743
+ });
17352
17744
  super.slottedOptionsChanged(prev, next);
17745
+ this.options.forEach(o => {
17746
+ const notifier = Observable.getNotifier(o);
17747
+ notifier.subscribe(this, "value");
17748
+ });
17353
17749
  this.setProxyOptions();
17354
17750
  this.updateValue();
17355
17751
  }
@@ -17517,12 +17913,18 @@ class Select$1 extends FormAssociatedSelect {
17517
17913
  this.indexWhenOpened = this.selectedIndex;
17518
17914
  }
17519
17915
 
17520
- return !(key in ArrowKeys);
17916
+ return !(key === keyArrowDown || key === keyArrowUp);
17521
17917
  }
17522
17918
 
17523
17919
  connectedCallback() {
17524
17920
  super.connectedCallback();
17525
17921
  this.forcedPosition = !!this.positionAttribute;
17922
+ this.addEventListener("contentchange", this.updateDisplayValue);
17923
+ }
17924
+
17925
+ disconnectedCallback() {
17926
+ this.removeEventListener("contentchange", this.updateDisplayValue);
17927
+ super.disconnectedCallback();
17526
17928
  }
17527
17929
  /**
17528
17930
  * Updates the proxy's size property when the size attribute changes.
@@ -17542,6 +17944,17 @@ class Select$1 extends FormAssociatedSelect {
17542
17944
  this.proxy.size = next;
17543
17945
  }
17544
17946
  }
17947
+ /**
17948
+ *
17949
+ * @internal
17950
+ */
17951
+
17952
+
17953
+ updateDisplayValue() {
17954
+ if (this.collapsible) {
17955
+ Observable.notify(this, "displayValue");
17956
+ }
17957
+ }
17545
17958
 
17546
17959
  }
17547
17960
 
@@ -17561,8 +17974,6 @@ __decorate$1([attr({
17561
17974
  __decorate$1([observable], Select$1.prototype, "position", void 0);
17562
17975
 
17563
17976
  __decorate$1([observable], Select$1.prototype, "maxHeight", void 0);
17564
-
17565
- __decorate$1([observable], Select$1.prototype, "displayValue", void 0);
17566
17977
  /**
17567
17978
  * Includes ARIA states and properties relating to the ARIA select role.
17568
17979
  *
@@ -17598,6 +18009,8 @@ const skeletonTemplate = (context, definition) => html`<template class="${x => x
17598
18009
  /**
17599
18010
  * A Skeleton Custom HTML Element.
17600
18011
  *
18012
+ * @slot - The default slot
18013
+ *
17601
18014
  * @public
17602
18015
  */
17603
18016
 
@@ -17658,6 +18071,9 @@ const defaultConfig = {
17658
18071
  /**
17659
18072
  * A label element intended to be used with the {@link @microsoft/fast-foundation#(Slider:class)} component.
17660
18073
  *
18074
+ * @slot - The default slot for the label content
18075
+ * @csspart root - The element wrapping the label mark and text
18076
+ *
17661
18077
  * @public
17662
18078
  */
17663
18079
 
@@ -17682,7 +18098,7 @@ class SliderLabel extends FoundationElement {
17682
18098
  this.getSliderConfiguration = () => {
17683
18099
  if (!this.isSliderConfig(this.parentNode)) {
17684
18100
  this.sliderDirection = defaultConfig.direction || Direction.ltr;
17685
- this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal;
18101
+ this.sliderOrientation = defaultConfig.orientation ;
17686
18102
  this.sliderMaxPosition = defaultConfig.max;
17687
18103
  this.sliderMinPosition = defaultConfig.min;
17688
18104
  } else {
@@ -17778,7 +18194,7 @@ class SliderLabel extends FoundationElement {
17778
18194
  break;
17779
18195
 
17780
18196
  case "max":
17781
- this.sliderMinPosition = source.max;
18197
+ this.sliderMaxPosition = source.max;
17782
18198
  break;
17783
18199
 
17784
18200
  case "min":
@@ -17845,19 +18261,26 @@ class FormAssociatedSlider extends FormAssociated(_Slider) {
17845
18261
  * @public
17846
18262
  */
17847
18263
 
17848
- var SliderMode;
17849
-
17850
- (function (SliderMode) {
17851
- SliderMode["singleValue"] = "single-value";
17852
- })(SliderMode || (SliderMode = {}));
18264
+ const SliderMode = {
18265
+ singleValue: "single-value"
18266
+ };
17853
18267
  /**
17854
18268
  * A Slider Custom HTML Element.
17855
18269
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#slider | ARIA slider }.
17856
18270
  *
18271
+ * @slot track - The track of the slider
18272
+ * @slot track-start - The track-start visual indicator
18273
+ * @slot thumb - The slider thumb
18274
+ * @slot - The default slot for labels
18275
+ * @csspart positioning-region - The region used to position the elements of the slider
18276
+ * @csspart track-container - The region containing the track elements
18277
+ * @csspart track-start - The element wrapping the track start slot
18278
+ * @csspart thumb-container - The thumb container element which is programatically positioned
18279
+ * @fires change - Fires a custom 'change' event when the slider value changes
18280
+ *
17857
18281
  * @public
17858
18282
  */
17859
18283
 
17860
-
17861
18284
  class Slider extends FormAssociatedSlider {
17862
18285
  constructor() {
17863
18286
  super(...arguments);
@@ -17956,6 +18379,10 @@ class Slider extends FormAssociatedSlider {
17956
18379
  this.mode = SliderMode.singleValue;
17957
18380
 
17958
18381
  this.keypressHandler = e => {
18382
+ if (this.readOnly) {
18383
+ return;
18384
+ }
18385
+
17959
18386
  if (e.key === keyHome) {
17960
18387
  e.preventDefault();
17961
18388
  this.value = `${this.min}`;
@@ -18348,6 +18775,16 @@ class FormAssociatedSwitch extends CheckableFormAssociated(_Switch) {
18348
18775
  * A Switch Custom HTML Element.
18349
18776
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.
18350
18777
  *
18778
+ * @slot - The deafult slot for the label
18779
+ * @slot checked-message - The message when in a checked state
18780
+ * @slot unchecked-message - The message when in an unchecked state
18781
+ * @csspart label - The label
18782
+ * @csspart switch - The element representing the switch, which wraps the indicator
18783
+ * @csspart status-message - The wrapper for the status messages
18784
+ * @csspart checked-message - The checked message
18785
+ * @csspart unchecked-message - The unchecked message
18786
+ * @fires change - Emits a custom change event when the checked state changes
18787
+ *
18351
18788
  * @public
18352
18789
  */
18353
18790
 
@@ -18427,6 +18864,9 @@ const tabPanelTemplate = (context, definition) => html`<template slot="tabpanel"
18427
18864
 
18428
18865
  /**
18429
18866
  * A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
18867
+ *
18868
+ * @slot - The default slot for the tabpanel content
18869
+ *
18430
18870
  * @public
18431
18871
  */
18432
18872
 
@@ -18441,6 +18881,9 @@ const tabTemplate = (context, definition) => html`<template slot="tab" role="tab
18441
18881
 
18442
18882
  /**
18443
18883
  * A Tab Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
18884
+ *
18885
+ * @slot - The default slot for the tab content
18886
+ *
18444
18887
  * @public
18445
18888
  */
18446
18889
 
@@ -18462,20 +18905,27 @@ const tabsTemplate = (context, definition) => html`<template class="${x => x.ori
18462
18905
  * @public
18463
18906
  */
18464
18907
 
18465
- var TabsOrientation;
18466
-
18467
- (function (TabsOrientation) {
18468
- TabsOrientation["vertical"] = "vertical";
18469
- TabsOrientation["horizontal"] = "horizontal";
18470
- })(TabsOrientation || (TabsOrientation = {}));
18908
+ const TabsOrientation = {
18909
+ vertical: "vertical",
18910
+ horizontal: "horizontal"
18911
+ };
18471
18912
  /**
18472
18913
  * A Tabs Custom HTML Element.
18473
18914
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#tablist | ARIA tablist }.
18474
18915
  *
18916
+ * @slot start - Content which can be provided before the tablist element
18917
+ * @slot end - Content which can be provided after the tablist element
18918
+ * @slot tab - The slot for tabs
18919
+ * @slot tabpanel - The slot for tabpanels
18920
+ * @csspart tablist - The element wrapping for the tabs
18921
+ * @csspart tab - The tab slot
18922
+ * @csspart activeIndicator - The visual indicator
18923
+ * @csspart tabpanel - The tabpanel slot
18924
+ * @fires change - Fires a custom 'change' event when a tab is clicked or during keyboard navigation
18925
+ *
18475
18926
  * @public
18476
18927
  */
18477
18928
 
18478
-
18479
18929
  class Tabs extends FoundationElement {
18480
18930
  constructor() {
18481
18931
  super(...arguments);
@@ -18520,8 +18970,6 @@ class Tabs extends FoundationElement {
18520
18970
  const gridHorizontalProperty = "gridColumn";
18521
18971
  const gridVerticalProperty = "gridRow";
18522
18972
  const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty;
18523
- this.tabIds = this.getTabIds();
18524
- this.tabpanelIds = this.getTabPanelIds();
18525
18973
  this.activeTabIndex = this.getActiveIndex();
18526
18974
  this.showActiveIndicator = false;
18527
18975
  this.tabs.forEach((tab, index) => {
@@ -18556,8 +19004,6 @@ class Tabs extends FoundationElement {
18556
19004
  };
18557
19005
 
18558
19006
  this.setTabPanels = () => {
18559
- this.tabIds = this.getTabIds();
18560
- this.tabpanelIds = this.getTabPanelIds();
18561
19007
  this.tabpanels.forEach((tabpanel, index) => {
18562
19008
  const tabId = this.tabIds[index];
18563
19009
  const tabpanelId = this.tabpanelIds[index];
@@ -18699,6 +19145,8 @@ class Tabs extends FoundationElement {
18699
19145
 
18700
19146
  tabsChanged() {
18701
19147
  if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) {
19148
+ this.tabIds = this.getTabIds();
19149
+ this.tabpanelIds = this.getTabPanelIds();
18702
19150
  this.setTabs();
18703
19151
  this.setTabPanels();
18704
19152
  this.handleActiveIndicatorPosition();
@@ -18711,6 +19159,8 @@ class Tabs extends FoundationElement {
18711
19159
 
18712
19160
  tabpanelsChanged() {
18713
19161
  if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) {
19162
+ this.tabIds = this.getTabIds();
19163
+ this.tabpanelIds = this.getTabPanelIds();
18714
19164
  this.setTabs();
18715
19165
  this.setTabPanels();
18716
19166
  this.handleActiveIndicatorPosition();
@@ -18855,34 +19305,38 @@ class FormAssociatedTextArea extends FormAssociated(_TextArea) {
18855
19305
  * Resize mode for a TextArea
18856
19306
  * @public
18857
19307
  */
18858
- var TextAreaResize;
18859
-
18860
- (function (TextAreaResize) {
19308
+ const TextAreaResize = {
18861
19309
  /**
18862
19310
  * No resize.
18863
19311
  */
18864
- TextAreaResize["none"] = "none";
19312
+ none: "none",
19313
+
18865
19314
  /**
18866
19315
  * Resize vertically and horizontally.
18867
19316
  */
19317
+ both: "both",
18868
19318
 
18869
- TextAreaResize["both"] = "both";
18870
19319
  /**
18871
19320
  * Resize horizontally.
18872
19321
  */
19322
+ horizontal: "horizontal",
18873
19323
 
18874
- TextAreaResize["horizontal"] = "horizontal";
18875
19324
  /**
18876
19325
  * Resize vertically.
18877
19326
  */
18878
-
18879
- TextAreaResize["vertical"] = "vertical";
18880
- })(TextAreaResize || (TextAreaResize = {}));
19327
+ vertical: "vertical"
19328
+ };
18881
19329
 
18882
19330
  /**
18883
19331
  * A Text Area Custom HTML Element.
18884
19332
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.
18885
19333
  *
19334
+ * @slot - The default slot for the label
19335
+ * @csspart label - The label
19336
+ * @csspart root - The element wrapping the control
19337
+ * @csspart control - The textarea element
19338
+ * @fires change - Emits a custom 'change' event when the textarea emits a change event
19339
+ *
18886
19340
  * @public
18887
19341
  */
18888
19342
 
@@ -18950,6 +19404,24 @@ class TextArea$1 extends FormAssociatedTextArea {
18950
19404
  this.proxy.spellcheck = this.spellcheck;
18951
19405
  }
18952
19406
  }
19407
+ /**
19408
+ * Selects all the text in the text area
19409
+ *
19410
+ * @public
19411
+ */
19412
+
19413
+
19414
+ select() {
19415
+ this.control.select();
19416
+ /**
19417
+ * The select event does not permeate the shadow DOM boundary.
19418
+ * This fn effectively proxies the select event,
19419
+ * emitting a `select` event whenever the internal
19420
+ * control emits a `select` event
19421
+ */
19422
+
19423
+ this.$emit("select");
19424
+ }
18953
19425
  /**
18954
19426
  * Change event handler for inner control.
18955
19427
  * @remarks
@@ -18964,6 +19436,12 @@ class TextArea$1 extends FormAssociatedTextArea {
18964
19436
  handleChange() {
18965
19437
  this.$emit("change");
18966
19438
  }
19439
+ /** {@inheritDoc (FormAssociated:interface).validate} */
19440
+
19441
+
19442
+ validate() {
19443
+ super.validate(this.control);
19444
+ }
18967
19445
 
18968
19446
  }
18969
19447
 
@@ -19036,7 +19514,12 @@ const textFieldTemplate = (context, definition) => html`<template class=" ${x =>
19036
19514
  * @public
19037
19515
  */
19038
19516
 
19039
- const toolbarTemplate = (context, definition) => html`<template aria-label="${x => x.ariaLabel}" aria-labelledby="${x => x.ariaLabelledby}" aria-orientation="${x => x.orientation}" orientation="${x => x.orientation}" role="toolbar" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot name="label"></slot><div class="positioning-region" part="positioning-region">${startSlotTemplate(context, definition)}<slot ${slotted({
19517
+ const toolbarTemplate = (context, definition) => html`<template aria-label="${x => x.ariaLabel}" aria-labelledby="${x => x.ariaLabelledby}" aria-orientation="${x => x.orientation}" orientation="${x => x.orientation}" role="toolbar" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" ${children({
19518
+ property: "childItems",
19519
+ attributeFilter: ["disabled", "hidden"],
19520
+ filter: elements(),
19521
+ subtree: true
19522
+ })}><slot name="label"></slot><div class="positioning-region" part="positioning-region">${startSlotTemplate(context, definition)}<slot ${slotted({
19040
19523
  filter: elements(),
19041
19524
  property: "slottedItems"
19042
19525
  })}></slot>${endSlotTemplate(context, definition)}</div></template>`;
@@ -19072,6 +19555,12 @@ const ToolbarArrowKeyMap = Object.freeze({
19072
19555
  * A Toolbar Custom HTML Element.
19073
19556
  * Implements the {@link https://w3c.github.io/aria-practices/#Toolbar|ARIA Toolbar}.
19074
19557
  *
19558
+ * @slot start - Content which can be provided before the slotted items
19559
+ * @slot end - Content which can be provided after the slotted items
19560
+ * @slot - The default slot for slotted items
19561
+ * @slot label - The toolbar label
19562
+ * @csspart positioning-region - The element containing the items, start and end slots
19563
+ *
19075
19564
  * @public
19076
19565
  */
19077
19566
 
@@ -19101,12 +19590,6 @@ class Toolbar$1 extends FoundationElement {
19101
19590
  */
19102
19591
 
19103
19592
  this.orientation = Orientation.horizontal;
19104
-
19105
- this.startEndSlotChange = () => {
19106
- if (this.$fastController.isConnected) {
19107
- this.reduceFocusableElements();
19108
- }
19109
- };
19110
19593
  }
19111
19594
  /**
19112
19595
  * The index of the currently focused element, clamped between 0 and the last element.
@@ -19150,6 +19633,12 @@ class Toolbar$1 extends FoundationElement {
19150
19633
 
19151
19634
  return true;
19152
19635
  }
19636
+
19637
+ childItemsChanged(prev, next) {
19638
+ if (this.$fastController.isConnected) {
19639
+ this.reduceFocusableElements();
19640
+ }
19641
+ }
19153
19642
  /**
19154
19643
  * @internal
19155
19644
  */
@@ -19158,18 +19647,6 @@ class Toolbar$1 extends FoundationElement {
19158
19647
  connectedCallback() {
19159
19648
  super.connectedCallback();
19160
19649
  this.direction = getDirection(this);
19161
- this.start.addEventListener("slotchange", this.startEndSlotChange);
19162
- this.end.addEventListener("slotchange", this.startEndSlotChange);
19163
- }
19164
- /**
19165
- * @internal
19166
- */
19167
-
19168
-
19169
- disconnectedCallback() {
19170
- super.disconnectedCallback();
19171
- this.start.removeEventListener("slotchange", this.startEndSlotChange);
19172
- this.end.removeEventListener("slotchange", this.startEndSlotChange);
19173
19650
  }
19174
19651
  /**
19175
19652
  * When the toolbar receives focus, set the currently active element as focused.
@@ -19247,7 +19724,14 @@ class Toolbar$1 extends FoundationElement {
19247
19724
 
19248
19725
 
19249
19726
  reduceFocusableElements() {
19250
- this.focusableElements = this.allSlottedItems.reduce(Toolbar$1.reduceFocusableItems, []);
19727
+ var _a;
19728
+
19729
+ const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex];
19730
+ this.focusableElements = this.allSlottedItems.reduce(Toolbar$1.reduceFocusableItems, []); // If the previously active item is still focusable, adjust the active index to the
19731
+ // index of that item.
19732
+
19733
+ const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement);
19734
+ this.activeIndex = Math.max(0, adjustedActiveIndex);
19251
19735
  this.setFocusableElements();
19252
19736
  }
19253
19737
  /**
@@ -19282,7 +19766,7 @@ class Toolbar$1 extends FoundationElement {
19282
19766
  const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus;
19283
19767
  const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some(x => isFocusable(x));
19284
19768
 
19285
- if (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow) {
19769
+ if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) {
19286
19770
  elements.push(element);
19287
19771
  return elements;
19288
19772
  }
@@ -19315,6 +19799,8 @@ __decorate$1([attr], Toolbar$1.prototype, "orientation", void 0);
19315
19799
  __decorate$1([observable], Toolbar$1.prototype, "slottedItems", void 0);
19316
19800
 
19317
19801
  __decorate$1([observable], Toolbar$1.prototype, "slottedLabel", void 0);
19802
+
19803
+ __decorate$1([observable], Toolbar$1.prototype, "childItems", void 0);
19318
19804
  /**
19319
19805
  * Includes ARIA states and properties relating to the ARIA toolbar role
19320
19806
  *
@@ -19349,83 +19835,85 @@ const tooltipTemplate = (context, definition) => {
19349
19835
  *
19350
19836
  * @public
19351
19837
  */
19352
- var TooltipPosition;
19353
-
19354
- (function (TooltipPosition) {
19838
+ const TooltipPosition = {
19355
19839
  /**
19356
19840
  * The tooltip is positioned above the element
19357
19841
  */
19358
- TooltipPosition["top"] = "top";
19842
+ top: "top",
19843
+
19359
19844
  /**
19360
19845
  * The tooltip is positioned to the right of the element
19361
19846
  */
19847
+ right: "right",
19362
19848
 
19363
- TooltipPosition["right"] = "right";
19364
19849
  /**
19365
19850
  * The tooltip is positioned below the element
19366
19851
  */
19852
+ bottom: "bottom",
19367
19853
 
19368
- TooltipPosition["bottom"] = "bottom";
19369
19854
  /**
19370
19855
  * The tooltip is positioned to the left of the element
19371
19856
  */
19857
+ left: "left",
19372
19858
 
19373
- TooltipPosition["left"] = "left";
19374
19859
  /**
19375
19860
  * The tooltip is positioned before the element
19376
19861
  */
19862
+ start: "start",
19377
19863
 
19378
- TooltipPosition["start"] = "start";
19379
19864
  /**
19380
19865
  * The tooltip is positioned after the element
19381
19866
  */
19867
+ end: "end",
19382
19868
 
19383
- TooltipPosition["end"] = "end";
19384
19869
  /**
19385
19870
  * The tooltip is positioned above the element and to the left
19386
19871
  */
19872
+ topLeft: "top-left",
19387
19873
 
19388
- TooltipPosition["topLeft"] = "top-left";
19389
19874
  /**
19390
19875
  * The tooltip is positioned above the element and to the right
19391
19876
  */
19877
+ topRight: "top-right",
19392
19878
 
19393
- TooltipPosition["topRight"] = "top-right";
19394
19879
  /**
19395
19880
  * The tooltip is positioned below the element and to the left
19396
19881
  */
19882
+ bottomLeft: "bottom-left",
19397
19883
 
19398
- TooltipPosition["bottomLeft"] = "bottom-left";
19399
19884
  /**
19400
19885
  * The tooltip is positioned below the element and to the right
19401
19886
  */
19887
+ bottomRight: "bottom-right",
19402
19888
 
19403
- TooltipPosition["bottomRight"] = "bottom-right";
19404
19889
  /**
19405
19890
  * The tooltip is positioned above the element and to the left
19406
19891
  */
19892
+ topStart: "top-start",
19407
19893
 
19408
- TooltipPosition["topStart"] = "top-start";
19409
19894
  /**
19410
19895
  * The tooltip is positioned above the element and to the right
19411
19896
  */
19897
+ topEnd: "top-end",
19412
19898
 
19413
- TooltipPosition["topEnd"] = "top-end";
19414
19899
  /**
19415
19900
  * The tooltip is positioned below the element and to the left
19416
19901
  */
19902
+ bottomStart: "bottom-start",
19417
19903
 
19418
- TooltipPosition["bottomStart"] = "bottom-start";
19419
19904
  /**
19420
19905
  * The tooltip is positioned below the element and to the right
19421
19906
  */
19422
-
19423
- TooltipPosition["bottomEnd"] = "bottom-end";
19424
- })(TooltipPosition || (TooltipPosition = {}));
19907
+ bottomEnd: "bottom-end"
19908
+ };
19425
19909
 
19426
19910
  /**
19427
19911
  * An Tooltip Custom HTML Element.
19428
19912
  *
19913
+ * @slot - The default slot for the tooltip content
19914
+ * @csspart tooltip - The tooltip element
19915
+ * @fires dismiss - Fires a custom 'dismiss' event when the tooltip is visible and escape key is pressed
19916
+ *
19429
19917
  * @public
19430
19918
  */
19431
19919
 
@@ -20030,6 +20518,18 @@ function isTreeItemElement(el) {
20030
20518
  /**
20031
20519
  * A Tree item Custom HTML Element.
20032
20520
  *
20521
+ * @slot start - Content which can be provided before the tree item content
20522
+ * @slot end - Content which can be provided after the tree item content
20523
+ * @slot - The default slot for tree item text content
20524
+ * @slot item - The slot for tree items (fast tree items manage this assignment themselves)
20525
+ * @slot expand-collapse-button - The expand/collapse button
20526
+ * @csspart positioning-region - The element used to position the tree item content with exception of any child nodes
20527
+ * @csspart content-region - The element containing the expand/collapse, start, and end slots
20528
+ * @csspart items - The element wrapping any child items
20529
+ * @csspart expand-collapse-button - The expand/collapse button
20530
+ * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
20531
+ * @fires selected-change - Fires a custom 'selected-change' event when the selected state changes
20532
+ *
20033
20533
  * @public
20034
20534
  */
20035
20535
 
@@ -20179,6 +20679,8 @@ const treeViewTemplate = (context, definition) => html`<template role="tree" ${r
20179
20679
  * A Tree view Custom HTML Element.
20180
20680
  * Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.
20181
20681
  *
20682
+ * @slot - The default slot for tree items
20683
+ *
20182
20684
  * @public
20183
20685
  */
20184
20686
 
@@ -20270,8 +20772,10 @@ class TreeView extends FoundationElement {
20270
20772
  if (e.target && this.isFocusableElement(e.target)) {
20271
20773
  const item = e.target;
20272
20774
 
20273
- if (item instanceof TreeItem && item.childItemLength() > 0) {
20775
+ if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) {
20274
20776
  item.expanded = false;
20777
+ } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) {
20778
+ TreeItem.focusItem(item.parentElement);
20275
20779
  }
20276
20780
  }
20277
20781
 
@@ -20281,8 +20785,10 @@ class TreeView extends FoundationElement {
20281
20785
  if (e.target && this.isFocusableElement(e.target)) {
20282
20786
  const item = e.target;
20283
20787
 
20284
- if (item instanceof TreeItem && item.childItemLength() > 0) {
20788
+ if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) {
20285
20789
  item.expanded = true;
20790
+ } else if (item instanceof TreeItem && item.childItemLength() > 0) {
20791
+ this.focusNextNode(1, e.target);
20286
20792
  }
20287
20793
  }
20288
20794