@material/web 1.0.0-pre.6 → 1.0.0-pre.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.
- package/README.md +7 -7
- package/aria/aria.d.ts +43 -0
- package/aria/aria.js +56 -0
- package/aria/aria.js.map +1 -0
- package/aria/delegate.d.ts +37 -0
- package/aria/delegate.js +53 -0
- package/aria/delegate.js.map +1 -0
- package/badge/badge.d.ts +0 -1
- package/badge/badge.js +0 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/badge.d.ts +8 -7
- package/badge/lib/badge.js +5 -6
- package/badge/lib/badge.js.map +1 -1
- package/button/lib/_elevation.scss +13 -3
- package/button/lib/button.d.ts +1 -12
- package/button/lib/button.js +29 -60
- package/button/lib/button.js.map +1 -1
- package/button/lib/shared-elevation-styles.css.js +1 -1
- package/button/lib/shared-elevation-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox.d.ts +0 -1
- package/checkbox/lib/checkbox.js +33 -43
- package/checkbox/lib/checkbox.js.map +1 -1
- package/chips/_filter-chip.scss +6 -0
- package/chips/filter-chip.d.ts +20 -0
- package/chips/filter-chip.js +24 -0
- package/chips/filter-chip.js.map +1 -0
- package/chips/lib/_filter-chip.scss +141 -0
- package/chips/lib/_shared.scss +18 -14
- package/chips/lib/assist-styles.css.js +1 -1
- package/chips/lib/assist-styles.css.js.map +1 -1
- package/chips/lib/chip.d.ts +8 -3
- package/chips/lib/chip.js +29 -30
- package/chips/lib/chip.js.map +1 -1
- package/chips/lib/filter-chip.d.ts +21 -0
- package/chips/lib/filter-chip.js +47 -0
- package/chips/lib/filter-chip.js.map +1 -0
- package/chips/lib/filter-styles.css.js +9 -0
- package/chips/lib/filter-styles.css.js.map +1 -0
- package/{fab/lib/fab-extended-styles.scss → chips/lib/filter-styles.scss} +3 -3
- package/chips/lib/shared-styles.css.js +1 -1
- package/chips/lib/shared-styles.css.js.map +1 -1
- package/chips/lib/suggestion-styles.css.js +1 -1
- package/chips/lib/suggestion-styles.css.js.map +1 -1
- package/circularprogress/harness.d.ts +1 -0
- package/circularprogress/harness.js +4 -0
- package/circularprogress/harness.js.map +1 -1
- package/circularprogress/lib/circular-progress.d.ts +0 -1
- package/circularprogress/lib/circular-progress.js +16 -19
- package/circularprogress/lib/circular-progress.js.map +1 -1
- package/dialog/lib/_dialog.scss +8 -8
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.js +25 -49
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/lib/divider.js +4 -7
- package/divider/lib/divider.js.map +1 -1
- package/elevation/lib/_elevation.scss +5 -7
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/fab/_fab.scss +1 -0
- package/fab/branded-fab.d.ts +53 -0
- package/fab/branded-fab.js +56 -0
- package/fab/branded-fab.js.map +1 -0
- package/fab/fab.d.ts +25 -5
- package/fab/fab.js +27 -10
- package/fab/fab.js.map +1 -1
- package/fab/harness.d.ts +1 -2
- package/fab/harness.js +1 -1
- package/fab/harness.js.map +1 -1
- package/fab/lib/_fab-branded.scss +27 -0
- package/fab/lib/_fab.scss +144 -16
- package/fab/lib/_shared.scss +155 -130
- package/fab/lib/fab-branded-styles.css.js +9 -0
- package/fab/lib/fab-branded-styles.css.js.map +1 -0
- package/fab/lib/fab-branded-styles.scss +10 -0
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab.d.ts +14 -10
- package/fab/lib/fab.js +19 -12
- package/fab/lib/fab.js.map +1 -1
- package/fab/lib/forced-colors-styles.css.d.ts +1 -0
- package/fab/lib/forced-colors-styles.css.js +9 -0
- package/fab/lib/forced-colors-styles.css.js.map +1 -0
- package/fab/lib/forced-colors-styles.scss +26 -0
- package/fab/lib/shared-styles.css.d.ts +1 -0
- package/fab/lib/shared-styles.css.js +9 -0
- package/fab/lib/shared-styles.css.js.map +1 -0
- package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
- package/fab/lib/{fab-shared.d.ts → shared.d.ts} +24 -16
- package/fab/lib/shared.js +137 -0
- package/fab/lib/shared.js.map +1 -0
- package/field/lib/field.js +14 -27
- package/field/lib/field.js.map +1 -1
- package/focus/focus-ring.d.ts +0 -1
- package/focus/focus-ring.js +0 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/focus-ring.js +2 -3
- package/focus/lib/focus-ring.js.map +1 -1
- package/focus/strong-focus.js +5 -0
- package/focus/strong-focus.js.map +1 -1
- package/icon/icon.d.ts +0 -1
- package/icon/icon.js +0 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +2 -0
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon.d.ts +5 -4
- package/icon/lib/icon.js +3 -2
- package/icon/lib/icon.js.map +1 -1
- package/iconbutton/lib/icon-button.d.ts +0 -4
- package/iconbutton/lib/icon-button.js +28 -48
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/linearprogress/_linear-progress.scss +6 -0
- package/linearprogress/harness.d.ts +13 -0
- package/linearprogress/harness.js +18 -0
- package/linearprogress/harness.js.map +1 -0
- package/linearprogress/lib/_linear-progress.scss +380 -0
- package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
- package/linearprogress/lib/linear-progress-styles.css.js +9 -0
- package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
- package/linearprogress/lib/linear-progress-styles.scss +8 -0
- package/linearprogress/lib/linear-progress.d.ts +35 -0
- package/linearprogress/lib/linear-progress.js +127 -0
- package/linearprogress/lib/linear-progress.js.map +1 -0
- package/linearprogress/linear-progress.d.ts +23 -0
- package/linearprogress/linear-progress.js +26 -0
- package/linearprogress/linear-progress.js.map +1 -0
- package/list/lib/_list.scss +6 -49
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/list.d.ts +1 -3
- package/list/lib/list.js +18 -34
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +10 -69
- package/list/lib/listitem/forced-colors-styles.css.js +1 -1
- package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item.d.ts +2 -4
- package/list/lib/listitem/list-item.js +24 -53
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js +4 -6
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/menu/lib/_menu.scss +6 -28
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu.d.ts +1 -2
- package/menu/lib/menu.js +38 -63
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +13 -32
- package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
- package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/lib/menuitem/menu-item.d.ts +1 -1
- package/menu/lib/menuitem/menu-item.js +4 -6
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
- package/menu/lib/menuitemlink/menu-item-link.js +3 -6
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +6 -2
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -2
- package/menu/lib/submenuitem/sub-menu-item.js +7 -15
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +7 -1
- package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
- package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
- package/navigationbar/lib/navigation-bar.d.ts +5 -5
- package/navigationbar/lib/navigation-bar.js +17 -18
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.d.ts +0 -1
- package/navigationbar/navigation-bar.js +0 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal.d.ts +5 -10
- package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer.d.ts +5 -9
- package/navigationdrawer/lib/navigation-drawer.js +17 -38
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
- package/navigationdrawer/navigation-drawer-modal.js +0 -1
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.d.ts +0 -1
- package/navigationdrawer/navigation-drawer.js +0 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/navigation-tab.d.ts +19 -24
- package/navigationtab/lib/navigation-tab.js +48 -68
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/navigation-tab.d.ts +0 -1
- package/navigationtab/navigation-tab.js +0 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/radio.d.ts +0 -1
- package/radio/lib/radio.js +30 -37
- package/radio/lib/radio.js.map +1 -1
- package/ripple/lib/ripple.js +7 -13
- package/ripple/lib/ripple.js.map +1 -1
- package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
- package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
- package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
- package/segmentedbutton/lib/segmented-button.d.ts +27 -33
- package/segmentedbutton/lib/segmented-button.js +42 -75
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
- package/segmentedbutton/outlined-segmented-button.js +0 -1
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
- package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/select/_filled-select.scss +6 -0
- package/select/_outlined-select.scss +6 -0
- package/select/filled-select.d.ts +41 -0
- package/select/filled-select.js +46 -0
- package/select/filled-select.js.map +1 -0
- package/select/harness.d.ts +24 -0
- package/select/harness.js +53 -0
- package/select/harness.js.map +1 -0
- package/select/lib/_filled-select.scss +163 -0
- package/select/lib/_outlined-select.scss +146 -0
- package/select/lib/_shared.scss +48 -0
- package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/filled-forced-colors-styles.css.js +9 -0
- package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
- package/select/lib/filled-forced-colors-styles.scss +29 -0
- package/select/lib/filled-select-styles.css.d.ts +1 -0
- package/select/lib/filled-select-styles.css.js +9 -0
- package/select/lib/filled-select-styles.css.js.map +1 -0
- package/select/lib/filled-select-styles.scss +10 -0
- package/select/lib/filled-select.d.ts +10 -0
- package/select/lib/filled-select.js +16 -0
- package/select/lib/filled-select.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/outlined-forced-colors-styles.css.js +9 -0
- package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.scss +29 -0
- package/select/lib/outlined-select-styles.css.d.ts +1 -0
- package/select/lib/outlined-select-styles.css.js +9 -0
- package/select/lib/outlined-select-styles.css.js.map +1 -0
- package/select/lib/outlined-select-styles.scss +10 -0
- package/select/lib/outlined-select.d.ts +10 -0
- package/select/lib/outlined-select.js +16 -0
- package/select/lib/outlined-select.js.map +1 -0
- package/select/lib/select.d.ts +218 -0
- package/select/lib/select.js +587 -0
- package/select/lib/select.js.map +1 -0
- package/select/lib/selectoption/harness.d.ts +11 -0
- package/select/lib/selectoption/harness.js +12 -0
- package/select/lib/selectoption/harness.js.map +1 -0
- package/select/lib/selectoption/select-option.d.ts +30 -0
- package/select/lib/selectoption/select-option.js +71 -0
- package/select/lib/selectoption/select-option.js.map +1 -0
- package/select/lib/shared-styles.css.d.ts +1 -0
- package/select/lib/shared-styles.css.js +9 -0
- package/select/lib/shared-styles.css.js.map +1 -0
- package/select/lib/shared-styles.scss +10 -0
- package/select/lib/shared.d.ts +52 -0
- package/select/lib/shared.js +41 -0
- package/select/lib/shared.js.map +1 -0
- package/select/outlined-select.d.ts +41 -0
- package/select/outlined-select.js +46 -0
- package/select/outlined-select.js.map +1 -0
- package/select/select-option.d.ts +44 -0
- package/select/select-option.js +51 -0
- package/select/select-option.js.map +1 -0
- package/slider/harness.d.ts +1 -0
- package/slider/harness.js +5 -0
- package/slider/harness.js.map +1 -1
- package/slider/lib/_slider.scss +146 -164
- package/slider/lib/forced-colors-styles.css.js +1 -1
- package/slider/lib/forced-colors-styles.css.js.map +1 -1
- package/slider/lib/forced-colors-styles.scss +2 -2
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/slider/lib/slider.d.ts +2 -7
- package/slider/lib/slider.js +64 -118
- package/slider/lib/slider.js.map +1 -1
- package/switch/lib/switch.d.ts +0 -2
- package/switch/lib/switch.js +32 -54
- package/switch/lib/switch.js.map +1 -1
- package/textfield/lib/text-field.d.ts +0 -10
- package/textfield/lib/text-field.js +45 -115
- package/textfield/lib/text-field.js.map +1 -1
- package/tokens/_index.scss +3 -0
- package/tokens/_md-comp-assist-chip.scss +25 -20
- package/tokens/_md-comp-elevation.scss +0 -4
- package/tokens/_md-comp-fab-branded.scss +109 -1
- package/tokens/_md-comp-fab.scss +290 -0
- package/tokens/_md-comp-filled-select.scss +150 -1
- package/tokens/_md-comp-filter-chip.scss +103 -93
- package/tokens/_md-comp-input-chip.scss +77 -85
- package/tokens/_md-comp-linear-progress-indicator.scss +14 -1
- package/tokens/_md-comp-list-item.scss +201 -0
- package/tokens/_md-comp-list.scss +107 -26
- package/tokens/_md-comp-menu-item.scss +76 -0
- package/tokens/_md-comp-menu.scss +52 -2
- package/tokens/_md-comp-outlined-select.scss +150 -1
- package/tokens/_md-comp-slider.scss +13 -1
- package/tokens/_md-comp-suggestion-chip.scss +29 -21
- package/tokens/_values.scss +5 -2
- package/types/aria.d.ts +61 -1
- package/actionelement/action-element.d.ts +0 -79
- package/actionelement/action-element.js +0 -97
- package/actionelement/action-element.js.map +0 -1
- package/button/lib/state.d.ts +0 -10
- package/button/lib/state.js +0 -7
- package/button/lib/state.js.map +0 -1
- package/controller/action-controller.d.ts +0 -147
- package/controller/action-controller.js +0 -286
- package/controller/action-controller.js.map +0 -1
- package/decorators/aria-property.d.ts +0 -32
- package/decorators/aria-property.js +0 -99
- package/decorators/aria-property.js.map +0 -1
- package/fab/_fab-extended.scss +0 -6
- package/fab/fab-extended.d.ts +0 -23
- package/fab/fab-extended.js +0 -29
- package/fab/fab-extended.js.map +0 -1
- package/fab/lib/_fab-extended.scss +0 -73
- package/fab/lib/fab-extended-styles.css.js +0 -9
- package/fab/lib/fab-extended-styles.css.js.map +0 -1
- package/fab/lib/fab-extended.d.ts +0 -19
- package/fab/lib/fab-extended.js +0 -28
- package/fab/lib/fab-extended.js.map +0 -1
- package/fab/lib/fab-shared-styles.css.js +0 -9
- package/fab/lib/fab-shared-styles.css.js.map +0 -1
- package/fab/lib/fab-shared.js +0 -121
- package/fab/lib/fab-shared.js.map +0 -1
- package/slider/lib/_tokens.scss +0 -65
- /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
- /package/fab/lib/{fab-shared-styles.css.d.ts → fab-branded-styles.css.d.ts} +0 -0
package/menu/lib/menu.js
CHANGED
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// tslint:disable:no-new-decorators
|
|
6
|
+
var _a;
|
|
7
|
+
import { __decorate } from "tslib";
|
|
9
8
|
import '../../list/list.js';
|
|
10
9
|
import '../../focus/focus-ring.js';
|
|
11
10
|
import '../../elevation/elevation.js';
|
|
12
|
-
import { html, isServer, LitElement } from 'lit';
|
|
11
|
+
import { html, isServer, LitElement, nothing } from 'lit';
|
|
13
12
|
import { eventOptions, property, query, state } from 'lit/decorators.js';
|
|
14
13
|
import { classMap } from 'lit/directives/class-map.js';
|
|
15
14
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
16
|
-
import {
|
|
17
|
-
import { MdFocusRing } from '../../focus/focus-ring.js';
|
|
15
|
+
import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
|
|
18
16
|
import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js';
|
|
19
17
|
import { List } from '../../list/lib/list.js';
|
|
20
18
|
import { createAnimationSignal, EASING } from '../../motion/animation.js';
|
|
@@ -105,7 +103,7 @@ export class Menu extends LitElement {
|
|
|
105
103
|
/**
|
|
106
104
|
* The role of the underlying list element.
|
|
107
105
|
*/
|
|
108
|
-
this.
|
|
106
|
+
this.type = 'menu';
|
|
109
107
|
/**
|
|
110
108
|
* The max time between the keystrokes of the typeahead menu behavior before
|
|
111
109
|
* it clears the typeahead buffer.
|
|
@@ -280,8 +278,8 @@ export class Menu extends LitElement {
|
|
|
280
278
|
class="menu ${classMap(this.getSurfaceClasses())}"
|
|
281
279
|
style=${styleMap(this.menuPositionController.surfaceStyles)}
|
|
282
280
|
@focusout=${this.handleFocusout}>
|
|
283
|
-
${this.renderList()}
|
|
284
281
|
${this.renderElevation()}
|
|
282
|
+
${this.renderList()}
|
|
285
283
|
${this.renderFocusRing()}
|
|
286
284
|
</div>
|
|
287
285
|
`;
|
|
@@ -290,10 +288,12 @@ export class Menu extends LitElement {
|
|
|
290
288
|
* Renders the List element and its items
|
|
291
289
|
*/
|
|
292
290
|
renderList() {
|
|
291
|
+
// Needed for closure conformance
|
|
292
|
+
const { ariaLabel } = this;
|
|
293
293
|
return html `
|
|
294
294
|
<md-list
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
aria-label=${ariaLabel || nothing}
|
|
296
|
+
type=${this.type}
|
|
297
297
|
listTabIndex=${this.listTabIndex}
|
|
298
298
|
@focus=${this.handleListFocus}
|
|
299
299
|
@blur=${this.handleListBlur}
|
|
@@ -555,6 +555,7 @@ export class Menu extends LitElement {
|
|
|
555
555
|
const items = this.items;
|
|
556
556
|
for (const item of items) {
|
|
557
557
|
item.active = false;
|
|
558
|
+
item.selected = false;
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
561
|
handleDeactivateTypeahead(e) {
|
|
@@ -582,100 +583,74 @@ export class Menu extends LitElement {
|
|
|
582
583
|
this.open = true;
|
|
583
584
|
}
|
|
584
585
|
}
|
|
586
|
+
_a = Menu;
|
|
587
|
+
(() => {
|
|
588
|
+
requestUpdateOnAriaChange(_a);
|
|
589
|
+
})();
|
|
585
590
|
__decorate([
|
|
586
|
-
query('md-list')
|
|
587
|
-
__metadata("design:type", List)
|
|
591
|
+
query('md-list')
|
|
588
592
|
], Menu.prototype, "listElement", void 0);
|
|
589
593
|
__decorate([
|
|
590
|
-
query('.menu')
|
|
591
|
-
__metadata("design:type", HTMLElement)
|
|
594
|
+
query('.menu')
|
|
592
595
|
], Menu.prototype, "surfaceEl", void 0);
|
|
593
596
|
__decorate([
|
|
594
|
-
query('slot')
|
|
595
|
-
__metadata("design:type", HTMLSlotElement)
|
|
597
|
+
query('slot')
|
|
596
598
|
], Menu.prototype, "slotEl", void 0);
|
|
597
599
|
__decorate([
|
|
598
|
-
query('md-focus-ring')
|
|
599
|
-
__metadata("design:type", MdFocusRing)
|
|
600
|
+
query('md-focus-ring')
|
|
600
601
|
], Menu.prototype, "focusRing", void 0);
|
|
601
602
|
__decorate([
|
|
602
|
-
|
|
603
|
-
property({ type: String, attribute: 'data-aria-label', noAccessor: true }),
|
|
604
|
-
__metadata("design:type", String)
|
|
605
|
-
], Menu.prototype, "ariaLabel", void 0);
|
|
606
|
-
__decorate([
|
|
607
|
-
property({ attribute: false }),
|
|
608
|
-
__metadata("design:type", Object)
|
|
603
|
+
property({ attribute: false })
|
|
609
604
|
], Menu.prototype, "anchor", void 0);
|
|
610
605
|
__decorate([
|
|
611
|
-
property({ type: Boolean })
|
|
612
|
-
__metadata("design:type", Object)
|
|
606
|
+
property({ type: Boolean })
|
|
613
607
|
], Menu.prototype, "fixed", void 0);
|
|
614
608
|
__decorate([
|
|
615
|
-
property({ type: Boolean })
|
|
616
|
-
__metadata("design:type", Object)
|
|
609
|
+
property({ type: Boolean })
|
|
617
610
|
], Menu.prototype, "quick", void 0);
|
|
618
611
|
__decorate([
|
|
619
|
-
property({ type: Boolean, attribute: 'has-overflow' })
|
|
620
|
-
__metadata("design:type", Object)
|
|
612
|
+
property({ type: Boolean, attribute: 'has-overflow' })
|
|
621
613
|
], Menu.prototype, "hasOverflow", void 0);
|
|
622
614
|
__decorate([
|
|
623
|
-
property({ type: Boolean, reflect: true })
|
|
624
|
-
__metadata("design:type", Object)
|
|
615
|
+
property({ type: Boolean, reflect: true })
|
|
625
616
|
], Menu.prototype, "open", void 0);
|
|
626
617
|
__decorate([
|
|
627
|
-
property({ type: Number, attribute: 'x-offset' })
|
|
628
|
-
__metadata("design:type", Object)
|
|
618
|
+
property({ type: Number, attribute: 'x-offset' })
|
|
629
619
|
], Menu.prototype, "xOffset", void 0);
|
|
630
620
|
__decorate([
|
|
631
|
-
property({ type: Number, attribute: 'y-offset' })
|
|
632
|
-
__metadata("design:type", Object)
|
|
621
|
+
property({ type: Number, attribute: 'y-offset' })
|
|
633
622
|
], Menu.prototype, "yOffset", void 0);
|
|
634
623
|
__decorate([
|
|
635
|
-
property({ type: Number, attribute: 'list-tab-index' })
|
|
636
|
-
__metadata("design:type", Object)
|
|
624
|
+
property({ type: Number, attribute: 'list-tab-index' })
|
|
637
625
|
], Menu.prototype, "listTabIndex", void 0);
|
|
638
626
|
__decorate([
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
__metadata("design:type", String)
|
|
642
|
-
], Menu.prototype, "role", void 0);
|
|
627
|
+
property()
|
|
628
|
+
], Menu.prototype, "type", void 0);
|
|
643
629
|
__decorate([
|
|
644
|
-
property({ type: Number, attribute: 'typeahead-delay' })
|
|
645
|
-
__metadata("design:type", Object)
|
|
630
|
+
property({ type: Number, attribute: 'typeahead-delay' })
|
|
646
631
|
], Menu.prototype, "typeaheadBufferTime", void 0);
|
|
647
632
|
__decorate([
|
|
648
|
-
property({
|
|
649
|
-
__metadata("design:type", String)
|
|
633
|
+
property({ attribute: 'anchor-corner' })
|
|
650
634
|
], Menu.prototype, "anchorCorner", void 0);
|
|
651
635
|
__decorate([
|
|
652
|
-
property({
|
|
653
|
-
__metadata("design:type", String)
|
|
636
|
+
property({ attribute: 'menu-corner' })
|
|
654
637
|
], Menu.prototype, "menuCorner", void 0);
|
|
655
638
|
__decorate([
|
|
656
|
-
property({ type: Boolean, attribute: 'stay-open-on-outside-click' })
|
|
657
|
-
__metadata("design:type", Object)
|
|
639
|
+
property({ type: Boolean, attribute: 'stay-open-on-outside-click' })
|
|
658
640
|
], Menu.prototype, "stayOpenOnOutsideClick", void 0);
|
|
659
641
|
__decorate([
|
|
660
|
-
property({ type: Boolean, attribute: 'stay-open-on-focusout' })
|
|
661
|
-
__metadata("design:type", Object)
|
|
642
|
+
property({ type: Boolean, attribute: 'stay-open-on-focusout' })
|
|
662
643
|
], Menu.prototype, "stayOpenOnFocusout", void 0);
|
|
663
644
|
__decorate([
|
|
664
|
-
property({ type: Boolean, attribute: 'skip-restore-focus' })
|
|
665
|
-
__metadata("design:type", Object)
|
|
645
|
+
property({ type: Boolean, attribute: 'skip-restore-focus' })
|
|
666
646
|
], Menu.prototype, "skipRestoreFocus", void 0);
|
|
667
647
|
__decorate([
|
|
668
|
-
property({
|
|
669
|
-
__metadata("design:type", String)
|
|
648
|
+
property({ attribute: 'default-focus' })
|
|
670
649
|
], Menu.prototype, "defaultFocus", void 0);
|
|
671
650
|
__decorate([
|
|
672
|
-
state()
|
|
673
|
-
__metadata("design:type", Object)
|
|
651
|
+
state()
|
|
674
652
|
], Menu.prototype, "typeaheadActive", void 0);
|
|
675
653
|
__decorate([
|
|
676
|
-
eventOptions({ capture: true })
|
|
677
|
-
__metadata("design:type", Function),
|
|
678
|
-
__metadata("design:paramtypes", [KeyboardEvent]),
|
|
679
|
-
__metadata("design:returntype", void 0)
|
|
654
|
+
eventOptions({ capture: true })
|
|
680
655
|
], Menu.prototype, "handleListKeydown", null);
|
|
681
656
|
//# sourceMappingURL=menu.js.map
|
package/menu/lib/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,6BAA6B;AAC7B,mCAAmC;AACnC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,C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IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;;8CAClC;AAIzB;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAC,CAAC;;0CACP;AAE9C;IAAC,KAAK,EAAE;;6CAAkC;AA6K1C;IAAC,YAAY,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;;qCACC,aAAa;;6CAE3C","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Required for @ariaProperty\n// tslint:disable:no-new-decorators\nimport '../../list/list.js';\nimport '../../focus/focus-ring.js';\nimport '../../elevation/elevation.js';\n\nimport {html, isServer, LitElement} from 'lit';\nimport {eventOptions, property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {MdFocusRing} from '../../focus/focus-ring.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {List} from '../../list/lib/list.js';\nimport {createAnimationSignal, EASING} from '../../motion/animation.js';\nimport {ARIARole} from '../../types/aria.js';\n\nimport {ActivateTypeaheadEvent, DeactivateTypeaheadEvent, isElementInSubtree, MenuItem} from './shared.js';\nimport {Corner, SurfacePositionController, SurfacePositionTarget} from './surfacePositionController.js';\nimport {TypeaheadController} from './typeaheadController.js';\n\nexport {Corner} from './surfacePositionController.js';\n\n/**\n * The default value for the typeahead buffer time in Milliseconds.\n */\nexport const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;\n\n/**\n * Element to focus on when menu is first opened.\n */\nexport type DefaultFocusState = 'NONE'|'LIST_ROOT'|'FIRST_ITEM'|'LAST_ITEM';\n\n/**\n * Gets the currently focused element on the page.\n *\n * @param activeDoc The document or shadowroot from which to start the search.\n * Defaults to `window.document`\n * @return Returns the currently deeply focused element or `null` if none.\n */\nfunction getFocusedElement(activeDoc: Document|ShadowRoot = document):\n HTMLElement|null {\n const activeEl = activeDoc.activeElement as HTMLElement | null;\n\n if (!activeEl) {\n return null;\n }\n\n if (activeEl.shadowRoot) {\n return getFocusedElement(activeEl.shadowRoot) ?? activeEl;\n }\n\n return activeEl;\n}\n\n/**\n * @fires opening Fired before the opening animation begins\n * @fires opened Fired once the menu is open, after any animations\n * @fires closing Fired before the closing animation begins\n * @fires closed Fired once the menu is closed, after any animations\n */\nexport abstract class Menu extends LitElement {\n @query('md-list') protected readonly listElement!: List|null;\n @query('.menu') protected readonly surfaceEl!: HTMLElement|null;\n @query('slot') protected readonly slotEl!: HTMLSlotElement|null;\n @query('md-focus-ring') protected readonly focusRing!: MdFocusRing;\n\n @ariaProperty\n @property({type: String, attribute: 'data-aria-label', noAccessor: true})\n override ariaLabel!: string;\n\n /**\n * The element in which the menu should align to.\n */\n @property({attribute: false})\n anchor: HTMLElement&Partial<SurfacePositionTarget>|null = null;\n /**\n * Makes the element use `position:fixed` instead of `position:absolute`. In\n * most cases, the menu should position itself above most other\n * `position:absolute` or `position:fixed` elements when placed inside of\n * them. e.g. using a menu inside of an `md-dialog`.\n *\n * __NOTE__: Fixed menus will not scroll with the page and will be fixed to\n * the window instead.\n */\n @property({type: Boolean}) fixed = false;\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n /**\n * Displays overflow content like a submenu.\n *\n * __NOTE__: This may cause adverse effects if you set\n * `md-menu {max-height:...}`\n * and have items overflowing items in the \"y\" direction.\n */\n @property({type: Boolean, attribute: 'has-overflow'}) hasOverflow = false;\n /**\n * Opens the menu and makes it visible. Alternative to the `.show()` and\n * `.close()` methods\n */\n @property({type: Boolean, reflect: true}) open = false;\n /**\n * Offsets the menu's inline alignment from the anchor by the given number in\n * pixels. This value is direction aware and will follow the LTR / RTL\n * direction.\n *\n * e.g. LTR: positive -> right, negative -> left\n * RTL: positive -> left, negative -> right\n */\n @property({type: Number, attribute: 'x-offset'}) xOffset = 0;\n /**\n * Offsets the menu's block alignment from the anchor by the given number in\n * pixels.\n *\n * e.g. positive -> down, negative -> up\n */\n @property({type: Number, attribute: 'y-offset'}) yOffset = 0;\n /**\n * The tabindex of the underlying list element.\n */\n @property({type: Number, attribute: 'list-tab-index'}) listTabIndex = 0;\n /**\n * The role of the underlying list element.\n */\n @ariaProperty\n @property({type: String, attribute: 'data-role', noAccessor: true})\n override role: ARIARole = 'list';\n /**\n * The max time between the keystrokes of the typeahead menu behavior before\n * it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n /**\n * The corner of the anchor which to align the menu in the standard logical\n * property style of <block>_<inline>.\n */\n @property({type: String, attribute: 'anchor-corner'})\n anchorCorner: Corner = 'END_START';\n /**\n * The corner of the menu which to align the anchor in the standard logical\n * property style of <block>_<inline>.\n */\n @property({type: String, attribute: 'menu-corner'})\n menuCorner: Corner = 'START_START';\n /**\n * Keeps the user clicks outside the menu.\n *\n * NOTE: clicking outside may still cause focusout to close the menu so see\n * `stayOpenOnFocusout`.\n */\n @property({type: Boolean, attribute: 'stay-open-on-outside-click'})\n stayOpenOnOutsideClick = false;\n /**\n * Keeps the menu open when focus leaves the menu's composed subtree.\n *\n * NOTE: Focusout behavior will stop propagation of the focusout event. Set\n * this property to true to opt-out of menu's focuout handling altogether.\n */\n @property({type: Boolean, attribute: 'stay-open-on-focusout'})\n stayOpenOnFocusout = false;\n /**\n * After closing, does not restore focus to the last focused element before\n * the menu was opened.\n */\n @property({type: Boolean, attribute: 'skip-restore-focus'})\n skipRestoreFocus = false;\n /**\n * The element that should be focused by default once opened.\n */\n @property({type: String, attribute: 'default-focus'})\n defaultFocus: DefaultFocusState = 'LIST_ROOT';\n\n @state() protected typeaheadActive = true;\n\n protected openCloseAnimationSignal = createAnimationSignal();\n\n /**\n * Whether the menu is animating upwards or downwards when opening. This is\n * helpful for calculating some animation calculations.\n */\n protected get openDirection(): 'UP'|'DOWN' {\n const menuCornerBlock = this.menuCorner.split('_')[0];\n return menuCornerBlock === 'START' ? 'DOWN' : 'UP';\n }\n\n /**\n * The element that was focused before the menu opened.\n */\n protected lastFocusedElement: HTMLElement|null = null;\n\n /**\n * Handles typeahead navigation through the menu.\n */\n typeaheadController = new TypeaheadController(() => {\n return {\n getItems: () => this.items,\n typeaheadBufferTime: this.typeaheadBufferTime,\n active: this.typeaheadActive\n };\n });\n\n /**\n * Handles positioning the surface and aligning it to the anchor.\n */\n protected menuPositionController = new SurfacePositionController(this, () => {\n return {\n anchorCorner: this.anchorCorner,\n surfaceCorner: this.menuCorner,\n surfaceEl: this.surfaceEl,\n anchorEl: this.anchor,\n isTopLayer: this.fixed,\n isOpen: this.open,\n xOffset: this.xOffset,\n yOffset: this.yOffset,\n onOpen: this.onOpened,\n beforeClose: this.beforeClose,\n onClose: this.onClosed,\n };\n });\n\n /**\n * The menu items associated with this menu. The items must be `MenuItem`s and\n * have both the `md-menu-item` and `md-list-item` attributes.\n */\n get items(): MenuItem[] {\n const listElement = this.listElement;\n\n if (listElement) {\n return listElement.items.filter(el => el.hasAttribute('md-menu-item')) as\n MenuItem[];\n }\n\n return [];\n }\n\n override render() {\n return this.renderSurface();\n }\n\n /**\n * Renders the positionable surface element and its contents.\n */\n protected renderSurface() {\n // TODO(b/274140618): elevation should be an underlay, not an overlay that\n // tints content\n return html`\n <div\n class=\"menu ${classMap(this.getSurfaceClasses())}\"\n style=${styleMap(this.menuPositionController.surfaceStyles)}\n @focusout=${this.handleFocusout}>\n ${this.renderList()}\n ${this.renderElevation()}\n ${this.renderFocusRing()}\n </div>\n `;\n }\n\n /**\n * Renders the List element and its items\n */\n protected renderList() {\n return html`\n <md-list\n .ariaLabel=${this.ariaLabel}\n .role=${this.role}\n listTabIndex=${this.listTabIndex}\n @focus=${this.handleListFocus}\n @blur=${this.handleListBlur}\n @click=${this.handleListClick}\n @keydown=${this.handleListKeydown}>\n ${this.renderMenuItems()}\n </md-list>`;\n }\n\n /**\n * Renders the menu items' slot\n */\n protected renderMenuItems() {\n return html`<slot\n @close-menu=${this.onCloseMenu}\n @deactivate-items=${this.onDeactivateItems}\n @deactivate-typeahead=${this.handleDeactivateTypeahead}\n @activate-typeahead=${this.handleActivateTypeahead}></slot>`;\n }\n\n /**\n * Renders the elevation component.\n */\n protected renderElevation() {\n return html`<md-elevation></md-elevation>`;\n }\n\n /**\n * Renders the focus ring component.\n */\n protected renderFocusRing() {\n return html`<md-focus-ring></md-focus-ring>`;\n }\n\n protected getSurfaceClasses() {\n return {\n open: this.open,\n fixed: this.fixed,\n 'has-overflow': this.hasOverflow,\n };\n }\n\n protected async handleFocusout(e: FocusEvent) {\n if (this.stayOpenOnFocusout) {\n return;\n }\n\n // Stop propagation to prevent nested menus from interfering with each other\n e.stopPropagation();\n\n if (e.relatedTarget) {\n // Don't close the menu if we are switching focus between menu,\n // md-menu-item, and md-list\n if (isElementInSubtree(e.relatedTarget, this)) {\n return;\n }\n }\n\n const oldRestoreFocus = this.skipRestoreFocus;\n // allow focus to continue to the next focused object rather than returning\n this.skipRestoreFocus = true;\n this.close();\n // await for close\n await this.updateComplete;\n // return to previous behavior\n this.skipRestoreFocus = oldRestoreFocus;\n }\n\n protected handleListFocus() {\n this.focusRing.visible = shouldShowStrongFocus();\n }\n\n protected handleListClick() {\n pointerPress();\n this.focusRing.visible = shouldShowStrongFocus();\n }\n\n // Capture so that we can grab the event before it reaches the list item\n // istelf. Specifically useful for the case where typeahead encounters a space\n // and we don't want the menu item to close the menu.\n @eventOptions({capture: true})\n protected handleListKeydown(e: KeyboardEvent) {\n this.typeaheadController.onKeydown(e);\n }\n\n protected handleListBlur() {\n this.focusRing.visible = false;\n }\n\n /**\n * Saves the last focused element focuses the new element based on\n * `defaultFocus`, and animates open.\n */\n protected onOpened = () => {\n this.lastFocusedElement = getFocusedElement();\n\n if (!this.listElement) return;\n\n const items = this.listElement.items;\n const activeItemRecord = List.getActiveItem(items);\n\n if (activeItemRecord && this.defaultFocus !== 'NONE') {\n activeItemRecord.item.active = false;\n }\n\n switch (this.defaultFocus) {\n case 'FIRST_ITEM':\n const first = List.getFirstActivatableItem(items);\n if (first) {\n first.active = true;\n }\n break;\n case 'LAST_ITEM':\n const last = List.getLastActivatableItem(items);\n if (last) {\n last.active = true;\n }\n break;\n case 'LIST_ROOT':\n this.listElement?.focus();\n break;\n default:\n case 'NONE':\n // Do nothing.\n break;\n }\n\n if (this.quick) {\n this.dispatchEvent(new Event('opening'));\n this.dispatchEvent(new Event('opened'));\n } else {\n this.animateOpen();\n }\n };\n\n /**\n * Animates closed.\n */\n protected beforeClose = async () => {\n this.open = false;\n\n if (!this.skipRestoreFocus) {\n this.lastFocusedElement?.focus?.();\n }\n\n if (!this.quick) {\n await this.animateClose();\n }\n };\n\n /**\n * Focuses the last focused element.\n */\n protected onClosed = () => {\n if (this.quick) {\n this.dispatchEvent(new Event('closing'));\n this.dispatchEvent(new Event('closed'));\n }\n };\n\n /**\n * Performs the opening animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n protected animateOpen() {\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) return;\n\n const openDirection = this.openDirection;\n this.dispatchEvent(new Event('opening'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const openingUpwards = openDirection === 'UP';\n const children = this.items;\n const FULL_DURATION = 500;\n const SURFACE_OPACITY_DURATION = 50;\n const ITEM_OPACITY_DURATION = 250;\n // We want to fit every child fade-in animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_DURATION) / children.length;\n\n const surfaceHeightAnimation =\n surfaceEl.animate([{height: '0px'}, {height: `${height}px`}], {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED,\n });\n // When we are opening upwards, we want to make sure the last item is always\n // in view, so we need to translate it upwards the opposite direction of the\n // height animation\n const upPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: openingUpwards ? `translateY(-${height}px)` : ''},\n {transform: ''}\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED});\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 0}, {opacity: 1}], SURFACE_OPACITY_DURATION);\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If we are animating upwards, then reverse the children list.\n const directionalIndex = openingUpwards ? children.length - 1 - i : i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 0}, {opacity: 1}], {\n duration: ITEM_OPACITY_DURATION,\n delay: DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make them all initially hidden and then clean up at the end of each\n // animation.\n child.classList.toggle('hidden', true);\n animation.addEventListener('finish', () => {\n child.classList.toggle('hidden', false);\n });\n\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n upPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n child.classList.toggle('hidden', false);\n animation.cancel();\n });\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('opened'));\n });\n }\n\n /**\n * Performs the closing animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n protected animateClose() {\n let resolve!: (value: unknown) => void;\n let reject!: () => void;\n\n // This promise blocks the surface position controller from setting\n // display: none on the surface which will interfere with this animation.\n const animationEnded = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) {\n reject();\n return animationEnded;\n }\n\n const openDirection = this.openDirection;\n const closingDownwards = openDirection === 'UP';\n this.dispatchEvent(new Event('closing'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const children = this.items;\n const FULL_DURATION = 150;\n const SURFACE_OPACITY_DURATION = 50;\n // The surface fades away at the very end\n const SURFACE_OPACITY_DELAY = FULL_DURATION - SURFACE_OPACITY_DURATION;\n const ITEM_OPACITY_DURATION = 50;\n const ITEM_OPACITY_INITIAL_DELAY = 50;\n const END_HEIGHT_PRECENTAGE = .35;\n\n // We want to fit every child fade-out animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_INITIAL_DELAY - ITEM_OPACITY_DURATION) /\n children.length;\n\n // The mock has the animation shrink to 35%\n const surfaceHeightAnimation = surfaceEl.animate(\n [\n {height: `${height}px`},\n {height: `${height * END_HEIGHT_PRECENTAGE}px`}\n ],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED_ACCELERATE,\n });\n\n // When we are closing downwards, we want to make sure the last item is\n // always in view, so we need to translate it upwards the opposite direction\n // of the height animation\n const downPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: ''}, {\n transform: closingDownwards ?\n `translateY(-${height * (1 - END_HEIGHT_PRECENTAGE)}px)` :\n ''\n }\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED_ACCELERATE});\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 1}, {opacity: 0}],\n {duration: SURFACE_OPACITY_DURATION, delay: SURFACE_OPACITY_DELAY});\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If the animation is closing upwards, then reverse the list of\n // children so that we animate in the opposite direction.\n const directionalIndex = closingDownwards ? i : children.length - 1 - i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 1}, {opacity: 0}], {\n duration: ITEM_OPACITY_DURATION,\n delay: ITEM_OPACITY_INITIAL_DELAY + DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make sure the items stay hidden at the end of each child animation.\n // We clean this up at the end of the overall animation.\n animation.addEventListener('finish', () => {\n child.classList.toggle('hidden', true);\n });\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n downPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n animation.cancel();\n child.classList.toggle('hidden', false);\n });\n reject();\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n childrenAnimations.forEach(([child]) => {\n child.classList.toggle('hidden', false);\n });\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('closed'));\n resolve(true);\n });\n\n return animationEnded;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n if (!isServer) {\n window.addEventListener('click', this.onWindowClick, {capture: true});\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (!isServer) {\n window.removeEventListener('click', this.onWindowClick, {capture: true});\n }\n }\n\n protected onWindowClick = (e: MouseEvent) => {\n if (!this.stayOpenOnOutsideClick && !e.composedPath().includes(this)) {\n this.open = false;\n }\n };\n\n protected onCloseMenu(e: Event) {\n this.close();\n }\n\n protected onDeactivateItems(e: Event) {\n e.stopPropagation();\n const items = this.items;\n for (const item of items) {\n item.active = false;\n }\n }\n\n protected handleDeactivateTypeahead(e: DeactivateTypeaheadEvent) {\n // stopPropagation so that this does not deactivate any typeaheads in menus\n // nested above it e.g. md-sub-menu-item\n e.stopPropagation();\n this.typeaheadActive = false;\n }\n\n protected handleActivateTypeahead(e: ActivateTypeaheadEvent) {\n // stopPropagation so that this does not activate any typeaheads in menus\n // nested above it e.g. md-sub-menu-item\n e.stopPropagation();\n this.typeaheadActive = true;\n }\n\n override focus() {\n this.listElement?.focus();\n }\n\n close() {\n this.open = false;\n this.items.forEach(item => {\n item.close?.();\n });\n }\n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vC,QAAQ,CAAC,EAAC,SAAS,EAAE,eAAe,EAAC,CAAC;0CAAoC;AAKrC;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;wCAAoC;AAQzE;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAC,CAAC;oDACpC;AAQ/B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAC,CAAC;gDACnC;AAM3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;8CAClC;AAKzB;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,eAAe,EAAC,CAAC;0CACO;AAErC;IAAR,KAAK,EAAE;6CAAkC;AAgL1C;IADC,YAAY,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;6CAG7B","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../list/list.js';\nimport '../../focus/focus-ring.js';\nimport '../../elevation/elevation.js';\n\nimport {html, isServer, LitElement, nothing} from 'lit';\nimport {eventOptions, property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {MdFocusRing} from '../../focus/focus-ring.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {List} from '../../list/lib/list.js';\nimport {createAnimationSignal, EASING} from '../../motion/animation.js';\nimport {ARIAMixinStrict, ARIARole} from '../../types/aria.js';\n\nimport {ActivateTypeaheadEvent, DeactivateTypeaheadEvent, isElementInSubtree, MenuItem} from './shared.js';\nimport {Corner, SurfacePositionController, SurfacePositionTarget} from './surfacePositionController.js';\nimport {TypeaheadController} from './typeaheadController.js';\n\nexport {Corner} from './surfacePositionController.js';\n\n/**\n * The default value for the typeahead buffer time in Milliseconds.\n */\nexport const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;\n\n/**\n * Element to focus on when menu is first opened.\n */\nexport type DefaultFocusState = 'NONE'|'LIST_ROOT'|'FIRST_ITEM'|'LAST_ITEM';\n\n/**\n * Gets the currently focused element on the page.\n *\n * @param activeDoc The document or shadowroot from which to start the search.\n * Defaults to `window.document`\n * @return Returns the currently deeply focused element or `null` if none.\n */\nfunction getFocusedElement(activeDoc: Document|ShadowRoot = document):\n HTMLElement|null {\n const activeEl = activeDoc.activeElement as HTMLElement | null;\n\n if (!activeEl) {\n return null;\n }\n\n if (activeEl.shadowRoot) {\n return getFocusedElement(activeEl.shadowRoot) ?? activeEl;\n }\n\n return activeEl;\n}\n\n/**\n * @fires opening Fired before the opening animation begins\n * @fires opened Fired once the menu is open, after any animations\n * @fires closing Fired before the closing animation begins\n * @fires closed Fired once the menu is closed, after any animations\n */\nexport abstract class Menu extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @query('md-list') protected readonly listElement!: List|null;\n @query('.menu') protected readonly surfaceEl!: HTMLElement|null;\n @query('slot') protected readonly slotEl!: HTMLSlotElement|null;\n @query('md-focus-ring') protected readonly focusRing!: MdFocusRing;\n\n /**\n * The element in which the menu should align to.\n */\n @property({attribute: false})\n anchor: HTMLElement&Partial<SurfacePositionTarget>|null = null;\n /**\n * Makes the element use `position:fixed` instead of `position:absolute`. In\n * most cases, the menu should position itself above most other\n * `position:absolute` or `position:fixed` elements when placed inside of\n * them. e.g. using a menu inside of an `md-dialog`.\n *\n * __NOTE__: Fixed menus will not scroll with the page and will be fixed to\n * the window instead.\n */\n @property({type: Boolean}) fixed = false;\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n /**\n * Displays overflow content like a submenu.\n *\n * __NOTE__: This may cause adverse effects if you set\n * `md-menu {max-height:...}`\n * and have items overflowing items in the \"y\" direction.\n */\n @property({type: Boolean, attribute: 'has-overflow'}) hasOverflow = false;\n /**\n * Opens the menu and makes it visible. Alternative to the `.show()` and\n * `.close()` methods\n */\n @property({type: Boolean, reflect: true}) open = false;\n /**\n * Offsets the menu's inline alignment from the anchor by the given number in\n * pixels. This value is direction aware and will follow the LTR / RTL\n * direction.\n *\n * e.g. LTR: positive -> right, negative -> left\n * RTL: positive -> left, negative -> right\n */\n @property({type: Number, attribute: 'x-offset'}) xOffset = 0;\n /**\n * Offsets the menu's block alignment from the anchor by the given number in\n * pixels.\n *\n * e.g. positive -> down, negative -> up\n */\n @property({type: Number, attribute: 'y-offset'}) yOffset = 0;\n /**\n * The tabindex of the underlying list element.\n */\n @property({type: Number, attribute: 'list-tab-index'}) listTabIndex = 0;\n /**\n * The role of the underlying list element.\n */\n @property() type: ARIARole = 'menu';\n /**\n * The max time between the keystrokes of the typeahead menu behavior before\n * it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n /**\n * The corner of the anchor which to align the menu in the standard logical\n * property style of <block>_<inline>.\n */\n @property({attribute: 'anchor-corner'}) anchorCorner: Corner = 'END_START';\n /**\n * The corner of the menu which to align the anchor in the standard logical\n * property style of <block>_<inline>.\n */\n @property({attribute: 'menu-corner'}) menuCorner: Corner = 'START_START';\n /**\n * Keeps the user clicks outside the menu.\n *\n * NOTE: clicking outside may still cause focusout to close the menu so see\n * `stayOpenOnFocusout`.\n */\n @property({type: Boolean, attribute: 'stay-open-on-outside-click'})\n stayOpenOnOutsideClick = false;\n /**\n * Keeps the menu open when focus leaves the menu's composed subtree.\n *\n * NOTE: Focusout behavior will stop propagation of the focusout event. Set\n * this property to true to opt-out of menu's focuout handling altogether.\n */\n @property({type: Boolean, attribute: 'stay-open-on-focusout'})\n stayOpenOnFocusout = false;\n /**\n * After closing, does not restore focus to the last focused element before\n * the menu was opened.\n */\n @property({type: Boolean, attribute: 'skip-restore-focus'})\n skipRestoreFocus = false;\n /**\n * The element that should be focused by default once opened.\n */\n @property({attribute: 'default-focus'})\n defaultFocus: DefaultFocusState = 'LIST_ROOT';\n\n @state() protected typeaheadActive = true;\n\n protected openCloseAnimationSignal = createAnimationSignal();\n\n /**\n * Whether the menu is animating upwards or downwards when opening. This is\n * helpful for calculating some animation calculations.\n */\n protected get openDirection(): 'UP'|'DOWN' {\n const menuCornerBlock = this.menuCorner.split('_')[0];\n return menuCornerBlock === 'START' ? 'DOWN' : 'UP';\n }\n\n /**\n * The element that was focused before the menu opened.\n */\n protected lastFocusedElement: HTMLElement|null = null;\n\n /**\n * Handles typeahead navigation through the menu.\n */\n typeaheadController = new TypeaheadController(() => {\n return {\n getItems: () => this.items,\n typeaheadBufferTime: this.typeaheadBufferTime,\n active: this.typeaheadActive\n };\n });\n\n /**\n * Handles positioning the surface and aligning it to the anchor.\n */\n protected menuPositionController = new SurfacePositionController(this, () => {\n return {\n anchorCorner: this.anchorCorner,\n surfaceCorner: this.menuCorner,\n surfaceEl: this.surfaceEl,\n anchorEl: this.anchor,\n isTopLayer: this.fixed,\n isOpen: this.open,\n xOffset: this.xOffset,\n yOffset: this.yOffset,\n onOpen: this.onOpened,\n beforeClose: this.beforeClose,\n onClose: this.onClosed,\n };\n });\n\n /**\n * The menu items associated with this menu. The items must be `MenuItem`s and\n * have both the `md-menu-item` and `md-list-item` attributes.\n */\n get items(): MenuItem[] {\n const listElement = this.listElement;\n\n if (listElement) {\n return listElement.items.filter(el => el.hasAttribute('md-menu-item')) as\n MenuItem[];\n }\n\n return [];\n }\n\n override render() {\n return this.renderSurface();\n }\n\n /**\n * Renders the positionable surface element and its contents.\n */\n protected renderSurface() {\n // TODO(b/274140618): elevation should be an underlay, not an overlay that\n // tints content\n return html`\n <div\n class=\"menu ${classMap(this.getSurfaceClasses())}\"\n style=${styleMap(this.menuPositionController.surfaceStyles)}\n @focusout=${this.handleFocusout}>\n ${this.renderElevation()}\n ${this.renderList()}\n ${this.renderFocusRing()}\n </div>\n `;\n }\n\n /**\n * Renders the List element and its items\n */\n protected renderList() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <md-list\n aria-label=${ariaLabel || nothing}\n type=${this.type}\n listTabIndex=${this.listTabIndex}\n @focus=${this.handleListFocus}\n @blur=${this.handleListBlur}\n @click=${this.handleListClick}\n @keydown=${this.handleListKeydown}>\n ${this.renderMenuItems()}\n </md-list>`;\n }\n\n /**\n * Renders the menu items' slot\n */\n protected renderMenuItems() {\n return html`<slot\n @close-menu=${this.onCloseMenu}\n @deactivate-items=${this.onDeactivateItems}\n @deactivate-typeahead=${this.handleDeactivateTypeahead}\n @activate-typeahead=${this.handleActivateTypeahead}></slot>`;\n }\n\n /**\n * Renders the elevation component.\n */\n protected renderElevation() {\n return html`<md-elevation></md-elevation>`;\n }\n\n /**\n * Renders the focus ring component.\n */\n protected renderFocusRing() {\n return html`<md-focus-ring></md-focus-ring>`;\n }\n\n protected getSurfaceClasses() {\n return {\n open: this.open,\n fixed: this.fixed,\n 'has-overflow': this.hasOverflow,\n };\n }\n\n protected async handleFocusout(e: FocusEvent) {\n if (this.stayOpenOnFocusout) {\n return;\n }\n\n // Stop propagation to prevent nested menus from interfering with each other\n e.stopPropagation();\n\n if (e.relatedTarget) {\n // Don't close the menu if we are switching focus between menu,\n // md-menu-item, and md-list\n if (isElementInSubtree(e.relatedTarget, this)) {\n return;\n }\n }\n\n const oldRestoreFocus = this.skipRestoreFocus;\n // allow focus to continue to the next focused object rather than returning\n this.skipRestoreFocus = true;\n this.close();\n // await for close\n await this.updateComplete;\n // return to previous behavior\n this.skipRestoreFocus = oldRestoreFocus;\n }\n\n protected handleListFocus() {\n this.focusRing.visible = shouldShowStrongFocus();\n }\n\n protected handleListClick() {\n pointerPress();\n this.focusRing.visible = shouldShowStrongFocus();\n }\n\n // Capture so that we can grab the event before it reaches the list item\n // istelf. Specifically useful for the case where typeahead encounters a space\n // and we don't want the menu item to close the menu.\n @eventOptions({capture: true})\n protected handleListKeydown(e: KeyboardEvent) {\n this.typeaheadController.onKeydown(e);\n }\n\n protected handleListBlur() {\n this.focusRing.visible = false;\n }\n\n /**\n * Saves the last focused element focuses the new element based on\n * `defaultFocus`, and animates open.\n */\n protected onOpened = () => {\n this.lastFocusedElement = getFocusedElement();\n\n if (!this.listElement) return;\n\n const items = this.listElement.items;\n const activeItemRecord = List.getActiveItem(items);\n\n if (activeItemRecord && this.defaultFocus !== 'NONE') {\n activeItemRecord.item.active = false;\n }\n\n switch (this.defaultFocus) {\n case 'FIRST_ITEM':\n const first = List.getFirstActivatableItem(items);\n if (first) {\n first.active = true;\n }\n break;\n case 'LAST_ITEM':\n const last = List.getLastActivatableItem(items);\n if (last) {\n last.active = true;\n }\n break;\n case 'LIST_ROOT':\n this.listElement?.focus();\n break;\n default:\n case 'NONE':\n // Do nothing.\n break;\n }\n\n if (this.quick) {\n this.dispatchEvent(new Event('opening'));\n this.dispatchEvent(new Event('opened'));\n } else {\n this.animateOpen();\n }\n };\n\n /**\n * Animates closed.\n */\n protected beforeClose = async () => {\n this.open = false;\n\n if (!this.skipRestoreFocus) {\n this.lastFocusedElement?.focus?.();\n }\n\n if (!this.quick) {\n await this.animateClose();\n }\n };\n\n /**\n * Focuses the last focused element.\n */\n protected onClosed = () => {\n if (this.quick) {\n this.dispatchEvent(new Event('closing'));\n this.dispatchEvent(new Event('closed'));\n }\n };\n\n /**\n * Performs the opening animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n protected animateOpen() {\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) return;\n\n const openDirection = this.openDirection;\n this.dispatchEvent(new Event('opening'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const openingUpwards = openDirection === 'UP';\n const children = this.items;\n const FULL_DURATION = 500;\n const SURFACE_OPACITY_DURATION = 50;\n const ITEM_OPACITY_DURATION = 250;\n // We want to fit every child fade-in animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_DURATION) / children.length;\n\n const surfaceHeightAnimation =\n surfaceEl.animate([{height: '0px'}, {height: `${height}px`}], {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED,\n });\n // When we are opening upwards, we want to make sure the last item is always\n // in view, so we need to translate it upwards the opposite direction of the\n // height animation\n const upPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: openingUpwards ? `translateY(-${height}px)` : ''},\n {transform: ''}\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED});\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 0}, {opacity: 1}], SURFACE_OPACITY_DURATION);\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If we are animating upwards, then reverse the children list.\n const directionalIndex = openingUpwards ? children.length - 1 - i : i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 0}, {opacity: 1}], {\n duration: ITEM_OPACITY_DURATION,\n delay: DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make them all initially hidden and then clean up at the end of each\n // animation.\n child.classList.toggle('hidden', true);\n animation.addEventListener('finish', () => {\n child.classList.toggle('hidden', false);\n });\n\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n upPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n child.classList.toggle('hidden', false);\n animation.cancel();\n });\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('opened'));\n });\n }\n\n /**\n * Performs the closing animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n protected animateClose() {\n let resolve!: (value: unknown) => void;\n let reject!: () => void;\n\n // This promise blocks the surface position controller from setting\n // display: none on the surface which will interfere with this animation.\n const animationEnded = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) {\n reject();\n return animationEnded;\n }\n\n const openDirection = this.openDirection;\n const closingDownwards = openDirection === 'UP';\n this.dispatchEvent(new Event('closing'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const children = this.items;\n const FULL_DURATION = 150;\n const SURFACE_OPACITY_DURATION = 50;\n // The surface fades away at the very end\n const SURFACE_OPACITY_DELAY = FULL_DURATION - SURFACE_OPACITY_DURATION;\n const ITEM_OPACITY_DURATION = 50;\n const ITEM_OPACITY_INITIAL_DELAY = 50;\n const END_HEIGHT_PRECENTAGE = .35;\n\n // We want to fit every child fade-out animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_INITIAL_DELAY - ITEM_OPACITY_DURATION) /\n children.length;\n\n // The mock has the animation shrink to 35%\n const surfaceHeightAnimation = surfaceEl.animate(\n [\n {height: `${height}px`},\n {height: `${height * END_HEIGHT_PRECENTAGE}px`}\n ],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED_ACCELERATE,\n });\n\n // When we are closing downwards, we want to make sure the last item is\n // always in view, so we need to translate it upwards the opposite direction\n // of the height animation\n const downPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: ''}, {\n transform: closingDownwards ?\n `translateY(-${height * (1 - END_HEIGHT_PRECENTAGE)}px)` :\n ''\n }\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED_ACCELERATE});\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 1}, {opacity: 0}],\n {duration: SURFACE_OPACITY_DURATION, delay: SURFACE_OPACITY_DELAY});\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If the animation is closing upwards, then reverse the list of\n // children so that we animate in the opposite direction.\n const directionalIndex = closingDownwards ? i : children.length - 1 - i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 1}, {opacity: 0}], {\n duration: ITEM_OPACITY_DURATION,\n delay: ITEM_OPACITY_INITIAL_DELAY + DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make sure the items stay hidden at the end of each child animation.\n // We clean this up at the end of the overall animation.\n animation.addEventListener('finish', () => {\n child.classList.toggle('hidden', true);\n });\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n downPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n animation.cancel();\n child.classList.toggle('hidden', false);\n });\n reject();\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n childrenAnimations.forEach(([child]) => {\n child.classList.toggle('hidden', false);\n });\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('closed'));\n resolve(true);\n });\n\n return animationEnded;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n if (!isServer) {\n window.addEventListener('click', this.onWindowClick, {capture: true});\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (!isServer) {\n window.removeEventListener('click', this.onWindowClick, {capture: true});\n }\n }\n\n protected onWindowClick = (e: MouseEvent) => {\n if (!this.stayOpenOnOutsideClick && !e.composedPath().includes(this)) {\n this.open = false;\n }\n };\n\n protected onCloseMenu(e: Event) {\n this.close();\n }\n\n protected onDeactivateItems(e: Event) {\n e.stopPropagation();\n const items = this.items;\n for (const item of items) {\n item.active = false;\n item.selected = false;\n }\n }\n\n protected handleDeactivateTypeahead(e: DeactivateTypeaheadEvent) {\n // stopPropagation so that this does not deactivate any typeaheads in menus\n // nested above it e.g. md-sub-menu-item\n e.stopPropagation();\n this.typeaheadActive = false;\n }\n\n protected handleActivateTypeahead(e: ActivateTypeaheadEvent) {\n // stopPropagation so that this does not activate any typeaheads in menus\n // nested above it e.g. md-sub-menu-item\n e.stopPropagation();\n this.typeaheadActive = true;\n }\n\n override focus() {\n this.listElement?.focus();\n }\n\n close() {\n this.open = false;\n this.items.forEach(item => {\n item.close?.();\n });\n }\n\n show() {\n this.open = true;\n }\n}\n"]}
|
|
@@ -9,30 +9,33 @@
|
|
|
9
9
|
@use 'sass:string';
|
|
10
10
|
// go/keep-sorted end
|
|
11
11
|
// go/keep-sorted start
|
|
12
|
+
@use '../../../list/list-item';
|
|
12
13
|
@use '../../../ripple/ripple';
|
|
13
14
|
@use '../../../sass/theme';
|
|
14
15
|
@use '../../../tokens';
|
|
15
16
|
// go/keep-sorted end
|
|
16
17
|
|
|
17
|
-
$
|
|
18
|
+
@mixin theme($tokens) {
|
|
19
|
+
$tokens: theme.validate-theme(tokens.md-comp-menu-item-values(), $tokens);
|
|
18
20
|
|
|
19
|
-
@
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
$theme: theme.create-theme-vars($theme, $_custom-property-prefix);
|
|
23
|
-
|
|
24
|
-
@include theme.emit-theme-vars($theme);
|
|
21
|
+
@each $token, $value in $tokens {
|
|
22
|
+
--md-menu-item-#{$token}: #{$value};
|
|
23
|
+
}
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
@mixin styles() {
|
|
28
|
-
$tokens: tokens.md-comp-menu-values();
|
|
29
|
-
$tokens: _resolve-tokens($tokens);
|
|
30
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
27
|
+
$tokens: tokens.md-comp-menu-item-values();
|
|
31
28
|
|
|
32
29
|
:host {
|
|
33
30
|
@each $token, $value in $tokens {
|
|
34
31
|
--_#{$token}: #{$value};
|
|
35
32
|
}
|
|
33
|
+
|
|
34
|
+
@include list-item.theme(
|
|
35
|
+
(
|
|
36
|
+
'list-item-container-color': var(--_list-item-container-color),
|
|
37
|
+
)
|
|
38
|
+
);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.list-item {
|
|
@@ -53,25 +56,3 @@ $_custom-property-prefix: 'menu';
|
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
|
|
57
|
-
@function _resolve-tokens($tokens) {
|
|
58
|
-
@return _remove-unused-tokens($tokens);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// removes unused tokens
|
|
62
|
-
@function _remove-unused-tokens($tokens) {
|
|
63
|
-
$unused-tokens: ();
|
|
64
|
-
@each $token in map-keys($tokens) {
|
|
65
|
-
$index: string.index($token, 'list-item');
|
|
66
|
-
|
|
67
|
-
@if not $index {
|
|
68
|
-
$unused-tokens: list.append($unused-tokens, $token);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@each $token in $unused-tokens {
|
|
73
|
-
$tokens: map.remove($tokens, $token);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@return $tokens;
|
|
77
|
-
}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{--_list-item-selected-container-color: var(--md-menu-list-item-selected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}:host([selected]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */
|
|
7
|
+
export const styles = css `:host{--_list-item-selected-container-color: var(--md-menu-item-list-item-selected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_list-item-container-color: var(--md-menu-item-list-item-container-color, var(--md-sys-color-surface-container, #f3edf7));--md-list-item-list-item-container-color: var(--_list-item-container-color)}:host([selected]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=menu-item-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-styles.css.js","sourceRoot":"","sources":["menu-item-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_list-item-selected-container-color: var(--md-menu-list-item-selected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}:host([selected]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */\n`;\n "]}
|
|
1
|
+
{"version":3,"file":"menu-item-styles.css.js","sourceRoot":"","sources":["menu-item-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_list-item-selected-container-color: var(--md-menu-item-list-item-selected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_list-item-container-color: var(--md-menu-item-list-item-container-color, var(--md-sys-color-surface-container, #f3edf7));--md-list-item-list-item-container-color: var(--_list-item-container-color)}:host([selected]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */\n`;\n "]}
|
|
@@ -10,7 +10,6 @@ import { MenuItem } from '../shared.js';
|
|
|
10
10
|
* @fires close-menu {CloseMenuEvent}
|
|
11
11
|
*/
|
|
12
12
|
export declare class MenuItemEl extends ListItemEl implements MenuItem {
|
|
13
|
-
role: ARIARole;
|
|
14
13
|
/**
|
|
15
14
|
* READONLY: self-identifies as a menu item and sets its identifying attribute
|
|
16
15
|
*/
|
|
@@ -23,6 +22,7 @@ export declare class MenuItemEl extends ListItemEl implements MenuItem {
|
|
|
23
22
|
* Used for overriding e.g. sub-menu-item.
|
|
24
23
|
*/
|
|
25
24
|
protected keepOpenOnClick: boolean;
|
|
25
|
+
protected readonly listItemRole: ARIARole;
|
|
26
26
|
protected onClick(): void;
|
|
27
27
|
protected onKeydown(e: KeyboardEvent): void;
|
|
28
28
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { __decorate
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
7
|
import { property } from 'lit/decorators.js';
|
|
8
8
|
import { ListItemEl } from '../../../list/lib/listitem/list-item.js';
|
|
9
9
|
import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey } from '../shared.js';
|
|
@@ -13,7 +13,6 @@ import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey } from '../shared.js
|
|
|
13
13
|
export class MenuItemEl extends ListItemEl {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
this.role = 'menuitem';
|
|
17
16
|
/**
|
|
18
17
|
* READONLY: self-identifies as a menu item and sets its identifying attribute
|
|
19
18
|
*/
|
|
@@ -26,6 +25,7 @@ export class MenuItemEl extends ListItemEl {
|
|
|
26
25
|
* Used for overriding e.g. sub-menu-item.
|
|
27
26
|
*/
|
|
28
27
|
this.keepOpenOnClick = false;
|
|
28
|
+
this.listItemRole = 'menuitem';
|
|
29
29
|
}
|
|
30
30
|
onClick() {
|
|
31
31
|
if (this.keepOpen || this.keepOpenOnClick)
|
|
@@ -43,11 +43,9 @@ export class MenuItemEl extends ListItemEl {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
__decorate([
|
|
46
|
-
property({ type: Boolean, attribute: 'md-menu-item', reflect: true })
|
|
47
|
-
__metadata("design:type", Object)
|
|
46
|
+
property({ type: Boolean, attribute: 'md-menu-item', reflect: true })
|
|
48
47
|
], MenuItemEl.prototype, "isMenuItem", void 0);
|
|
49
48
|
__decorate([
|
|
50
|
-
property({ type: Boolean, attribute: 'keep-open' })
|
|
51
|
-
__metadata("design:type", Object)
|
|
49
|
+
property({ type: Boolean, attribute: 'keep-open' })
|
|
52
50
|
], MenuItemEl.prototype, "keepOpen", void 0);
|
|
53
51
|
//# sourceMappingURL=menu-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["menu-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAE,aAAa,EAAW,MAAM,cAAc,CAAC;AAE1F;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;
|
|
1
|
+
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["menu-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAE,aAAa,EAAW,MAAM,cAAc,CAAC;AAE1F;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QACE;;WAEG;QAEH,eAAU,GAAG,IAAI,CAAC;QAElB;;WAEG;QACgD,aAAQ,GAAG,KAAK,CAAC;QAEpE;;WAEG;QACO,oBAAe,GAAG,KAAK,CAAC;QAEN,iBAAY,GAAa,UAAU,CAAC;IAmBlE,CAAC;IAjBoB,OAAO;QACxB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe;YAAE,OAAO;QAElD,IAAI,CAAC,aAAa,CACd,IAAI,qBAAqB,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,YAAY,CAAC,eAAe,EAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAEkB,SAAS,CAAC,CAAgB;QAC3C,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC;QAEvB,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE;YACjD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,aAAa,CAAC,IAAI,qBAAqB,CACxC,IAAI,EAAE,EAAC,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;SACxD;IACH,CAAC;CACF;AA/BC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAClD;AAKiC;IAAlD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAC,CAAC;4CAAkB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {property} from 'lit/decorators.js';\n\nimport {ListItemEl} from '../../../list/lib/listitem/list-item.js';\nimport {ARIARole} from '../../../types/aria.js';\nimport {CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey, MenuItem} from '../shared.js';\n\n/**\n * @fires close-menu {CloseMenuEvent}\n */\nexport class MenuItemEl extends ListItemEl implements MenuItem {\n /**\n * READONLY: self-identifies as a menu item and sets its identifying attribute\n */\n @property({type: Boolean, attribute: 'md-menu-item', reflect: true})\n isMenuItem = true;\n\n /**\n * Keeps the menu open if clicked or keyboard selected.\n */\n @property({type: Boolean, attribute: 'keep-open'}) keepOpen = false;\n\n /**\n * Used for overriding e.g. sub-menu-item.\n */\n protected keepOpenOnClick = false;\n\n protected override readonly listItemRole: ARIARole = 'menuitem';\n\n protected override onClick() {\n if (this.keepOpen || this.keepOpenOnClick) return;\n\n this.dispatchEvent(\n new DefaultCloseMenuEvent(this, {kind: CLOSE_REASON.CLICK_SELECTION}));\n }\n\n protected override onKeydown(e: KeyboardEvent) {\n if (this.keepOpen) return;\n const keyCode = e.code;\n\n if (!e.defaultPrevented && isClosableKey(keyCode)) {\n e.preventDefault();\n this.dispatchEvent(new DefaultCloseMenuEvent(\n this, {kind: CLOSE_REASON.KEYDOWN, key: keyCode}));\n }\n }\n}\n"]}
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { ListItemLink } from '../../../list/lib/listitemlink/list-item-link.js';
|
|
7
|
-
import { ARIARole } from '../../../types/aria.js';
|
|
8
7
|
import { MenuItem } from '../shared.js';
|
|
9
8
|
/**
|
|
10
9
|
* @fires close-menu {CloseMenuEvent}
|
|
11
10
|
*/
|
|
12
11
|
export declare class MenuItemLink extends ListItemLink implements MenuItem {
|
|
13
|
-
role: ARIARole;
|
|
14
12
|
/**
|
|
15
13
|
* READONLY: self-identifies as a menu item and sets its identifying attribute
|
|
16
14
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2023 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { __decorate
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
7
|
import { property } from 'lit/decorators.js';
|
|
8
8
|
import { ListItemLink } from '../../../list/lib/listitemlink/list-item-link.js';
|
|
9
9
|
import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey, SELECTION_KEY } from '../shared.js';
|
|
@@ -13,7 +13,6 @@ import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey, SELECTION_KEY } fro
|
|
|
13
13
|
export class MenuItemLink extends ListItemLink {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
this.role = 'menuitem';
|
|
17
16
|
/**
|
|
18
17
|
* READONLY: self-identifies as a menu item and sets its identifying attribute
|
|
19
18
|
*/
|
|
@@ -42,11 +41,9 @@ export class MenuItemLink extends ListItemLink {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
__decorate([
|
|
45
|
-
property({ type: Boolean, attribute: 'md-menu-item', reflect: true })
|
|
46
|
-
__metadata("design:type", Object)
|
|
44
|
+
property({ type: Boolean, attribute: 'md-menu-item', reflect: true })
|
|
47
45
|
], MenuItemLink.prototype, "isMenuItem", void 0);
|
|
48
46
|
__decorate([
|
|
49
|
-
property({ type: Boolean, attribute: 'keep-open' })
|
|
50
|
-
__metadata("design:type", Object)
|
|
47
|
+
property({ type: Boolean, attribute: 'keep-open' })
|
|
51
48
|
], MenuItemLink.prototype, "keepOpen", void 0);
|
|
52
49
|
//# sourceMappingURL=menu-item-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-link.js","sourceRoot":"","sources":["menu-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,YAAY,EAAC,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"menu-item-link.js","sourceRoot":"","sources":["menu-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,YAAY,EAAC,MAAM,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Apache-2.0\n */\n\nimport {property} from 'lit/decorators.js';\n\nimport {ListItemLink} from '../../../list/lib/listitemlink/list-item-link.js';\nimport {CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey, MenuItem, SELECTION_KEY} from '../shared.js';\n\n/**\n * @fires close-menu {CloseMenuEvent}\n */\nexport class MenuItemLink extends ListItemLink implements MenuItem {\n /**\n * READONLY: self-identifies as a menu item and sets its identifying attribute\n */\n @property({type: Boolean, attribute: 'md-menu-item', reflect: true})\n isMenuItem = true;\n\n /**\n * Keeps the menu open if clicked or keyboard selected.\n */\n @property({type: Boolean, attribute: 'keep-open'}) keepOpen = false;\n\n protected keepOpenOnClick = false;\n\n protected override onClick() {\n if (this.keepOpen || this.keepOpenOnClick) return;\n\n this.dispatchEvent(\n new DefaultCloseMenuEvent(this, {kind: CLOSE_REASON.CLICK_SELECTION}));\n }\n\n protected override onKeydown(e: KeyboardEvent) {\n if (this.keepOpen) return;\n\n const keyCode = e.code;\n // Do not preventDefault on enter or else it will prevent from opening links\n if (!e.defaultPrevented && isClosableKey(keyCode) &&\n keyCode !== SELECTION_KEY.ENTER) {\n e.preventDefault();\n this.dispatchEvent(new DefaultCloseMenuEvent(\n this, {kind: CLOSE_REASON.KEYDOWN, key: keyCode}));\n }\n }\n}\n"]}
|
package/menu/lib/shared.d.ts
CHANGED
|
@@ -13,10 +13,14 @@ interface MenuItemSelf {
|
|
|
13
13
|
*/
|
|
14
14
|
headline: string;
|
|
15
15
|
/**
|
|
16
|
-
* Whether or not the item is
|
|
17
|
-
*
|
|
16
|
+
* Whether or not the item is the currently active item of interest (focuses
|
|
17
|
+
* upon activation).
|
|
18
18
|
*/
|
|
19
19
|
active: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not the item is in the selected visual state.
|
|
22
|
+
*/
|
|
23
|
+
selected?: boolean;
|
|
20
24
|
/**
|
|
21
25
|
* If it is a sub-menu-item, a method that can close the submenu.
|
|
22
26
|
*/
|