@m3e/web 2.5.5 → 2.5.7

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 (211) hide show
  1. package/README.md +1 -1
  2. package/dist/all.js +511 -248
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +31 -31
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/autocomplete.js +3 -3
  7. package/dist/autocomplete.js.map +1 -1
  8. package/dist/autocomplete.min.js.map +1 -1
  9. package/dist/bottom-sheet.js +5 -5
  10. package/dist/bottom-sheet.js.map +1 -1
  11. package/dist/bottom-sheet.min.js.map +1 -1
  12. package/dist/breadcrumb.js +1 -1
  13. package/dist/breadcrumb.js.map +1 -1
  14. package/dist/breadcrumb.min.js.map +1 -1
  15. package/dist/button.js +7 -8
  16. package/dist/button.js.map +1 -1
  17. package/dist/button.min.js +1 -1
  18. package/dist/button.min.js.map +1 -1
  19. package/dist/calendar.js +1 -1
  20. package/dist/calendar.js.map +1 -1
  21. package/dist/calendar.min.js.map +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/card.js.map +1 -1
  24. package/dist/card.min.js.map +1 -1
  25. package/dist/checkbox.js +10 -9
  26. package/dist/checkbox.js.map +1 -1
  27. package/dist/checkbox.min.js +1 -1
  28. package/dist/checkbox.min.js.map +1 -1
  29. package/dist/chips.js +17 -16
  30. package/dist/chips.js.map +1 -1
  31. package/dist/chips.min.js +1 -1
  32. package/dist/chips.min.js.map +1 -1
  33. package/dist/core.js +5 -5
  34. package/dist/core.js.map +1 -1
  35. package/dist/core.min.js.map +1 -1
  36. package/dist/css-custom-data.json +314 -314
  37. package/dist/custom-elements.json +5222 -4838
  38. package/dist/datepicker.js +26 -2
  39. package/dist/datepicker.js.map +1 -1
  40. package/dist/datepicker.min.js +1 -1
  41. package/dist/datepicker.min.js.map +1 -1
  42. package/dist/dialog.js +5 -5
  43. package/dist/dialog.js.map +1 -1
  44. package/dist/dialog.min.js.map +1 -1
  45. package/dist/drawer-container.js +1 -1
  46. package/dist/drawer-container.js.map +1 -1
  47. package/dist/drawer-container.min.js.map +1 -1
  48. package/dist/expansion-panel.js +5 -5
  49. package/dist/expansion-panel.js.map +1 -1
  50. package/dist/expansion-panel.min.js.map +1 -1
  51. package/dist/fab-menu.js +1 -1
  52. package/dist/fab-menu.js.map +1 -1
  53. package/dist/fab-menu.min.js.map +1 -1
  54. package/dist/fab.js +1 -1
  55. package/dist/fab.js.map +1 -1
  56. package/dist/fab.min.js.map +1 -1
  57. package/dist/html-custom-data.json +296 -291
  58. package/dist/icon-button.js +7 -8
  59. package/dist/icon-button.js.map +1 -1
  60. package/dist/icon-button.min.js +1 -1
  61. package/dist/icon-button.min.js.map +1 -1
  62. package/dist/list.js +17 -16
  63. package/dist/list.js.map +1 -1
  64. package/dist/list.min.js +1 -1
  65. package/dist/list.min.js.map +1 -1
  66. package/dist/menu.js +3 -3
  67. package/dist/menu.js.map +1 -1
  68. package/dist/menu.min.js.map +1 -1
  69. package/dist/nav-bar.js +12 -9
  70. package/dist/nav-bar.js.map +1 -1
  71. package/dist/nav-bar.min.js +1 -1
  72. package/dist/nav-bar.min.js.map +1 -1
  73. package/dist/nav-menu.js +5 -5
  74. package/dist/nav-menu.js.map +1 -1
  75. package/dist/nav-menu.min.js.map +1 -1
  76. package/dist/nav-rail.js +3 -1
  77. package/dist/nav-rail.js.map +1 -1
  78. package/dist/nav-rail.min.js.map +1 -1
  79. package/dist/paginator.js +1 -1
  80. package/dist/paginator.js.map +1 -1
  81. package/dist/paginator.min.js.map +1 -1
  82. package/dist/radio-group.js +12 -9
  83. package/dist/radio-group.js.map +1 -1
  84. package/dist/radio-group.min.js +1 -1
  85. package/dist/radio-group.min.js.map +1 -1
  86. package/dist/segmented-button.js +12 -11
  87. package/dist/segmented-button.js.map +1 -1
  88. package/dist/segmented-button.min.js +1 -1
  89. package/dist/segmented-button.min.js.map +1 -1
  90. package/dist/select.js +9 -9
  91. package/dist/select.js.map +1 -1
  92. package/dist/select.min.js +1 -1
  93. package/dist/select.min.js.map +1 -1
  94. package/dist/slide-group.js +6 -1
  95. package/dist/slide-group.js.map +1 -1
  96. package/dist/slide-group.min.js +1 -1
  97. package/dist/slide-group.min.js.map +1 -1
  98. package/dist/slider.js +46 -25
  99. package/dist/slider.js.map +1 -1
  100. package/dist/slider.min.js +1 -1
  101. package/dist/slider.min.js.map +1 -1
  102. package/dist/split-pane.js +17 -19
  103. package/dist/split-pane.js.map +1 -1
  104. package/dist/split-pane.min.js +1 -1
  105. package/dist/split-pane.min.js.map +1 -1
  106. package/dist/src/autocomplete/AutocompleteElement.d.ts +3 -3
  107. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +1 -1
  108. package/dist/src/autocomplete/QueryEventDetail.d.ts +1 -1
  109. package/dist/src/bottom-sheet/BottomSheetElement.d.ts +5 -5
  110. package/dist/src/breadcrumb/BreadcrumbItemElement.d.ts +1 -1
  111. package/dist/src/button/ButtonElement.d.ts +2 -1
  112. package/dist/src/button/ButtonElement.d.ts.map +1 -1
  113. package/dist/src/calendar/CalendarElement.d.ts +1 -1
  114. package/dist/src/card/CardElement.d.ts +1 -1
  115. package/dist/src/checkbox/CheckboxElement.d.ts +5 -4
  116. package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
  117. package/dist/src/chips/AssistChipElement.d.ts +1 -1
  118. package/dist/src/chips/FilterChipElement.d.ts +4 -3
  119. package/dist/src/chips/FilterChipElement.d.ts.map +1 -1
  120. package/dist/src/chips/FilterChipSetElement.d.ts +3 -2
  121. package/dist/src/chips/FilterChipSetElement.d.ts.map +1 -1
  122. package/dist/src/chips/InputChipElement.d.ts +2 -2
  123. package/dist/src/chips/InputChipSetElement.d.ts +1 -1
  124. package/dist/src/chips/SuggestionChipElement.d.ts +1 -1
  125. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +4 -4
  126. package/dist/src/core/shared/primitives/TextHighlightElement.d.ts +1 -1
  127. package/dist/src/datepicker/DatepickerElement.d.ts +6 -0
  128. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
  129. package/dist/src/dialog/DialogElement.d.ts +5 -5
  130. package/dist/src/drawer-container/DrawerContainerElement.d.ts +1 -1
  131. package/dist/src/expansion-panel/ExpansionHeaderElement.d.ts +1 -1
  132. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts +4 -4
  133. package/dist/src/fab/FabElement.d.ts +1 -1
  134. package/dist/src/fab-menu/FabMenuItemElement.d.ts +1 -1
  135. package/dist/src/icon-button/IconButtonElement.d.ts +2 -1
  136. package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
  137. package/dist/src/list/ExpandableListItemElement.d.ts +4 -4
  138. package/dist/src/list/ListActionElement.d.ts +1 -1
  139. package/dist/src/list/ListOptionElement.d.ts +4 -3
  140. package/dist/src/list/ListOptionElement.d.ts.map +1 -1
  141. package/dist/src/list/SelectionListElement.d.ts +3 -2
  142. package/dist/src/list/SelectionListElement.d.ts.map +1 -1
  143. package/dist/src/menu/MenuItemCheckboxElement.d.ts +1 -1
  144. package/dist/src/menu/MenuItemElement.d.ts +1 -1
  145. package/dist/src/menu/MenuItemRadioElement.d.ts +1 -1
  146. package/dist/src/nav-bar/NavBarElement.d.ts +3 -1
  147. package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
  148. package/dist/src/nav-bar/NavItemElement.d.ts +4 -3
  149. package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
  150. package/dist/src/nav-menu/NavMenuItemElement.d.ts +5 -5
  151. package/dist/src/nav-rail/NavRailElement.d.ts +3 -1
  152. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  153. package/dist/src/paginator/PageEventDetail.d.ts +1 -1
  154. package/dist/src/paginator/PaginatorElement.d.ts +1 -1
  155. package/dist/src/paginator/PaginatorPageEventDetail.d.ts +1 -1
  156. package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -1
  157. package/dist/src/radio-group/RadioElement.d.ts +4 -3
  158. package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
  159. package/dist/src/radio-group/RadioGroupElement.d.ts +3 -1
  160. package/dist/src/radio-group/RadioGroupElement.d.ts.map +1 -1
  161. package/dist/src/search/SearchViewQueryEventDetail.d.ts +1 -1
  162. package/dist/src/segmented-button/ButtonSegmentElement.d.ts +4 -3
  163. package/dist/src/segmented-button/ButtonSegmentElement.d.ts.map +1 -1
  164. package/dist/src/segmented-button/SegmentedButtonElement.d.ts +3 -2
  165. package/dist/src/segmented-button/SegmentedButtonElement.d.ts.map +1 -1
  166. package/dist/src/select/SelectElement.d.ts +3 -2
  167. package/dist/src/select/SelectElement.d.ts.map +1 -1
  168. package/dist/src/slide-group/SlideGroupElement.d.ts.map +1 -1
  169. package/dist/src/slider/SliderElement.d.ts +4 -0
  170. package/dist/src/slider/SliderElement.d.ts.map +1 -1
  171. package/dist/src/slider/SliderThumbElement.d.ts +4 -3
  172. package/dist/src/slider/SliderThumbElement.d.ts.map +1 -1
  173. package/dist/src/split-pane/SplitPaneElement.d.ts +3 -2
  174. package/dist/src/split-pane/SplitPaneElement.d.ts.map +1 -1
  175. package/dist/src/stepper/StepElement.d.ts +4 -3
  176. package/dist/src/stepper/StepElement.d.ts.map +1 -1
  177. package/dist/src/stepper/StepperElement.d.ts +5 -1
  178. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  179. package/dist/src/switch/SwitchElement.d.ts +4 -3
  180. package/dist/src/switch/SwitchElement.d.ts.map +1 -1
  181. package/dist/src/tabs/TabElement.d.ts +4 -3
  182. package/dist/src/tabs/TabElement.d.ts.map +1 -1
  183. package/dist/src/tabs/TabsElement.d.ts +5 -2
  184. package/dist/src/tabs/TabsElement.d.ts.map +1 -1
  185. package/dist/src/theme/ThemeElement.d.ts.map +1 -1
  186. package/dist/src/toc/TocItemElement.d.ts +1 -1
  187. package/dist/src/tree/TreeElement.d.ts +1 -1
  188. package/dist/src/tree/TreeItemElement.d.ts +5 -5
  189. package/dist/stepper.js +26 -17
  190. package/dist/stepper.js.map +1 -1
  191. package/dist/stepper.min.js +1 -1
  192. package/dist/stepper.min.js.map +1 -1
  193. package/dist/switch.js +9 -8
  194. package/dist/switch.js.map +1 -1
  195. package/dist/switch.min.js +1 -1
  196. package/dist/switch.min.js.map +1 -1
  197. package/dist/tabs.js +198 -24
  198. package/dist/tabs.js.map +1 -1
  199. package/dist/tabs.min.js +1 -1
  200. package/dist/tabs.min.js.map +1 -1
  201. package/dist/theme.js +34 -13
  202. package/dist/theme.js.map +1 -1
  203. package/dist/theme.min.js +23 -23
  204. package/dist/theme.min.js.map +1 -1
  205. package/dist/toc.js +1 -1
  206. package/dist/toc.js.map +1 -1
  207. package/dist/toc.min.js.map +1 -1
  208. package/dist/tree.js +6 -6
  209. package/dist/tree.js.map +1 -1
  210. package/dist/tree.min.js.map +1 -1
  211. package/package.json +1 -1
package/dist/all.js CHANGED
@@ -403,9 +403,9 @@ var M3eAutocompleteElement_1;
403
403
  * @slot loading - Renders content when loading options.
404
404
  * @slot no-data - Renders content when there are no options to show.
405
405
  *
406
- * @fires toggle - Emitted when the options menu opens or closes.
407
- * @fires query - Emitted when the input is focused or when the user modifies its value.
408
- * @fires change - Emitted when the committed value changes due to selecting an option or clearing the input.
406
+ * @fires toggle - Dispatched when the options menu opens or closes.
407
+ * @fires query - Dispatched when the input is focused or when the user modifies its value.
408
+ * @fires change - Dispatched when the committed value changes due to selecting an option or clearing the input.
409
409
  */
410
410
  let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteElement extends HtmlFor$1(LitElement) {
411
411
  constructor() {
@@ -1468,11 +1468,11 @@ var M3eBottomSheetElement_1;
1468
1468
  * @attr open - Whether the bottom sheet is open.
1469
1469
  * @attr overshoot-limit - A fractional value, between 0 and 100, indicating the maximum visual overshoot allowed when dragging past the minimum or maximum size.
1470
1470
  *
1471
- * @fires opening - Emitted when the sheet begins to open.
1472
- * @fires opened - Emitted when the sheet has opened.
1473
- * @fires cancel - Emitted when the sheet is cancelled.
1474
- * @fires closing - Emitted when the sheet begins to close.
1475
- * @fires closed - Emitted when the sheet has closed.
1471
+ * @fires opening - Dispatched when the sheet begins to open.
1472
+ * @fires opened - Dispatched when the sheet has opened.
1473
+ * @fires cancel - Dispatched when the sheet is cancelled.
1474
+ * @fires closing - Dispatched when the sheet begins to close.
1475
+ * @fires closed - Dispatched when the sheet has closed.
1476
1476
  *
1477
1477
  * @cssprop --m3e-bottom-sheet-width - The width of the sheet.
1478
1478
  * @cssprop --m3e-bottom-sheet-max-width - The maximum width of the sheet.
@@ -2358,7 +2358,7 @@ var _M3eBreadcrumbItemElement_instances, _M3eBreadcrumbItemElement_defaultSepara
2358
2358
  * @attr download - A value indicating whether the internal link target will be downloaded, optionally specifying a file name.
2359
2359
  * @attr rel - The relationship between the internal link target and the document.
2360
2360
  *
2361
- * @fires click - Emitted when the element is clicked.
2361
+ * @fires click - Dispatched when the element is clicked.
2362
2362
  *
2363
2363
  * @cssprop --m3e-breadcrumb-item-shape - Shape of the internal breadcrumb item button.
2364
2364
  * @cssprop --m3e-breadcrumb-item-container-height - Height of the internal breadcrumb item button container.
@@ -3196,9 +3196,10 @@ var _M3eButtonElement_instances, _M3eButtonElement_clickHandler, _M3eButtonEleme
3196
3196
  * @attr value - The value associated with the element's name when it's submitted with form data.
3197
3197
  * @attr variant - The appearance variant of the button.
3198
3198
  *
3199
+ * @fires beforeinput - Dispatched before a toggle button's selected state changes.
3199
3200
  * @fires input - Dispatched when a toggle button's selected state changes.
3200
3201
  * @fires change - Dispatched when a toggle button's selected state changes.
3201
- * @fires click - Emitted when the element is clicked.
3202
+ * @fires click - Dispatched when the element is clicked.
3202
3203
  *
3203
3204
  * @cssprop --m3e-button-container-height - Height of the button container, for all size variants.
3204
3205
  * @cssprop --m3e-button-outline-thickness - Thickness of the button outline, for all size variants.
@@ -3710,19 +3711,17 @@ _M3eButtonElement_handleClick = function _M3eButtonElement_handleClick(e) {
3710
3711
  e.stopImmediatePropagation();
3711
3712
  }
3712
3713
  if (this.toggle && !e.defaultPrevented) {
3713
- this.selected = !this.selected;
3714
- // Dispatch an input event and if not prevented, dispatch a change event.
3715
- // Otherwise, reset the selected state.
3716
- if (this.dispatchEvent(new Event("input", {
3714
+ if (this.dispatchEvent(new Event("beforeinput", {
3717
3715
  bubbles: true,
3718
- composed: true,
3719
3716
  cancelable: true
3720
3717
  }))) {
3718
+ this.selected = !this.selected;
3719
+ this.dispatchEvent(new Event("input", {
3720
+ bubbles: true
3721
+ }));
3721
3722
  this.dispatchEvent(new Event("change", {
3722
3723
  bubbles: true
3723
3724
  }));
3724
- } else {
3725
- this.selected = !this.selected;
3726
3725
  }
3727
3726
  }
3728
3727
  };
@@ -4592,7 +4591,7 @@ var _M3eCalendarElement_instances, _M3eCalendarElement_transitionComplete, _M3eC
4592
4591
  * @attr previous-multi-year-label - The accessible label given to the button used to move to the previous 24 years.
4593
4592
  * @attr next-multi-year-label - The accessible label given to the button used to move to the next 24 years.
4594
4593
  *
4595
- * @fires change - Emitted when the selected date changes.
4594
+ * @fires change - Dispatched when the selected date changes.
4596
4595
  *
4597
4596
  * @cssprop --m3e-calendar-container-color - Background color of the container surface.
4598
4597
  * @cssprop --m3e-calendar-container-elevation - Elevation shadow applied to the container surface.
@@ -5244,7 +5243,7 @@ var _M3eCardElement_instances, _M3eCardElement_clickHandler, _M3eCardElement_han
5244
5243
  * @attr orientation - The orientation of the card.
5245
5244
  * @attr variant - The appearance variant of the card.
5246
5245
  *
5247
- * @fires click - Emitted when the element is clicked.
5246
+ * @fires click - Dispatched when the element is clicked.
5248
5247
  *
5249
5248
  * @cssprop --m3e-card-padding - Internal spacing for all slotted regions
5250
5249
  * @cssprop --m3e-card-shape - Corner radius of the card container.
@@ -5476,10 +5475,11 @@ var _M3eCheckboxElement_instances, _M3eCheckboxElement_clickHandler, _M3eCheckbo
5476
5475
  * @attr required - Whether the element is required.
5477
5476
  * @attr value - A string representing the value of the checkbox.
5478
5477
  *
5479
- * @fires input - Emitted when the checked state changes.
5480
- * @fires invalid - Emitted when a form is submitted and the element fails constraint validation.
5481
- * @fires change - Emitted when the checked state changes.
5482
- * @fires click - Emitted when the element is clicked.
5478
+ * @fires beforeinput - Dispatched before the checked state changes.
5479
+ * @fires input - Dispatched when the checked state changes.
5480
+ * @fires invalid - Dispatched when a form is submitted and the element fails constraint validation.
5481
+ * @fires change - Dispatched when the checked state changes.
5482
+ * @fires click - Dispatched when the element is clicked.
5483
5483
  *
5484
5484
  * @cssprop --m3e-checkbox-icon-size - Size of the checkbox icon inside the container.
5485
5485
  * @cssprop --m3e-checkbox-container-size - Base size of the checkbox container.
@@ -5589,18 +5589,18 @@ _M3eCheckboxElement_renderIcon = function _M3eCheckboxElement_renderIcon() {
5589
5589
  };
5590
5590
  _M3eCheckboxElement_handleClick = function _M3eCheckboxElement_handleClick(e) {
5591
5591
  if (e.defaultPrevented) return;
5592
- this.checked = !this.checked;
5593
- if (this.dispatchEvent(new Event("input", {
5592
+ if (this.dispatchEvent(new Event("beforeinput", {
5594
5593
  bubbles: true,
5595
- composed: true,
5596
5594
  cancelable: true
5597
5595
  }))) {
5596
+ this.checked = !this.checked;
5598
5597
  this.indeterminate = false;
5598
+ this.dispatchEvent(new Event("input", {
5599
+ bubbles: true
5600
+ }));
5599
5601
  this.dispatchEvent(new Event("change", {
5600
5602
  bubbles: true
5601
5603
  }));
5602
- } else {
5603
- this.checked = !this.checked;
5604
5604
  }
5605
5605
  // Prevent default avoids double-click in FireFox.
5606
5606
  if (this.closest("label")) {
@@ -5786,7 +5786,7 @@ M3eChipElement = __decorate([customElement$1("m3e-chip")], M3eChipElement);
5786
5786
  * @attr value - A string representing the value of the chip.
5787
5787
  * @attr variant - The appearance variant of the chip.
5788
5788
  *
5789
- * @fires click - Emitted when the element is clicked.
5789
+ * @fires click - Dispatched when the element is clicked.
5790
5790
  *
5791
5791
  * @cssprop --m3e-chip-container-shape - Border radius of the chip container.
5792
5792
  * @cssprop --m3e-chip-container-height - Base height of the chip container before density adjustment.
@@ -5899,9 +5899,10 @@ var _M3eFilterChipElement_instances, _M3eFilterChipElement_clickHandler, _M3eFil
5899
5899
  * @attr value - A string representing the value of the chip.
5900
5900
  * @attr variant - The appearance variant of the chip.
5901
5901
  *
5902
- * @fires input - Emitted when the selected state changes.
5903
- * @fires change - Emitted when the selected state changes.
5904
- * @fires click - Emitted when the element is clicked.
5902
+ * @fires beforeinput - Dispatched before the selected state changes.
5903
+ * @fires input - Dispatched when the selected state changes.
5904
+ * @fires change - Dispatched when the selected state changes.
5905
+ * @fires click - Dispatched when the element is clicked.
5905
5906
  *
5906
5907
  * @cssprop --m3e-chip-container-shape - Border radius of the chip container.
5907
5908
  * @cssprop --m3e-chip-container-height - Base height of the chip container before density adjustment.
@@ -5980,19 +5981,18 @@ _M3eFilterChipElement_clickHandler = new WeakMap();
5980
5981
  _M3eFilterChipElement_instances = new WeakSet();
5981
5982
  _M3eFilterChipElement_handleClick = function _M3eFilterChipElement_handleClick(e) {
5982
5983
  if (e.defaultPrevented) return;
5983
- const selected = this.selected;
5984
- this.selected = !this.selected;
5985
- if (this.dispatchEvent(new Event("input", {
5984
+ if (this.dispatchEvent(new Event("beforeinput", {
5986
5985
  bubbles: true,
5987
- composed: true,
5988
5986
  cancelable: true
5989
5987
  }))) {
5988
+ this.selected = !this.selected;
5990
5989
  this.closest("m3e-filter-chip-set")?.[selectionManager].notifySelectionChange(this);
5990
+ this.dispatchEvent(new Event("input", {
5991
+ bubbles: true
5992
+ }));
5991
5993
  this.dispatchEvent(new Event("change", {
5992
5994
  bubbles: true
5993
5995
  }));
5994
- } else {
5995
- this.selected = selected;
5996
5996
  }
5997
5997
  };
5998
5998
  /** Indicates that this custom element participates in form submission, validation, and form state restoration. */
@@ -6034,8 +6034,9 @@ var _M3eFilterChipSetElement_instances, _M3eFilterChipSetElement_directionalityS
6034
6034
  * @attr name - The name that identifies the element when submitting the associated form.
6035
6035
  * @attr vertical - Whether the element is oriented vertically.
6036
6036
  *
6037
- * @fires input - Emitted when the selected state of a chip changes.
6038
- * @fires change - Emitted when the selected state of a chip changes.
6037
+ * @fires beforeinput - Dispatched before the selected state of a chip changes.
6038
+ * @fires input - Dispatched when the selected state of a chip changes.
6039
+ * @fires change - Dispatched when the selected state of a chip changes.
6039
6040
  *
6040
6041
  * @cssprop --m3e-chip-set-spacing - The spacing (gap) between chips in the set.
6041
6042
  */
@@ -6194,8 +6195,8 @@ var _M3eInputChipElement_instances, _M3eInputChipElement_handleAvatarSlotChange,
6194
6195
  * @attr value - A string representing the value of the chip.
6195
6196
  * @attr variant - The appearance variant of the chip.
6196
6197
  *
6197
- * @fires remove - Emitted when the remove button is clicked or DELETE or BACKSPACE key is pressed.
6198
- * @fires click - Emitted when the element is clicked.
6198
+ * @fires remove - Dispatched when the remove button is clicked or DELETE or BACKSPACE key is pressed.
6199
+ * @fires click - Dispatched when the element is clicked.
6199
6200
  *
6200
6201
  * @cssprop --m3e-chip-container-shape - Border radius of the chip container.
6201
6202
  * @cssprop --m3e-chip-container-height - Base height of the chip container before density adjustment.
@@ -6336,7 +6337,7 @@ var _M3eInputChipSetElement_instances, _M3eInputChipSetElement_directionalitySub
6336
6337
  * @attr required - Whether a value is required for the element.
6337
6338
  * @attr vertical - Whether the element is oriented vertically.
6338
6339
  *
6339
- * @fires change - Emitted when a chip is added to, or removed from, the set.
6340
+ * @fires change - Dispatched when a chip is added to, or removed from, the set.
6340
6341
  *
6341
6342
  * @cssprop --m3e-chip-set-spacing - The spacing (gap) between chips in the set.
6342
6343
  */
@@ -6613,7 +6614,7 @@ M3eInputChipSetElement = __decorate([customElement$1("m3e-input-chip-set")], M3e
6613
6614
  * @attr value - A string representing the value of the chip.
6614
6615
  * @attr variant - The appearance variant of the chip.
6615
6616
  *
6616
- * @fires click - Emitted when the element is clicked.
6617
+ * @fires click - Dispatched when the element is clicked.
6617
6618
  *
6618
6619
  * @cssprop --m3e-chip-container-shape - Border radius of the chip container.
6619
6620
  * @cssprop --m3e-chip-container-height - Base height of the chip container before density adjustment.
@@ -10550,10 +10551,10 @@ var _M3eCollapsibleElement_instances, _M3eCollapsibleElement_slotChanged, _M3eCo
10550
10551
  * @attr orientation - Orientation of collapsible content.
10551
10552
  * @attr no-animate - Whether to disable animation.
10552
10553
  *
10553
- * @fires opening - Emitted when the collapsible begins to open.
10554
- * @fires opened - Emitted when the collapsible has opened.
10555
- * @fires closing - Emitted when the collapsible begins to close.
10556
- * @fires closed - Emitted when the collapsible has closed.
10554
+ * @fires opening - Dispatched when the collapsible begins to open.
10555
+ * @fires opened - Dispatched when the collapsible has opened.
10556
+ * @fires closing - Dispatched when the collapsible begins to close.
10557
+ * @fires closed - Dispatched when the collapsible has closed.
10557
10558
  *
10558
10559
  * @cssprop --m3e-collapsible-animation-duration - The duration of the expand / collapse animation.
10559
10560
  */
@@ -11699,7 +11700,7 @@ var M3eTextHighlightElement_1;
11699
11700
  * @attr mode - The mode in which to highlight text.
11700
11701
  * @attr term - The term to highlight.
11701
11702
  *
11702
- * @fires highlight - Emitted when content is highlighted.
11703
+ * @fires highlight - Dispatched when content is highlighted.
11703
11704
  *
11704
11705
  * @cssprop --m3e-text-highlight-container-color - Background color applied to highlighted text ranges.
11705
11706
  * @cssprop --m3e-text-highlight-color - Foreground color of highlighted text content.
@@ -11964,6 +11965,7 @@ var M3eDatepickerElement_1;
11964
11965
  * @attr date - The selected date.
11965
11966
  * @attr max-date - The maximum date that can be selected.
11966
11967
  * @attr min-date - The minimum date that can be selected.
11968
+ * @attr range - Whether a range of dates can be selected.
11967
11969
  * @attr range-end - End of a date range.
11968
11970
  * @attr range-start - Start of a date range.
11969
11971
  * @attr start-at - A date specifying the period (month or year) to start the calendar in.
@@ -12065,6 +12067,11 @@ let M3eDatepickerElement = M3eDatepickerElement_1 = class M3eDatepickerElement e
12065
12067
  * @default null
12066
12068
  */
12067
12069
  this.maxDate = null;
12070
+ /**
12071
+ * Whether a range of dates can be selected.
12072
+ * @default false
12073
+ */
12074
+ this.range = false;
12068
12075
  /**
12069
12076
  * Start of a date range.
12070
12077
  * @default null
@@ -12247,6 +12254,9 @@ let M3eDatepickerElement = M3eDatepickerElement_1 = class M3eDatepickerElement e
12247
12254
  if (["date", "rangeStart", "rangeEnd"].some(x => changedProperties.has(x))) {
12248
12255
  __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearSelectionState).call(this);
12249
12256
  }
12257
+ if (changedProperties.has("rangeStart") && this.rangeStart) {
12258
+ this.range = true;
12259
+ }
12250
12260
  if (changedProperties.has("rangeStart") && this.rangeStart && !changedProperties.has("date")) {
12251
12261
  this.date = new Date(this.rangeStart);
12252
12262
  }
@@ -12284,12 +12294,20 @@ _M3eDatepickerElement_toggleHandler = new WeakMap();
12284
12294
  _M3eDatepickerElement_instances = new WeakSet();
12285
12295
  _M3eDatepickerElement_renderHeader = function _M3eDatepickerElement_renderHeader() {
12286
12296
  if (this.currentVariant === "docked") return nothing;
12297
+ const rangeStart = this._rangeStart ?? this.rangeStart;
12298
+ const rangeEnd = this._rangeStart ? this._rangeEnd : this._rangeEnd ?? this.rangeEnd;
12287
12299
  const selectedDate = this._date ?? this.date;
12288
- return html`<div class="supporting-text">${this.label}</div><div class="headline">${selectedDate ? new Intl.DateTimeFormat(navigator.language, {
12300
+ return html`<div class="supporting-text">${this.label}</div>${rangeStart ? html`<div class="headline">${new Intl.DateTimeFormat(navigator.language, {
12301
+ month: "short",
12302
+ day: "numeric"
12303
+ }).format(rangeStart) + " – " + (rangeEnd ? new Intl.DateTimeFormat(navigator.language, {
12304
+ month: "short",
12305
+ day: "numeric"
12306
+ }).format(rangeEnd) : "")}</div>` : html`<div class="headline">${selectedDate ? new Intl.DateTimeFormat(navigator.language, {
12289
12307
  weekday: "short",
12290
12308
  month: "short",
12291
12309
  day: "numeric"
12292
- }).format(selectedDate) : "––"}</div><div class="divider"></div>`;
12310
+ }).format(selectedDate) : "––"}</div>`}<div class="divider"></div>`;
12293
12311
  };
12294
12312
  _M3eDatepickerElement_handleDocumentClick = function _M3eDatepickerElement_handleDocumentClick(e) {
12295
12313
  if (!e.composedPath().some(x => x instanceof M3eDatepickerElement_1 || x === __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") || x === __classPrivateFieldGet(this, _M3eDatepickerElement_anchor, "f"))) {
@@ -12300,6 +12318,10 @@ _M3eDatepickerElement_handleCalendarChange = function _M3eDatepickerElement_hand
12300
12318
  this._date = this._calendar.date;
12301
12319
  this._rangeStart = this._calendar.rangeStart;
12302
12320
  this._rangeEnd = this._calendar.rangeEnd;
12321
+ if (this.range && !this._rangeStart && this._date) {
12322
+ this._rangeStart = new Date(this._date);
12323
+ this._calendar.rangeStart = this._rangeStart;
12324
+ }
12303
12325
  };
12304
12326
  _M3eDatepickerElement_handleClearClick = function _M3eDatepickerElement_handleClearClick() {
12305
12327
  this.date = null;
@@ -12425,6 +12447,9 @@ __decorate([property({
12425
12447
  attribute: "max-date",
12426
12448
  converter: dateConverter$1
12427
12449
  })], M3eDatepickerElement.prototype, "maxDate", void 0);
12450
+ __decorate([property({
12451
+ type: Boolean
12452
+ })], M3eDatepickerElement.prototype, "range", void 0);
12428
12453
  __decorate([property({
12429
12454
  attribute: "range-start",
12430
12455
  converter: dateConverter$1
@@ -12565,11 +12590,11 @@ var M3eDialogElement_1;
12565
12590
  * @attr no-focus-trap - Whether to disable focus trapping, which keeps keyboard `Tab` navigation within the dialog.
12566
12591
  * @attr open - Whether the dialog is open.
12567
12592
  *
12568
- * @fires opening - Emitted when the dialog begins to open.
12569
- * @fires opened - Emitted when the dialog has opened.
12570
- * @fires cancel - Emitted when the dialog is cancelled.
12571
- * @fires closing - Emitted when the dialog begins to close.
12572
- * @fires closed - Emitted when the dialog has closed.
12593
+ * @fires opening - Dispatched when the dialog begins to open.
12594
+ * @fires opened - Dispatched when the dialog has opened.
12595
+ * @fires cancel - Dispatched when the dialog is cancelled.
12596
+ * @fires closing - Dispatched when the dialog begins to close.
12597
+ * @fires closed - Dispatched when the dialog has closed.
12573
12598
  *
12574
12599
  * @cssprop --m3e-dialog-shape - Border radius of the dialog container.
12575
12600
  * @cssprop --m3e-dialog-min-width - Minimum width of the dialog.
@@ -12967,7 +12992,7 @@ var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointU
12967
12992
  * @attr start-mode - The behavior mode of the start drawer.
12968
12993
  * @attr start-divider - Whether to show a divider between the start drawer and content for `side` mode.
12969
12994
  *
12970
- * @fires change - Emitted when the state of the start or end drawers change.
12995
+ * @fires change - Dispatched when the state of the start or end drawers change.
12971
12996
  *
12972
12997
  * @cssprop --m3e-drawer-container-color - The background color of the drawer container.
12973
12998
  * @cssprop --m3e-drawer-container-elevation - The elevation level of the drawer container.
@@ -13488,7 +13513,7 @@ var _M3eExpansionHeaderElement_instances, _M3eExpansionHeaderElement_renderToggl
13488
13513
  * @attr toggle-direction - The direction of the expansion toggle.
13489
13514
  * @attr toggle-position - The position of the expansion toggle.
13490
13515
  *
13491
- * @fires click - Emitted when the element is clicked.
13516
+ * @fires click - Dispatched when the element is clicked.
13492
13517
  *
13493
13518
  * @cssprop --m3e-expansion-header-collapsed-height - Height of the header when the panel is collapsed.
13494
13519
  * @cssprop --m3e-expansion-header-expanded-height - Height of the header when the panel is expanded.
@@ -13596,10 +13621,10 @@ var M3eExpansionPanelElement_1;
13596
13621
  * @attr toggle-direction - The direction of the expansion toggle.
13597
13622
  * @attr toggle-position - The position of the expansion toggle.
13598
13623
  *
13599
- * @fires opening - Emitted when the expansion panel begins to open.
13600
- * @fires opened - Emitted when the expansion panel has opened.
13601
- * @fires closing - Emitted when the expansion panel begins to close.
13602
- * @fires closed - Emitted when the expansion panel has closed.
13624
+ * @fires opening - Dispatched when the expansion panel begins to open.
13625
+ * @fires opened - Dispatched when the expansion panel has opened.
13626
+ * @fires closing - Dispatched when the expansion panel begins to close.
13627
+ * @fires closed - Dispatched when the expansion panel has closed.
13603
13628
  *
13604
13629
  * @cssprop --m3e-expansion-header-collapsed-height - Height of the header when the panel is collapsed.
13605
13630
  * @cssprop --m3e-expansion-header-expanded-height - Height of the header when the panel is expanded.
@@ -14463,7 +14488,7 @@ var _M3eFabElement_instances, _M3eFabElement_handleSlotChange;
14463
14488
  * @attr value - The value associated with the element's name when it's submitted with form data.
14464
14489
  * @attr variant - The appearance variant of the button.
14465
14490
  *
14466
- * @fires click - Emitted when the element is clicked.
14491
+ * @fires click - Dispatched when the element is clicked.
14467
14492
  *
14468
14493
  * @cssprop --m3e-fab-container-height - Height of the FAB container for all size variants.
14469
14494
  * @cssprop --m3e-fab-label-text-font-size - Font size for the FAB label text for all size variants.
@@ -14873,7 +14898,7 @@ var _M3eFabMenuItemElement_instances, _M3eFabMenuItemElement_clickHandler, _M3eF
14873
14898
  * @attr rel - The relationship between the `target` of the link button and the document.
14874
14899
  * @attr target - The target of the link button.
14875
14900
  *
14876
- * @fires click - Emitted when the element is clicked.
14901
+ * @fires click - Dispatched when the element is clicked.
14877
14902
  *
14878
14903
  * @cssprop --m3e-fab-menu-item-height - Height of the menu item.
14879
14904
  * @cssprop --m3e-fab-menu-item-font-size - Font size of the menu item label.
@@ -16718,9 +16743,10 @@ var _M3eIconButtonElement_instances, _M3eIconButtonElement_clickHandler, _M3eIco
16718
16743
  * @attr variant - The appearance variant of the button.
16719
16744
  * @attr width - The width of the button.
16720
16745
  *
16746
+ * @fires beforeinput - Dispatched before a toggle button's selected state changes.
16721
16747
  * @fires input - Dispatched when a toggle button's selected state changes.
16722
16748
  * @fires change - Dispatched when a toggle button's selected state changes.
16723
- * @fires click - Emitted when the element is clicked.
16749
+ * @fires click - Dispatched when the element is clicked.
16724
16750
  *
16725
16751
  * @cssprop --m3e-icon-button-container-height - Height of the container for all size variants.
16726
16752
  * @cssprop --m3e-icon-button-outline-thickness - Outline thickness for all size variants.
@@ -17135,19 +17161,17 @@ _M3eIconButtonElement_handleClick = function _M3eIconButtonElement_handleClick(e
17135
17161
  e.stopImmediatePropagation();
17136
17162
  }
17137
17163
  if (this.toggle && !e.defaultPrevented) {
17138
- this.selected = !this.selected;
17139
- // Dispatch an input event and if not prevented, dispatch a change event.
17140
- // Otherwise, reset the selected state.
17141
- if (this.dispatchEvent(new Event("input", {
17164
+ if (this.dispatchEvent(new Event("beforeinput", {
17142
17165
  bubbles: true,
17143
- composed: true,
17144
17166
  cancelable: true
17145
17167
  }))) {
17168
+ this.selected = !this.selected;
17169
+ this.dispatchEvent(new Event("input", {
17170
+ bubbles: true
17171
+ }));
17146
17172
  this.dispatchEvent(new Event("change", {
17147
17173
  bubbles: true
17148
17174
  }));
17149
- } else {
17150
- this.selected = !this.selected;
17151
17175
  }
17152
17176
  }
17153
17177
  };
@@ -17550,10 +17574,10 @@ var M3eExpandableListItemElement_1;
17550
17574
  * @attr disabled - Whether the element is disabled.
17551
17575
  * @attr open - Whether the item is expanded.
17552
17576
  *
17553
- * @fires opening - Emitted when the item begins to open.
17554
- * @fires opened - Emitted when the item has opened.
17555
- * @fires closing - Emitted when the item begins to close.
17556
- * @fires closed - Emitted when the item has closed.
17577
+ * @fires opening - Dispatched when the item begins to open.
17578
+ * @fires opened - Dispatched when the item has opened.
17579
+ * @fires closing - Dispatched when the item begins to close.
17580
+ * @fires closed - Dispatched when the item has closed.
17557
17581
  *
17558
17582
  * @cssprop --m3e-expandable-list-item-toggle-icon-container-width - Width of the toggle icon container.
17559
17583
  * @cssprop --m3e-expandable-list-item-toggle-icon-container-shape - Border radius of the toggle icon container.
@@ -17874,7 +17898,7 @@ var _M3eListActionElement_instances, _M3eListActionElement_handleClick;
17874
17898
  * @attr rel - The relationship between the `target` of the link button and the document.
17875
17899
  * @attr target - The target of the link button.
17876
17900
  *
17877
- * @fires click - Emitted when the element is clicked.
17901
+ * @fires click - Dispatched when the element is clicked.
17878
17902
  *
17879
17903
  * @cssprop --m3e-list-item-between-space - Horizontal gap between elements.
17880
17904
  * @cssprop --m3e-list-item-padding-inline - Horizontal padding for the list item.
@@ -17996,9 +18020,10 @@ var _M3eListOptionElement_instances, _M3eListOptionElement_value, _M3eListOption
17996
18020
  * @attr disabled - Whether the element is disabled.
17997
18021
  * @attr selected - Whether the element is selected.
17998
18022
  *
17999
- * @fires input - Emitted when the selected state changes.
18000
- * @fires change - Emitted when the selected state changes.
18001
- * @fires click - Emitted when the element is clicked.
18023
+ * @fires beforeinput - Dispatched before the selected state changes.
18024
+ * @fires input - Dispatched when the selected state changes.
18025
+ * @fires change - Dispatched when the selected state changes.
18026
+ * @fires click - Dispatched when the element is clicked.
18002
18027
  *
18003
18028
  * @cssprop --m3e-list-item-between-space - Horizontal gap between elements.
18004
18029
  * @cssprop --m3e-list-item-padding-inline - Horizontal padding for the list item.
@@ -18139,19 +18164,18 @@ _M3eListOptionElement_handleClick = function _M3eListOptionElement_handleClick(e
18139
18164
  const selectionList = this.closest("m3e-selection-list");
18140
18165
  if (e.defaultPrevented || !selectionList) return;
18141
18166
  if (selectionList.multi || !this.selected) {
18142
- const selected = this.selected;
18143
- this.selected = !this.selected;
18144
- if (this.dispatchEvent(new Event("input", {
18167
+ if (this.dispatchEvent(new Event("beforeinput", {
18145
18168
  bubbles: true,
18146
- composed: true,
18147
18169
  cancelable: true
18148
18170
  }))) {
18171
+ this.selected = !this.selected;
18149
18172
  selectionList[selectionManager].notifySelectionChange(this);
18173
+ this.dispatchEvent(new Event("input", {
18174
+ bubbles: true
18175
+ }));
18150
18176
  this.dispatchEvent(new Event("change", {
18151
18177
  bubbles: true
18152
18178
  }));
18153
- } else {
18154
- this.selected = selected;
18155
18179
  }
18156
18180
  }
18157
18181
  };
@@ -18183,8 +18207,9 @@ var _M3eSelectionListElement_instances, _M3eSelectionListElement_keyDownHandler,
18183
18207
  * @attr multi - Whether multiple items can be selected.
18184
18208
  * @attr variant - The appearance variant of the list.
18185
18209
  *
18186
- * @fires input - Emitted when the selected state of an option changes.
18187
- * @fires change - Emitted when the selected state of an option changes.
18210
+ * @fires beforeinput - Dispatched before the selected state of an option changes.
18211
+ * @fires input - Dispatched when the selected state of an option changes.
18212
+ * @fires change - Dispatched when the selected state of an option changes.
18188
18213
  *
18189
18214
  * @cssprop --m3e-list-divider-inset-start-size - Start inset for dividers within the list.
18190
18215
  * @cssprop --m3e-list-divider-inset-end-size - End inset for dividers within the list.
@@ -18621,7 +18646,7 @@ var M3eMenuItemElement_1;
18621
18646
  * @attr rel - The relationship between the `target` of the link button and the document.
18622
18647
  * @attr target - The target of the link button.
18623
18648
  *
18624
- * @fires click - Emitted when the element is clicked.
18649
+ * @fires click - Dispatched when the element is clicked.
18625
18650
  *
18626
18651
  * @cssprop --m3e-menu-item-container-height - Height of the menu item container.
18627
18652
  * @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
@@ -19164,7 +19189,7 @@ var _M3eMenuItemCheckboxElement_instances, _M3eMenuItemCheckboxElement_clickHand
19164
19189
  * @attr disabled - Whether the element is disabled.
19165
19190
  * @attr checked - Whether the element is checked.
19166
19191
  *
19167
- * @fires click - Emitted when the element is clicked.
19192
+ * @fires click - Dispatched when the element is clicked.
19168
19193
  *
19169
19194
  * @cssprop --m3e-menu-item-container-height - Height of the menu item container.
19170
19195
  * @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
@@ -19337,7 +19362,7 @@ var _M3eMenuItemRadioElement_instances, _M3eMenuItemRadioElement_clickHandler, _
19337
19362
  * @attr disabled - Whether the element is disabled.
19338
19363
  * @attr checked - Whether the element is checked.
19339
19364
  *
19340
- * @fires click - Emitted when the element is clicked.
19365
+ * @fires click - Dispatched when the element is clicked.
19341
19366
  *
19342
19367
  * @cssprop --m3e-menu-item-container-height - Height of the menu item container.
19343
19368
  * @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
@@ -19493,7 +19518,9 @@ var _M3eNavBarElement_instances, _M3eNavBarElement_breakpointUnobserve, _M3eNavB
19493
19518
  *
19494
19519
  * @attr mode - The mode in which items in the bar are presented.
19495
19520
  *
19496
- * @fires change - Emitted when the selected state of an item changes.
19521
+ * @fires beforeinput - Dispatched before the selected state of an item changes.
19522
+ * @fires input - Dispatched when the selected state of an item changes.
19523
+ * @fires change - Dispatched when the selected state of an item changes.
19497
19524
  *
19498
19525
  * @cssprop --m3e-nav-bar-height - Height of the navigation bar.
19499
19526
  * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.
@@ -19634,9 +19661,10 @@ var _M3eNavItemElement_instances, _M3eNavItemElement_inRail, _M3eNavItemElement_
19634
19661
  * @attr selected - A value indicating whether the element is selected.
19635
19662
  * @attr target - The target of the link button.
19636
19663
  *
19637
- * @fires input - Emitted when the selected state changes.
19638
- * @fires change - Emitted when the selected state changes.
19639
- * @fires click - Emitted when the element is clicked.
19664
+ * @fires beforeinput - Dispatched before the selected state changes.
19665
+ * @fires input - Dispatched when the selected state changes.
19666
+ * @fires change - Dispatched when the selected state changes.
19667
+ * @fires click - Dispatched when the element is clicked.
19640
19668
  *
19641
19669
  * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.
19642
19670
  * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.
@@ -19752,18 +19780,18 @@ let M3eNavItemElement = class M3eNavItemElement extends ReconnectedCallback$1(Su
19752
19780
  };
19753
19781
  _M3eNavItemElement_handleClick = function _M3eNavItemElement_handleClick(e) {
19754
19782
  if (e.defaultPrevented) return;
19755
- this.selected = true;
19756
- if (this.dispatchEvent(new Event("input", {
19783
+ if (this.dispatchEvent(new Event("beforeinput", {
19757
19784
  bubbles: true,
19758
- composed: true,
19759
19785
  cancelable: true
19760
19786
  }))) {
19787
+ this.selected = true;
19761
19788
  this.navBar?.[selectionManager].notifySelectionChange(this);
19789
+ this.dispatchEvent(new Event("input", {
19790
+ bubbles: true
19791
+ }));
19762
19792
  this.dispatchEvent(new Event("change", {
19763
19793
  bubbles: true
19764
19794
  }));
19765
- } else {
19766
- this.selected = false;
19767
19795
  }
19768
19796
  };
19769
19797
  _M3eNavItemElement_handleSelectedIconSlotChange = function _M3eNavItemElement_handleSelectedIconSlotChange(e) {
@@ -19865,11 +19893,11 @@ var M3eNavMenuItemElement_1;
19865
19893
  * @attr open - Whether the item is expanded.
19866
19894
  * @attr selected - Whether the item is selected.
19867
19895
  *
19868
- * @fires opening - Emitted when the item begins to open.
19869
- * @fires opened - Emitted when the item has opened.
19870
- * @fires closing - Emitted when the item begins to close.
19871
- * @fires closed - Emitted when the item has closed.
19872
- * @fires click - Emitted when the element is clicked.
19896
+ * @fires opening - Dispatched when the item begins to open.
19897
+ * @fires opened - Dispatched when the item has opened.
19898
+ * @fires closing - Dispatched when the item begins to close.
19899
+ * @fires closed - Dispatched when the item has closed.
19900
+ * @fires click - Dispatched when the element is clicked.
19873
19901
  *
19874
19902
  * @cssprop --m3e-nav-menu-item-font-size - Font size for the item label.
19875
19903
  * @cssprop --m3e-nav-menu-item-font-weight - Font weight for the item label.
@@ -20554,7 +20582,9 @@ var _M3eNavRailElement_instances, _M3eNavRailElement_focusKeyManager, _M3eNavRai
20554
20582
  *
20555
20583
  * @attr mode - The mode in which items in the rail are presented.
20556
20584
  *
20557
- * @fires change - Emitted when the selected state of an item changes.
20585
+ * @fires beforeinput - Dispatched before the selected state of an item changes.
20586
+ * @fires input - Dispatched when the selected state of an item changes.
20587
+ * @fires change - Dispatched when the selected state of an item changes.
20558
20588
  *
20559
20589
  * @cssprop --m3e-nav-rail-top-space - Top block padding for the nav rail.
20560
20590
  * @cssprop --m3e-nav-rail-bottom-space - Bottom block padding for the nav rail.
@@ -21071,7 +21101,7 @@ var M3ePaginatorElement_1;
21071
21101
  * @attr previous-page-label - The accessible label given to the button used to move to the previous page.
21072
21102
  * @attr show-first-last-buttons - Whether to show first/last buttons.
21073
21103
  *
21074
- * @fires page - Emitted when a user selects a different page size or navigates to another page.
21104
+ * @fires page - Dispatched when a user selects a different page size or navigates to another page.
21075
21105
  *
21076
21106
  * @cssprop --m3e-paginator-font-size - The font size used for paginator text.
21077
21107
  * @cssprop --m3e-paginator-font-weight - The font weight used for paginator text.
@@ -21990,9 +22020,10 @@ var _M3eRadioElement_instances, _M3eRadioElement_clickHandler, _M3eRadioElement_
21990
22020
  * @attr required - Whether the element is required.
21991
22021
  * @attr value - A string representing the value of the radio.
21992
22022
  *
21993
- * @fires input - Emitted when the checked state changes.
21994
- * @fires change - Emitted when the checked state changes.
21995
- * @fires click - Emitted when the element is clicked.
22023
+ * @fires beforeinput - Dispatched before the checked state changes.
22024
+ * @fires input - Dispatched when the checked state changes.
22025
+ * @fires change - Dispatched when the checked state changes.
22026
+ * @fires click - Dispatched when the element is clicked.
21996
22027
  *
21997
22028
  * @cssprop --m3e-radio-container-size - Base size of the radio button container.
21998
22029
  * @cssprop --m3e-radio-icon-size - Size of the radio icon inside the wrapper.
@@ -22091,18 +22122,18 @@ _M3eRadioElement_renderIcon = function _M3eRadioElement_renderIcon() {
22091
22122
  };
22092
22123
  _M3eRadioElement_handleClick = function _M3eRadioElement_handleClick(e) {
22093
22124
  if (e.defaultPrevented || this.checked || this.disabled) return;
22094
- this.checked = true;
22095
- if (this.dispatchEvent(new Event("input", {
22125
+ if (this.dispatchEvent(new Event("beforeinput", {
22096
22126
  bubbles: true,
22097
- composed: true,
22098
22127
  cancelable: true
22099
22128
  }))) {
22129
+ this.checked = true;
22100
22130
  __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_notifySelectionChange).call(this);
22131
+ this.dispatchEvent(new Event("input", {
22132
+ bubbles: true
22133
+ }));
22101
22134
  this.dispatchEvent(new Event("change", {
22102
22135
  bubbles: true
22103
22136
  }));
22104
- } else {
22105
- this.checked = false;
22106
22137
  }
22107
22138
  // Prevent default avoids double-click in FireFox.
22108
22139
  if (this.closest("label")) {
@@ -22158,7 +22189,9 @@ var _M3eRadioGroupElement_instances, _M3eRadioGroupElement_directionalitySubscri
22158
22189
  * @attr name - The name that identifies the element when submitting the associated form.
22159
22190
  * @attr required - Whether the element is required.
22160
22191
  *
22161
- * @fires change - Emitted when the checked state of a radio button changes.
22192
+ * @fires beforeinput - Dispatched before the checked state of a radio button changes.
22193
+ * @fires input - Dispatched when the checked state of a radio button changes.
22194
+ * @fires change - Dispatched when the checked state of a radio button changes.
22162
22195
  */
22163
22196
  let M3eRadioGroupElement = class M3eRadioGroupElement extends Labelled$1(RequiredConstraintValidation$1(Dirty$1(Touched$1(Required$1(ConstraintValidation$1(FormAssociated$1(Disabled$1(AttachInternals$1(Role$1(LitElement, "radiogroup")))))))))) {
22164
22197
  constructor() {
@@ -23115,9 +23148,10 @@ var M3eButtonSegmentElement_1;
23115
23148
  * @attr disabled - Whether the element is disabled.
23116
23149
  * @attr value - A string representing the value of the segment.
23117
23150
  *
23118
- * @fires input - Emitted when the checked state changes.
23119
- * @fires change - Emitted when the checked state changes.
23120
- * @fires click - Emitted when the element is clicked.
23151
+ * @fires beforeinput - Dispatched before the checked state changes.
23152
+ * @fires input - Dispatched when the checked state changes.
23153
+ * @fires change - Dispatched when the checked state changes.
23154
+ * @fires click - Dispatched when the element is clicked.
23121
23155
  *
23122
23156
  * @cssprop --m3e-segmented-button-height - Total height of the segmented button.
23123
23157
  * @cssprop --m3e-segmented-button-outline-thickness - Thickness of the button's border.
@@ -23221,19 +23255,18 @@ _M3eButtonSegmentElement_handleClick = function _M3eButtonSegmentElement_handleC
23221
23255
  if (e.defaultPrevented) return;
23222
23256
  const segmentedButton = this.closest("m3e-segmented-button");
23223
23257
  if (segmentedButton && (segmentedButton.multi || !this.checked)) {
23224
- const checked = this.checked;
23225
- this.checked = !this.checked;
23226
- if (this.dispatchEvent(new Event("input", {
23258
+ if (this.dispatchEvent(new Event("beforeinput", {
23227
23259
  bubbles: true,
23228
- composed: true,
23229
23260
  cancelable: true
23230
23261
  }))) {
23262
+ this.checked = !this.checked;
23231
23263
  this.closest("m3e-segmented-button")?.[selectionManager].notifySelectionChange(this);
23264
+ this.dispatchEvent(new Event("input", {
23265
+ bubbles: true
23266
+ }));
23232
23267
  this.dispatchEvent(new Event("change", {
23233
23268
  bubbles: true
23234
23269
  }));
23235
- } else {
23236
- this.checked = checked;
23237
23270
  }
23238
23271
  }
23239
23272
  };
@@ -23285,8 +23318,9 @@ var _M3eSegmentedButtonElement_instances, _M3eSegmentedButtonElement_directional
23285
23318
  * @attr multi - Whether multiple options can be selected.
23286
23319
  * @attr name - The name that identifies the element when submitting the associated form.
23287
23320
  *
23288
- * @fires input - Emitted when the checked state of a segment changes.
23289
- * @fires change - Emitted when the checked state of a segment changes.
23321
+ * @fires beforeinput - Dispatched before the checked state of a segment changes.
23322
+ * @fires input - Dispatched when the checked state of a segment changes.
23323
+ * @fires change - Dispatched when the checked state of a segment changes.
23290
23324
  *
23291
23325
  * @cssprop --m3e-segmented-button-start-shape - Border radius for the first segment in a segmented button.
23292
23326
  * @cssprop --m3e-segmented-button-end-shape - Border radius for the last segment in a segmented button.
@@ -23453,8 +23487,9 @@ var M3eSelectElement_1;
23453
23487
  * @attr panel-class - Class or list of classes to be applied to the select's overlay panel.
23454
23488
  * @attr required - Whether the element is required.
23455
23489
  *
23456
- * @fires input - Emitted when the selected state changes.
23457
- * @fires change - Emitted when the selected state changes.
23490
+ * @fires beforeinput - Dispatched before the selected state changes.
23491
+ * @fires input - Dispatched when the selected state changes.
23492
+ * @fires change - Dispatched when the selected state changes.
23458
23493
  *
23459
23494
  * @cssprop --m3e-form-field-font-size - The font size of the select control.
23460
23495
  * @cssprop --m3e-form-field-font-weight - The font weight of the select control.
@@ -23874,13 +23909,12 @@ _M3eSelectElement_updateSelectionState = function _M3eSelectElement_updateSelect
23874
23909
  _M3eSelectElement_selectOption = function _M3eSelectElement_selectOption(option) {
23875
23910
  const selected = this.multi ? !option.selected : true;
23876
23911
  if (option.selected === selected) return;
23877
- option.selected = selected;
23878
- __classPrivateFieldGet(this, _M3eSelectElement_instances, "m", _M3eSelectElement_updateSelectionState).call(this, option);
23879
- if (this.dispatchEvent(new Event("input", {
23912
+ if (this.dispatchEvent(new Event("beforeinput", {
23880
23913
  bubbles: true,
23881
- composed: true,
23882
23914
  cancelable: true
23883
23915
  }))) {
23916
+ option.selected = selected;
23917
+ __classPrivateFieldGet(this, _M3eSelectElement_instances, "m", _M3eSelectElement_updateSelectionState).call(this, option);
23884
23918
  if (!this.multi) {
23885
23919
  __classPrivateFieldGet(this, _M3eSelectElement_instances, "a", _M3eSelectElement_selected_get).filter(x => x !== option).forEach(x => {
23886
23920
  x.selected = false;
@@ -23889,12 +23923,12 @@ _M3eSelectElement_selectOption = function _M3eSelectElement_selectOption(option)
23889
23923
  }
23890
23924
  this.requestUpdate();
23891
23925
  __classPrivateFieldGet(this, _M3eSelectElement_instances, "a", _M3eSelectElement_formField_get)?.notifyControlStateChange();
23926
+ this.dispatchEvent(new Event("input", {
23927
+ bubbles: true
23928
+ }));
23892
23929
  this.dispatchEvent(new Event("change", {
23893
23930
  bubbles: true
23894
23931
  }));
23895
- } else {
23896
- option.selected = !selected;
23897
- __classPrivateFieldGet(this, _M3eSelectElement_instances, "m", _M3eSelectElement_updateSelectionState).call(this, option);
23898
23932
  }
23899
23933
  };
23900
23934
  /** The styles of the element. */
@@ -24342,6 +24376,7 @@ let M3eSlideGroupElement = class M3eSlideGroupElement extends ReconnectedCallbac
24342
24376
  }
24343
24377
  /** @private */
24344
24378
  _updatePaging() {
24379
+ const canPage = this._canPage;
24345
24380
  if (this.disabled) {
24346
24381
  this._canPage = false;
24347
24382
  } else if (!this.vertical) {
@@ -24360,6 +24395,10 @@ let M3eSlideGroupElement = class M3eSlideGroupElement extends ReconnectedCallbac
24360
24395
  if (!this._canPage) {
24361
24396
  this._canPageStart = this._canPageEnd = false;
24362
24397
  }
24398
+ if (canPage != this._canPage) {
24399
+ // Emit internal (undocumented) event for use with tabs.
24400
+ this.dispatchEvent(new CustomEvent("pagination-changed"));
24401
+ }
24363
24402
  }
24364
24403
  };
24365
24404
  _M3eSlideGroupElement_directionalitySubscription = new WeakMap();
@@ -24408,7 +24447,7 @@ _M3eSlideGroupElement_pageEnd = function _M3eSlideGroupElement_pageEnd() {
24408
24447
  }
24409
24448
  };
24410
24449
  /** The styles of the element. */
24411
- M3eSlideGroupElement.styles = css`:host { display: flex; flex-wrap: nowrap; overflow: hidden; } :host([vertical]) { flex-direction: column; } .prev-button, .next-button { flex: none; --m3e-icon-button-small-shape-round: 0px; --m3e-icon-button-small-shape-square: 0px; --m3e-icon-button-small-shape-pressed-morph: 0px; --m3e-focus-ring-visibility: hidden; } ::slotted(prev-icon), ::slotted(next-icon), .icon { width: 1em; font-size: var(--m3e-slide-group-button-icon-size, var(--m3e-icon-button-small-icon-size, 1.5rem)) !important; } :host(:not([vertical])) .prev-button, :host(:not([vertical])) .next-button { --m3e-icon-button-small-container-height: 100%; width: var(--m3e-slide-group-button-size, 2.5rem); } :host([vertical]) .prev-button, :host([vertical]) .next-button { width: unset; --m3e-icon-button-small-container-height: var(--m3e-slide-group-button-size, 2.5rem); } :host([vertical]) .prev-button .icon, :host([vertical]) .next-button .icon { transform: rotate(90deg); } .content { flex: 1 1 auto; display: inherit; flex-wrap: inherit; flex-direction: inherit; overflow: inherit; position: relative; border-top: var(--m3e-slide-group-divider-top); border-bottom: var(--m3e-slide-group-divider-bottom); }`;
24450
+ M3eSlideGroupElement.styles = css`:host { display: flex; flex-wrap: nowrap; } :host([vertical]) { flex-direction: column; } .prev-button, .next-button { flex: none; --m3e-icon-button-small-shape-round: 0px; --m3e-icon-button-small-shape-square: 0px; --m3e-icon-button-small-shape-pressed-morph: 0px; --m3e-focus-ring-visibility: hidden; } ::slotted(prev-icon), ::slotted(next-icon), .icon { width: 1em; font-size: var(--m3e-slide-group-button-icon-size, var(--m3e-icon-button-small-icon-size, 1.5rem)) !important; } :host(:not([vertical])) .prev-button, :host(:not([vertical])) .next-button { --m3e-icon-button-small-container-height: 100%; width: var(--m3e-slide-group-button-size, 2.5rem); } :host([vertical]) .prev-button, :host([vertical]) .next-button { width: unset; --m3e-icon-button-small-container-height: var(--m3e-slide-group-button-size, 2.5rem); } :host([vertical]) .prev-button .icon, :host([vertical]) .next-button .icon { transform: rotate(90deg); } .content { flex: 1 1 auto; display: inherit; flex-wrap: inherit; flex-direction: inherit; position: relative; border-top: var(--m3e-slide-group-divider-top); border-bottom: var(--m3e-slide-group-divider-bottom); scrollbar-width: none; } .content::-webkit-scrollbar { display: none; } :host([vertical]) .content { overflow-x: hidden; overflow-y: auto; } :host(:not([vertical])) .content { overflow-x: auto; overflow-y: hidden; }`;
24412
24451
  __decorate([query(".content")], M3eSlideGroupElement.prototype, "scrollContainer", void 0);
24413
24452
  __decorate([state()], M3eSlideGroupElement.prototype, "_canPage", void 0);
24414
24453
  __decorate([state()], M3eSlideGroupElement.prototype, "_canPageStart", void 0);
@@ -24465,9 +24504,10 @@ var _M3eSliderThumbElement_instances, _M3eSliderThumbElement_labelText_get;
24465
24504
  * @attr name - The name that identifies the element when submitting the associated form.
24466
24505
  * @attr value - The value of the thumb.
24467
24506
  *
24468
- * @fires input - Emitted when the value changes.
24469
- * @fires change - Emitted when the value changes.
24470
- * @fires click - Emitted when the element is clicked.
24507
+ * @fires beforeinput - Dispatched before the value changes.
24508
+ * @fires input - Dispatched when the value changes.
24509
+ * @fires change - Dispatched when the value changes.
24510
+ * @fires click - Dispatched when the element is clicked.
24471
24511
  *
24472
24512
  * @cssprop --m3e-slider-thumb-width - Width of the slider thumb.
24473
24513
  * @cssprop --m3e-slider-thumb-padding - Horizontal padding around the thumb.
@@ -24540,7 +24580,7 @@ __decorate([property({
24540
24580
  })], M3eSliderThumbElement.prototype, "value", void 0);
24541
24581
  M3eSliderThumbElement = __decorate([customElement$1("m3e-slider-thumb")], M3eSliderThumbElement);
24542
24582
 
24543
- var _M3eSliderElement_instances, _M3eSliderElement_directionalitySubscription, _M3eSliderElement_thumbs, _M3eSliderElement_activeThumb, _M3eSliderElement_cachedWidth, _M3eSliderElement_cachedThumbWidth, _M3eSliderElement_cachedLeft, _M3eSliderElement_renderTick, _M3eSliderElement_handleSlotChange, _M3eSliderElement_updateThumbs, _M3eSliderElement_pointFromValue, _M3eSliderElement_valueFromPoint, _M3eSliderElement_updateCachedDimensions, _M3eSliderElement_updateDimensions, _M3eSliderElement_updateTicks, _M3eSliderElement_handlePointerDown, _M3eSliderElement_handlePointerMove, _M3eSliderElement_handlePointerUp, _M3eSliderElement_handleKeyDown, _M3eSliderElement_handleThumbChange, _M3eSliderElement_changeThumb;
24583
+ var _M3eSliderElement_instances, _M3eSliderElement_directionalitySubscription, _M3eSliderElement_changedThumbs, _M3eSliderElement_thumbs, _M3eSliderElement_activeThumb, _M3eSliderElement_cachedWidth, _M3eSliderElement_cachedThumbWidth, _M3eSliderElement_cachedLeft, _M3eSliderElement_renderTick, _M3eSliderElement_handleSlotChange, _M3eSliderElement_updateThumbs, _M3eSliderElement_pointFromValue, _M3eSliderElement_valueFromPoint, _M3eSliderElement_updateCachedDimensions, _M3eSliderElement_updateDimensions, _M3eSliderElement_updateTicks, _M3eSliderElement_handlePointerDown, _M3eSliderElement_handlePointerMove, _M3eSliderElement_handlePointerUp, _M3eSliderElement_handleKeyDown, _M3eSliderElement_handleKeyUp, _M3eSliderElement_handleThumbChange, _M3eSliderElement_changeThumb, _M3eSliderElement_commitThumb;
24544
24584
  /**
24545
24585
  * Allows for the selection of numeric values from a range.
24546
24586
  *
@@ -24578,6 +24618,10 @@ var _M3eSliderElement_instances, _M3eSliderElement_directionalitySubscription, _
24578
24618
  * @attr step - The value at which the thumb will snap.
24579
24619
  * @attr size - The size of the slider.
24580
24620
  *
24621
+ * @fires beforeinput - Dispatched before the value of a thumb changes.
24622
+ * @fires input - Dispatched when the value of a thumb changes.
24623
+ * @fires change - Dispatched when the value of a thumb changes.
24624
+ *
24581
24625
  * @cssprop --m3e-slider-min-width - Minimum inline size of the slider host.
24582
24626
  * @cssprop --m3e-slider-small-height - Height of the slider when size is small or extra-small.
24583
24627
  * @cssprop --m3e-slider-medium-height - Height of the slider when size is medium.
@@ -24622,6 +24666,8 @@ let M3eSliderElement = class M3eSliderElement extends AttachInternals$1(LitEleme
24622
24666
  /** @private */
24623
24667
  this._ticks = new Array();
24624
24668
  /** @private */
24669
+ _M3eSliderElement_changedThumbs.set(this, new Set());
24670
+ /** @private */
24625
24671
  _M3eSliderElement_thumbs.set(this, new Array());
24626
24672
  /** @private */
24627
24673
  _M3eSliderElement_activeThumb.set(this, void 0);
@@ -24703,6 +24749,7 @@ let M3eSliderElement = class M3eSliderElement extends AttachInternals$1(LitEleme
24703
24749
  /** @inheritdoc */
24704
24750
  disconnectedCallback() {
24705
24751
  super.disconnectedCallback();
24752
+ __classPrivateFieldGet(this, _M3eSliderElement_changedThumbs, "f").clear();
24706
24753
  __classPrivateFieldGet(this, _M3eSliderElement_directionalitySubscription, "f")?.call(this);
24707
24754
  }
24708
24755
  /** @inheritdoc */
@@ -24714,10 +24761,11 @@ let M3eSliderElement = class M3eSliderElement extends AttachInternals$1(LitEleme
24714
24761
  }
24715
24762
  /** @inheritdoc */
24716
24763
  render() {
24717
- return html`<div class="base" tabindex="${ifDefined(!this.disabled ? "-1" : undefined)}" @pointerdown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerDown)}" @pointermove="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerMove)}" @pointerup="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerUp)}" @keydown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleKeyDown)}" @value-change="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleThumbChange)}"><div class="track" aria-hidden="true"><div class="track-inactive start"></div><div class="track-active"></div><div class="track-inactive end"></div></div><div class="ticks" aria-hidden="true">${this._ticks.map(x => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_renderTick).call(this, x))}</div><slot @slotchange="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleSlotChange)}"></slot></div>`;
24764
+ return html`<div class="base" tabindex="${ifDefined(!this.disabled ? "-1" : undefined)}" @pointerdown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerDown)}" @pointermove="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerMove)}" @pointerup="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handlePointerUp)}" @keydown="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleKeyDown)}" @keyup="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleKeyUp)}" @value-change="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleThumbChange)}"><div class="track" aria-hidden="true"><div class="track-inactive start"></div><div class="track-active"></div><div class="track-inactive end"></div></div><div class="ticks" aria-hidden="true">${this._ticks.map(x => __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_renderTick).call(this, x))}</div><slot @slotchange="${__classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_handleSlotChange)}"></slot></div>`;
24718
24765
  }
24719
24766
  };
24720
24767
  _M3eSliderElement_directionalitySubscription = new WeakMap();
24768
+ _M3eSliderElement_changedThumbs = new WeakMap();
24721
24769
  _M3eSliderElement_thumbs = new WeakMap();
24722
24770
  _M3eSliderElement_activeThumb = new WeakMap();
24723
24771
  _M3eSliderElement_cachedWidth = new WeakMap();
@@ -24828,6 +24876,7 @@ _M3eSliderElement_handlePointerDown = function _M3eSliderElement_handlePointerDo
24828
24876
  if (e.target instanceof HTMLElement) {
24829
24877
  e.target.setPointerCapture(e.pointerId);
24830
24878
  }
24879
+ __classPrivateFieldGet(this, _M3eSliderElement_changedThumbs, "f").clear();
24831
24880
  __classPrivateFieldSet(this, _M3eSliderElement_activeThumb, e.composedPath().find(x => x instanceof M3eSliderThumbElement), "f");
24832
24881
  if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f")) {
24833
24882
  return;
@@ -24888,6 +24937,7 @@ _M3eSliderElement_handlePointerUp = function _M3eSliderElement_handlePointerUp(e
24888
24937
  e.target.releasePointerCapture(e.pointerId);
24889
24938
  }
24890
24939
  if (__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f") && !__classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").disabled) {
24940
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_commitThumb).call(this, __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f"));
24891
24941
  __classPrivateFieldGet(this, _M3eSliderElement_activeThumb, "f").focus();
24892
24942
  }
24893
24943
  };
@@ -24954,6 +25004,12 @@ _M3eSliderElement_handleKeyDown = function _M3eSliderElement_handleKeyDown(e) {
24954
25004
  break;
24955
25005
  }
24956
25006
  };
25007
+ _M3eSliderElement_handleKeyUp = function _M3eSliderElement_handleKeyUp(e) {
25008
+ const activeThumb = e.composedPath().find(x => x instanceof M3eSliderThumbElement);
25009
+ if (activeThumb) {
25010
+ __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_commitThumb).call(this, activeThumb);
25011
+ }
25012
+ };
24957
25013
  _M3eSliderElement_handleThumbChange = function _M3eSliderElement_handleThumbChange(e) {
24958
25014
  e.stopPropagation();
24959
25015
  __classPrivateFieldGet(this, _M3eSliderElement_instances, "m", _M3eSliderElement_updateThumbs).call(this);
@@ -24961,31 +25017,35 @@ _M3eSliderElement_handleThumbChange = function _M3eSliderElement_handleThumbChan
24961
25017
  };
24962
25018
  _M3eSliderElement_changeThumb = function _M3eSliderElement_changeThumb(thumb, value, animate = false) {
24963
25019
  if (thumb.value === value) return;
24964
- const prev = thumb.value;
24965
- if (animate && !prefersReducedMotion$1()) {
24966
- addCustomState$1(this, "--animating");
24967
- thumb.addEventListener("transitionend", () => {
24968
- thumb.style.transition = "";
24969
- deleteCustomState$1(this, "--animating");
24970
- }, {
24971
- once: true
24972
- });
24973
- thumb.style.transition = `transform ${DesignToken$1.motion.spring.fastEffects}`;
24974
- }
24975
- thumb.value = value;
24976
- thumb.markAsDirty();
24977
- thumb.markAsTouched();
24978
- if (thumb.dispatchEvent(new Event("input", {
25020
+ if (thumb.dispatchEvent(new Event("beforeinput", {
24979
25021
  bubbles: true,
24980
- composed: true,
24981
25022
  cancelable: true
24982
25023
  }))) {
25024
+ if (animate && !prefersReducedMotion$1()) {
25025
+ addCustomState$1(this, "--animating");
25026
+ thumb.addEventListener("transitionend", () => {
25027
+ thumb.style.transition = "";
25028
+ deleteCustomState$1(this, "--animating");
25029
+ }, {
25030
+ once: true
25031
+ });
25032
+ thumb.style.transition = `transform ${DesignToken$1.motion.spring.fastEffects}`;
25033
+ }
25034
+ __classPrivateFieldGet(this, _M3eSliderElement_changedThumbs, "f").add(thumb);
25035
+ thumb.value = value;
25036
+ thumb.markAsDirty();
25037
+ thumb.markAsTouched();
25038
+ thumb.dispatchEvent(new Event("input", {
25039
+ bubbles: true
25040
+ }));
25041
+ }
25042
+ };
25043
+ _M3eSliderElement_commitThumb = function _M3eSliderElement_commitThumb(thumb) {
25044
+ if (__classPrivateFieldGet(this, _M3eSliderElement_changedThumbs, "f").has(thumb)) {
24983
25045
  thumb.dispatchEvent(new Event("change", {
24984
- bubbles: true,
24985
- composed: true
25046
+ bubbles: true
24986
25047
  }));
24987
- } else {
24988
- thumb.value = prev;
25048
+ __classPrivateFieldGet(this, _M3eSliderElement_changedThumbs, "f").delete(thumb);
24989
25049
  }
24990
25050
  };
24991
25051
  /** The styles of the element. */
@@ -25498,8 +25558,9 @@ var _M3eSplitPaneElement_instances, _M3eSplitPaneElement_breakpointUnobserve, _M
25498
25558
  * @attr value - A fractional value, between 0 and 100, indicating the size of the start pane.
25499
25559
  * @attr wrap-detents - Whether cycling through detents will wrap.
25500
25560
  *
25501
- * @fires input - Fired continuously while the user adjusts the drag handle.
25502
- * @fires change - Fired when the user finishes adjusting the drag handle.
25561
+ * @fires beforeinput - Dispatched continuously before the user adjusts the drag handle.
25562
+ * @fires input - Dispatched continuously while the user adjusts the drag handle.
25563
+ * @fires change - Dispatched when the user finishes adjusting the drag handle.
25503
25564
  *
25504
25565
  * @cssprop --m3e-split-pane-drag-handle-hover-color - Color used for the drag handle hover state.
25505
25566
  * @cssprop --m3e-split-pane-drag-handle-hover-opacity - Opacity used for the drag handle hover state.
@@ -25806,8 +25867,7 @@ _M3eSplitPaneElement_handlePointerUp = function _M3eSplitPaneElement_handlePoint
25806
25867
  }
25807
25868
  if (__classPrivateFieldGet(this, _M3eSplitPaneElement_valueChanged, "f")) {
25808
25869
  this.dispatchEvent(new Event("change", {
25809
- bubbles: true,
25810
- composed: true
25870
+ bubbles: true
25811
25871
  }));
25812
25872
  __classPrivateFieldSet(this, _M3eSplitPaneElement_valueChanged, false, "f");
25813
25873
  }
@@ -25943,27 +26003,25 @@ _M3eSplitPaneElement_handleKeyDown = function _M3eSplitPaneElement_handleKeyDown
25943
26003
  };
25944
26004
  _M3eSplitPaneElement_changeValue = function _M3eSplitPaneElement_changeValue(value, emitChange = true, allowOvershoot = false) {
25945
26005
  __classPrivateFieldGet(this, _M3eSplitPaneElement_instances, "m", _M3eSplitPaneElement_clearSnapAnimation).call(this);
25946
- if (!allowOvershoot) {
25947
- value = Math.max(this.min, Math.min(this.max, value));
25948
- }
25949
- if (value != this.value) {
25950
- const prev = this.value;
25951
- this.value = value;
25952
- if (this.dispatchEvent(new Event("input", {
25953
- bubbles: true,
25954
- composed: true,
25955
- cancelable: true
25956
- }))) {
26006
+ if (this.dispatchEvent(new Event("beforeinput", {
26007
+ bubbles: true,
26008
+ cancelable: true
26009
+ }))) {
26010
+ if (!allowOvershoot) {
26011
+ value = Math.max(this.min, Math.min(this.max, value));
26012
+ }
26013
+ if (value != this.value) {
26014
+ this.value = value;
25957
26015
  this._base.style.setProperty("--_split-pane-value", `${this.value}%`);
26016
+ this.dispatchEvent(new Event("input", {
26017
+ bubbles: true
26018
+ }));
25958
26019
  if (emitChange) {
25959
26020
  this.dispatchEvent(new Event("change", {
25960
- bubbles: true,
25961
- composed: true
26021
+ bubbles: true
25962
26022
  }));
25963
26023
  }
25964
26024
  return true;
25965
- } else {
25966
- this.value = prev;
25967
26025
  }
25968
26026
  }
25969
26027
  return false;
@@ -26244,9 +26302,10 @@ var M3eStepElement_1;
26244
26302
  * @attr optional - Whether the step is optional.
26245
26303
  * @attr selected - Whether the element is selected.
26246
26304
  *
26247
- * @fires input - Emitted when the selected state changes.
26248
- * @fires change - Emitted when the selected state changes.
26249
- * @fires click - Emitted when the element is clicked.
26305
+ * @fires beforeinput - Dispatched before the selected state changes.
26306
+ * @fires input - Dispatched when the selected state changes.
26307
+ * @fires change - Dispatched when the selected state changes.
26308
+ * @fires click - Dispatched when the element is clicked.
26250
26309
  *
26251
26310
  * @cssprop --m3e-step-shape - Border radius of the step container, defining its visual shape.
26252
26311
  * @cssprop --m3e-step-padding - Internal padding of the step container, used for layout spacing.
@@ -26390,17 +26449,17 @@ _M3eStepElement_handleClick = function _M3eStepElement_handleClick(e) {
26390
26449
  e.stopImmediatePropagation();
26391
26450
  }
26392
26451
  if (e.defaultPrevented || this.selected) return;
26393
- this.selected = true;
26394
- if (this.dispatchEvent(new Event("input", {
26452
+ if (this.dispatchEvent(new Event("beforeinput", {
26395
26453
  bubbles: true,
26396
- composed: true,
26397
26454
  cancelable: true
26398
- })) && this.closest("m3e-stepper")?.moveTo(this.index)) {
26455
+ })) && this.closest("m3e-stepper")?._moveTo(this.index)) {
26456
+ this.selected = true;
26457
+ this.dispatchEvent(new Event("input", {
26458
+ bubbles: true
26459
+ }));
26399
26460
  this.dispatchEvent(new Event("change", {
26400
26461
  bubbles: true
26401
26462
  }));
26402
- } else {
26403
- this.selected = false;
26404
26463
  }
26405
26464
  };
26406
26465
  /** The styles of the element. */
@@ -26515,7 +26574,9 @@ var _M3eStepperElement_instances, _M3eStepperElement_breakpointUnobserve, _M3eSt
26515
26574
  * @slot step - Renders a step.
26516
26575
  * @slot panel - Renders a panel.
26517
26576
  *
26518
- * @fires change - Emitted when the selected step changes.
26577
+ * @fires beforeinput - Dispatched before the selected state of a step changes.
26578
+ * @fires input - Dispatched when the selected state of a step changes.
26579
+ * @fires change - Dispatched when the selected step changes.
26519
26580
  *
26520
26581
  * @cssprop --m3e-step-divider-thickness - Thickness of the divider line between steps.
26521
26582
  * @cssprop --m3e-step-divider-color - Color of the divider line between steps.
@@ -26584,6 +26645,16 @@ let M3eStepperElement = class M3eStepperElement extends ReconnectedCallback$1(At
26584
26645
  * @returns {boolean} Whether the stepper moved to the specified `index`.
26585
26646
  */
26586
26647
  moveTo(index) {
26648
+ if (this._moveTo(index)) {
26649
+ this.dispatchEvent(new Event("change", {
26650
+ bubbles: true
26651
+ }));
26652
+ return true;
26653
+ }
26654
+ return false;
26655
+ }
26656
+ /** @internal */
26657
+ _moveTo(index) {
26587
26658
  const selectedStep = this.selectedStep;
26588
26659
  if (selectedStep && selectedStep.index === index) {
26589
26660
  return true;
@@ -26613,16 +26684,10 @@ let M3eStepperElement = class M3eStepperElement extends ReconnectedCallback$1(At
26613
26684
  }
26614
26685
  this._selectedIndex = index;
26615
26686
  this[selectionManager].select(this.selectedStep);
26616
- this.dispatchEvent(new Event("change", {
26617
- bubbles: true
26618
- }));
26619
26687
  return true;
26620
26688
  } else {
26621
26689
  if (selectedStep) {
26622
26690
  this[selectionManager].deselect(selectedStep);
26623
- this.dispatchEvent(new Event("change", {
26624
- bubbles: true
26625
- }));
26626
26691
  }
26627
26692
  return false;
26628
26693
  }
@@ -26696,7 +26761,9 @@ _M3eStepperElement_renderHeader = function _M3eStepperElement_renderHeader() {
26696
26761
  };
26697
26762
  _M3eStepperElement_handleChange = function _M3eStepperElement_handleChange(e) {
26698
26763
  e.stopPropagation();
26699
- // Note: change event emitted from moveTo.
26764
+ this.dispatchEvent(new Event("change", {
26765
+ bubbles: true
26766
+ }));
26700
26767
  };
26701
26768
  _M3eStepperElement_handleSlotChange = function _M3eStepperElement_handleSlotChange() {
26702
26769
  const {
@@ -26990,9 +27057,10 @@ var _M3eSwitchElement_instances, _M3eSwitchElement_clickHandler, _M3eSwitchEleme
26990
27057
  * @attr name - The name that identifies the element when submitting the associated form.
26991
27058
  * @attr value - A string representing the value of the switch.
26992
27059
  *
26993
- * @fires input - Emitted when the checked state changes.
26994
- * @fires change - Emitted when the checked state changes.
26995
- * @fires click - Emitted when the element is clicked.
27060
+ * @fires beforeinput - Dispatched before the checked state changes.
27061
+ * @fires input - Dispatched when the checked state changes.
27062
+ * @fires change - Dispatched when the checked state changes.
27063
+ * @fires click - Dispatched when the element is clicked.
26996
27064
  *
26997
27065
  * @cssprop --m3e-switch-selected-icon-color - Color of the icon when the switch is selected.
26998
27066
  * @cssprop --m3e-switch-selected-icon-size - Size of the icon in the selected state.
@@ -27139,17 +27207,17 @@ _M3eSwitchElement_renderIcon = function _M3eSwitchElement_renderIcon() {
27139
27207
  };
27140
27208
  _M3eSwitchElement_handleClick = function _M3eSwitchElement_handleClick(e) {
27141
27209
  if (e.defaultPrevented) return;
27142
- this.checked = !this.checked;
27143
- if (this.dispatchEvent(new Event("input", {
27210
+ if (this.dispatchEvent(new Event("beforeinput", {
27144
27211
  bubbles: true,
27145
- composed: true,
27146
27212
  cancelable: true
27147
27213
  }))) {
27214
+ this.checked = !this.checked;
27215
+ this.dispatchEvent(new Event("input", {
27216
+ bubbles: true
27217
+ }));
27148
27218
  this.dispatchEvent(new Event("change", {
27149
27219
  bubbles: true
27150
27220
  }));
27151
- } else {
27152
- this.checked = !this.checked;
27153
27221
  }
27154
27222
  // Prevent default avoids double-click in FireFox.
27155
27223
  if (this.closest("label")) {
@@ -27201,9 +27269,10 @@ var M3eTabElement_1;
27201
27269
  * @attr for - The identifier of the interactive control to which this element is attached.
27202
27270
  * @attr selected - Whether the element is selected.
27203
27271
  *
27204
- * @fires input - Emitted when the selected state changes.
27205
- * @fires change - Emitted when the selected state changes.
27206
- * @fires click - Emitted when the element is clicked.
27272
+ * @fires beforeinput - Dispatched before the selected state changes.
27273
+ * @fires input - Dispatched when the selected state changes.
27274
+ * @fires change - Dispatched when the selected state changes.
27275
+ * @fires click - Dispatched when the element is clicked.
27207
27276
  *
27208
27277
  * @cssprop --m3e-tab-font-size - Font size for tab label.
27209
27278
  * @cssprop --m3e-tab-font-weight - Font weight for tab label.
@@ -27280,18 +27349,18 @@ _M3eTabElement_handleClick = function _M3eTabElement_handleClick(e) {
27280
27349
  e.stopImmediatePropagation();
27281
27350
  }
27282
27351
  if (e.defaultPrevented || this.selected) return;
27283
- this.selected = true;
27284
- if (this.dispatchEvent(new Event("input", {
27352
+ if (this.dispatchEvent(new Event("beforeinput", {
27285
27353
  bubbles: true,
27286
- composed: true,
27287
27354
  cancelable: true
27288
27355
  }))) {
27356
+ this.selected = true;
27289
27357
  this.closest("m3e-tabs")?.[selectionManager].notifySelectionChange(this);
27358
+ this.dispatchEvent(new Event("input", {
27359
+ bubbles: true
27360
+ }));
27290
27361
  this.dispatchEvent(new Event("change", {
27291
27362
  bubbles: true
27292
27363
  }));
27293
- } else {
27294
- this.selected = false;
27295
27364
  }
27296
27365
  };
27297
27366
  /** The styles of the element. */
@@ -27347,7 +27416,7 @@ let M3eTabPanelElement = class M3eTabPanelElement extends Role$1(LitElement, "ta
27347
27416
  M3eTabPanelElement.styles = css`:host { display: block; overflow-y: auto; scrollbar-width: ${DesignToken$1.scrollbar.width}; scrollbar-color: ${DesignToken$1.scrollbar.color}; }`;
27348
27417
  M3eTabPanelElement = __decorate([customElement$1("m3e-tab-panel")], M3eTabPanelElement);
27349
27418
 
27350
- var _M3eTabsElement_instances, _M3eTabsElement_directionalitySubscription, _M3eTabsElement_renderHeader, _M3eTabsElement_handleSlotChange, _M3eTabsElement_handleKeyDown, _M3eTabsElement_handleChange, _M3eTabsElement_handleSelectedChange, _M3eTabsElement_updateInkBar, _a$2;
27419
+ var _M3eTabsElement_instances, _M3eTabsElement_directionalitySubscription, _M3eTabsElement_swipe, _M3eTabsElement_velocityTracker, _M3eTabsElement_renderHeader, _M3eTabsElement_handleSlotChange, _M3eTabsElement_handleKeyDown, _M3eTabsElement_handleChange, _M3eTabsElement_handleSelectedChange, _M3eTabsElement_handleActiveItemChange, _M3eTabsElement_handleTabsPaginationChange, _M3eTabsElement_handleTabsPointerDown, _M3eTabsElement_handleTabsPointerMove, _M3eTabsElement_handleTabsPointerUp, _M3eTabsElement_handleTabsPointerCancel, _M3eTabsElement_handleTabsLostPointerCapture, _M3eTabsElement_endSwipeGesture, _M3eTabsElement_scrollTabIntoView, _M3eTabsElement_updateInkBar, _a$2;
27351
27420
  const MIN_PRIMARY_TAB_WIDTH = 24;
27352
27421
  /**
27353
27422
  * Organizes content into separate views where only one view can be visible at a time.
@@ -27389,7 +27458,9 @@ const MIN_PRIMARY_TAB_WIDTH = 24;
27389
27458
  * @attr stretch - Whether tabs are stretched to fill the header.
27390
27459
  * @attr variant - The appearance variant of the tabs.
27391
27460
  *
27392
- * @fires change - Emitted when the selected tab changes.
27461
+ * @fires beforeinput - Dispatched before the selected state of a tab changes.
27462
+ * @fires input - Dispatched when the selected state of a tab changes.
27463
+ * @fires change - Dispatched when the selected tab changes.
27393
27464
  *
27394
27465
  * @cssprop --m3e-tabs-paginator-button-icon-size - Overrides the icon size for paginator buttons.
27395
27466
  * @cssprop --m3e-tabs-active-indicator-color - Color of the active tab indicator.
@@ -27407,13 +27478,12 @@ let M3eTabsElement = class M3eTabsElement extends AttachInternals$1(LitElement)
27407
27478
  _M3eTabsElement_directionalitySubscription.set(this, void 0);
27408
27479
  /** @private */
27409
27480
  this._selectedIndex = null;
27481
+ /** @private */
27482
+ _M3eTabsElement_swipe.set(this, void 0);
27483
+ /** @private */
27484
+ _M3eTabsElement_velocityTracker.set(this, new VelocityTracker$1());
27410
27485
  /** @internal */
27411
- this[_a$2] = new SelectionManager().onSelectedItemsChange(() => __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleSelectedChange).call(this)).withHomeAndEnd().withWrap().withDirectionality(M3eDirectionality.current);
27412
- /**
27413
- * Whether scroll buttons are disabled.
27414
- * @default false
27415
- */
27416
- this.disablePagination = false;
27486
+ this[_a$2] = new SelectionManager().onSelectedItemsChange(() => __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleSelectedChange).call(this)).onActiveItemChange(() => __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleActiveItemChange).call(this)).withHomeAndEnd().withWrap().withDirectionality(M3eDirectionality.current);
27417
27487
  /**
27418
27488
  * The position of the tab headers.
27419
27489
  * @default "before"
@@ -27443,10 +27513,43 @@ let M3eTabsElement = class M3eTabsElement extends AttachInternals$1(LitElement)
27443
27513
  skipInitial: true,
27444
27514
  callback: () => {
27445
27515
  addCustomState$1(this, "--no-animate");
27446
- __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_updateInkBar).call(this);
27516
+ const activeTab = this[selectionManager].activeItem ?? this.selectedTab;
27517
+ if (activeTab) {
27518
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_scrollTabIntoView).call(this, activeTab, true);
27519
+ } else {
27520
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_updateInkBar).call(this);
27521
+ }
27447
27522
  }
27448
27523
  });
27449
27524
  }
27525
+ /**
27526
+ * Whether scroll buttons are disabled.
27527
+ * @default false
27528
+ */
27529
+ get disablePagination() {
27530
+ switch (this.getAttribute("disable-pagination")) {
27531
+ case "auto":
27532
+ return "auto";
27533
+ case "":
27534
+ case "true":
27535
+ return true;
27536
+ default:
27537
+ return false;
27538
+ }
27539
+ }
27540
+ set disablePagination(value) {
27541
+ switch (value) {
27542
+ case false:
27543
+ this.removeAttribute("disable-pagination");
27544
+ break;
27545
+ case true:
27546
+ this.toggleAttribute("disable-pagination", true);
27547
+ break;
27548
+ case "auto":
27549
+ this.setAttribute("disable-pagination", "auto");
27550
+ break;
27551
+ }
27552
+ }
27450
27553
  /** The tabs. */
27451
27554
  get tabs() {
27452
27555
  return this[selectionManager]?.items ?? [];
@@ -27499,14 +27602,16 @@ let M3eTabsElement = class M3eTabsElement extends AttachInternals$1(LitElement)
27499
27602
  panelIndex = undefined;
27500
27603
  }
27501
27604
  }
27502
- return html`${this.headerPosition === "before" ? __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_renderHeader).call(this) : nothing}<m3e-slide class="tabs" selected-index="${ifDefined(panelIndex)}"><slot name="panel"></slot></m3e-slide>${this.headerPosition === "after" ? __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_renderHeader).call(this) : nothing}`;
27605
+ return html`${this.headerPosition === "before" ? __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_renderHeader).call(this) : nothing}<m3e-slide class="tabs" selected-index="${ifDefined(panelIndex)}" @pointerdown="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsPointerDown)}" @pointermove="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsPointerMove)}" @pointerup="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsPointerUp)}" @pointercancel="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsPointerCancel)}" @lostpointercapture="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsLostPointerCapture)}"><slot name="panel"></slot></m3e-slide>${this.headerPosition === "after" ? __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_renderHeader).call(this) : nothing}`;
27503
27606
  }
27504
27607
  };
27505
27608
  _M3eTabsElement_directionalitySubscription = new WeakMap();
27609
+ _M3eTabsElement_swipe = new WeakMap();
27610
+ _M3eTabsElement_velocityTracker = new WeakMap();
27506
27611
  _M3eTabsElement_instances = new WeakSet();
27507
27612
  _a$2 = selectionManager;
27508
27613
  _M3eTabsElement_renderHeader = function _M3eTabsElement_renderHeader() {
27509
- return html`<m3e-slide-group class="tablist" threshold="8" previous-page-label="${this.previousPageLabel}" next-page-label="${this.nextPageLabel}" ?disabled="${this.disablePagination}"><slot name="prev-icon" slot="prev-icon">${M3eDirectionality.current === "ltr" ? html`<svg class="prev icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z"/></svg>` : html`<svg class="next icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z"/></svg>`}</slot><slot name="next-icon" slot="next-icon">${M3eDirectionality.current === "ltr" ? html`<svg class="next icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z"/></svg>` : html`<svg class="prev icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z"/></svg>`}</slot><div class="header" role="tablist"><div class="tabs"><slot @slotchange="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleSlotChange)}" @keydown="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleKeyDown)}" @change="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleChange)}"></slot></div><div class="ink-bar" aria-hidden="true"><div class="active-indicator"></div></div></div></m3e-slide-group>`;
27614
+ return html`<m3e-slide-group class="tablist" threshold="8" previous-page-label="${this.previousPageLabel}" next-page-label="${this.nextPageLabel}" ?disabled="${this.disablePagination === "auto" ? matchMedia("(hover: none) and (pointer: coarse)").matches : this.disablePagination}" @pagination-changed="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleTabsPaginationChange)}"><slot name="prev-icon" slot="prev-icon">${M3eDirectionality.current === "ltr" ? html`<svg class="prev icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z"/></svg>` : html`<svg class="next icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z"/></svg>`}</slot><slot name="next-icon" slot="next-icon">${M3eDirectionality.current === "ltr" ? html`<svg class="next icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z"/></svg>` : html`<svg class="prev icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z"/></svg>`}</slot><div class="header" role="tablist"><div class="tabs"><slot @slotchange="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleSlotChange)}" @keydown="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleKeyDown)}" @change="${__classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_handleChange)}"></slot></div><div class="ink-bar" aria-hidden="true"><div class="active-indicator"></div></div></div></m3e-slide-group>`;
27510
27615
  };
27511
27616
  _M3eTabsElement_handleSlotChange = function _M3eTabsElement_handleSlotChange() {
27512
27617
  this[selectionManager].setItems([...this.querySelectorAll("m3e-tab")]);
@@ -27527,6 +27632,142 @@ _M3eTabsElement_handleSelectedChange = function _M3eTabsElement_handleSelectedCh
27527
27632
  selectedIndex = null;
27528
27633
  }
27529
27634
  this._selectedIndex = selectedIndex;
27635
+ if (selected) {
27636
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_scrollTabIntoView).call(this, selected, hasCustomState$1(this, "--no-animate"));
27637
+ } else {
27638
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_updateInkBar).call(this);
27639
+ }
27640
+ };
27641
+ _M3eTabsElement_handleActiveItemChange = function _M3eTabsElement_handleActiveItemChange() {
27642
+ if (this[selectionManager].activeItem) {
27643
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_scrollTabIntoView).call(this, this[selectionManager].activeItem, hasCustomState$1(this, "--no-animate"));
27644
+ }
27645
+ };
27646
+ _M3eTabsElement_handleTabsPaginationChange = function _M3eTabsElement_handleTabsPaginationChange() {
27647
+ if (this.disablePagination) return;
27648
+ const activeTab = this[selectionManager].activeItem ?? this.selectedTab;
27649
+ if (activeTab) {
27650
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_scrollTabIntoView).call(this, activeTab, true);
27651
+ }
27652
+ };
27653
+ _M3eTabsElement_handleTabsPointerDown = function _M3eTabsElement_handleTabsPointerDown(e) {
27654
+ if (e.pointerType !== "touch") {
27655
+ return; // swipe only supported for touch
27656
+ }
27657
+ e.currentTarget.setPointerCapture(e.pointerId);
27658
+ __classPrivateFieldSet(this, _M3eTabsElement_swipe, {
27659
+ x: e.clientX,
27660
+ y: e.clientY
27661
+ }, "f");
27662
+ __classPrivateFieldGet(this, _M3eTabsElement_velocityTracker, "f").reset();
27663
+ __classPrivateFieldGet(this, _M3eTabsElement_velocityTracker, "f").add(e.clientX);
27664
+ };
27665
+ _M3eTabsElement_handleTabsPointerMove = function _M3eTabsElement_handleTabsPointerMove(e) {
27666
+ if (!__classPrivateFieldGet(this, _M3eTabsElement_swipe, "f") || !e.currentTarget.hasPointerCapture(e.pointerId)) {
27667
+ return;
27668
+ }
27669
+ let dx = e.clientX - __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").x;
27670
+ const dy = e.clientY - __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").y;
27671
+ if (this.selectedIndex === 0 && dx > 0) {
27672
+ dx = 0;
27673
+ }
27674
+ if (this.selectedIndex === this.tabs.length - 1 && dx < 0) {
27675
+ dx = 0;
27676
+ }
27677
+ if (!__classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").dir) {
27678
+ if (Math.abs(dx) > 10) {
27679
+ __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").dir = "horizontal";
27680
+ } else if (Math.abs(dy) > 10) {
27681
+ __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").dir = "vertical";
27682
+ } else {
27683
+ return;
27684
+ }
27685
+ }
27686
+ if (__classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").dir === "vertical") {
27687
+ return;
27688
+ }
27689
+ __classPrivateFieldGet(this, _M3eTabsElement_velocityTracker, "f").add(e.clientX);
27690
+ __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").currentX = dx;
27691
+ this.shadowRoot?.querySelector("m3e-slide")?.classList.add("sliding");
27692
+ this.selectedTab?.control?.style.setProperty("--_tabs-slide-offset-x", `${dx}px`);
27693
+ const nextTab = this.tabs[dx > 0 ? this.selectedIndex - 1 : this.selectedIndex + 1];
27694
+ nextTab?.control?.style.setProperty("--_tabs-slide-offset-x", `${dx}px`);
27695
+ nextTab?.control?.style.setProperty("--_tabs-slide-visibility", "visible");
27696
+ const prevTab = this.tabs[dx > 0 ? this.selectedIndex + 1 : this.selectedIndex - 1];
27697
+ prevTab?.control?.style.removeProperty("--_tabs-slide-offset-x");
27698
+ prevTab?.control?.style.removeProperty("--_tabs-slide-visibility");
27699
+ };
27700
+ _M3eTabsElement_handleTabsPointerUp = function _M3eTabsElement_handleTabsPointerUp(e) {
27701
+ if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
27702
+ return;
27703
+ }
27704
+ e.currentTarget.releasePointerCapture(e.pointerId);
27705
+ if (__classPrivateFieldGet(this, _M3eTabsElement_swipe, "f") && __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").dir === "horizontal" && __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").currentX !== undefined) {
27706
+ const dx = __classPrivateFieldGet(this, _M3eTabsElement_swipe, "f").currentX;
27707
+ const threshold = this.clientWidth * 0.33;
27708
+ const velocity = __classPrivateFieldGet(this, _M3eTabsElement_velocityTracker, "f").getVelocity();
27709
+ const significantVelocityThreshold = e.pointerType === "touch" ? 1200 : 500;
27710
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_endSwipeGesture).call(this);
27711
+ if (Math.abs(dx) > threshold || Math.abs(velocity) > significantVelocityThreshold) {
27712
+ if (dx > threshold) {
27713
+ // go to the previous tab only if its not disabled.
27714
+ if (this.selectedIndex > 0 && this.tabs.length > 1 && !this.tabs[this.selectedIndex - 1].disabled) {
27715
+ this.selectedIndex--;
27716
+ }
27717
+ } else if (dx < -threshold) {
27718
+ // go to the next tab only if its not disabled.
27719
+ if (this.selectedIndex < this.tabs.length - 1 && !this.tabs[this.selectedIndex + 1].disabled) {
27720
+ this.selectedIndex++;
27721
+ }
27722
+ }
27723
+ }
27724
+ } else {
27725
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_endSwipeGesture).call(this);
27726
+ }
27727
+ };
27728
+ _M3eTabsElement_handleTabsPointerCancel = function _M3eTabsElement_handleTabsPointerCancel(e) {
27729
+ if (e.currentTarget.hasPointerCapture(e.pointerId)) {
27730
+ e.currentTarget.releasePointerCapture(e.pointerId);
27731
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_endSwipeGesture).call(this);
27732
+ }
27733
+ };
27734
+ _M3eTabsElement_handleTabsLostPointerCapture = function _M3eTabsElement_handleTabsLostPointerCapture() {
27735
+ __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_endSwipeGesture).call(this);
27736
+ };
27737
+ _M3eTabsElement_endSwipeGesture = function _M3eTabsElement_endSwipeGesture() {
27738
+ __classPrivateFieldSet(this, _M3eTabsElement_swipe, undefined, "f");
27739
+ __classPrivateFieldGet(this, _M3eTabsElement_velocityTracker, "f").reset();
27740
+ const slide = this.shadowRoot?.querySelector("m3e-slide");
27741
+ if (!slide || !slide.classList.contains("sliding")) {
27742
+ return;
27743
+ }
27744
+ slide.classList.add("snap");
27745
+ if (!prefersReducedMotion$1()) {
27746
+ slide.addEventListener("transitionend", () => slide.classList.remove("snap"), {
27747
+ once: true
27748
+ });
27749
+ }
27750
+ slide.classList.remove("sliding");
27751
+ this.tabs.forEach(x => {
27752
+ x.control?.style.removeProperty("--_tabs-slide-offset-x");
27753
+ x.control?.style.removeProperty("--_tabs-slide-visibility");
27754
+ });
27755
+ };
27756
+ _M3eTabsElement_scrollTabIntoView = /** @private */
27757
+ async function _M3eTabsElement_scrollTabIntoView(tab, instant) {
27758
+ await this.updateComplete;
27759
+ for (const tab of this.tabs) {
27760
+ await tab.updateComplete;
27761
+ }
27762
+ await this._tablist?.updateComplete;
27763
+ const scrollMargin = 48;
27764
+ const scrollContainer = this._tablist?.scrollContainer;
27765
+ if (!scrollContainer) return;
27766
+ scrollContainer?.scrollTo({
27767
+ behavior: instant ? "instant" : "smooth",
27768
+ top: 0,
27769
+ left: Math.min(tab.offsetLeft - scrollContainer.offsetLeft - scrollMargin, Math.max(tab.offsetLeft + tab.offsetWidth - scrollContainer.offsetWidth - scrollContainer.offsetLeft + scrollMargin, scrollContainer.scrollLeft))
27770
+ });
27530
27771
  __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_updateInkBar).call(this);
27531
27772
  };
27532
27773
  _M3eTabsElement_updateInkBar = function _M3eTabsElement_updateInkBar() {
@@ -27556,13 +27797,14 @@ _M3eTabsElement_updateInkBar = function _M3eTabsElement_updateInkBar() {
27556
27797
  };
27557
27798
  /** The styles of the element. */
27558
27799
  M3eTabsElement.styles = css`:host { display: flex; flex-direction: column; position: relative; } .tablist { position: relative; box-sizing: border-box; flex: none; } ::slotted(prev-icon), ::slotted(next-icon), .icon { width: 1em; font-size: var(--m3e-tabs-paginator-button-icon-size, var(--m3e-icon-button-icon-size, 1.5rem)) !important; } .header { display: flex; flex-direction: column; } .tabs { display: flex; flex-wrap: nowrap; align-items: center; } .ink-bar { box-sizing: border-box; height: var(--_tabs-active-indicator-thickness); } .active-indicator { position: relative; height: var(--_tabs-active-indicator-thickness); left: calc(var(--_tabs-active-tab-position) + var(--_tabs-activate-indicator-inset, 0px)); width: calc(var(--_tabs-active-tab-size) - calc(var(--_tabs-activate-indicator-inset, 0px) * 2)); background-color: var(--m3e-tabs-active-indicator-color, ${DesignToken$1.color.primary}); transition: ${unsafeCSS(`left var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard},
27559
- width var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard}`)}; } :host([header-position="after"]) .header { flex-direction: column-reverse; } :host([header-position="before"]) .ink-bar { margin-top: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="before"]) .tablist { --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken$1.color.outlineVariant}); } :host([header-position="after"]) .ink-bar { margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="after"]) .tablist { --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken$1.color.outlineVariant}); } :host([header-position="before"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken$1.shape.corner.extraSmallTop}); } :host([header-position="after"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken$1.shape.corner.extraSmallBottom}); } .tabs { flex: 1 1 auto; } :host([variant="primary"]) .tablist { --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem); --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px); --_tab-height: 4rem; } :host([header-position="before"]) .tablist { --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px); } :host([header-position="after"]) .tablist { --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px); } :host([header-position="before"][variant="primary"]) .tablist { --_tab-direction: column; } :host([header-position="after"][variant="primary"]) .tablist { --_tab-direction: column-reverse; } :host([variant="secondary"]) .tablist { --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px); --_tab-height: 3rem; --_tab-selected-color: ${DesignToken$1.color.onSurface}; --_tab-selected-container-hover-color: ${DesignToken$1.color.onSurface}; --_tab-selected-container-focus-color: ${DesignToken$1.color.onSurface}; --_tab-selected-ripple-color: ${DesignToken$1.color.onSurface}; } :host([stretch]) .header { width: 100%; --_tab-grow: 1; } :host(:is(:state(--no-animate), :--no-animate)) .active-indicator { transition: none; } @media (prefers-reduced-motion) { .active-indicator { transition: none; } } @media (forced-colors: active) { .active-indicator { background-color: ButtonText; --m3e-divider-color: GrayText; } }`;
27800
+ width var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard}`)}; } :host([header-position="after"]) .header { flex-direction: column-reverse; } :host([header-position="before"]) .ink-bar { margin-top: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="before"]) .tablist { --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken$1.color.outlineVariant}); } :host([header-position="after"]) .ink-bar { margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="after"]) .tablist { --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken$1.color.outlineVariant}); } :host([header-position="before"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken$1.shape.corner.extraSmallTop}); } :host([header-position="after"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken$1.shape.corner.extraSmallBottom}); } .tabs { flex: 1 1 auto; } :host([variant="primary"]) .tablist { --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem); --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px); --_tab-height: 4rem; } :host([header-position="before"]) .tablist { --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px); } :host([header-position="after"]) .tablist { --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px); } :host([header-position="before"][variant="primary"]) .tablist { --_tab-direction: column; } :host([header-position="after"][variant="primary"]) .tablist { --_tab-direction: column-reverse; } :host([variant="secondary"]) .tablist { --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px); --_tab-height: 3rem; --_tab-selected-color: ${DesignToken$1.color.onSurface}; --_tab-selected-container-hover-color: ${DesignToken$1.color.onSurface}; --_tab-selected-container-focus-color: ${DesignToken$1.color.onSurface}; --_tab-selected-ripple-color: ${DesignToken$1.color.onSurface}; } :host([stretch]) .header { width: 100%; --_tab-grow: 1; } .tabs.sliding ::slotted([slot="panel"]) { transform: translateX(var(--_tabs-slide-offset-x)); visibility: var(--_tabs-slide-visibility, "hidden"); } .tabs.snap ::slotted([slot="panel"]) { transition: ${unsafeCSS(`inset-inline-start var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard},
27801
+ transform var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard},
27802
+ visibility var(--m3e-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } .tabs:not(.sliding) ::slotted([slot="panel"]) { transform: translateX(0); } :host(:is(:state(--no-animate), :--no-animate)) .active-indicator { transition: none; } @media (prefers-reduced-motion) { .active-indicator { transition: none; } .tabs.snap ::slotted([slot="panel"]) { transition: none; } } @media (forced-colors: active) { .active-indicator { background-color: ButtonText; --m3e-divider-color: GrayText; } }`;
27560
27803
  __decorate([query(".tablist")], M3eTabsElement.prototype, "_tablist", void 0);
27561
27804
  __decorate([state()], M3eTabsElement.prototype, "_selectedIndex", void 0);
27562
27805
  __decorate([property({
27563
- attribute: "disable-pagination",
27564
- type: Boolean
27565
- })], M3eTabsElement.prototype, "disablePagination", void 0);
27806
+ attribute: false
27807
+ })], M3eTabsElement.prototype, "disablePagination", null);
27566
27808
  __decorate([property({
27567
27809
  attribute: "header-position",
27568
27810
  reflect: true
@@ -32015,8 +32257,20 @@ let M3eThemeElement = class M3eThemeElement extends LitElement {
32015
32257
  /** @inheritdoc */
32016
32258
  connectedCallback() {
32017
32259
  super.connectedCallback();
32018
- if (this.shadowRoot && !this.shadowRoot.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32019
- this.shadowRoot.adoptedStyleSheets = [...this.shadowRoot.adoptedStyleSheets, __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f")];
32260
+ if (this.parentElement instanceof HTMLBodyElement) {
32261
+ if (this.shadowRoot?.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32262
+ this.shadowRoot.adoptedStyleSheets = this.shadowRoot.adoptedStyleSheets.filter(x => x !== __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"));
32263
+ }
32264
+ if (!document.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32265
+ document.adoptedStyleSheets = [__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"), ...document.adoptedStyleSheets];
32266
+ }
32267
+ } else {
32268
+ if (document.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32269
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter(x => x !== __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"));
32270
+ }
32271
+ if (this.shadowRoot && !this.shadowRoot.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32272
+ this.shadowRoot.adoptedStyleSheets = [__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"), ...this.shadowRoot.adoptedStyleSheets];
32273
+ }
32020
32274
  }
32021
32275
  __classPrivateFieldSet(this, _M3eThemeElement_light, matchMedia("(prefers-color-scheme: light)"), "f");
32022
32276
  __classPrivateFieldSet(this, _M3eThemeElement_dark, matchMedia("(prefers-color-scheme: dark)"), "f");
@@ -32028,6 +32282,9 @@ let M3eThemeElement = class M3eThemeElement extends LitElement {
32028
32282
  super.disconnectedCallback();
32029
32283
  [__classPrivateFieldGet(this, _M3eThemeElement_light, "f"), __classPrivateFieldGet(this, _M3eThemeElement_dark, "f"), __classPrivateFieldGet(this, _M3eThemeElement_forcedColor, "f")].forEach(x => x?.removeEventListener("change", __classPrivateFieldGet(this, _M3eThemeElement_colorSchemeChangeHandler, "f")));
32030
32284
  __classPrivateFieldSet(this, _M3eThemeElement_light, __classPrivateFieldSet(this, _M3eThemeElement_dark, __classPrivateFieldSet(this, _M3eThemeElement_forcedColor, undefined, "f"), "f"), "f");
32285
+ if (document.adoptedStyleSheets.includes(__classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"))) {
32286
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter(x => x !== __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f"));
32287
+ }
32031
32288
  }
32032
32289
  /** @inheritdoc */
32033
32290
  updated(_changedProperties) {
@@ -32085,9 +32342,20 @@ _M3eThemeElement_apply = function _M3eThemeElement_apply(forceReflow) {
32085
32342
  css += `--md-sys-density-scale: ${this.density};`;
32086
32343
  css += `--m3e-scrollbar-thumb-color: ${hexFromArgb(scheme.neutralPalette.tone(60))};`;
32087
32344
  css += `--m3e-focus-ring-visibility: ${this.strongFocus ? "visible" : "hidden"};`;
32088
- __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f").replaceSync(`:host { ${css} }`);
32345
+ css += `font-size: ${DesignToken$1.typescale.standard.body.large.fontSize};`;
32346
+ css += `font-weight: ${DesignToken$1.typescale.standard.body.large.fontWeight};`;
32347
+ css += `line-height: ${DesignToken$1.typescale.standard.body.large.lineHeight};`;
32348
+ css += `letter-spacing: ${DesignToken$1.typescale.standard.body.large.tracking};`;
32089
32349
  if (this.parentElement instanceof HTMLBodyElement) {
32090
- const computedStyle = getComputedStyle(this);
32350
+ __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f").replaceSync(`
32351
+ html { ${css} }
32352
+ @media not (forced-colors: active) {
32353
+ body {
32354
+ background-color: var(--md-sys-color-background);
32355
+ color: var(--md-sys-color-on-background);
32356
+ scrollbar-color: ${DesignToken$1.scrollbar.color};
32357
+ }
32358
+ }`);
32091
32359
  switch (this.scheme) {
32092
32360
  case "light":
32093
32361
  document.documentElement.style.colorScheme = "light";
@@ -32103,13 +32371,8 @@ _M3eThemeElement_apply = function _M3eThemeElement_apply(forceReflow) {
32103
32371
  break;
32104
32372
  }
32105
32373
  }
32106
- if (__classPrivateFieldGet(this, _M3eThemeElement_forcedColor, "f")?.matches) {
32107
- this.parentElement.style.backgroundColor = this.parentElement.style.color = this.parentElement.ownerDocument.documentElement.style.scrollbarColor = this.parentElement.style.scrollbarColor = "";
32108
- } else {
32109
- this.parentElement.style.backgroundColor = computedStyle.getPropertyValue("--md-sys-color-background");
32110
- this.parentElement.style.color = computedStyle.getPropertyValue("--md-sys-color-on-background");
32111
- this.parentElement.ownerDocument.documentElement.style.scrollbarColor = this.parentElement.style.scrollbarColor = `${computedStyle.getPropertyValue("--m3e-scrollbar-thumb-color")} ${computedStyle.getPropertyValue("--m3e-scrollbar-track-color")}`;
32112
- }
32374
+ } else {
32375
+ __classPrivateFieldGet(this, _M3eThemeElement_styleSheet, "f").replaceSync(`:host { ${css} }`);
32113
32376
  }
32114
32377
  if (__classPrivateFieldGet(this, _M3eThemeElement_firstUpdated, "f")) {
32115
32378
  this.dispatchEvent(new Event("change", {
@@ -32132,7 +32395,7 @@ _M3eThemeElement_getContrastLevel = function _M3eThemeElement_getContrastLevel()
32132
32395
  }
32133
32396
  };
32134
32397
  /** The styles of the element. */
32135
- M3eThemeElement.styles = css`:host { display: contents; font-size: ${DesignToken$1.typescale.standard.body.large.fontSize}; font-weight: ${DesignToken$1.typescale.standard.body.large.fontWeight}; line-height: ${DesignToken$1.typescale.standard.body.large.lineHeight}; letter-spacing: ${DesignToken$1.typescale.standard.body.large.tracking}; }`;
32398
+ M3eThemeElement.styles = css`:host { display: contents; }`;
32136
32399
  __decorate([property()], M3eThemeElement.prototype, "color", void 0);
32137
32400
  __decorate([property()], M3eThemeElement.prototype, "scheme", void 0);
32138
32401
  __decorate([property()], M3eThemeElement.prototype, "contrast", void 0);
@@ -32154,7 +32417,7 @@ M3eThemeElement = __decorate([customElement$1("m3e-theme")], M3eThemeElement);
32154
32417
  *
32155
32418
  * @attr disabled - A value indicating whether the element is disabled.
32156
32419
  *
32157
- * @fires click - Emitted when the element is clicked.
32420
+ * @fires click - Dispatched when the element is clicked.
32158
32421
  *
32159
32422
  * @cssprop --m3e-toc-item-shape - Border radius of the TOC item.
32160
32423
  * @cssprop --m3e-toc-item-padding-block - Block padding for the TOC item.
@@ -33267,11 +33530,11 @@ var M3eTreeItemElement_1;
33267
33530
  * @attr open - Whether the item is expanded.
33268
33531
  * @attr selected - Whether the item is selected.
33269
33532
  *
33270
- * @fires opening - Emitted when the item begins to open.
33271
- * @fires opened - Emitted when the item has opened.
33272
- * @fires closing - Emitted when the item begins to close.
33273
- * @fires closed - Emitted when the item has closed.
33274
- * @fires click - Emitted when the element is clicked.
33533
+ * @fires opening - Dispatched when the item begins to open.
33534
+ * @fires opened - Dispatched when the item has opened.
33535
+ * @fires closing - Dispatched when the item begins to close.
33536
+ * @fires closed - Dispatched when the item has closed.
33537
+ * @fires click - Dispatched when the element is clicked.
33275
33538
  *
33276
33539
  * @cssprop --m3e-tree-item-font-size - Font size for the item label.
33277
33540
  * @cssprop --m3e-tree-item-font-weight - Font weight for the item label.
@@ -33632,7 +33895,7 @@ var M3eTreeElement_1;
33632
33895
  * @attr multi - Whether multiple items can be selected.
33633
33896
  * @attr cascade -Whether multiple item selection cascades to child items.
33634
33897
  *
33635
- * @fires change - Emitted when the selected state changes.
33898
+ * @fires change - Dispatched when the selected state changes.
33636
33899
  *
33637
33900
  * @cssprop --m3e-tree-scrollbar-width - Width of the tree scrollbar.
33638
33901
  * @cssprop --m3e-tree-scrollbar-color - Color of the tree scrollbar.