@material/web 1.0.0-pre.4 → 1.0.0-pre.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/badge/lib/_badge.scss +2 -10
- package/button/lib/_elevated-button.scss +5 -30
- package/button/lib/_elevation.scss +1 -16
- package/button/lib/_filled-button.scss +4 -31
- package/button/lib/_icon.scss +1 -0
- package/button/lib/_outlined-button.scss +6 -23
- package/button/lib/_shared.scss +20 -54
- package/button/lib/_text-button.scss +8 -34
- package/button/lib/_tonal-button.scss +5 -28
- package/button/lib/button.d.ts +2 -0
- package/button/lib/button.js +5 -1
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-styles.css.js +1 -1
- package/button/lib/elevated-styles.css.js.map +1 -1
- package/button/lib/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.js.map +1 -1
- package/button/lib/outlined-styles.css.js +1 -1
- package/button/lib/outlined-styles.css.js.map +1 -1
- package/button/lib/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +1 -2
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/chips/_assist-chip.scss +6 -0
- package/chips/_suggestion-chip.scss +6 -0
- package/chips/assist-chip.d.ts +20 -0
- package/chips/assist-chip.js +24 -0
- package/chips/assist-chip.js.map +1 -0
- package/chips/lib/_assist-chip.scss +27 -0
- package/chips/lib/_shared.scss +183 -0
- package/chips/lib/_suggestion-chip.scss +30 -0
- package/chips/lib/assist-chip.d.ts +11 -0
- package/chips/lib/assist-chip.js +12 -0
- package/chips/lib/assist-chip.js.map +1 -0
- package/chips/lib/assist-styles.css.js +9 -0
- package/chips/lib/assist-styles.css.js.map +1 -0
- package/{menusurface/lib/menu-surface-styles.scss → chips/lib/assist-styles.scss} +3 -3
- package/chips/lib/chip.d.ts +29 -0
- package/chips/lib/chip.js +110 -0
- package/chips/lib/chip.js.map +1 -0
- package/chips/lib/shared-styles.css.js +9 -0
- package/chips/lib/shared-styles.css.js.map +1 -0
- package/{autocomplete → chips}/lib/shared-styles.scss +1 -1
- package/chips/lib/suggestion-chip.d.ts +11 -0
- package/chips/lib/suggestion-chip.js +12 -0
- package/chips/lib/suggestion-chip.js.map +1 -0
- package/chips/lib/suggestion-styles.css.js +9 -0
- package/chips/lib/suggestion-styles.css.js.map +1 -0
- package/{autocomplete/lib/autocompletelist/autocomplete-list-styles.scss → chips/lib/suggestion-styles.scss} +3 -3
- package/chips/suggestion-chip.d.ts +20 -0
- package/chips/suggestion-chip.js +24 -0
- package/chips/suggestion-chip.js.map +1 -0
- package/dialog/lib/_dialog.scss +7 -5
- package/dialog/lib/_tokens.scss +1 -2
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.js +1 -1
- package/dialog/lib/dialog.js.map +1 -1
- package/elevation/lib/_elevation.scss +1 -21
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/fab/lib/_fab-extended.scss +3 -10
- package/fab/lib/_fab.scss +0 -3
- package/fab/lib/_shared.scss +3 -25
- package/fab/lib/fab-extended-styles.css.js +1 -1
- package/fab/lib/fab-extended-styles.css.js.map +1 -1
- package/fab/lib/fab-shared-styles.css.js +1 -1
- package/fab/lib/fab-shared-styles.css.js.map +1 -1
- package/fab/lib/fab-shared.d.ts +0 -1
- package/fab/lib/fab-shared.js +1 -7
- package/fab/lib/fab-shared.js.map +1 -1
- package/field/lib/field.d.ts +4 -1
- package/field/lib/field.js +7 -0
- package/field/lib/field.js.map +1 -1
- package/focus/lib/_focus-ring.scss +13 -7
- package/focus/lib/_md-comp-focus-ring.scss +1 -2
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +1 -12
- package/iconbutton/lib/_filled-tonal-icon-button.scss +1 -12
- package/iconbutton/lib/_outlined-icon-button.scss +1 -13
- package/iconbutton/lib/_shared.scss +10 -6
- package/iconbutton/lib/_standard-icon-button.scss +5 -12
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/icon-button.js +0 -2
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/iconbutton/lib/outlined-styles.css.js +1 -1
- package/iconbutton/lib/outlined-styles.css.js.map +1 -1
- package/iconbutton/lib/shared-styles.css.js +1 -1
- package/iconbutton/lib/shared-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/list/lib/_list.scss +15 -8
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +41 -44
- 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 +1 -0
- package/list/lib/listitem/list-item.js +4 -1
- package/list/lib/listitem/list-item.js.map +1 -1
- package/menu/lib/_menu.scss +6 -9
- 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 +22 -9
- package/menu/lib/menu.js +74 -26
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/menu-item.js +1 -1
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.js +2 -1
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +16 -0
- package/menu/lib/shared.js +16 -0
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +4 -0
- package/menu/lib/submenuitem/sub-menu-item.js +9 -2
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/surfacePositionController.d.ts +10 -2
- package/menu/lib/surfacePositionController.js +6 -2
- package/menu/lib/surfacePositionController.js.map +1 -1
- package/menu/lib/typeaheadController.d.ts +5 -0
- package/menu/lib/typeaheadController.js +7 -3
- package/menu/lib/typeaheadController.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +1 -4
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
- package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
- package/navigationdrawer/lib/_shared.scss +0 -9
- package/navigationtab/lib/_navigation-tab.scss +4 -10
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/_radio.scss +1 -2
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/segmentedbutton/lib/_shared.scss +0 -2
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/slider/lib/_slider.scss +1 -4
- package/slider/lib/_tokens.scss +2 -8
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +1 -7
- package/textfield/lib/_outlined-text-field.scss +1 -7
- package/tokens/_index.scss +101 -2
- package/tokens/_md-comp-assist-chip.scss +68 -0
- package/tokens/_md-comp-badge.scss +34 -0
- package/tokens/_md-comp-banner.scss +23 -0
- package/tokens/_md-comp-bottom-app-bar.scss +21 -0
- package/tokens/_md-comp-carousel-item.scss +23 -0
- package/tokens/_md-comp-checkbox.scss +21 -0
- package/tokens/_md-comp-circular-progress-indicator.scss +22 -0
- package/tokens/_md-comp-data-table.scss +23 -0
- package/tokens/_md-comp-date-input-modal.scss +23 -0
- package/tokens/_md-comp-date-picker-docked.scss +25 -0
- package/tokens/_md-comp-date-picker-modal.scss +25 -0
- package/tokens/_md-comp-dialog.scss +43 -0
- package/tokens/_md-comp-divider.scss +17 -0
- package/tokens/_md-comp-elevated-button.scss +58 -0
- package/tokens/_md-comp-elevated-card.scss +23 -0
- package/tokens/_md-comp-extended-fab-branded.scss +38 -0
- package/tokens/_md-comp-extended-fab-primary.scss +38 -0
- package/tokens/_md-comp-extended-fab-secondary.scss +41 -0
- package/tokens/_md-comp-extended-fab-surface.scss +38 -0
- package/tokens/_md-comp-extended-fab-tertiary.scss +41 -0
- package/tokens/_md-comp-fab-branded-large.scss +23 -0
- package/tokens/_md-comp-fab-branded.scss +23 -0
- package/tokens/_md-comp-fab-primary-large.scss +23 -0
- package/tokens/_md-comp-fab-primary-small.scss +23 -0
- package/tokens/_md-comp-fab-primary.scss +23 -0
- package/tokens/_md-comp-fab-secondary-large.scss +23 -0
- package/tokens/_md-comp-fab-secondary-small.scss +23 -0
- package/tokens/_md-comp-fab-secondary.scss +23 -0
- package/tokens/_md-comp-fab-surface-large.scss +23 -0
- package/tokens/_md-comp-fab-surface-small.scss +23 -0
- package/tokens/_md-comp-fab-surface.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-large.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-small.scss +23 -0
- package/tokens/_md-comp-fab-tertiary.scss +23 -0
- package/tokens/_md-comp-filled-autocomplete.scss +25 -0
- package/tokens/_md-comp-filled-button.scss +58 -0
- package/tokens/_md-comp-filled-card.scss +23 -0
- package/tokens/_md-comp-filled-icon-button.scss +21 -0
- package/tokens/_md-comp-filled-menu-button.scss +25 -0
- package/tokens/_md-comp-filled-select.scss +25 -0
- package/tokens/_md-comp-filled-text-field.scss +46 -0
- package/tokens/_md-comp-filled-tonal-button.scss +59 -0
- package/tokens/_md-comp-filled-tonal-icon-button.scss +24 -0
- package/tokens/_md-comp-filter-chip.scss +38 -0
- package/tokens/_md-comp-full-screen-dialog.scss +25 -0
- package/tokens/_md-comp-icon-button.scss +21 -0
- package/tokens/_md-comp-input-chip.scss +38 -0
- package/tokens/_md-comp-linear-progress-indicator.scss +22 -0
- package/tokens/_md-comp-list.scss +58 -0
- package/tokens/_md-comp-menu.scss +21 -0
- package/tokens/_md-comp-navigation-bar.scss +25 -0
- package/tokens/_md-comp-navigation-drawer.scss +25 -0
- package/tokens/_md-comp-navigation-rail.scss +25 -0
- package/tokens/_md-comp-outlined-autocomplete.scss +28 -0
- package/tokens/_md-comp-outlined-button.scss +56 -0
- package/tokens/_md-comp-outlined-card.scss +23 -0
- package/tokens/_md-comp-outlined-icon-button.scss +21 -0
- package/tokens/_md-comp-outlined-menu-button.scss +23 -0
- package/tokens/_md-comp-outlined-segmented-button.scss +38 -0
- package/tokens/_md-comp-outlined-select.scss +25 -0
- package/tokens/_md-comp-outlined-text-field.scss +44 -0
- package/tokens/_md-comp-plain-tooltip.scss +21 -0
- package/tokens/_md-comp-primary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-radio-button.scss +19 -0
- package/tokens/_md-comp-rich-tooltip.scss +25 -0
- package/tokens/_md-comp-scrim.scss +17 -0
- package/tokens/_md-comp-search-bar.scss +25 -0
- package/tokens/_md-comp-search-view.scss +23 -0
- package/tokens/_md-comp-secondary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-sheet-bottom.scss +21 -0
- package/tokens/_md-comp-sheet-floating.scss +21 -0
- package/tokens/_md-comp-sheet-side.scss +25 -0
- package/tokens/_md-comp-slider.scss +38 -0
- package/tokens/_md-comp-snackbar.scss +25 -0
- package/tokens/_md-comp-standard-menu-button.scss +23 -0
- package/tokens/_md-comp-suggestion-chip.scss +72 -0
- package/tokens/_md-comp-switch.scss +21 -0
- package/tokens/_md-comp-text-button.scss +56 -0
- package/tokens/_md-comp-time-input.scss +25 -0
- package/tokens/_md-comp-time-picker.scss +25 -0
- package/tokens/_md-comp-top-app-bar-large.scss +23 -0
- package/tokens/_md-comp-top-app-bar-medium.scss +23 -0
- package/tokens/_md-comp-top-app-bar-small-centered.scss +26 -0
- package/tokens/_md-comp-top-app-bar-small.scss +23 -0
- package/tokens/_md-ref-palette.scss +12 -0
- package/tokens/_md-ref-typeface.scss +12 -0
- package/tokens/_md-sys-color.scss +25 -0
- package/tokens/_md-sys-elevation.scss +30 -0
- package/tokens/_md-sys-motion.scss +12 -0
- package/tokens/_md-sys-shape.scss +12 -0
- package/tokens/_md-sys-state.scss +12 -0
- package/tokens/_md-sys-typescale.scss +17 -0
- package/autocomplete/_filled-autocomplete.scss +0 -6
- package/autocomplete/_outlined-autocomplete.scss +0 -6
- package/autocomplete/autocomplete-item.d.ts +0 -19
- package/autocomplete/autocomplete-item.js +0 -22
- package/autocomplete/autocomplete-item.js.map +0 -1
- package/autocomplete/autocomplete-list.d.ts +0 -19
- package/autocomplete/autocomplete-list.js +0 -23
- package/autocomplete/autocomplete-list.js.map +0 -1
- package/autocomplete/autocomplete-surface.d.ts +0 -19
- package/autocomplete/autocomplete-surface.js +0 -23
- package/autocomplete/autocomplete-surface.js.map +0 -1
- package/autocomplete/filled-autocomplete.d.ts +0 -28
- package/autocomplete/filled-autocomplete.js +0 -46
- package/autocomplete/filled-autocomplete.js.map +0 -1
- package/autocomplete/lib/_filled-autocomplete.scss +0 -189
- package/autocomplete/lib/_outlined-autocomplete.scss +0 -178
- package/autocomplete/lib/_shared.scss +0 -25
- package/autocomplete/lib/autocomplete.d.ts +0 -54
- package/autocomplete/lib/autocomplete.js +0 -265
- package/autocomplete/lib/autocomplete.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js +0 -14
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/harness.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/harness.js +0 -12
- package/autocomplete/lib/autocompleteitem/harness.js.map +0 -1
- package/autocomplete/lib/autocompletelist/_autocomplete-list.scss +0 -13
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js +0 -9
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletelist/autocomplete-list.d.ts +0 -14
- package/autocomplete/lib/autocompletelist/autocomplete-list.js +0 -21
- package/autocomplete/lib/autocompletelist/autocomplete-list.js.map +0 -1
- package/autocomplete/lib/autocompletelist/harness.d.ts +0 -11
- package/autocomplete/lib/autocompletelist/harness.js +0 -12
- package/autocomplete/lib/autocompletelist/harness.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/_autocomplete-surface.scss +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js +0 -9
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.scss +0 -10
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js +0 -21
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js.map +0 -1
- package/autocomplete/lib/filled-styles.css.d.ts +0 -1
- package/autocomplete/lib/filled-styles.css.js +0 -9
- package/autocomplete/lib/filled-styles.css.js.map +0 -1
- package/autocomplete/lib/filled-styles.scss +0 -10
- package/autocomplete/lib/outlined-styles.css.d.ts +0 -1
- package/autocomplete/lib/outlined-styles.css.js +0 -9
- package/autocomplete/lib/outlined-styles.css.js.map +0 -1
- package/autocomplete/lib/outlined-styles.scss +0 -10
- package/autocomplete/lib/shared-styles.css.js +0 -9
- package/autocomplete/lib/shared-styles.css.js.map +0 -1
- package/autocomplete/outlined-autocomplete.d.ts +0 -28
- package/autocomplete/outlined-autocomplete.js +0 -46
- package/autocomplete/outlined-autocomplete.js.map +0 -1
- package/chips/action/delete-action.d.ts +0 -18
- package/chips/action/delete-action.js +0 -20
- package/chips/action/delete-action.js.map +0 -1
- package/chips/action/lib/action.d.ts +0 -47
- package/chips/action/lib/action.js +0 -162
- package/chips/action/lib/action.js.map +0 -1
- package/chips/action/lib/constants.d.ts +0 -62
- package/chips/action/lib/constants.js +0 -69
- package/chips/action/lib/constants.js.map +0 -1
- package/chips/action/lib/delete-action.d.ts +0 -20
- package/chips/action/lib/delete-action.js +0 -65
- package/chips/action/lib/delete-action.js.map +0 -1
- package/chips/action/lib/events.d.ts +0 -14
- package/chips/action/lib/events.js +0 -16
- package/chips/action/lib/events.js.map +0 -1
- package/chips/action/lib/link-action.d.ts +0 -19
- package/chips/action/lib/link-action.js +0 -55
- package/chips/action/lib/link-action.js.map +0 -1
- package/chips/action/lib/presentational-action.d.ts +0 -15
- package/chips/action/lib/presentational-action.js +0 -30
- package/chips/action/lib/presentational-action.js.map +0 -1
- package/chips/action/lib/primary-action.d.ts +0 -28
- package/chips/action/lib/primary-action.js +0 -88
- package/chips/action/lib/primary-action.js.map +0 -1
- package/chips/action/lib/selectable-action.d.ts +0 -17
- package/chips/action/lib/selectable-action.js +0 -67
- package/chips/action/lib/selectable-action.js.map +0 -1
- package/chips/action/lib/types.d.ts +0 -23
- package/chips/action/lib/types.js +0 -7
- package/chips/action/lib/types.js.map +0 -1
- package/chips/action/link-action.d.ts +0 -18
- package/chips/action/link-action.js +0 -20
- package/chips/action/link-action.js.map +0 -1
- package/chips/action/presentational-action.d.ts +0 -18
- package/chips/action/presentational-action.js +0 -20
- package/chips/action/presentational-action.js.map +0 -1
- package/chips/action/primary-action.d.ts +0 -18
- package/chips/action/primary-action.js +0 -20
- package/chips/action/primary-action.js.map +0 -1
- package/chips/action/selectable-action.d.ts +0 -18
- package/chips/action/selectable-action.js +0 -20
- package/chips/action/selectable-action.js.map +0 -1
- package/chips/chip/lib/_assist-chip-theme.scss +0 -99
- package/chips/chip/lib/_chip-theme.scss +0 -1285
- package/chips/chip/lib/_chip.scss +0 -444
- package/chips/chip/lib/_filter-chip-theme.scss +0 -130
- package/chips/chip/lib/_input-chip-theme.scss +0 -91
- package/chips/chip/lib/_suggestion-chip-theme.scss +0 -92
- package/chips/chip/lib/action-chip.d.ts +0 -18
- package/chips/chip/lib/action-chip.js +0 -39
- package/chips/chip/lib/action-chip.js.map +0 -1
- package/chips/chip/lib/adapter.d.ts +0 -50
- package/chips/chip/lib/adapter.js +0 -7
- package/chips/chip/lib/adapter.js.map +0 -1
- package/chips/chip/lib/animationframe.d.ts +0 -31
- package/chips/chip/lib/animationframe.js +0 -66
- package/chips/chip/lib/animationframe.js.map +0 -1
- package/chips/chip/lib/chip.d.ts +0 -43
- package/chips/chip/lib/chip.js +0 -134
- package/chips/chip/lib/chip.js.map +0 -1
- package/chips/chip/lib/constants.d.ts +0 -43
- package/chips/chip/lib/constants.js +0 -48
- package/chips/chip/lib/constants.js.map +0 -1
- package/chips/chip/lib/foundation.d.ts +0 -41
- package/chips/chip/lib/foundation.js +0 -255
- package/chips/chip/lib/foundation.js.map +0 -1
- package/chips/chip/lib/link-chip.d.ts +0 -21
- package/chips/chip/lib/link-chip.js +0 -53
- package/chips/chip/lib/link-chip.js.map +0 -1
- package/chips/chip/lib/presentational-chip.d.ts +0 -18
- package/chips/chip/lib/presentational-chip.js +0 -39
- package/chips/chip/lib/presentational-chip.js.map +0 -1
- package/chips/chip/lib/selectable-chip.d.ts +0 -22
- package/chips/chip/lib/selectable-chip.js +0 -57
- package/chips/chip/lib/selectable-chip.js.map +0 -1
- package/chips/chip/lib/types.d.ts +0 -42
- package/chips/chip/lib/types.js +0 -7
- package/chips/chip/lib/types.js.map +0 -1
- package/chips/chipset/lib/_chip-set-theme.scss +0 -50
- package/chips/chipset/lib/_chip-set.scss +0 -48
- package/chips/chipset/lib/adapter.d.ts +0 -45
- package/chips/chipset/lib/adapter.js +0 -7
- package/chips/chipset/lib/adapter.js.map +0 -1
- package/chips/chipset/lib/constants.d.ts +0 -26
- package/chips/chipset/lib/constants.js +0 -30
- package/chips/chipset/lib/constants.js.map +0 -1
- package/chips/chipset/lib/foundation.d.ts +0 -68
- package/chips/chipset/lib/foundation.js +0 -314
- package/chips/chipset/lib/foundation.js.map +0 -1
- package/chips/chipset/lib/types.d.ts +0 -41
- package/chips/chipset/lib/types.js +0 -7
- package/chips/chipset/lib/types.js.map +0 -1
- package/menusurface/_menu-surface.scss +0 -6
- package/menusurface/lib/_md-comp-menu-surface.scss +0 -31
- package/menusurface/lib/_menu-surface.scss +0 -122
- package/menusurface/lib/adapter.d.ts +0 -46
- package/menusurface/lib/adapter.js +0 -7
- package/menusurface/lib/adapter.js.map +0 -1
- package/menusurface/lib/constants.d.ts +0 -71
- package/menusurface/lib/constants.js +0 -83
- package/menusurface/lib/constants.js.map +0 -1
- package/menusurface/lib/foundation.d.ts +0 -176
- package/menusurface/lib/foundation.js +0 -544
- package/menusurface/lib/foundation.js.map +0 -1
- package/menusurface/lib/menu-surface-styles.css.d.ts +0 -1
- package/menusurface/lib/menu-surface-styles.css.js +0 -9
- package/menusurface/lib/menu-surface-styles.css.js.map +0 -1
- package/menusurface/lib/menu-surface.d.ts +0 -62
- package/menusurface/lib/menu-surface.js +0 -347
- package/menusurface/lib/menu-surface.js.map +0 -1
- package/menusurface/lib/types.d.ts +0 -19
- package/menusurface/lib/types.js +0 -7
- package/menusurface/lib/types.js.map +0 -1
- package/menusurface/menu-surface.d.ts +0 -14
- package/menusurface/menu-surface.js +0 -17
- package/menusurface/menu-surface.js.map +0 -1
- package/sass/_elevation.scss +0 -159
- package/sass/_resolvers.scss +0 -16
- package/sass/_typography.scss +0 -39
- package/tokens/v0_160/_index.scss +0 -107
- package/tokens/v0_160/_md-comp-assist-chip.scss +0 -109
- package/tokens/v0_160/_md-comp-badge.scss +0 -58
- package/tokens/v0_160/_md-comp-banner.scss +0 -75
- package/tokens/v0_160/_md-comp-bottom-app-bar.scss +0 -35
- package/tokens/v0_160/_md-comp-carousel-item.scss +0 -65
- package/tokens/v0_160/_md-comp-checkbox.scss +0 -126
- package/tokens/v0_160/_md-comp-circular-progress-indicator.scss +0 -39
- package/tokens/v0_160/_md-comp-data-table.scss +0 -96
- package/tokens/v0_160/_md-comp-date-input-modal.scss +0 -89
- package/tokens/v0_160/_md-comp-date-picker-docked.scss +0 -246
- package/tokens/v0_160/_md-comp-date-picker-modal.scss +0 -305
- package/tokens/v0_160/_md-comp-dialog.scss +0 -123
- package/tokens/v0_160/_md-comp-divider.scss +0 -25
- package/tokens/v0_160/_md-comp-elevated-button.scss +0 -91
- package/tokens/v0_160/_md-comp-elevated-card.scss +0 -59
- package/tokens/v0_160/_md-comp-extended-fab-branded.scss +0 -86
- package/tokens/v0_160/_md-comp-extended-fab-primary.scss +0 -94
- package/tokens/v0_160/_md-comp-extended-fab-secondary.scss +0 -95
- package/tokens/v0_160/_md-comp-extended-fab-surface.scss +0 -90
- package/tokens/v0_160/_md-comp-extended-fab-tertiary.scss +0 -95
- package/tokens/v0_160/_md-comp-fab-branded-large.scss +0 -60
- package/tokens/v0_160/_md-comp-fab-branded.scss +0 -60
- package/tokens/v0_160/_md-comp-fab-primary-large.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-primary-small.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-primary.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-secondary-large.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-secondary-small.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-secondary.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-surface-large.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-surface-small.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-surface.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-tertiary-large.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-tertiary-small.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-tertiary.scss +0 -66
- package/tokens/v0_160/_md-comp-filled-autocomplete.scss +0 -267
- package/tokens/v0_160/_md-comp-filled-button.scss +0 -89
- package/tokens/v0_160/_md-comp-filled-card.scss +0 -58
- package/tokens/v0_160/_md-comp-filled-icon-button.scss +0 -79
- package/tokens/v0_160/_md-comp-filled-menu-button.scss +0 -98
- package/tokens/v0_160/_md-comp-filled-select.scss +0 -272
- package/tokens/v0_160/_md-comp-filled-text-field.scss +0 -189
- package/tokens/v0_160/_md-comp-filled-tonal-button.scss +0 -99
- package/tokens/v0_160/_md-comp-filled-tonal-icon-button.scss +0 -86
- package/tokens/v0_160/_md-comp-filter-chip.scss +0 -209
- package/tokens/v0_160/_md-comp-full-screen-dialog.scss +0 -111
- package/tokens/v0_160/_md-comp-icon-button.scss +0 -70
- package/tokens/v0_160/_md-comp-input-chip.scss +0 -184
- package/tokens/v0_160/_md-comp-linear-progress-indicator.scss +0 -41
- package/tokens/v0_160/_md-comp-list.scss +0 -248
- package/tokens/v0_160/_md-comp-menu.scss +0 -121
- package/tokens/v0_160/_md-comp-navigation-bar.scss +0 -114
- package/tokens/v0_160/_md-comp-navigation-drawer.scss +0 -162
- package/tokens/v0_160/_md-comp-navigation-rail.scss +0 -131
- package/tokens/v0_160/_md-comp-outlined-autocomplete.scss +0 -257
- package/tokens/v0_160/_md-comp-outlined-button.scss +0 -84
- package/tokens/v0_160/_md-comp-outlined-card.scss +0 -65
- package/tokens/v0_160/_md-comp-outlined-icon-button.scss +0 -79
- package/tokens/v0_160/_md-comp-outlined-menu-button.scss +0 -94
- package/tokens/v0_160/_md-comp-outlined-segmented-button.scss +0 -112
- package/tokens/v0_160/_md-comp-outlined-select.scss +0 -262
- package/tokens/v0_160/_md-comp-outlined-text-field.scss +0 -171
- package/tokens/v0_160/_md-comp-plain-tooltip.scss +0 -55
- package/tokens/v0_160/_md-comp-primary-navigation-tab.scss +0 -121
- package/tokens/v0_160/_md-comp-radio-button.scss +0 -68
- package/tokens/v0_160/_md-comp-rich-tooltip.scss +0 -121
- package/tokens/v0_160/_md-comp-scrim.scss +0 -25
- package/tokens/v0_160/_md-comp-search-bar.scss +0 -99
- package/tokens/v0_160/_md-comp-search-view.scss +0 -93
- package/tokens/v0_160/_md-comp-secondary-navigation-tab.scss +0 -84
- package/tokens/v0_160/_md-comp-sheet-bottom.scss +0 -45
- package/tokens/v0_160/_md-comp-sheet-floating.scss +0 -34
- package/tokens/v0_160/_md-comp-sheet-side.scss +0 -91
- package/tokens/v0_160/_md-comp-slider.scss +0 -114
- package/tokens/v0_160/_md-comp-snackbar.scss +0 -127
- package/tokens/v0_160/_md-comp-standard-menu-button.scss +0 -98
- package/tokens/v0_160/_md-comp-suggestion-chip.scss +0 -125
- package/tokens/v0_160/_md-comp-switch.scss +0 -136
- package/tokens/v0_160/_md-comp-text-button.scss +0 -77
- package/tokens/v0_160/_md-comp-time-input.scss +0 -218
- package/tokens/v0_160/_md-comp-time-picker.scss +0 -264
- package/tokens/v0_160/_md-comp-top-app-bar-large.scss +0 -63
- package/tokens/v0_160/_md-comp-top-app-bar-medium.scss +0 -63
- package/tokens/v0_160/_md-comp-top-app-bar-small-centered.scss +0 -66
- package/tokens/v0_160/_md-comp-top-app-bar-small.scss +0 -64
- package/tokens/v0_160/_md-ref-palette.scss +0 -107
- package/tokens/v0_160/_md-ref-typeface.scss +0 -21
- package/tokens/v0_160/_md-sys-color.scss +0 -904
- package/tokens/v0_160/_md-sys-elevation.scss +0 -21
- package/tokens/v0_160/_md-sys-motion.scss +0 -53
- package/tokens/v0_160/_md-sys-shape.scss +0 -30
- package/tokens/v0_160/_md-sys-state.scss +0 -19
- package/tokens/v0_160/_md-sys-typescale.scss +0 -284
- package/tokens/v0_160/index.test.css.d.ts +0 -1
- package/tokens/v0_160/index.test.css.js +0 -9
- package/tokens/v0_160/index.test.css.js.map +0 -1
- package/tokens/v0_160/index.test.scss +0 -584
- package/tokens/v0_160/lib.test.css.d.ts +0 -1
- package/tokens/v0_160/lib.test.css.js +0 -9
- package/tokens/v0_160/lib.test.css.js.map +0 -1
- package/tokens/v0_160/lib.test.scss +0 -663
- /package/{autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts → chips/lib/assist-styles.css.d.ts} +0 -0
- /package/{autocomplete → chips}/lib/shared-styles.css.d.ts +0 -0
- /package/{autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts → chips/lib/suggestion-styles.css.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,6BAA6B;AAC7B,mCAAmC;AAEnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAepD,gEAAgE;AAChE,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QAIE,uDAAuD;QACvD,SAAI,GAAa,UAAU,CAAC;QAQ5B;;WAEG;QACS,aAAQ,GAAG,EAAE,CAAC;QAE1B;;;;WAIG;QACS,mBAAc,GAAG,EAAE,CAAC;QAEhC;;WAEG;QACwB,4BAAuB,GAAG,KAAK,CAAC;QAE3D;;;WAGG;QACS,2BAAsB,GAAG,EAAE,CAAC;QAExC;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;;;;WAKG;QACuB,iBAAY,GAAG,CAAC,CAAC,CAAC;QAE5C;;;;WAIG;QACuC,WAAM,GAAG,KAAK,CAAC;QAEzD;;WAEG;QAEH,eAAU,GAAG,IAA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* SPDX-License-Identifier: Apache-2.0\n */\n\n// Required for @ariaProperty\n// tslint:disable:no-new-decorators\n\nimport '../../../ripple/ripple.js';\nimport '../../../focus/focus-ring.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {ariaProperty} from '../../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../../focus/strong-focus.js';\nimport {ripple} from '../../../ripple/directive.js';\nimport {MdRipple} from '../../../ripple/ripple.js';\nimport {ARIARole} from '../../../types/aria.js';\n\ninterface ListItemSelf {\n active: boolean;\n disabled: boolean;\n}\n\n/**\n * The interface of an item that is compatible with md-list. An item that is\n * selectable and disablable.\n */\nexport type ListItem = ListItemSelf&HTMLElement;\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemEl extends LitElement implements ListItem {\n @ariaProperty\n // tslint:disable-next-line\n @property({type: String, attribute: 'data-role', noAccessor: true})\n // @ts-ignore(b/264292293): Use `override` with TS 4.9+\n role: ARIARole = 'listitem';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-selected', noAccessor: true})\n override ariaSelected!: 'true'|'false';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-checked', noAccessor: true})\n override ariaChecked!: 'true'|'false';\n\n /**\n * The primary, headline text of the list item.\n */\n @property() headline = '';\n\n /**\n * The one-line supporting text below the headline. Set\n * `multiLineSupportingText` to `true` to support multiple lines in the\n * supporting text.\n */\n @property() supportingText = '';\n\n /**\n * Modifies `supportingText` to support multiple lines.\n */\n @property({type: Boolean}) multiLineSupportingText = false;\n\n /**\n * The supporting text placed at the end of the item. Overriden by elements\n * slotted into the `end` slot.\n */\n @property() trailingSupportingText = '';\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * The tabindex of the underlying item.\n *\n * __NOTE:__ this is overriden by the keyboard behavior of `md-list` and by\n * setting `selected`.\n */\n @property({type: Number}) itemTabIndex = -1;\n\n /**\n * Whether or not the element is in the selected visual state. When active,\n * tabindex is set to 0, and in some list item variants (like md-list-item),\n * focuses the underlying item.\n */\n @property({type: Boolean, reflect: true}) active = false;\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\n\n @queryAsync('md-ripple') protected ripple!: Promise<MdRipple|null>;\n @query('.list-item') protected listItemRoot!: HTMLElement;\n\n @state() protected showFocusRing = false;\n @state() protected showRipple = false;\n\n /**\n * Only meant to be overriden by subclassing and not by the user. This is\n * so that we have control over focus on specific variants such as disabling\n * focus on <md-autocomplete-item> but enabling it for <md-menu-item>.\n */\n protected focusOnSelection = true;\n\n protected getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private isFirstUpdate = true;\n\n override willUpdate(changed: PropertyValues<this>) {\n if (changed.has('active') && !this.disabled) {\n if (this.active) {\n this.itemTabIndex = 0;\n\n if (this.focusOnSelection) {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n // Do not reset anything if it's the first render because user could\n // have set `itemTabIndex` manually.\n } else if (!this.isFirstUpdate) {\n this.itemTabIndex = -1;\n }\n }\n }\n\n override render(): TemplateResult {\n return this.renderListItem(html`\n <div class=\"content-wrapper\">\n ${this.renderStart()}\n ${this.renderBody()}\n ${this.renderEnd()}\n ${this.renderRipple()}\n ${this.renderFocusRing()}\n </div>`);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content {unkown} the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n return html`\n <li\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.role}\n aria-selected=${this.ariaSelected || nothing}\n aria-checked=${this.ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n @pointerdown=${this.onPointerdown}\n @focus=${this.onFocus}\n @blur=${this.onBlur}\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</li>`;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n protected renderRipple(): TemplateResult|typeof nothing {\n return this.showRipple ?\n html`<md-ripple ?disabled=\"${this.disabled}\"></md-ripple>` :\n nothing;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring class=\"focus-ring\" .visible=\"${\n this.showFocusRing}\"></md-focus-ring>`;\n }\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses(): ClassInfo {\n return {\n 'with-one-line': this.supportingText === '',\n 'with-two-line':\n this.supportingText !== '' && !this.multiLineSupportingText,\n 'with-three-line':\n this.supportingText !== '' && this.multiLineSupportingText,\n 'disabled': this.disabled\n };\n }\n\n /**\n * The content rendered at the start of the list item.\n */\n protected renderStart(): TemplateResult {\n return html`<div class=\"start\"><slot name=\"start\"></slot></div>`;\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n protected renderBody(): TemplateResult {\n const supportingText =\n this.supportingText !== '' ? this.renderSupportingText() : '';\n\n return html`<div class=\"body\"\n ><span class=\"label-text\">${this.headline}</span>${supportingText}</div>`;\n }\n\n /**\n * Renders the one-line supporting text.\n */\n protected renderSupportingText(): TemplateResult {\n return html`<span\n class=\"supporting-text ${classMap(this.getSupportingTextClasses())}\"\n >${this.supportingText}</span>`;\n }\n\n /**\n * Gets the classes for the supporting text node\n */\n protected getSupportingTextClasses(): ClassInfo {\n return {'supporting-text--multi-line': this.multiLineSupportingText};\n }\n\n /**\n * The content rendered at the end of the list item.\n */\n protected renderEnd(): TemplateResult {\n const supportingText = this.trailingSupportingText !== '' ?\n this.renderTrailingSupportingText() :\n '';\n return html`<div class=\"end\"\n ><slot name=\"end\">${supportingText}</slot></div>`;\n }\n\n /**\n * Renders the supporting text at the end of the list item.\n */\n protected renderTrailingSupportingText(): TemplateResult {\n return html`<span class=\"trailing-supporting-text\"\n >${this.trailingSupportingText}</span>`;\n }\n\n protected onPointerdown() {\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onBlur() {\n this.showFocusRing = false;\n }\n\n // For easier overriding in menu-item\n protected onClick(e: Event) {}\n protected onKeydown(e: KeyboardEvent) {}\n protected onPointerenter(e: Event) {}\n protected onPointerleave(e: Event) {}\n\n override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n\n // will focus the list item root if it is selected but not on the first\n // update or else it may cause the page to jump on first load.\n if (changed.has('active') && !this.isFirstUpdate && this.active &&\n this.focusOnSelection) {\n this.listItemRoot.focus();\n }\n\n this.isFirstUpdate = false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,6BAA6B;AAC7B,mCAAmC;AAEnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAepD,gEAAgE;AAChE,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QAIE,uDAAuD;QACvD,SAAI,GAAa,UAAU,CAAC;QAQ5B;;WAEG;QACS,aAAQ,GAAG,EAAE,CAAC;QAE1B;;;;WAIG;QACS,mBAAc,GAAG,EAAE,CAA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AAC;;0CAAgB;AAKzD;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;8CAClD;AAElB;IAAC,UAAU,CAAC,WAAW,CAAC;;0CAA2C;AACnE;IAAC,KAAK,CAAC,YAAY,CAAC;8BAA0B,WAAW;gDAAC;AAE1D;IAAC,KAAK,EAAE;;iDAAiC;AACzC;IAAC,KAAK,EAAE;;8CAA8B","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\n\nimport '../../../ripple/ripple.js';\nimport '../../../focus/focus-ring.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {ariaProperty} from '../../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../../focus/strong-focus.js';\nimport {ripple} from '../../../ripple/directive.js';\nimport {MdRipple} from '../../../ripple/ripple.js';\nimport {ARIARole} from '../../../types/aria.js';\n\ninterface ListItemSelf {\n active: boolean;\n disabled: boolean;\n}\n\n/**\n * The interface of an item that is compatible with md-list. An item that is\n * selectable and disablable.\n */\nexport type ListItem = ListItemSelf&HTMLElement;\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemEl extends LitElement implements ListItem {\n @ariaProperty\n // tslint:disable-next-line\n @property({type: String, attribute: 'data-role', noAccessor: true})\n // @ts-ignore(b/264292293): Use `override` with TS 4.9+\n role: ARIARole = 'listitem';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-selected', noAccessor: true})\n override ariaSelected!: 'true'|'false';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-checked', noAccessor: true})\n override ariaChecked!: 'true'|'false';\n\n /**\n * The primary, headline text of the list item.\n */\n @property() headline = '';\n\n /**\n * The one-line supporting text below the headline. Set\n * `multiLineSupportingText` to `true` to support multiple lines in the\n * supporting text.\n */\n @property() supportingText = '';\n\n /**\n * Modifies `supportingText` to support multiple lines.\n */\n @property({type: Boolean}) multiLineSupportingText = false;\n\n /**\n * The supporting text placed at the end of the item. Overriden by elements\n * slotted into the `end` slot.\n */\n @property() trailingSupportingText = '';\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * The tabindex of the underlying item.\n *\n * __NOTE:__ this is overriden by the keyboard behavior of `md-list` and by\n * setting `selected`.\n */\n @property({type: Number}) itemTabIndex = -1;\n\n /**\n * Whether or not the element is in the selected visual state. When active,\n * tabindex is set to 0, and in some list item variants (like md-list-item),\n * focuses the underlying item.\n */\n @property({type: Boolean, reflect: true}) active = false;\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\n\n @queryAsync('md-ripple') protected ripple!: Promise<MdRipple|null>;\n @query('.list-item') protected listItemRoot!: HTMLElement;\n\n @state() protected showFocusRing = false;\n @state() protected showRipple = false;\n\n /**\n * Only meant to be overriden by subclassing and not by the user. This is\n * so that we have control over focus on specific variants such as disabling\n * focus on <md-autocomplete-item> but enabling it for <md-menu-item>.\n */\n protected focusOnSelection = true;\n\n protected getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private isFirstUpdate = true;\n\n override willUpdate(changed: PropertyValues<this>) {\n if (changed.has('active') && !this.disabled) {\n if (this.active) {\n this.itemTabIndex = 0;\n\n if (this.focusOnSelection) {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n // Do not reset anything if it's the first render because user could\n // have set `itemTabIndex` manually.\n } else if (!this.isFirstUpdate) {\n this.itemTabIndex = -1;\n }\n }\n }\n\n override render(): TemplateResult {\n return this.renderListItem(html`\n <div class=\"content-wrapper\">\n ${this.renderStart()}\n ${this.renderBody()}\n ${this.renderEnd()}\n ${this.renderRipple()}\n ${this.renderFocusRing()}\n </div>`);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content {unkown} the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n return html`\n <li\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.role}\n aria-selected=${this.ariaSelected || nothing}\n aria-checked=${this.ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n @pointerdown=${this.onPointerdown}\n @focus=${this.onFocus}\n @blur=${this.onBlur}\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</li>`;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n protected renderRipple(): TemplateResult|typeof nothing {\n return this.showRipple ?\n html`<md-ripple ?disabled=\"${this.disabled}\"></md-ripple>` :\n nothing;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring class=\"focus-ring\" .visible=\"${\n this.showFocusRing}\"></md-focus-ring>`;\n }\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses(): ClassInfo {\n return {\n 'with-one-line': this.supportingText === '',\n 'with-two-line':\n this.supportingText !== '' && !this.multiLineSupportingText,\n 'with-three-line':\n this.supportingText !== '' && this.multiLineSupportingText,\n 'disabled': this.disabled\n };\n }\n\n /**\n * The content rendered at the start of the list item.\n */\n protected renderStart(): TemplateResult {\n return html`<div class=\"start\"><slot name=\"start\"></slot></div>`;\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n protected renderBody(): TemplateResult {\n const supportingText =\n this.supportingText !== '' ? this.renderSupportingText() : '';\n\n return html`<div class=\"body\"\n ><span class=\"label-text\">${this.headline}</span>${supportingText}</div>`;\n }\n\n /**\n * Renders the one-line supporting text.\n */\n protected renderSupportingText(): TemplateResult {\n return html`<span\n class=\"supporting-text ${classMap(this.getSupportingTextClasses())}\"\n >${this.supportingText}</span>`;\n }\n\n /**\n * Gets the classes for the supporting text node\n */\n protected getSupportingTextClasses(): ClassInfo {\n return {'supporting-text--multi-line': this.multiLineSupportingText};\n }\n\n /**\n * The content rendered at the end of the list item.\n */\n protected renderEnd(): TemplateResult {\n const supportingText = this.trailingSupportingText !== '' ?\n this.renderTrailingSupportingText() :\n '';\n return html`<div class=\"end\"\n ><slot name=\"end\">${supportingText}</slot></div>`;\n }\n\n /**\n * Renders the supporting text at the end of the list item.\n */\n protected renderTrailingSupportingText(): TemplateResult {\n return html`<span class=\"trailing-supporting-text\"\n >${this.trailingSupportingText}</span>`;\n }\n\n protected onPointerdown() {\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onBlur() {\n this.showFocusRing = false;\n }\n\n // For easier overriding in menu-item\n protected onClick(e: Event) {}\n protected onKeydown(e: KeyboardEvent) {}\n protected onPointerenter(e: Event) {}\n protected onPointerleave(e: Event) {}\n\n override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n\n // will focus the list item root if it is selected but not on the first\n // update or else it may cause the page to jump on first load.\n if (changed.has('active') && !this.isFirstUpdate && this.active &&\n this.focusOnSelection) {\n this.focus();\n }\n\n this.isFirstUpdate = false;\n }\n\n override focus() {\n this.listItemRoot?.focus?.();\n }\n}\n"]}
|
package/menu/lib/_menu.scss
CHANGED
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
@use 'sass:string';
|
|
10
10
|
// go/keep-sorted end
|
|
11
11
|
// go/keep-sorted start
|
|
12
|
-
@use '../../elevation/
|
|
12
|
+
@use '../../elevation/elevation';
|
|
13
13
|
@use '../../focus/focus-ring';
|
|
14
14
|
@use '../../list/list' as md-list;
|
|
15
15
|
@use '../../list/list-item';
|
|
16
|
-
@use '../../sass/resolvers';
|
|
17
16
|
@use '../../sass/theme';
|
|
18
17
|
@use '../../tokens';
|
|
19
18
|
// go/keep-sorted end
|
|
@@ -57,6 +56,8 @@ $_custom-property-prefix: 'menu';
|
|
|
57
56
|
shape: var(--_container-shape),
|
|
58
57
|
)
|
|
59
58
|
);
|
|
59
|
+
|
|
60
|
+
min-width: 300px;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
.menu {
|
|
@@ -68,6 +69,7 @@ $_custom-property-prefix: 'menu';
|
|
|
68
69
|
user-select: none;
|
|
69
70
|
max-height: inherit;
|
|
70
71
|
height: inherit;
|
|
72
|
+
min-width: inherit;
|
|
71
73
|
|
|
72
74
|
&.fixed {
|
|
73
75
|
position: fixed;
|
|
@@ -78,6 +80,7 @@ $_custom-property-prefix: 'menu';
|
|
|
78
80
|
max-height: inherit;
|
|
79
81
|
display: block;
|
|
80
82
|
overflow: auto;
|
|
83
|
+
min-width: inherit;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
&.has-overflow md-list {
|
|
@@ -103,17 +106,11 @@ $_custom-property-prefix: 'menu';
|
|
|
103
106
|
md-elevation {
|
|
104
107
|
position: absolute;
|
|
105
108
|
inset: 0;
|
|
106
|
-
pointer-events: none;
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
@function _resolve-tokens($tokens) {
|
|
111
|
-
|
|
112
|
-
@return elevation.resolve-tokens($menu-tokens, 'elevation-key');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// removes unused tokens
|
|
116
|
-
@function _remove-unused-tokens($tokens) {
|
|
113
|
+
// removes unused tokens
|
|
117
114
|
$unused-tokens: ();
|
|
118
115
|
@each $token in map-keys($tokens) {
|
|
119
116
|
$index: string.index($token, 'list-item');
|
|
@@ -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{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-menu-container-elevation,
|
|
7
|
+
export const styles = css `:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--_container-surface-tint-layer-color: var(--md-menu-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--md-list-container-color:var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color);--md-focus-ring-shape-start-start:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-start-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-start:var(--md-focus-ring-shape, var(--_container-shape));min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}md-elevation{position:absolute;inset:0}/*# sourceMappingURL=menu-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=menu-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-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{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-menu-container-elevation,
|
|
1
|
+
{"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-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{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--_container-surface-tint-layer-color: var(--md-menu-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--md-list-container-color:var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color);--md-focus-ring-shape-start-start:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-start-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-start:var(--md-focus-ring-shape, var(--_container-shape));min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}md-elevation{position:absolute;inset:0}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}
|
package/menu/lib/menu.d.ts
CHANGED
|
@@ -9,18 +9,23 @@ import '../../elevation/elevation.js';
|
|
|
9
9
|
import { LitElement } from 'lit';
|
|
10
10
|
import { MdFocusRing } from '../../focus/focus-ring.js';
|
|
11
11
|
import { List } from '../../list/lib/list.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { ARIARole } from '../../types/aria.js';
|
|
13
|
+
import { ActivateTypeaheadEvent, DeactivateTypeaheadEvent, MenuItem } from './shared.js';
|
|
14
|
+
import { Corner, SurfacePositionController, SurfacePositionTarget } from './surfacePositionController.js';
|
|
14
15
|
import { TypeaheadController } from './typeaheadController.js';
|
|
15
16
|
export { Corner } from './surfacePositionController.js';
|
|
17
|
+
/**
|
|
18
|
+
* The default value for the typeahead buffer time in Milliseconds.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;
|
|
16
21
|
/**
|
|
17
22
|
* Element to focus on when menu is first opened.
|
|
18
23
|
*/
|
|
19
24
|
export type DefaultFocusState = 'NONE' | 'LIST_ROOT' | 'FIRST_ITEM' | 'LAST_ITEM';
|
|
20
25
|
/**
|
|
21
|
-
* @fires opening Fired before the opening animation begins
|
|
26
|
+
* @fires opening Fired before the opening animation begins
|
|
22
27
|
* @fires opened Fired once the menu is open, after any animations
|
|
23
|
-
* @fires closing Fired before the closing animation begins
|
|
28
|
+
* @fires closing Fired before the closing animation begins
|
|
24
29
|
* @fires closed Fired once the menu is closed, after any animations
|
|
25
30
|
*/
|
|
26
31
|
export declare abstract class Menu extends LitElement {
|
|
@@ -32,7 +37,7 @@ export declare abstract class Menu extends LitElement {
|
|
|
32
37
|
/**
|
|
33
38
|
* The element in which the menu should align to.
|
|
34
39
|
*/
|
|
35
|
-
anchor: HTMLElement | null;
|
|
40
|
+
anchor: HTMLElement & Partial<SurfacePositionTarget> | null;
|
|
36
41
|
/**
|
|
37
42
|
* Makes the element use `position:fixed` instead of `position:absolute`. In
|
|
38
43
|
* most cases, the menu should position itself above most other
|
|
@@ -80,6 +85,10 @@ export declare abstract class Menu extends LitElement {
|
|
|
80
85
|
* The tabindex of the underlying list element.
|
|
81
86
|
*/
|
|
82
87
|
listTabIndex: number;
|
|
88
|
+
/**
|
|
89
|
+
* The role of the underlying list element.
|
|
90
|
+
*/
|
|
91
|
+
role: ARIARole;
|
|
83
92
|
/**
|
|
84
93
|
* The max time between the keystrokes of the typeahead menu behavior before
|
|
85
94
|
* it clears the typeahead buffer.
|
|
@@ -108,6 +117,7 @@ export declare abstract class Menu extends LitElement {
|
|
|
108
117
|
* The element that should be focused by default once opened.
|
|
109
118
|
*/
|
|
110
119
|
defaultFocus: DefaultFocusState;
|
|
120
|
+
protected typeaheadActive: boolean;
|
|
111
121
|
protected openCloseAnimationSignal: import("../../motion/animation.js").AnimationSignal;
|
|
112
122
|
/**
|
|
113
123
|
* Whether the menu is animating upwards or downwards when opening. This is
|
|
@@ -121,7 +131,7 @@ export declare abstract class Menu extends LitElement {
|
|
|
121
131
|
/**
|
|
122
132
|
* Handles typeahead navigation through the menu.
|
|
123
133
|
*/
|
|
124
|
-
|
|
134
|
+
typeaheadController: TypeaheadController;
|
|
125
135
|
/**
|
|
126
136
|
* Handles positioning the surface and aligning it to the anchor.
|
|
127
137
|
*/
|
|
@@ -157,9 +167,10 @@ export declare abstract class Menu extends LitElement {
|
|
|
157
167
|
fixed: boolean;
|
|
158
168
|
'has-overflow': boolean;
|
|
159
169
|
};
|
|
160
|
-
protected
|
|
161
|
-
protected
|
|
162
|
-
protected
|
|
170
|
+
protected handleListFocus(): void;
|
|
171
|
+
protected handleListClick(): void;
|
|
172
|
+
protected handleListKeydown(e: KeyboardEvent): void;
|
|
173
|
+
protected handleListBlur(): void;
|
|
163
174
|
/**
|
|
164
175
|
* Saves the last focused element focuses the new element based on
|
|
165
176
|
* `defaultFocus`, and animates open.
|
|
@@ -190,6 +201,8 @@ export declare abstract class Menu extends LitElement {
|
|
|
190
201
|
protected onWindowClick: (e: MouseEvent) => void;
|
|
191
202
|
protected onCloseMenu(e: Event): void;
|
|
192
203
|
protected onDeactivateItems(e: Event): void;
|
|
204
|
+
protected handleDeactivateTypeahead(e: DeactivateTypeaheadEvent): void;
|
|
205
|
+
protected handleActivateTypeahead(e: ActivateTypeaheadEvent): void;
|
|
193
206
|
focus(): void;
|
|
194
207
|
close(): void;
|
|
195
208
|
show(): void;
|
package/menu/lib/menu.js
CHANGED
|
@@ -9,8 +9,8 @@ import { __decorate, __metadata } from "tslib";
|
|
|
9
9
|
import '../../list/list.js';
|
|
10
10
|
import '../../focus/focus-ring.js';
|
|
11
11
|
import '../../elevation/elevation.js';
|
|
12
|
-
import { html, LitElement } from 'lit';
|
|
13
|
-
import { property, query } from 'lit/decorators.js';
|
|
12
|
+
import { html, isServer, LitElement } from 'lit';
|
|
13
|
+
import { eventOptions, property, query, state } from 'lit/decorators.js';
|
|
14
14
|
import { classMap } from 'lit/directives/class-map.js';
|
|
15
15
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
16
16
|
import { ariaProperty } from '../../decorators/aria-property.js';
|
|
@@ -20,6 +20,10 @@ import { List } from '../../list/lib/list.js';
|
|
|
20
20
|
import { createAnimationSignal, EASING } from '../../motion/animation.js';
|
|
21
21
|
import { SurfacePositionController } from './surfacePositionController.js';
|
|
22
22
|
import { TypeaheadController } from './typeaheadController.js';
|
|
23
|
+
/**
|
|
24
|
+
* The default value for the typeahead buffer time in Milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
export const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;
|
|
23
27
|
/**
|
|
24
28
|
* Gets the currently focused element on the page.
|
|
25
29
|
*
|
|
@@ -38,9 +42,9 @@ function getFocusedElement(activeDoc = document) {
|
|
|
38
42
|
return activeEl;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
|
-
* @fires opening Fired before the opening animation begins
|
|
45
|
+
* @fires opening Fired before the opening animation begins
|
|
42
46
|
* @fires opened Fired once the menu is open, after any animations
|
|
43
|
-
* @fires closing Fired before the closing animation begins
|
|
47
|
+
* @fires closing Fired before the closing animation begins
|
|
44
48
|
* @fires closed Fired once the menu is closed, after any animations
|
|
45
49
|
*/
|
|
46
50
|
export class Menu extends LitElement {
|
|
@@ -97,11 +101,15 @@ export class Menu extends LitElement {
|
|
|
97
101
|
* The tabindex of the underlying list element.
|
|
98
102
|
*/
|
|
99
103
|
this.listTabIndex = 0;
|
|
104
|
+
/**
|
|
105
|
+
* The role of the underlying list element.
|
|
106
|
+
*/
|
|
107
|
+
this.role = 'list';
|
|
100
108
|
/**
|
|
101
109
|
* The max time between the keystrokes of the typeahead menu behavior before
|
|
102
110
|
* it clears the typeahead buffer.
|
|
103
111
|
*/
|
|
104
|
-
this.typeaheadBufferTime =
|
|
112
|
+
this.typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME;
|
|
105
113
|
/**
|
|
106
114
|
* The corner of the anchor which to align the menu in the standard logical
|
|
107
115
|
* property style of <block>_<inline>.
|
|
@@ -125,6 +133,7 @@ export class Menu extends LitElement {
|
|
|
125
133
|
* The element that should be focused by default once opened.
|
|
126
134
|
*/
|
|
127
135
|
this.defaultFocus = 'LIST_ROOT';
|
|
136
|
+
this.typeaheadActive = true;
|
|
128
137
|
this.openCloseAnimationSignal = createAnimationSignal();
|
|
129
138
|
/**
|
|
130
139
|
* The element that was focused before the menu opened.
|
|
@@ -137,6 +146,7 @@ export class Menu extends LitElement {
|
|
|
137
146
|
return {
|
|
138
147
|
getItems: () => this.items,
|
|
139
148
|
typeaheadBufferTime: this.typeaheadBufferTime,
|
|
149
|
+
active: this.typeaheadActive
|
|
140
150
|
};
|
|
141
151
|
});
|
|
142
152
|
/**
|
|
@@ -192,6 +202,7 @@ export class Menu extends LitElement {
|
|
|
192
202
|
break;
|
|
193
203
|
}
|
|
194
204
|
if (this.quick) {
|
|
205
|
+
this.dispatchEvent(new Event('opening'));
|
|
195
206
|
this.dispatchEvent(new Event('opened'));
|
|
196
207
|
}
|
|
197
208
|
else {
|
|
@@ -203,6 +214,9 @@ export class Menu extends LitElement {
|
|
|
203
214
|
*/
|
|
204
215
|
this.beforeClose = async () => {
|
|
205
216
|
this.open = false;
|
|
217
|
+
if (!this.skipRestoreFocus) {
|
|
218
|
+
this.lastFocusedElement?.focus?.();
|
|
219
|
+
}
|
|
206
220
|
if (!this.quick) {
|
|
207
221
|
await this.animateClose();
|
|
208
222
|
}
|
|
@@ -212,11 +226,9 @@ export class Menu extends LitElement {
|
|
|
212
226
|
*/
|
|
213
227
|
this.onClosed = () => {
|
|
214
228
|
if (this.quick) {
|
|
229
|
+
this.dispatchEvent(new Event('closing'));
|
|
215
230
|
this.dispatchEvent(new Event('closed'));
|
|
216
231
|
}
|
|
217
|
-
if (!this.skipRestoreFocus) {
|
|
218
|
-
this.lastFocusedElement?.focus?.();
|
|
219
|
-
}
|
|
220
232
|
};
|
|
221
233
|
this.onWindowClick = (e) => {
|
|
222
234
|
if (!this.stayOpenOnOutsideClick && !e.composedPath().includes(this)) {
|
|
@@ -250,11 +262,13 @@ export class Menu extends LitElement {
|
|
|
250
262
|
* Renders the positionable surface element and its contents.
|
|
251
263
|
*/
|
|
252
264
|
renderSurface() {
|
|
265
|
+
// TODO(b/274140618): elevation should be an underlay, not an overlay that
|
|
266
|
+
// tints content
|
|
253
267
|
return html `
|
|
254
268
|
<div
|
|
255
269
|
class="menu ${classMap(this.getSurfaceClasses())}"
|
|
256
270
|
style=${styleMap(this.menuPositionController.surfaceStyles)}>
|
|
257
|
-
${this.renderList()}
|
|
271
|
+
${this.renderList()}
|
|
258
272
|
${this.renderElevation()}
|
|
259
273
|
${this.renderFocusRing()}
|
|
260
274
|
</div>
|
|
@@ -265,17 +279,16 @@ export class Menu extends LitElement {
|
|
|
265
279
|
*/
|
|
266
280
|
renderList() {
|
|
267
281
|
return html `
|
|
268
|
-
|
|
269
|
-
role="menu"
|
|
270
|
-
class="list"
|
|
282
|
+
<md-list
|
|
271
283
|
.ariaLabel=${this.ariaLabel}
|
|
284
|
+
.role=${this.role}
|
|
272
285
|
listTabIndex=${this.listTabIndex}
|
|
273
|
-
@focus=${this.
|
|
274
|
-
@blur=${this.
|
|
275
|
-
@click=${this.
|
|
276
|
-
@keydown=${this.
|
|
277
|
-
|
|
278
|
-
|
|
286
|
+
@focus=${this.handleListFocus}
|
|
287
|
+
@blur=${this.handleListBlur}
|
|
288
|
+
@click=${this.handleListClick}
|
|
289
|
+
@keydown=${this.handleListKeydown}>
|
|
290
|
+
${this.renderMenuItems()}
|
|
291
|
+
</md-list>`;
|
|
279
292
|
}
|
|
280
293
|
/**
|
|
281
294
|
* Renders the menu items' slot
|
|
@@ -283,7 +296,9 @@ export class Menu extends LitElement {
|
|
|
283
296
|
renderMenuItems() {
|
|
284
297
|
return html `<slot
|
|
285
298
|
@close-menu=${this.onCloseMenu}
|
|
286
|
-
@deactivate-items=${this.onDeactivateItems}
|
|
299
|
+
@deactivate-items=${this.onDeactivateItems}
|
|
300
|
+
@deactivate-typeahead=${this.handleDeactivateTypeahead}
|
|
301
|
+
@activate-typeahead=${this.handleActivateTypeahead}></slot>`;
|
|
287
302
|
}
|
|
288
303
|
/**
|
|
289
304
|
* Renders the elevation component.
|
|
@@ -304,14 +319,20 @@ export class Menu extends LitElement {
|
|
|
304
319
|
'has-overflow': this.hasOverflow,
|
|
305
320
|
};
|
|
306
321
|
}
|
|
307
|
-
|
|
322
|
+
handleListFocus() {
|
|
308
323
|
this.focusRing.visible = shouldShowStrongFocus();
|
|
309
324
|
}
|
|
310
|
-
|
|
325
|
+
handleListClick() {
|
|
311
326
|
pointerPress();
|
|
312
327
|
this.focusRing.visible = shouldShowStrongFocus();
|
|
313
328
|
}
|
|
314
|
-
|
|
329
|
+
// Capture so that we can grab the event before it reaches the list item
|
|
330
|
+
// istelf. Specifically useful for the case where typeahead encounters a space
|
|
331
|
+
// and we don't want the menu item to close the menu.
|
|
332
|
+
handleListKeydown(e) {
|
|
333
|
+
this.typeaheadController.onKeydown(e);
|
|
334
|
+
}
|
|
335
|
+
handleListBlur() {
|
|
315
336
|
this.focusRing.visible = false;
|
|
316
337
|
}
|
|
317
338
|
/**
|
|
@@ -482,14 +503,14 @@ export class Menu extends LitElement {
|
|
|
482
503
|
}
|
|
483
504
|
connectedCallback() {
|
|
484
505
|
super.connectedCallback();
|
|
485
|
-
if (
|
|
506
|
+
if (!isServer) {
|
|
486
507
|
window.addEventListener('click', this.onWindowClick, { capture: true });
|
|
487
508
|
}
|
|
488
509
|
}
|
|
489
510
|
disconnectedCallback() {
|
|
490
511
|
super.disconnectedCallback();
|
|
491
|
-
if (
|
|
492
|
-
window.removeEventListener('click', this.onWindowClick);
|
|
512
|
+
if (!isServer) {
|
|
513
|
+
window.removeEventListener('click', this.onWindowClick, { capture: true });
|
|
493
514
|
}
|
|
494
515
|
}
|
|
495
516
|
onCloseMenu(e) {
|
|
@@ -502,6 +523,18 @@ export class Menu extends LitElement {
|
|
|
502
523
|
item.active = false;
|
|
503
524
|
}
|
|
504
525
|
}
|
|
526
|
+
handleDeactivateTypeahead(e) {
|
|
527
|
+
// stopPropagation so that this does not deactivate any typeaheads in menus
|
|
528
|
+
// nested above it e.g. md-sub-menu-item
|
|
529
|
+
e.stopPropagation();
|
|
530
|
+
this.typeaheadActive = false;
|
|
531
|
+
}
|
|
532
|
+
handleActivateTypeahead(e) {
|
|
533
|
+
// stopPropagation so that this does not activate any typeaheads in menus
|
|
534
|
+
// nested above it e.g. md-sub-menu-item
|
|
535
|
+
e.stopPropagation();
|
|
536
|
+
this.typeaheadActive = true;
|
|
537
|
+
}
|
|
505
538
|
focus() {
|
|
506
539
|
this.listElement?.focus();
|
|
507
540
|
}
|
|
@@ -538,7 +571,7 @@ __decorate([
|
|
|
538
571
|
], Menu.prototype, "ariaLabel", void 0);
|
|
539
572
|
__decorate([
|
|
540
573
|
property({ attribute: false }),
|
|
541
|
-
__metadata("design:type",
|
|
574
|
+
__metadata("design:type", Object)
|
|
542
575
|
], Menu.prototype, "anchor", void 0);
|
|
543
576
|
__decorate([
|
|
544
577
|
property({ type: Boolean }),
|
|
@@ -568,6 +601,11 @@ __decorate([
|
|
|
568
601
|
property({ type: Number, attribute: 'list-tab-index' }),
|
|
569
602
|
__metadata("design:type", Object)
|
|
570
603
|
], Menu.prototype, "listTabIndex", void 0);
|
|
604
|
+
__decorate([
|
|
605
|
+
ariaProperty,
|
|
606
|
+
property({ type: String, attribute: 'data-role', noAccessor: true }),
|
|
607
|
+
__metadata("design:type", String)
|
|
608
|
+
], Menu.prototype, "role", void 0);
|
|
571
609
|
__decorate([
|
|
572
610
|
property({ type: Number, attribute: 'typeahead-delay' }),
|
|
573
611
|
__metadata("design:type", Object)
|
|
@@ -592,4 +630,14 @@ __decorate([
|
|
|
592
630
|
property({ type: String, attribute: 'default-focus' }),
|
|
593
631
|
__metadata("design:type", String)
|
|
594
632
|
], Menu.prototype, "defaultFocus", void 0);
|
|
633
|
+
__decorate([
|
|
634
|
+
state(),
|
|
635
|
+
__metadata("design:type", Object)
|
|
636
|
+
], Menu.prototype, "typeaheadActive", void 0);
|
|
637
|
+
__decorate([
|
|
638
|
+
eventOptions({ capture: true }),
|
|
639
|
+
__metadata("design:type", Function),
|
|
640
|
+
__metadata("design:paramtypes", [KeyboardEvent]),
|
|
641
|
+
__metadata("design:returntype", void 0)
|
|
642
|
+
], Menu.prototype, "handleListKeydown", null);
|
|
595
643
|
//# sourceMappingURL=menu.js.map
|