@material/web 1.0.0-pre.3 → 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/LICENSE +1 -1
- package/README.md +41 -41
- 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/{list/lib/listitem/list-item-private-styles.scss → chips/lib/assist-styles.scss} +2 -2
- 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/{menu/lib/menuitem/menu-item-private-styles.scss → chips/lib/suggestion-styles.scss} +2 -2
- package/chips/suggestion-chip.d.ts +20 -0
- package/chips/suggestion-chip.js +24 -0
- package/chips/suggestion-chip.js.map +1 -0
- package/controller/form-controller.d.ts +1 -1
- package/controller/form-controller.js +21 -29
- package/controller/form-controller.js.map +1 -1
- 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/_content.scss +91 -13
- package/field/lib/_filled-field.scss +19 -57
- package/field/lib/_label.scss +1 -2
- package/field/lib/_md-comp-filled-field.scss +123 -64
- package/field/lib/_md-comp-outlined-field.scss +100 -59
- package/field/lib/_outlined-field.scss +13 -11
- package/field/lib/_shared.scss +21 -17
- package/field/lib/field.d.ts +6 -2
- package/field/lib/field.js +80 -62
- package/field/lib/field.js.map +1 -1
- package/field/lib/filled-field.d.ts +0 -5
- package/field/lib/filled-field.js +2 -41
- package/field/lib/filled-field.js.map +1 -1
- package/field/lib/filled-styles.css.js +1 -1
- package/field/lib/filled-styles.css.js.map +1 -1
- package/field/lib/outlined-field.js +1 -1
- package/field/lib/outlined-field.js.map +1 -1
- package/field/lib/outlined-styles.css.js +1 -1
- package/field/lib/outlined-styles.css.js.map +1 -1
- package/field/lib/shared-styles.css.js +1 -1
- package/field/lib/shared-styles.css.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/icon/lib/_icon.scss +1 -1
- package/icon/lib/_md-comp-icon.scss +1 -2
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-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 +34 -17
- 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 +312 -124
- 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 +8 -6
- package/list/lib/listitem/list-item.js +26 -27
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/list-item-link.d.ts +18 -0
- package/list/list-item-link.js +19 -2
- package/list/list-item-link.js.map +1 -1
- package/list/list-item.d.ts +19 -0
- package/list/list-item.js +20 -2
- package/list/list-item.js.map +1 -1
- package/menu/lib/_menu.scss +26 -8
- 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 +76 -27
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +39 -79
- 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.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 -1
- package/menu/lib/submenuitem/sub-menu-item.js +9 -3
- 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/menu/menu-item-link.js +1 -2
- package/menu/menu-item-link.js.map +1 -1
- package/menu/menu-item.js +2 -3
- package/menu/menu-item.js.map +1 -1
- package/menu/sub-menu-item.js +1 -2
- package/menu/sub-menu-item.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 +99 -103
- package/textfield/lib/_icon.scss +11 -55
- package/textfield/lib/_input.scss +4 -6
- package/textfield/lib/_outlined-text-field.scss +88 -95
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/outlined-styles.css.js +1 -1
- package/textfield/lib/outlined-styles.css.js.map +1 -1
- package/textfield/lib/shared-styles.css.js +1 -1
- package/textfield/lib/shared-styles.css.js.map +1 -1
- 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/tokens/{v0_160 → v0_161}/_md-comp-assist-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-badge.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-banner.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-bottom-app-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-carousel-item.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-checkbox.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-circular-progress-indicator.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-data-table.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-input-modal.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-picker-docked.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-picker-modal.scss +3 -3
- package/tokens/{v0_160 → v0_161}/_md-comp-dialog.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-divider.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-elevated-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-elevated-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-branded.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-primary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-secondary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-surface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-tertiary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-branded-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-branded.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-autocomplete.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-select.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-text-field.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-tonal-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-tonal-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filter-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-full-screen-dialog.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-input-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-linear-progress-indicator.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-list.scss +1 -1
- package/tokens/v0_161/_md-comp-menu.scss +37 -0
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-drawer.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-rail.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-autocomplete.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-segmented-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-select.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-text-field.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-plain-tooltip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-primary-navigation-tab.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-radio-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-rich-tooltip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-scrim.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-search-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-search-view.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-secondary-navigation-tab.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-bottom.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-floating.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-side.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-slider.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-snackbar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-standard-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-suggestion-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-switch.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-text-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-time-input.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-time-picker.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-medium.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-small-centered.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-ref-palette.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-ref-typeface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-color.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-elevation.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-motion.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-shape.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-state.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-typescale.scss +1 -1
- 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-styles.scss +0 -10
- 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/controller/foundation.d.ts +0 -24
- package/controller/foundation.js +0 -18
- package/controller/foundation.js.map +0 -1
- package/controller/observer-foundation.d.ts +0 -25
- package/controller/observer-foundation.js +0 -37
- package/controller/observer-foundation.js.map +0 -1
- package/controller/observer.d.ts +0 -52
- package/controller/observer.js +0 -149
- package/controller/observer.js.map +0 -1
- package/decorators/bound.d.ts +0 -40
- package/decorators/bound.js +0 -49
- package/decorators/bound.js.map +0 -1
- package/list/lib/avatar/_list-item-avatar.scss +0 -40
- package/list/lib/avatar/list-item-avatar-styles.css.d.ts +0 -1
- package/list/lib/avatar/list-item-avatar-styles.css.js +0 -9
- package/list/lib/avatar/list-item-avatar-styles.css.js.map +0 -1
- package/list/lib/avatar/list-item-avatar-styles.scss +0 -10
- package/list/lib/avatar/list-item-avatar.d.ts +0 -21
- package/list/lib/avatar/list-item-avatar.js +0 -48
- package/list/lib/avatar/list-item-avatar.js.map +0 -1
- package/list/lib/icon/_list-item-icon.scss +0 -71
- package/list/lib/icon/list-item-icon-styles.css.d.ts +0 -1
- package/list/lib/icon/list-item-icon-styles.css.js +0 -9
- package/list/lib/icon/list-item-icon-styles.css.js.map +0 -1
- package/list/lib/icon/list-item-icon-styles.scss +0 -10
- package/list/lib/icon/list-item-icon.d.ts +0 -9
- package/list/lib/icon/list-item-icon.js +0 -15
- package/list/lib/icon/list-item-icon.js.map +0 -1
- package/list/lib/image/_list-item-image.scss +0 -63
- package/list/lib/image/list-item-image-styles.css.d.ts +0 -1
- package/list/lib/image/list-item-image-styles.css.js +0 -9
- package/list/lib/image/list-item-image-styles.css.js.map +0 -1
- package/list/lib/image/list-item-image-styles.scss +0 -10
- package/list/lib/image/list-item-image.d.ts +0 -21
- package/list/lib/image/list-item-image.js +0 -48
- package/list/lib/image/list-item-image.js.map +0 -1
- package/list/lib/listitem/list-item-private-styles.css.d.ts +0 -1
- package/list/lib/listitem/list-item-private-styles.css.js +0 -9
- package/list/lib/listitem/list-item-private-styles.css.js.map +0 -1
- package/list/lib/video/_list-item-video.scss +0 -71
- package/list/lib/video/list-item-video-styles.css.d.ts +0 -1
- package/list/lib/video/list-item-video-styles.css.js +0 -9
- package/list/lib/video/list-item-video-styles.css.js.map +0 -1
- package/list/lib/video/list-item-video-styles.scss +0 -10
- package/list/lib/video/list-item-video.d.ts +0 -53
- package/list/lib/video/list-item-video.js +0 -115
- package/list/lib/video/list-item-video.js.map +0 -1
- package/list/list-item-avatar.d.ts +0 -20
- package/list/list-item-avatar.js +0 -23
- package/list/list-item-avatar.js.map +0 -1
- package/list/list-item-icon.d.ts +0 -20
- package/list/list-item-icon.js +0 -23
- package/list/list-item-icon.js.map +0 -1
- package/list/list-item-image.d.ts +0 -20
- package/list/list-item-image.js +0 -23
- package/list/list-item-image.js.map +0 -1
- package/list/list-item-video.d.ts +0 -20
- package/list/list-item-video.js +0 -23
- package/list/list-item-video.js.map +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.d.ts +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.js +0 -9
- package/menu/lib/menuitem/menu-item-private-styles.css.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-styles.scss +0 -10
- 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/_md-comp-menu.scss +0 -121
- /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
- /package/tokens/{v0_160 → v0_161}/_index.scss +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.d.ts +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.js +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.js.map +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.scss +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.d.ts +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.js +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.js.map +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.scss +0 -0
|
@@ -25,14 +25,15 @@ export class ListItemEl extends LitElement {
|
|
|
25
25
|
*/
|
|
26
26
|
this.headline = '';
|
|
27
27
|
/**
|
|
28
|
-
* The one-line supporting text below the headline.
|
|
28
|
+
* The one-line supporting text below the headline. Set
|
|
29
|
+
* `multiLineSupportingText` to `true` to support multiple lines in the
|
|
30
|
+
* supporting text.
|
|
29
31
|
*/
|
|
30
32
|
this.supportingText = '';
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
* truthy value, overrides the visibility and behavior of `supportingText`.
|
|
34
|
+
* Modifies `supportingText` to support multiple lines.
|
|
34
35
|
*/
|
|
35
|
-
this.multiLineSupportingText =
|
|
36
|
+
this.multiLineSupportingText = false;
|
|
36
37
|
/**
|
|
37
38
|
* The supporting text placed at the end of the item. Overriden by elements
|
|
38
39
|
* slotted into the `end` slot.
|
|
@@ -90,13 +91,11 @@ export class ListItemEl extends LitElement {
|
|
|
90
91
|
}
|
|
91
92
|
render() {
|
|
92
93
|
return this.renderListItem(html `
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
<div class="content-wrapper">
|
|
95
|
+
${this.renderStart()}
|
|
96
|
+
${this.renderBody()}
|
|
97
|
+
${this.renderEnd()}
|
|
97
98
|
${this.renderRipple()}
|
|
98
|
-
</div>
|
|
99
|
-
<div class="focus-ring">
|
|
100
99
|
${this.renderFocusRing()}
|
|
101
100
|
</div>`);
|
|
102
101
|
}
|
|
@@ -134,18 +133,17 @@ export class ListItemEl extends LitElement {
|
|
|
134
133
|
* Handles rendering of the focus ring.
|
|
135
134
|
*/
|
|
136
135
|
renderFocusRing() {
|
|
137
|
-
return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`;
|
|
136
|
+
return html `<md-focus-ring class="focus-ring" .visible="${this.showFocusRing}"></md-focus-ring>`;
|
|
138
137
|
}
|
|
139
138
|
/**
|
|
140
139
|
* Classes applied to the list item root.
|
|
141
140
|
*/
|
|
142
141
|
getRenderClasses() {
|
|
143
142
|
return {
|
|
144
|
-
'with-one-line': this.supportingText === ''
|
|
145
|
-
'with-two-line': this.supportingText !== '' && this.multiLineSupportingText
|
|
146
|
-
'with-three-line': this.
|
|
147
|
-
'disabled': this.disabled
|
|
148
|
-
'enabled': !this.disabled,
|
|
143
|
+
'with-one-line': this.supportingText === '',
|
|
144
|
+
'with-two-line': this.supportingText !== '' && !this.multiLineSupportingText,
|
|
145
|
+
'with-three-line': this.supportingText !== '' && this.multiLineSupportingText,
|
|
146
|
+
'disabled': this.disabled
|
|
149
147
|
};
|
|
150
148
|
}
|
|
151
149
|
/**
|
|
@@ -158,10 +156,7 @@ export class ListItemEl extends LitElement {
|
|
|
158
156
|
* Handles rendering the headline and supporting text.
|
|
159
157
|
*/
|
|
160
158
|
renderBody() {
|
|
161
|
-
const supportingText = this.
|
|
162
|
-
this.renderMultiLineSupportingText() :
|
|
163
|
-
this.supportingText !== '' ? this.renderSupportingText() :
|
|
164
|
-
'';
|
|
159
|
+
const supportingText = this.supportingText !== '' ? this.renderSupportingText() : '';
|
|
165
160
|
return html `<div class="body"
|
|
166
161
|
><span class="label-text">${this.headline}</span>${supportingText}</div>`;
|
|
167
162
|
}
|
|
@@ -169,14 +164,15 @@ export class ListItemEl extends LitElement {
|
|
|
169
164
|
* Renders the one-line supporting text.
|
|
170
165
|
*/
|
|
171
166
|
renderSupportingText() {
|
|
172
|
-
return html `<span
|
|
167
|
+
return html `<span
|
|
168
|
+
class="supporting-text ${classMap(this.getSupportingTextClasses())}"
|
|
169
|
+
>${this.supportingText}</span>`;
|
|
173
170
|
}
|
|
174
171
|
/**
|
|
175
|
-
*
|
|
172
|
+
* Gets the classes for the supporting text node
|
|
176
173
|
*/
|
|
177
|
-
|
|
178
|
-
return
|
|
179
|
-
>${this.multiLineSupportingText}</span>`;
|
|
174
|
+
getSupportingTextClasses() {
|
|
175
|
+
return { 'supporting-text--multi-line': this.multiLineSupportingText };
|
|
180
176
|
}
|
|
181
177
|
/**
|
|
182
178
|
* The content rendered at the end of the list item.
|
|
@@ -216,10 +212,13 @@ export class ListItemEl extends LitElement {
|
|
|
216
212
|
// update or else it may cause the page to jump on first load.
|
|
217
213
|
if (changed.has('active') && !this.isFirstUpdate && this.active &&
|
|
218
214
|
this.focusOnSelection) {
|
|
219
|
-
this.
|
|
215
|
+
this.focus();
|
|
220
216
|
}
|
|
221
217
|
this.isFirstUpdate = false;
|
|
222
218
|
}
|
|
219
|
+
focus() {
|
|
220
|
+
this.listItemRoot?.focus?.();
|
|
221
|
+
}
|
|
223
222
|
}
|
|
224
223
|
__decorate([
|
|
225
224
|
ariaProperty
|
|
@@ -249,7 +248,7 @@ __decorate([
|
|
|
249
248
|
__metadata("design:type", Object)
|
|
250
249
|
], ListItemEl.prototype, "supportingText", void 0);
|
|
251
250
|
__decorate([
|
|
252
|
-
property(),
|
|
251
|
+
property({ type: Boolean }),
|
|
253
252
|
__metadata("design:type", Object)
|
|
254
253
|
], ListItemEl.prototype, "multiLineSupportingText", void 0);
|
|
255
254
|
__decorate([
|
|
@@ -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;;WAEG;QACS,mBAAc,GAAG,EAAE,CAAC;QAEhC;;;WAGG;QACS,4BAAuB,GAAG,EAAE,CAAC;QAEzC;;;WAGG;QACS,2BAAsB,GAAG,EAAE,CAAC;QAExC;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;;;;WAKG;QACuB,iBAAY,GAAG,CAAC,CAAC,CAAC;QAE5C;;;;WAIG;QACwC,WAAM,GAAG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B,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.\n */\n @property() supportingText = '';\n\n /**\n * The multi-line supporting text below the headline. __NOTE:__ if set to a\n * truthy value, overrides the visibility and behavior of `supportingText`.\n */\n @property() multiLineSupportingText = '';\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 ${this.renderStart()}\n ${this.renderBody()}\n ${this.renderEnd()}\n <div class=\"ripple\">\n ${this.renderRipple()}\n </div>\n <div class=\"focus-ring\">\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 .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':\n this.supportingText === '' && this.multiLineSupportingText === '',\n 'with-two-line':\n this.supportingText !== '' && this.multiLineSupportingText === '',\n 'with-three-line': this.multiLineSupportingText !== '',\n 'disabled': this.disabled,\n 'enabled': !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 = this.multiLineSupportingText !== '' ?\n this.renderMultiLineSupportingText() :\n this.supportingText !== '' ? this.renderSupportingText() :\n '';\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 class=\"supporting-text\">${this.supportingText}</span>`;\n }\n\n /**\n * Renders the multi-line supporting text\n */\n protected renderMultiLineSupportingText(): TemplateResult {\n return html`<span class=\"supporting-text supporting-text--multi-line\"\n >${this.multiLineSupportingText}</span>`;\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,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EAAE,OAAO,EAAC,CAAC;;4CAAkB;AAQ5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;gDAAmB;AAO5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;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/list/list-item-link.d.ts
CHANGED
|
@@ -27,6 +27,24 @@ declare global {
|
|
|
27
27
|
* item in a collection and act on it.
|
|
28
28
|
* - Lists should present icons, text, and actions in a consistent format.
|
|
29
29
|
*
|
|
30
|
+
* Example slottable child variants are:
|
|
31
|
+
*
|
|
32
|
+
* - `video[data-variant=video]`
|
|
33
|
+
* - `img,span[data-variant=avatar]`
|
|
34
|
+
* - `img[data-variant=image]`
|
|
35
|
+
* - `md-icon[data-variant=icon]`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <md-list-item-link
|
|
40
|
+
* headline="User Name"
|
|
41
|
+
* supportingText="user@name.com"
|
|
42
|
+
* href="/accounts">
|
|
43
|
+
* <md-icon data-variant="icon" slot="start">account_circle</md-icon>
|
|
44
|
+
* <md-icon data-variant="icon" slot="end">open_in_new</md-icon>
|
|
45
|
+
* </md-list-item-link>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
30
48
|
* @final
|
|
31
49
|
* @suppress {visibility}
|
|
32
50
|
*/
|
package/list/list-item-link.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
7
|
import { customElement } from 'lit/decorators.js';
|
|
8
|
-
import { styles as privateProps } from './lib/listitem/list-item-private-styles.css.js';
|
|
9
8
|
import { styles } from './lib/listitem/list-item-styles.css.js';
|
|
10
9
|
import { ListItemLink } from './lib/listitemlink/list-item-link.js';
|
|
11
10
|
/**
|
|
@@ -26,12 +25,30 @@ import { ListItemLink } from './lib/listitemlink/list-item-link.js';
|
|
|
26
25
|
* item in a collection and act on it.
|
|
27
26
|
* - Lists should present icons, text, and actions in a consistent format.
|
|
28
27
|
*
|
|
28
|
+
* Example slottable child variants are:
|
|
29
|
+
*
|
|
30
|
+
* - `video[data-variant=video]`
|
|
31
|
+
* - `img,span[data-variant=avatar]`
|
|
32
|
+
* - `img[data-variant=image]`
|
|
33
|
+
* - `md-icon[data-variant=icon]`
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```html
|
|
37
|
+
* <md-list-item-link
|
|
38
|
+
* headline="User Name"
|
|
39
|
+
* supportingText="user@name.com"
|
|
40
|
+
* href="/accounts">
|
|
41
|
+
* <md-icon data-variant="icon" slot="start">account_circle</md-icon>
|
|
42
|
+
* <md-icon data-variant="icon" slot="end">open_in_new</md-icon>
|
|
43
|
+
* </md-list-item-link>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
29
46
|
* @final
|
|
30
47
|
* @suppress {visibility}
|
|
31
48
|
*/
|
|
32
49
|
let MdListItemLink = class MdListItemLink extends ListItemLink {
|
|
33
50
|
};
|
|
34
|
-
MdListItemLink.styles = [
|
|
51
|
+
MdListItemLink.styles = [styles];
|
|
35
52
|
MdListItemLink = __decorate([
|
|
36
53
|
customElement('md-list-item-link')
|
|
37
54
|
], MdListItemLink);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-link.js","sourceRoot":"","sources":["list-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"list-item-link.js","sourceRoot":"","sources":["list-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,EAAC,MAAM,wCAAwC,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAQlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,YAAY;;AAC9B,qBAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AADvB,cAAc;IAD1B,aAAa,CAAC,mBAAmB,CAAC;GACtB,cAAc,CAE1B;SAFY,cAAc","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles} from './lib/listitem/list-item-styles.css.js';\nimport {ListItemLink} from './lib/listitemlink/list-item-link.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-list-item-link': MdListItemLink;\n }\n}\n\n/**\n * @summary\n * Lists are continuous, vertical indexes of text or images. Items are placed\n * inside the list. This is a linkable variant.\n *\n * @description\n * Lists consist of one or more list items, and can contain actions represented\n * by icons and text. List items come in three sizes: one-line, two-line, and\n * three-line.\n *\n * __Takeaways:__\n *\n * - Lists should be sorted in logical ways that make content easy to scan, such\n * as alphabetical, numerical, chronological, or by user preference.\n * - Lists present content in a way that makes it easy to identify a specific\n * item in a collection and act on it.\n * - Lists should present icons, text, and actions in a consistent format.\n *\n * Example slottable child variants are:\n *\n * - `video[data-variant=video]`\n * - `img,span[data-variant=avatar]`\n * - `img[data-variant=image]`\n * - `md-icon[data-variant=icon]`\n *\n * @example\n * ```html\n * <md-list-item-link\n * headline=\"User Name\"\n * supportingText=\"user@name.com\"\n * href=\"/accounts\">\n * <md-icon data-variant=\"icon\" slot=\"start\">account_circle</md-icon>\n * <md-icon data-variant=\"icon\" slot=\"end\">open_in_new</md-icon>\n * </md-list-item-link>\n * ```\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-list-item-link')\nexport class MdListItemLink extends ListItemLink {\n static override styles = [styles];\n}\n"]}
|
package/list/list-item.d.ts
CHANGED
|
@@ -27,6 +27,25 @@ declare global {
|
|
|
27
27
|
* item in a collection and act on it.
|
|
28
28
|
* - Lists should present icons, text, and actions in a consistent format.
|
|
29
29
|
*
|
|
30
|
+
* Acceptable slottable child variants are:
|
|
31
|
+
*
|
|
32
|
+
* - `video[data-variant=video]`
|
|
33
|
+
* - `img,span[data-variant=avatar]`
|
|
34
|
+
* - `img[data-variant=image]`
|
|
35
|
+
* - `md-icon[data-variant=icon]`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <md-list-item
|
|
40
|
+
* headline="User Name"
|
|
41
|
+
* supportingText="user@name.com">
|
|
42
|
+
* <md-icon data-variant="icon" slot="start">account_circle</md-icon>
|
|
43
|
+
* <md-icon data-variant="icon" slot="end">check</md-icon>
|
|
44
|
+
* </md-list-item>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
*
|
|
30
49
|
* @final
|
|
31
50
|
* @suppress {visibility}
|
|
32
51
|
*/
|
package/list/list-item.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
7
|
import { customElement } from 'lit/decorators.js';
|
|
8
8
|
import { ListItemEl as ListItem } from './lib/listitem/list-item.js';
|
|
9
|
-
import { styles as privateProps } from './lib/listitem/list-item-private-styles.css.js';
|
|
10
9
|
import { styles } from './lib/listitem/list-item-styles.css.js';
|
|
11
10
|
/**
|
|
12
11
|
* @summary
|
|
@@ -26,12 +25,31 @@ import { styles } from './lib/listitem/list-item-styles.css.js';
|
|
|
26
25
|
* item in a collection and act on it.
|
|
27
26
|
* - Lists should present icons, text, and actions in a consistent format.
|
|
28
27
|
*
|
|
28
|
+
* Acceptable slottable child variants are:
|
|
29
|
+
*
|
|
30
|
+
* - `video[data-variant=video]`
|
|
31
|
+
* - `img,span[data-variant=avatar]`
|
|
32
|
+
* - `img[data-variant=image]`
|
|
33
|
+
* - `md-icon[data-variant=icon]`
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```html
|
|
37
|
+
* <md-list-item
|
|
38
|
+
* headline="User Name"
|
|
39
|
+
* supportingText="user@name.com">
|
|
40
|
+
* <md-icon data-variant="icon" slot="start">account_circle</md-icon>
|
|
41
|
+
* <md-icon data-variant="icon" slot="end">check</md-icon>
|
|
42
|
+
* </md-list-item>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
*
|
|
29
47
|
* @final
|
|
30
48
|
* @suppress {visibility}
|
|
31
49
|
*/
|
|
32
50
|
let MdListItem = class MdListItem extends ListItem {
|
|
33
51
|
};
|
|
34
|
-
MdListItem.styles = [
|
|
52
|
+
MdListItem.styles = [styles];
|
|
35
53
|
MdListItem = __decorate([
|
|
36
54
|
customElement('md-list-item')
|
|
37
55
|
], MdListItem);
|
package/list/list-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,UAAU,IAAI,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,UAAU,IAAI,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,wCAAwC,CAAC;AAQ9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,QAAQ;;AACtB,iBAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AADvB,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CAEtB;SAFY,UAAU","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {ListItemEl as ListItem} from './lib/listitem/list-item.js';\nimport {styles} from './lib/listitem/list-item-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-list-item': MdListItem;\n }\n}\n\n/**\n * @summary\n * Lists are continuous, vertical indexes of text or images. Items are placed\n * inside the list.\n *\n * @description\n * Lists consist of one or more list items, and can contain actions represented\n * by icons and text. List items come in three sizes: one-line, two-line, and\n * three-line.\n *\n * __Takeaways:__\n *\n * - Lists should be sorted in logical ways that make content easy to scan, such\n * as alphabetical, numerical, chronological, or by user preference.\n * - Lists present content in a way that makes it easy to identify a specific\n * item in a collection and act on it.\n * - Lists should present icons, text, and actions in a consistent format.\n *\n * Acceptable slottable child variants are:\n *\n * - `video[data-variant=video]`\n * - `img,span[data-variant=avatar]`\n * - `img[data-variant=image]`\n * - `md-icon[data-variant=icon]`\n *\n * @example\n * ```html\n * <md-list-item\n * headline=\"User Name\"\n * supportingText=\"user@name.com\">\n * <md-icon data-variant=\"icon\" slot=\"start\">account_circle</md-icon>\n * <md-icon data-variant=\"icon\" slot=\"end\">check</md-icon>\n * </md-list-item>\n * ```\n *\n * @example\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-list-item')\nexport class MdListItem extends ListItem {\n static override styles = [styles];\n}\n"]}
|
package/menu/lib/_menu.scss
CHANGED
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
|
+
@use 'sass:list';
|
|
7
8
|
@use 'sass:map';
|
|
9
|
+
@use 'sass:string';
|
|
8
10
|
// go/keep-sorted end
|
|
9
11
|
// go/keep-sorted start
|
|
10
|
-
@use '../../elevation/
|
|
12
|
+
@use '../../elevation/elevation';
|
|
11
13
|
@use '../../focus/focus-ring';
|
|
12
|
-
@use '../../list/list';
|
|
13
|
-
@use '../../
|
|
14
|
+
@use '../../list/list' as md-list;
|
|
15
|
+
@use '../../list/list-item';
|
|
14
16
|
@use '../../sass/theme';
|
|
15
17
|
@use '../../tokens';
|
|
16
|
-
@use './menuitem/menu-item';
|
|
17
18
|
// go/keep-sorted end
|
|
18
19
|
|
|
19
20
|
$_custom-property-prefix: 'menu';
|
|
@@ -36,9 +37,9 @@ $_custom-property-prefix: 'menu';
|
|
|
36
37
|
--_#{$token}: #{$value};
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
@include list.theme(
|
|
40
|
+
@include md-list.theme(
|
|
40
41
|
(
|
|
41
|
-
container-color: var(--_container-color),
|
|
42
|
+
list-item-container-color: var(--_container-color),
|
|
42
43
|
)
|
|
43
44
|
);
|
|
44
45
|
|
|
@@ -55,6 +56,8 @@ $_custom-property-prefix: 'menu';
|
|
|
55
56
|
shape: var(--_container-shape),
|
|
56
57
|
)
|
|
57
58
|
);
|
|
59
|
+
|
|
60
|
+
min-width: 300px;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
.menu {
|
|
@@ -66,6 +69,7 @@ $_custom-property-prefix: 'menu';
|
|
|
66
69
|
user-select: none;
|
|
67
70
|
max-height: inherit;
|
|
68
71
|
height: inherit;
|
|
72
|
+
min-width: inherit;
|
|
69
73
|
|
|
70
74
|
&.fixed {
|
|
71
75
|
position: fixed;
|
|
@@ -76,6 +80,7 @@ $_custom-property-prefix: 'menu';
|
|
|
76
80
|
max-height: inherit;
|
|
77
81
|
display: block;
|
|
78
82
|
overflow: auto;
|
|
83
|
+
min-width: inherit;
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
&.has-overflow md-list {
|
|
@@ -101,10 +106,23 @@ $_custom-property-prefix: 'menu';
|
|
|
101
106
|
md-elevation {
|
|
102
107
|
position: absolute;
|
|
103
108
|
inset: 0;
|
|
104
|
-
pointer-events: none;
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
@function _resolve-tokens($tokens) {
|
|
109
|
-
|
|
113
|
+
// removes unused tokens
|
|
114
|
+
$unused-tokens: ();
|
|
115
|
+
@each $token in map-keys($tokens) {
|
|
116
|
+
$index: string.index($token, 'list-item');
|
|
117
|
+
|
|
118
|
+
@if $index {
|
|
119
|
+
$unused-tokens: list.append($unused-tokens, $token);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@each $token in $unused-tokens {
|
|
124
|
+
$tokens: map.remove($tokens, $token);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@return $tokens;
|
|
110
128
|
}
|
|
@@ -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{--
|
|
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{--
|
|
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;
|