@material/web 1.0.0-pre.6 → 1.0.0-pre.8
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 +8 -8
- package/aria/aria.d.ts +43 -0
- package/aria/aria.js +80 -0
- package/aria/aria.js.map +1 -0
- package/aria/delegate.d.ts +37 -0
- package/aria/delegate.js +53 -0
- package/aria/delegate.js.map +1 -0
- package/badge/badge.d.ts +0 -1
- package/badge/badge.js +0 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/badge.d.ts +5 -7
- package/badge/lib/badge.js +9 -12
- package/badge/lib/badge.js.map +1 -1
- package/button/lib/_elevated-button.scss +35 -6
- package/button/lib/_elevation.scss +13 -3
- package/button/lib/_filled-button.scss +35 -3
- package/button/lib/_outlined-button.scss +35 -6
- package/button/lib/_shared.scss +4 -2
- package/button/lib/_text-button.scss +35 -6
- package/button/lib/_tonal-button.scss +34 -7
- package/button/lib/button.d.ts +24 -38
- package/button/lib/button.js +40 -89
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-button.d.ts +6 -4
- package/button/lib/elevated-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-button.d.ts +6 -4
- package/button/lib/filled-button.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-button.d.ts +6 -4
- package/button/lib/outlined-button.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-elevation-styles.css.js +1 -1
- package/button/lib/shared-elevation-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-button.d.ts +5 -2
- package/button/lib/text-button.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-button.d.ts +6 -4
- package/button/lib/tonal-button.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 +48 -47
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox.d.ts +2 -7
- package/checkbox/lib/checkbox.js +35 -62
- package/checkbox/lib/checkbox.js.map +1 -1
- package/checkbox/lib/forced-colors-styles.css.js +1 -1
- package/checkbox/lib/forced-colors-styles.css.js.map +1 -1
- package/chips/_filter-chip.scss +6 -0
- package/chips/assist-chip.js +2 -1
- package/chips/assist-chip.js.map +1 -1
- package/chips/filter-chip.d.ts +20 -0
- package/chips/filter-chip.js +25 -0
- package/chips/filter-chip.js.map +1 -0
- package/chips/lib/_assist-chip.scss +37 -3
- package/chips/lib/_elevated.scss +60 -0
- package/chips/lib/_filter-chip.scss +175 -0
- package/chips/lib/_shared.scss +48 -84
- package/chips/lib/_suggestion-chip.scss +36 -5
- package/chips/lib/assist-chip.d.ts +12 -0
- package/chips/lib/assist-chip.js +64 -0
- package/chips/lib/assist-chip.js.map +1 -1
- package/chips/lib/assist-styles.css.js +1 -1
- package/chips/lib/assist-styles.css.js.map +1 -1
- package/chips/lib/chip.d.ts +24 -16
- package/chips/lib/chip.js +53 -74
- package/chips/lib/chip.js.map +1 -1
- package/chips/lib/elevated-styles.css.js +9 -0
- package/chips/lib/elevated-styles.css.js.map +1 -0
- package/{fab/lib/fab-extended-styles.scss → chips/lib/elevated-styles.scss} +3 -3
- package/chips/lib/filter-chip.d.ts +26 -0
- package/chips/lib/filter-chip.js +80 -0
- package/chips/lib/filter-chip.js.map +1 -0
- package/chips/lib/filter-styles.css.js +9 -0
- package/chips/lib/filter-styles.css.js.map +1 -0
- package/chips/lib/filter-styles.scss +10 -0
- package/chips/lib/shared-styles.css.js +1 -1
- package/chips/lib/shared-styles.css.js.map +1 -1
- package/chips/lib/suggestion-chip.d.ts +2 -2
- package/chips/lib/suggestion-chip.js +4 -2
- package/chips/lib/suggestion-chip.js.map +1 -1
- package/chips/lib/suggestion-styles.css.js +1 -1
- package/chips/lib/suggestion-styles.css.js.map +1 -1
- package/chips/suggestion-chip.js +2 -1
- package/chips/suggestion-chip.js.map +1 -1
- package/circularprogress/harness.d.ts +1 -0
- package/circularprogress/harness.js +4 -0
- package/circularprogress/harness.js.map +1 -1
- package/circularprogress/lib/_circular-progress.scss +13 -7
- package/circularprogress/lib/circular-progress-styles.css.js +1 -1
- package/circularprogress/lib/circular-progress-styles.css.js.map +1 -1
- package/circularprogress/lib/circular-progress.d.ts +5 -7
- package/circularprogress/lib/circular-progress.js +17 -21
- package/circularprogress/lib/circular-progress.js.map +1 -1
- package/dialog/lib/_dialog.scss +8 -9
- package/dialog/lib/_tokens.scss +0 -1
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.d.ts +10 -10
- package/dialog/lib/dialog.js +33 -56
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/lib/divider.js +4 -7
- package/divider/lib/divider.js.map +1 -1
- package/elevation/lib/_elevation.scss +5 -7
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/elevation/lib/elevation.d.ts +1 -1
- package/elevation/lib/elevation.js.map +1 -1
- package/fab/_fab.scss +1 -0
- package/fab/branded-fab.d.ts +56 -0
- package/fab/branded-fab.js +56 -0
- package/fab/branded-fab.js.map +1 -0
- package/fab/fab.d.ts +25 -5
- package/fab/fab.js +27 -10
- package/fab/fab.js.map +1 -1
- package/fab/harness.d.ts +1 -2
- package/fab/harness.js +1 -1
- package/fab/harness.js.map +1 -1
- package/fab/lib/_fab-branded.scss +81 -0
- package/fab/lib/_fab.scss +221 -19
- package/fab/lib/_shared.scss +161 -131
- package/fab/lib/fab-branded-styles.css.d.ts +1 -0
- package/fab/lib/fab-branded-styles.css.js +9 -0
- package/fab/lib/fab-branded-styles.css.js.map +1 -0
- package/fab/lib/fab-branded-styles.scss +10 -0
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab.d.ts +18 -10
- package/fab/lib/fab.js +19 -12
- package/fab/lib/fab.js.map +1 -1
- package/fab/lib/forced-colors-styles.css.d.ts +1 -0
- package/fab/lib/forced-colors-styles.css.js +9 -0
- package/fab/lib/forced-colors-styles.css.js.map +1 -0
- package/fab/lib/forced-colors-styles.scss +26 -0
- package/fab/lib/shared-styles.css.d.ts +1 -0
- package/fab/lib/shared-styles.css.js +9 -0
- package/fab/lib/shared-styles.css.js.map +1 -0
- package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
- package/fab/lib/shared.d.ts +49 -0
- package/fab/lib/shared.js +113 -0
- package/fab/lib/shared.js.map +1 -0
- package/field/lib/_filled-field.scss +47 -12
- package/field/lib/_outlined-field.scss +39 -12
- package/field/lib/field.js +14 -27
- package/field/lib/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-styles.css.js +1 -1
- package/field/lib/outlined-styles.css.js.map +1 -1
- package/focus/focus-ring.d.ts +2 -1
- package/focus/focus-ring.js +2 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/_focus-ring.scss +49 -34
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/focus/lib/focus-ring.d.ts +59 -12
- package/focus/lib/focus-ring.js +118 -14
- package/focus/lib/focus-ring.js.map +1 -1
- package/icon/icon.d.ts +0 -1
- package/icon/icon.js +0 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +2 -0
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon.d.ts +5 -4
- package/icon/lib/icon.js +3 -2
- package/icon/lib/icon.js.map +1 -1
- package/iconbutton/filled-icon-button.d.ts +6 -2
- package/iconbutton/filled-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button.d.ts +6 -2
- package/iconbutton/filled-tonal-icon-button.js.map +1 -1
- package/iconbutton/harness.d.ts +1 -1
- package/iconbutton/harness.js +4 -1
- package/iconbutton/harness.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +38 -13
- package/iconbutton/lib/_filled-tonal-icon-button.scss +38 -11
- package/iconbutton/lib/_outlined-icon-button.scss +38 -13
- package/iconbutton/lib/_shared.scss +4 -6
- package/iconbutton/lib/_standard-icon-button.scss +14 -14
- 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.d.ts +17 -25
- package/iconbutton/lib/icon-button.js +37 -73
- 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/iconbutton/outlined-icon-button.d.ts +5 -2
- package/iconbutton/outlined-icon-button.js.map +1 -1
- package/iconbutton/standard-icon-button.d.ts +5 -2
- package/iconbutton/standard-icon-button.js.map +1 -1
- package/linearprogress/_linear-progress.scss +6 -0
- package/linearprogress/harness.d.ts +13 -0
- package/linearprogress/harness.js +18 -0
- package/linearprogress/harness.js.map +1 -0
- package/linearprogress/lib/_linear-progress.scss +386 -0
- package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
- package/linearprogress/lib/linear-progress-styles.css.js +9 -0
- package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
- package/linearprogress/lib/linear-progress-styles.scss +8 -0
- package/linearprogress/lib/linear-progress.d.ts +35 -0
- package/linearprogress/lib/linear-progress.js +127 -0
- package/linearprogress/lib/linear-progress.js.map +1 -0
- package/linearprogress/linear-progress.d.ts +23 -0
- package/linearprogress/linear-progress.js +26 -0
- package/linearprogress/linear-progress.js.map +1 -0
- package/list/lib/_list.scss +9 -50
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/list.d.ts +8 -15
- package/list/lib/list.js +20 -45
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +17 -72
- package/list/lib/listitem/forced-colors-styles.css.js +1 -1
- package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item.d.ts +29 -31
- package/list/lib/listitem/list-item.js +26 -80
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js +5 -9
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/menu/lib/_menu.scss +9 -29
- 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 +32 -41
- package/menu/lib/menu.js +51 -82
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +16 -33
- package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
- package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/lib/menuitem/menu-item.d.ts +1 -1
- package/menu/lib/menuitem/menu-item.js +4 -6
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
- package/menu/lib/menuitemlink/menu-item-link.js +3 -6
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +20 -2
- package/menu/lib/shared.js +18 -0
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +16 -13
- package/menu/lib/submenuitem/sub-menu-item.js +27 -18
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/typeaheadController.d.ts +9 -9
- package/menu/lib/typeaheadController.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +7 -1
- package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
- package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
- package/navigationbar/lib/navigation-bar.d.ts +6 -6
- package/navigationbar/lib/navigation-bar.js +17 -18
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.d.ts +0 -1
- package/navigationbar/navigation-bar.js +0 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
- package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
- package/navigationdrawer/lib/_shared.scss +1 -4
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal.d.ts +7 -12
- package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer.d.ts +6 -10
- package/navigationdrawer/lib/navigation-drawer.js +17 -38
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/lib/shared-styles.css.js +1 -1
- package/navigationdrawer/lib/shared-styles.css.js.map +1 -1
- package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
- package/navigationdrawer/navigation-drawer-modal.js +0 -1
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.d.ts +0 -1
- package/navigationdrawer/navigation-drawer.js +0 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/_navigation-tab.scss +2 -2
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/navigationtab/lib/navigation-tab.d.ts +16 -29
- package/navigationtab/lib/navigation-tab.js +49 -88
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/lib/state.d.ts +1 -1
- package/navigationtab/lib/state.js.map +1 -1
- package/navigationtab/navigation-tab.d.ts +0 -1
- package/navigationtab/navigation-tab.js +0 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/_radio.scss +1 -1
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/radio/lib/radio.d.ts +2 -8
- package/radio/lib/radio.js +31 -58
- package/radio/lib/radio.js.map +1 -1
- package/ripple/lib/ripple.js +11 -13
- package/ripple/lib/ripple.js.map +1 -1
- package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
- package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
- package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
- package/segmentedbutton/lib/segmented-button.d.ts +28 -40
- package/segmentedbutton/lib/segmented-button.js +42 -96
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
- package/segmentedbutton/outlined-segmented-button.js +0 -1
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +32 -13
- package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
- package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/select/_filled-select.scss +6 -0
- package/select/_outlined-select.scss +6 -0
- package/select/filled-select.d.ts +41 -0
- package/select/filled-select.js +46 -0
- package/select/filled-select.js.map +1 -0
- package/select/harness.d.ts +24 -0
- package/select/harness.js +53 -0
- package/select/harness.js.map +1 -0
- package/select/lib/_filled-select.scss +222 -0
- package/select/lib/_outlined-select.scss +180 -0
- package/select/lib/_shared.scss +48 -0
- package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/filled-forced-colors-styles.css.js +9 -0
- package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
- package/select/lib/filled-forced-colors-styles.scss +29 -0
- package/select/lib/filled-select-styles.css.d.ts +1 -0
- package/select/lib/filled-select-styles.css.js +9 -0
- package/select/lib/filled-select-styles.css.js.map +1 -0
- package/select/lib/filled-select-styles.scss +10 -0
- package/select/lib/filled-select.d.ts +10 -0
- package/select/lib/filled-select.js +16 -0
- package/select/lib/filled-select.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/outlined-forced-colors-styles.css.js +9 -0
- package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.scss +29 -0
- package/select/lib/outlined-select-styles.css.d.ts +1 -0
- package/select/lib/outlined-select-styles.css.js +9 -0
- package/select/lib/outlined-select-styles.css.js.map +1 -0
- package/select/lib/outlined-select-styles.scss +10 -0
- package/select/lib/outlined-select.d.ts +10 -0
- package/select/lib/outlined-select.js +16 -0
- package/select/lib/outlined-select.js.map +1 -0
- package/select/lib/select.d.ts +216 -0
- package/select/lib/select.js +589 -0
- package/select/lib/select.js.map +1 -0
- package/select/lib/selectoption/harness.d.ts +11 -0
- package/select/lib/selectoption/harness.js +12 -0
- package/select/lib/selectoption/harness.js.map +1 -0
- package/select/lib/selectoption/select-option.d.ts +30 -0
- package/select/lib/selectoption/select-option.js +71 -0
- package/select/lib/selectoption/select-option.js.map +1 -0
- package/select/lib/shared-styles.css.d.ts +1 -0
- package/select/lib/shared-styles.css.js +9 -0
- package/select/lib/shared-styles.css.js.map +1 -0
- package/select/lib/shared-styles.scss +10 -0
- package/select/lib/shared.d.ts +52 -0
- package/select/lib/shared.js +41 -0
- package/select/lib/shared.js.map +1 -0
- package/select/outlined-select.d.ts +41 -0
- package/select/outlined-select.js +46 -0
- package/select/outlined-select.js.map +1 -0
- package/select/select-option.d.ts +44 -0
- package/select/select-option.js +51 -0
- package/select/select-option.js.map +1 -0
- package/slider/harness.d.ts +2 -1
- package/slider/harness.js +14 -9
- package/slider/harness.js.map +1 -1
- package/slider/lib/_slider.scss +149 -167
- package/slider/lib/forced-colors-styles.css.js +1 -1
- package/slider/lib/forced-colors-styles.css.js.map +1 -1
- package/slider/lib/forced-colors-styles.scss +2 -2
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/slider/lib/slider.d.ts +23 -57
- package/slider/lib/slider.js +77 -167
- package/slider/lib/slider.js.map +1 -1
- package/switch/lib/_switch.scss +63 -18
- package/switch/lib/switch-styles.css.js +1 -1
- package/switch/lib/switch-styles.css.js.map +1 -1
- package/switch/lib/switch.d.ts +0 -7
- package/switch/lib/switch.js +32 -79
- package/switch/lib/switch.js.map +1 -1
- package/textfield/harness.d.ts +1 -1
- package/textfield/harness.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +70 -14
- package/textfield/lib/_outlined-text-field.scss +60 -35
- package/textfield/lib/filled-forced-colors-styles.css.js +1 -1
- package/textfield/lib/filled-forced-colors-styles.css.js.map +1 -1
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/outlined-forced-colors-styles.css.js +1 -1
- package/textfield/lib/outlined-forced-colors-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/text-field.d.ts +1 -11
- package/textfield/lib/text-field.js +45 -115
- package/textfield/lib/text-field.js.map +1 -1
- package/tokens/_index.scss +5 -18
- package/tokens/_md-comp-assist-chip.scss +25 -29
- package/tokens/_md-comp-checkbox.scss +78 -1
- package/tokens/_md-comp-circular-progress-indicator.scss +39 -13
- package/tokens/_md-comp-elevated-button.scss +0 -10
- package/tokens/_md-comp-elevation.scss +0 -4
- package/tokens/_md-comp-fab-branded.scss +84 -1
- package/tokens/_md-comp-fab.scss +249 -0
- package/tokens/_md-comp-filled-button.scss +0 -10
- package/{field/lib → tokens}/_md-comp-filled-field.scss +91 -9
- package/tokens/_md-comp-filled-icon-button.scss +46 -1
- package/tokens/_md-comp-filled-select.scss +124 -1
- package/tokens/_md-comp-filled-text-field.scss +93 -9
- package/tokens/_md-comp-filled-tonal-button.scss +0 -11
- package/tokens/_md-comp-filled-tonal-icon-button.scss +45 -3
- package/tokens/_md-comp-filter-chip.scss +103 -103
- package/tokens/_md-comp-focus-ring.scss +23 -24
- package/tokens/_md-comp-icon-button.scss +37 -1
- package/tokens/_md-comp-input-chip.scss +77 -95
- package/tokens/_md-comp-linear-progress-indicator.scss +31 -3
- package/tokens/_md-comp-list-item.scss +174 -0
- package/tokens/_md-comp-list.scss +81 -26
- package/tokens/_md-comp-menu-item.scss +50 -0
- package/tokens/_md-comp-menu.scss +29 -2
- package/tokens/_md-comp-outlined-button.scss +0 -10
- package/{field/lib → tokens}/_md-comp-outlined-field.scss +85 -9
- package/tokens/_md-comp-outlined-icon-button.scss +41 -1
- package/tokens/_md-comp-outlined-segmented-button.scss +57 -11
- package/tokens/_md-comp-outlined-select.scss +123 -1
- package/tokens/_md-comp-outlined-text-field.scss +85 -8
- package/tokens/_md-comp-slider.scss +13 -1
- package/tokens/_md-comp-suggestion-chip.scss +29 -30
- package/tokens/_md-comp-switch.scss +81 -1
- package/tokens/_md-comp-text-button.scss +0 -10
- package/tokens/_values.scss +2 -4
- package/types/aria.d.ts +59 -1
- package/actionelement/action-element.d.ts +0 -79
- package/actionelement/action-element.js +0 -97
- package/actionelement/action-element.js.map +0 -1
- package/button/lib/state.d.ts +0 -10
- package/button/lib/state.js +0 -7
- package/button/lib/state.js.map +0 -1
- package/controller/action-controller.d.ts +0 -147
- package/controller/action-controller.js +0 -286
- package/controller/action-controller.js.map +0 -1
- package/decorators/aria-property.d.ts +0 -32
- package/decorators/aria-property.js +0 -99
- package/decorators/aria-property.js.map +0 -1
- package/fab/_fab-extended.scss +0 -6
- package/fab/fab-extended.d.ts +0 -23
- package/fab/fab-extended.js +0 -29
- package/fab/fab-extended.js.map +0 -1
- package/fab/lib/_fab-extended.scss +0 -73
- package/fab/lib/fab-extended-styles.css.js +0 -9
- package/fab/lib/fab-extended-styles.css.js.map +0 -1
- package/fab/lib/fab-extended.d.ts +0 -19
- package/fab/lib/fab-extended.js +0 -28
- package/fab/lib/fab-extended.js.map +0 -1
- package/fab/lib/fab-shared-styles.css.js +0 -9
- package/fab/lib/fab-shared-styles.css.js.map +0 -1
- package/fab/lib/fab-shared.d.ts +0 -44
- package/fab/lib/fab-shared.js +0 -121
- package/fab/lib/fab-shared.js.map +0 -1
- package/focus/strong-focus.d.ts +0 -56
- package/focus/strong-focus.js +0 -96
- package/focus/strong-focus.js.map +0 -1
- package/sass/_shape.scss +0 -154
- package/slider/lib/_tokens.scss +0 -65
- package/tokens/_md-comp-extended-fab-branded.scss +0 -45
- package/tokens/_md-comp-extended-fab-primary.scss +0 -45
- package/tokens/_md-comp-extended-fab-secondary.scss +0 -48
- package/tokens/_md-comp-extended-fab-surface.scss +0 -45
- package/tokens/_md-comp-extended-fab-tertiary.scss +0 -48
- package/tokens/_md-comp-fab-branded-large.scss +0 -23
- package/tokens/_md-comp-fab-primary-large.scss +0 -23
- package/tokens/_md-comp-fab-primary-small.scss +0 -23
- package/tokens/_md-comp-fab-primary.scss +0 -23
- package/tokens/_md-comp-fab-secondary-large.scss +0 -23
- package/tokens/_md-comp-fab-secondary-small.scss +0 -23
- package/tokens/_md-comp-fab-secondary.scss +0 -23
- package/tokens/_md-comp-fab-surface-large.scss +0 -23
- package/tokens/_md-comp-fab-surface-small.scss +0 -23
- package/tokens/_md-comp-fab-surface.scss +0 -23
- package/tokens/_md-comp-fab-tertiary-large.scss +0 -23
- package/tokens/_md-comp-fab-tertiary-small.scss +0 -23
- package/tokens/_md-comp-fab-tertiary.scss +0 -23
- /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/elevated-styles.css.d.ts} +0 -0
- /package/{fab/lib/fab-shared-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
|
@@ -3,24 +3,23 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
import { __decorate } from "tslib";
|
|
7
8
|
import '../../focus/focus-ring.js';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
9
|
+
import '../../ripple/ripple.js';
|
|
10
|
+
import { html, LitElement, nothing } from 'lit';
|
|
11
|
+
import { property, queryAssignedElements, queryAsync, state } from 'lit/decorators.js';
|
|
10
12
|
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js';
|
|
15
|
-
import { MdRipple } from '../../ripple/ripple.js';
|
|
13
|
+
import { when } from 'lit/directives/when.js';
|
|
14
|
+
import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
|
|
15
|
+
import { ripple } from '../../ripple/directive.js';
|
|
16
16
|
/**
|
|
17
17
|
* SegmentedButton is a web component implementation of the Material Design
|
|
18
18
|
* segmented button component. It is intended **only** for use as a child of a
|
|
19
19
|
* `SementedButtonSet` component. It is **not** intended for use in any other
|
|
20
20
|
* context.
|
|
21
|
-
* @soyCompatible
|
|
22
21
|
*/
|
|
23
|
-
export class SegmentedButton extends
|
|
22
|
+
export class SegmentedButton extends LitElement {
|
|
24
23
|
constructor() {
|
|
25
24
|
super(...arguments);
|
|
26
25
|
this.disabled = false;
|
|
@@ -29,7 +28,14 @@ export class SegmentedButton extends ActionElement {
|
|
|
29
28
|
this.noCheckmark = false;
|
|
30
29
|
this.hasIcon = false;
|
|
31
30
|
this.animState = '';
|
|
32
|
-
this.
|
|
31
|
+
this.showRipple = false;
|
|
32
|
+
this.getRipple = () => {
|
|
33
|
+
this.showRipple = true;
|
|
34
|
+
return this.ripple;
|
|
35
|
+
};
|
|
36
|
+
this.renderRipple = () => {
|
|
37
|
+
return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
|
|
38
|
+
};
|
|
33
39
|
}
|
|
34
40
|
update(props) {
|
|
35
41
|
this.animState = this.nextAnimationState(props);
|
|
@@ -53,58 +59,24 @@ export class SegmentedButton extends ActionElement {
|
|
|
53
59
|
}
|
|
54
60
|
return '';
|
|
55
61
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
endPress(options) {
|
|
60
|
-
// TODO(b/261201805): connect to ripple
|
|
61
|
-
super.endPress(options);
|
|
62
|
-
if (!options.cancelled) {
|
|
63
|
-
const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
|
|
64
|
-
this.dispatchEvent(event);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
handlePointerDown(e) {
|
|
68
|
-
super.handlePointerDown(e);
|
|
69
|
-
pointerPress();
|
|
70
|
-
this.showFocusRing = shouldShowStrongFocus();
|
|
71
|
-
}
|
|
72
|
-
handlePointerUp(e) {
|
|
73
|
-
super.handlePointerUp(e);
|
|
74
|
-
}
|
|
75
|
-
handlePointerEnter(e) {
|
|
76
|
-
this.ripple.handlePointerenter(e);
|
|
62
|
+
handleClick() {
|
|
63
|
+
const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
|
|
64
|
+
this.dispatchEvent(event);
|
|
77
65
|
}
|
|
78
|
-
handlePointerLeave(e) {
|
|
79
|
-
super.handlePointerLeave(e);
|
|
80
|
-
this.ripple.handlePointerleave(e);
|
|
81
|
-
}
|
|
82
|
-
handleFocus() {
|
|
83
|
-
this.showFocusRing = shouldShowStrongFocus();
|
|
84
|
-
}
|
|
85
|
-
handleBlur() {
|
|
86
|
-
this.showFocusRing = false;
|
|
87
|
-
}
|
|
88
|
-
/** @soyTemplate */
|
|
89
66
|
render() {
|
|
67
|
+
// Needed for closure conformance
|
|
68
|
+
const { ariaLabel } = this;
|
|
90
69
|
return html `
|
|
91
70
|
<button
|
|
92
71
|
tabindex="${this.disabled ? '-1' : '0'}"
|
|
93
|
-
aria-label
|
|
72
|
+
aria-label=${ariaLabel || nothing}
|
|
94
73
|
aria-pressed=${this.selected}
|
|
95
74
|
?disabled=${this.disabled}
|
|
96
|
-
@focus="${this.handleFocus}"
|
|
97
|
-
@blur="${this.handleBlur}"
|
|
98
|
-
@pointerdown="${this.handlePointerDown}"
|
|
99
|
-
@pointerup="${this.handlePointerUp}"
|
|
100
|
-
@pointercancel="${this.handlePointerCancel}"
|
|
101
|
-
@pointerleave="${this.handlePointerLeave}"
|
|
102
|
-
@pointerenter="${this.handlePointerEnter}"
|
|
103
75
|
@click="${this.handleClick}"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
${this.renderRipple
|
|
76
|
+
class="md3-segmented-button ${classMap(this.getRenderClasses())}"
|
|
77
|
+
${ripple(this.getRipple)}>
|
|
78
|
+
<md-focus-ring class="md3-segmented-button__focus-ring"></md-focus-ring>
|
|
79
|
+
${when(this.showRipple, this.renderRipple)}
|
|
108
80
|
${this.renderOutline()}
|
|
109
81
|
${this.renderLeading()}
|
|
110
82
|
${this.renderLabel()}
|
|
@@ -112,7 +84,6 @@ export class SegmentedButton extends ActionElement {
|
|
|
112
84
|
</button>
|
|
113
85
|
`;
|
|
114
86
|
}
|
|
115
|
-
/** @soyTemplate */
|
|
116
87
|
getRenderClasses() {
|
|
117
88
|
return {
|
|
118
89
|
'md3-segmented-button--selected': this.selected,
|
|
@@ -126,24 +97,13 @@ export class SegmentedButton extends ActionElement {
|
|
|
126
97
|
'md3-segmented-button--deselecting': this.animState === 'deselecting',
|
|
127
98
|
};
|
|
128
99
|
}
|
|
129
|
-
/** @soyTemplate */
|
|
130
|
-
renderFocusRing() {
|
|
131
|
-
return html `<md-focus-ring .visible="${this.showFocusRing}" class="md3-segmented-button__focus-ring"></md-focus-ring>`;
|
|
132
|
-
}
|
|
133
|
-
/** @soyTemplate */
|
|
134
|
-
renderRipple() {
|
|
135
|
-
return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
|
|
136
|
-
}
|
|
137
|
-
/** @soyTemplate */
|
|
138
100
|
renderOutline() {
|
|
139
|
-
return
|
|
101
|
+
return nothing;
|
|
140
102
|
}
|
|
141
|
-
/** @soyTemplate */
|
|
142
103
|
renderLeading() {
|
|
143
104
|
return this.label === '' ? this.renderLeadingWithoutLabel() :
|
|
144
105
|
this.renderLeadingWithLabel();
|
|
145
106
|
}
|
|
146
|
-
/** @soyTemplate */
|
|
147
107
|
renderLeadingWithoutLabel() {
|
|
148
108
|
return html `
|
|
149
109
|
<span class="md3-segmented-button__leading" aria-hidden="true">
|
|
@@ -158,7 +118,6 @@ export class SegmentedButton extends ActionElement {
|
|
|
158
118
|
</span>
|
|
159
119
|
`;
|
|
160
120
|
}
|
|
161
|
-
/** @soyTemplate */
|
|
162
121
|
renderLeadingWithLabel() {
|
|
163
122
|
return html `
|
|
164
123
|
<span class="md3-segmented-button__leading" aria-hidden="true">
|
|
@@ -173,57 +132,44 @@ export class SegmentedButton extends ActionElement {
|
|
|
173
132
|
</span>
|
|
174
133
|
`;
|
|
175
134
|
}
|
|
176
|
-
/** @soyTemplate */
|
|
177
135
|
renderLabel() {
|
|
178
136
|
return html `
|
|
179
137
|
<span class="md3-segmented-button__label-text">${this.label}</span>
|
|
180
138
|
`;
|
|
181
139
|
}
|
|
182
|
-
/** @soyTemplate */
|
|
183
140
|
renderTouchTarget() {
|
|
184
141
|
return html `<span class="md3-segmented-button__touch"></span>`;
|
|
185
142
|
}
|
|
186
143
|
}
|
|
144
|
+
_a = SegmentedButton;
|
|
145
|
+
(() => {
|
|
146
|
+
requestUpdateOnAriaChange(_a);
|
|
147
|
+
})();
|
|
187
148
|
__decorate([
|
|
188
|
-
property({ type: Boolean })
|
|
189
|
-
__metadata("design:type", Object)
|
|
149
|
+
property({ type: Boolean })
|
|
190
150
|
], SegmentedButton.prototype, "disabled", void 0);
|
|
191
151
|
__decorate([
|
|
192
|
-
property({ type: Boolean })
|
|
193
|
-
__metadata("design:type", Object)
|
|
152
|
+
property({ type: Boolean })
|
|
194
153
|
], SegmentedButton.prototype, "selected", void 0);
|
|
195
154
|
__decorate([
|
|
196
|
-
property(
|
|
197
|
-
__metadata("design:type", Object)
|
|
155
|
+
property()
|
|
198
156
|
], SegmentedButton.prototype, "label", void 0);
|
|
199
157
|
__decorate([
|
|
200
|
-
property({ type: Boolean })
|
|
201
|
-
__metadata("design:type", Object)
|
|
158
|
+
property({ type: Boolean })
|
|
202
159
|
], SegmentedButton.prototype, "noCheckmark", void 0);
|
|
203
160
|
__decorate([
|
|
204
|
-
property({ type: Boolean })
|
|
205
|
-
__metadata("design:type", Object)
|
|
161
|
+
property({ type: Boolean })
|
|
206
162
|
], SegmentedButton.prototype, "hasIcon", void 0);
|
|
207
163
|
__decorate([
|
|
208
|
-
|
|
209
|
-
,
|
|
210
|
-
property({ type: String, attribute: 'aria-label' }),
|
|
211
|
-
__metadata("design:type", String)
|
|
212
|
-
], SegmentedButton.prototype, "ariaLabel", void 0);
|
|
213
|
-
__decorate([
|
|
214
|
-
state(),
|
|
215
|
-
__metadata("design:type", String)
|
|
164
|
+
state()
|
|
216
165
|
], SegmentedButton.prototype, "animState", void 0);
|
|
217
166
|
__decorate([
|
|
218
|
-
state()
|
|
219
|
-
|
|
220
|
-
], SegmentedButton.prototype, "showFocusRing", void 0);
|
|
167
|
+
state()
|
|
168
|
+
], SegmentedButton.prototype, "showRipple", void 0);
|
|
221
169
|
__decorate([
|
|
222
|
-
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
223
|
-
__metadata("design:type", Array)
|
|
170
|
+
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
224
171
|
], SegmentedButton.prototype, "iconElement", void 0);
|
|
225
172
|
__decorate([
|
|
226
|
-
|
|
227
|
-
__metadata("design:type", MdRipple)
|
|
173
|
+
queryAsync('md-ripple')
|
|
228
174
|
], SegmentedButton.prototype, "ripple", void 0);
|
|
229
175
|
//# sourceMappingURL=segmented-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-button.js","sourceRoot":"","sources":["segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAiC,MAAM,KAAK,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAC,aAAa,EAAmC,MAAM,uCAAuC,CAAC;AACtG,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC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AsB,EAAE,CAAC;IAC3D,CAAC;IAED,mBAAmB;IACT,yBAAyB;QACjC,OAAO,IAAI,CAAA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,sBAAsB;QAC9B,OAAO,IAAI,CAAA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,WAAW;QACnB,OAAO,IAAI,CAAA;uDACwC,IAAI,CAAC,KAAK;KAC5D,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,iBAAiB;QACzB,OAAO,IAAI,CAAA,mDAAmD,CAAC;IACjE,CAAC;CACF;AAhMC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;iDAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;iDAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;8CAAY;AACrC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;oDAAqB;AAC/C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;gDAAiB;AAG3C;IAAC,YAAY,CAAE,wCAAwC;;IACtD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;;kDACtB;AAE5B;IAAC,KAAK,EAAE;;kDAAkC;AAC1C;IAAC,KAAK,EAAE;;sDAAiC;AACzC;IAAC,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;oDACf;AACtC;IAAC,KAAK,CAAC,WAAW,CAAC;8BAAU,QAAQ;+CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\n\nimport {html, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\nimport {ActionElement, BeginPressConfig, EndPressConfig} from '../../actionelement/action-element.js';\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {MdRipple} from '../../ripple/ripple.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n * @soyCompatible\n */\nexport class SegmentedButton extends ActionElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property({type: String}) label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n /** @soyPrefixAttribute */\n @ariaProperty // tslint:disable-line:no-new-decorators\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel!: string;\n\n @state() protected animState: string = '';\n @state() protected showFocusRing = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n protected iconElement!: HTMLElement[];\n @query('md-ripple') ripple!: MdRipple;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n override beginPress({positionEvent}: BeginPressConfig) {\n // TODO(b/261201805): connect to ripple\n }\n\n override endPress(options: EndPressConfig) {\n // TODO(b/261201805): connect to ripple\n super.endPress(options);\n if (!options.cancelled) {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n }\n\n override handlePointerDown(e: PointerEvent) {\n super.handlePointerDown(e);\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n override handlePointerUp(e: PointerEvent) {\n super.handlePointerUp(e);\n }\n\n protected handlePointerEnter(e: PointerEvent) {\n this.ripple.handlePointerenter(e);\n }\n\n override handlePointerLeave(e: PointerEvent) {\n super.handlePointerLeave(e);\n this.ripple.handlePointerleave(e);\n }\n\n protected handleFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected handleBlur() {\n this.showFocusRing = false;\n }\n\n /** @soyTemplate */\n override render(): TemplateResult {\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @focus=\"${this.handleFocus}\"\n @blur=\"${this.handleBlur}\"\n @pointerdown=\"${this.handlePointerDown}\"\n @pointerup=\"${this.handlePointerUp}\"\n @pointercancel=\"${this.handlePointerCancel}\"\n @pointerleave=\"${this.handlePointerLeave}\"\n @pointerenter=\"${this.handlePointerEnter}\"\n @click=\"${this.handleClick}\"\n @contextmenu=\"${this.handleContextMenu}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n /** @soyTemplate */\n protected getRenderClasses(): ClassInfo {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n /** @soyTemplate */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring .visible=\"${\n this.showFocusRing}\" class=\"md3-segmented-button__focus-ring\"></md-focus-ring>`;\n }\n\n /** @soyTemplate */\n protected renderRipple(): TemplateResult|string {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n }\n\n /** @soyTemplate */\n protected renderOutline(): TemplateResult {\n return html``;\n }\n\n /** @soyTemplate */\n protected renderLeading(): TemplateResult {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n /** @soyTemplate */\n protected renderLeadingWithoutLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLeadingWithLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n /** @soyTemplate */\n protected renderTouchTarget(): TemplateResult {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"segmented-button.js","sourceRoot":"","sources":["segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QAK6B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAChC,UAAK,GAAG,EAAE,CAAC;QACI,gBAAW,GAAG,KAAK,CAAC;QACpB,YAAO,GAAG,KAAK,CAAC;QAE1B,cAAS,GAAG,EAAE,CAAC;QACf,eAAU,GAAG,KAAK,CAAC;QAwEnB,cAAS,GAAG,GAAG,EAAE;YAChC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC,CAAC;QAEe,iBAAY,GAAG,GAAG,EAAE;YACnC,OAAO,IAAI,CAAA,yBACP,IAAI,CAAC,QAAQ,sDAAsD,CAAC;QAC1E,CAAC,CAAC;IAkDJ,CAAC;IA7HoB,MAAM,CAAC,KAAsC;QAC9D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,KA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AAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDAAkB;AAChC;IAAX,QAAQ,EAAE;8CAAY;AACI;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oDAAqB;AACpB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;gDAAiB;AAElC;IAAR,KAAK,EAAE;kDAAwB;AACvB;IAAR,KAAK,EAAE;mDAA4B;AAEpC;IADC,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDACR;AACpB;IAAxB,UAAU,CAAC,WAAW,CAAC;+CAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, queryAssignedElements, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {when} from 'lit/directives/when.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {ripple} from '../../ripple/directive.js';\nimport {MdRipple} from '../../ripple/ripple.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n */\nexport class SegmentedButton extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property() label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n @state() private animState = '';\n @state() private showRipple = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly iconElement!: HTMLElement[];\n @queryAsync('md-ripple') private readonly ripple!: Promise<MdRipple|null>;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n private handleClick() {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @click=\"${this.handleClick}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\"\n ${ripple(this.getRipple)}>\n <md-focus-ring class=\"md3-segmented-button__focus-ring\"></md-focus-ring>\n ${when(this.showRipple, this.renderRipple)}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n protected getRenderClasses() {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n private readonly getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private readonly renderRipple = () => {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n };\n\n protected renderOutline(): TemplateResult|typeof nothing {\n return nothing;\n }\n\n private renderLeading() {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n private renderLeadingWithoutLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n private renderLeadingWithLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n private renderLabel() {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE
|
|
1
|
+
{"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;GAKG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;;AACpD,gCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAErC;SAFY,yBAAyB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButton} from './lib/outlined-segmented-button.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button': MdOutlinedSegmentedButton;\n }\n}\n\n/**\n * MdOutlinedSegmentedButton is the custom element for the Material\n * Design outlined segmented button component.\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button')\nexport class MdOutlinedSegmentedButton extends OutlinedSegmentedButton {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
|
|
@@ -4,31 +4,50 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
|
-
@use '../../sass/shape';
|
|
8
|
-
@use '../../sass/theme';
|
|
9
7
|
@use '../../tokens';
|
|
10
8
|
// go/keep-sorted end
|
|
11
9
|
|
|
12
|
-
$_custom-property-prefix: 'segmented-button';
|
|
13
|
-
|
|
14
10
|
@mixin theme($tokens) {
|
|
15
|
-
$tokens:
|
|
16
|
-
tokens
|
|
17
|
-
|
|
11
|
+
$supported-tokens: list.join(
|
|
12
|
+
tokens.$md-comp-outlined-segmented-button-supported-tokens,
|
|
13
|
+
('shape-start-start', 'shape-start-end', 'shape-end-end', 'shape-end-start')
|
|
18
14
|
);
|
|
19
|
-
|
|
20
|
-
$
|
|
21
|
-
|
|
15
|
+
|
|
16
|
+
@each $token, $value in $tokens {
|
|
17
|
+
@if list.index($supported-tokens, $token) == null {
|
|
18
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@if $value {
|
|
22
|
+
--md-outlined-segmented-button-#{$token}: #{$value};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
@mixin styles() {
|
|
25
28
|
$tokens: tokens.md-comp-outlined-segmented-button-values();
|
|
26
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
27
|
-
$tokens: shape.resolve-tokens($tokens, 'shape');
|
|
28
29
|
|
|
29
30
|
:host {
|
|
30
31
|
@each $token, $value in $tokens {
|
|
31
|
-
--_#{$token}: #{$value};
|
|
32
|
+
--_#{$token}: var(--md-outlined-segmented-button-#{$token}, #{$value});
|
|
32
33
|
}
|
|
34
|
+
|
|
35
|
+
// Support logical shape properties
|
|
36
|
+
--_shape-start-start: var(
|
|
37
|
+
--md-outlined-segmented-button-shape-start-start,
|
|
38
|
+
var(--_shape)
|
|
39
|
+
);
|
|
40
|
+
--_shape-start-end: var(
|
|
41
|
+
--md-outlined-segmented-button-shape-start-end,
|
|
42
|
+
var(--_shape)
|
|
43
|
+
);
|
|
44
|
+
--_shape-end-end: var(
|
|
45
|
+
--md-outlined-segmented-button-shape-end-end,
|
|
46
|
+
var(--_shape)
|
|
47
|
+
);
|
|
48
|
+
--_shape-end-start: var(
|
|
49
|
+
--md-outlined-segmented-button-shape-end-start,
|
|
50
|
+
var(--_shape)
|
|
51
|
+
);
|
|
33
52
|
}
|
|
34
53
|
}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
7
6
|
import { SegmentedButtonSet } from './segmented-button-set.js';
|
|
8
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* TODO(b/265346443): add docs
|
|
9
|
+
*/
|
|
9
10
|
export declare class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
protected getRenderClasses(): {
|
|
12
|
+
'md3-segmented-button-set--outlined': boolean;
|
|
13
|
+
};
|
|
12
14
|
}
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { SegmentedButtonSet } from './segmented-button-set.js';
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* TODO(b/265346443): add docs
|
|
9
|
+
*/
|
|
8
10
|
export class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
|
|
9
|
-
/** @soyTemplate */
|
|
10
11
|
getRenderClasses() {
|
|
11
12
|
return {
|
|
12
13
|
...super.getRenderClasses(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAC7C,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/**\n * TODO(b/265346443): add docs\n */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}\n"]}
|
|
@@ -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-height: var(--md-outlined-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-outlined-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-outlined-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-outlined-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-outlined-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-outlined-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-outlined-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-outlined-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-outlined-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-outlined-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-outlined-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-outlined-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-outlined-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-outlined-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-outlined-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-outlined-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-outlined-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-outlined-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-outlined-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-outlined-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-outlined-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-outlined-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-outlined-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-outlined-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-outlined-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-outlined-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-outlined-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-outlined-segmented-button-with-icon-icon-size, 18px);--_shape-start-start: var( --md-outlined-segmented-button-shape-start-start, var(--_shape) );--_shape-start-end: var( --md-outlined-segmented-button-shape-start-end, var(--_shape) );--_shape-end-end: var( --md-outlined-segmented-button-shape-end-end, var(--_shape) );--_shape-end-start: var( --md-outlined-segmented-button-shape-end-start, var(--_shape) )}/*# sourceMappingURL=outlined-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=outlined-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-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":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-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-height: var(--md-outlined-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-outlined-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-outlined-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-outlined-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-outlined-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-outlined-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-outlined-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-outlined-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-outlined-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-outlined-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-outlined-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-outlined-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-outlined-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-outlined-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-outlined-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-outlined-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-outlined-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-outlined-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-outlined-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-outlined-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-outlined-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-outlined-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-outlined-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-outlined-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-outlined-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-outlined-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-outlined-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-outlined-segmented-button-with-icon-icon-size, 18px);--_shape-start-start: var( --md-outlined-segmented-button-shape-start-start, var(--_shape) );--_shape-start-end: var( --md-outlined-segmented-button-shape-start-end, var(--_shape) );--_shape-end-end: var( --md-outlined-segmented-button-shape-end-end, var(--_shape) );--_shape-end-start: var( --md-outlined-segmented-button-shape-end-start, var(--_shape) )}/*# sourceMappingURL=outlined-styles.css.map */\n`;\n "]}
|
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { LitElement
|
|
7
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
8
7
|
import { SegmentedButton } from '../../segmentedbutton/lib/segmented-button.js';
|
|
9
8
|
/**
|
|
10
9
|
* SegmentedButtonSet is the parent component for two or more
|
|
11
10
|
* `SegmentedButton` components. **Only** `SegmentedButton` components may be
|
|
12
11
|
* used as children.
|
|
13
|
-
* @soyCompatible
|
|
14
12
|
*/
|
|
15
13
|
export declare class SegmentedButtonSet extends LitElement {
|
|
16
14
|
multiselect: boolean;
|
|
17
|
-
/** @soyPrefixAttribute */
|
|
18
|
-
ariaLabel: string;
|
|
19
15
|
buttons: SegmentedButton[];
|
|
20
16
|
getButtonDisabled(index: number): boolean;
|
|
21
17
|
setButtonDisabled(index: number, disabled: boolean): void;
|
|
@@ -25,8 +21,6 @@ export declare class SegmentedButtonSet extends LitElement {
|
|
|
25
21
|
private toggleSelection;
|
|
26
22
|
private indexOutOfBounds;
|
|
27
23
|
private emitSelectionEvent;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/** @soyTemplate */
|
|
31
|
-
protected getRenderClasses(): ClassInfo;
|
|
24
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
protected getRenderClasses(): {};
|
|
32
26
|
}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
6
|
+
var _a;
|
|
7
|
+
import { __decorate } from "tslib";
|
|
8
|
+
import { html, LitElement, nothing } from 'lit';
|
|
8
9
|
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
-
import {
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { ariaProperty } from '../../decorators/aria-property.js';
|
|
10
|
+
import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
|
|
12
11
|
/**
|
|
13
12
|
* SegmentedButtonSet is the parent component for two or more
|
|
14
13
|
* `SegmentedButton` components. **Only** `SegmentedButton` components may be
|
|
15
14
|
* used as children.
|
|
16
|
-
* @soyCompatible
|
|
17
15
|
*/
|
|
18
16
|
export class SegmentedButtonSet extends LitElement {
|
|
19
17
|
constructor() {
|
|
@@ -82,35 +80,31 @@ export class SegmentedButtonSet extends LitElement {
|
|
|
82
80
|
composed: true
|
|
83
81
|
}));
|
|
84
82
|
}
|
|
85
|
-
/** @soyTemplate */
|
|
86
83
|
render() {
|
|
84
|
+
// Needed for closure conformance
|
|
85
|
+
const { ariaLabel } = this;
|
|
87
86
|
return html `
|
|
88
87
|
<span
|
|
89
88
|
role="group"
|
|
90
89
|
@segmented-button-interaction="${this.handleSegmentedButtonInteraction}"
|
|
91
|
-
aria-label
|
|
92
|
-
class="md3-segmented-button-set
|
|
90
|
+
aria-label=${ariaLabel || nothing}
|
|
91
|
+
class="md3-segmented-button-set">
|
|
93
92
|
<slot></slot>
|
|
94
93
|
</span>
|
|
95
94
|
`;
|
|
96
95
|
}
|
|
97
|
-
/** @soyTemplate */
|
|
98
96
|
getRenderClasses() {
|
|
99
97
|
return {};
|
|
100
98
|
}
|
|
101
99
|
}
|
|
100
|
+
_a = SegmentedButtonSet;
|
|
101
|
+
(() => {
|
|
102
|
+
requestUpdateOnAriaChange(_a);
|
|
103
|
+
})();
|
|
102
104
|
__decorate([
|
|
103
|
-
property({ type: Boolean })
|
|
104
|
-
__metadata("design:type", Object)
|
|
105
|
+
property({ type: Boolean })
|
|
105
106
|
], SegmentedButtonSet.prototype, "multiselect", void 0);
|
|
106
107
|
__decorate([
|
|
107
|
-
|
|
108
|
-
,
|
|
109
|
-
property({ type: String, attribute: 'aria-label' }),
|
|
110
|
-
__metadata("design:type", String)
|
|
111
|
-
], SegmentedButtonSet.prototype, "ariaLabel", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
queryAssignedElements({ flatten: true }),
|
|
114
|
-
__metadata("design:type", Array)
|
|
108
|
+
queryAssignedElements({ flatten: true })
|
|
115
109
|
], SegmentedButtonSet.prototype, "buttons", void 0);
|
|
116
110
|
//# sourceMappingURL=segmented-button-set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-button-set.js","sourceRoot":"","sources":["segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"segmented-button-set.js","sourceRoot":"","sources":["segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAIjE;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAAlD;;QAK6B,gBAAW,GAAG,KAAK,CAAC;IAsFjD,CAAC;IAlFC,iBAAiB,CAAC,KAAa;QAC7B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,iBAAiB,CAAC,KAAa,EAAE,QAAiB;QAChD,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO;QACzC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,iBAAiB,CAAC,KAAa,EAAE,QAAiB;QAChD,8BAA8B;QAC9B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO;QACzC,2BAA2B;QAC3B,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK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EAAE;YACnE,MAAM,EAAE;gBACN,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ;gBACtC,KAAK;aACN;YACD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;IACN,CAAC;IAEkB,MAAM;QACvB,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,OAAO,IAAI,CAAA;;;wCAGyB,IAAI,CAAC,gCAAgC;oBACzD,SAAS,IAAI,OAAO;;;;MAIlC,CAAC;IACL,CAAC;IAES,gBAAgB;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;;AA1FC;IACE,yBAAyB,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uDAAqB;AAEP;IAAvC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;mDAA6B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {SegmentedButton} from '../../segmentedbutton/lib/segmented-button.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButtonSet is the parent component for two or more\n * `SegmentedButton` components. **Only** `SegmentedButton` components may be\n * used as children.\n */\nexport class SegmentedButtonSet extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) multiselect = false;\n\n @queryAssignedElements({flatten: true}) buttons!: SegmentedButton[];\n\n getButtonDisabled(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].disabled;\n }\n\n setButtonDisabled(index: number, disabled: boolean) {\n if (this.indexOutOfBounds(index)) return;\n this.buttons[index].disabled = disabled;\n }\n\n getButtonSelected(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].selected;\n }\n\n setButtonSelected(index: number, selected: boolean) {\n // Ignore out-of-index values.\n if (this.indexOutOfBounds(index)) return;\n // Ignore disabled buttons.\n if (this.getButtonDisabled(index)) return;\n\n if (this.multiselect) {\n this.buttons[index].selected = selected;\n this.emitSelectionEvent(index);\n return;\n }\n\n // Single-select segmented buttons are not unselectable.\n if (!selected) return;\n\n this.buttons[index].selected = true;\n this.emitSelectionEvent(index);\n // Deselect all other buttons for single-select.\n for (let i = 0; i < this.buttons.length; i++) {\n if (i === index) continue;\n this.buttons[i].selected = false;\n }\n }\n\n private handleSegmentedButtonInteraction(e: CustomEvent) {\n const index = this.buttons.indexOf(e.target as SegmentedButton);\n this.toggleSelection(index);\n }\n\n private toggleSelection(index: number) {\n if (this.indexOutOfBounds(index)) return;\n this.setButtonSelected(index, !this.buttons[index].selected);\n }\n\n private indexOutOfBounds(index: number): boolean {\n return index < 0 || index >= this.buttons.length;\n }\n\n private emitSelectionEvent(index: number) {\n this.dispatchEvent(new CustomEvent('segmented-button-set-selection', {\n detail: {\n button: this.buttons[index],\n selected: this.buttons[index].selected,\n index,\n },\n bubbles: true,\n composed: true\n }));\n }\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <span\n role=\"group\"\n @segmented-button-interaction=\"${this.handleSegmentedButtonInteraction}\"\n aria-label=${ariaLabel || nothing}\n class=\"md3-segmented-button-set\">\n <slot></slot>\n </span>\n `;\n }\n\n protected getRenderClasses() {\n return {};\n }\n}\n"]}
|
|
@@ -11,7 +11,6 @@ import { styles as sharedStyles } from './lib/shared-styles.css.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* MdOutlinedSegmentedButtonSet is the custom element for the Material
|
|
13
13
|
* Design outlined segmented button set component.
|
|
14
|
-
* @soyCompatible
|
|
15
14
|
* @final
|
|
16
15
|
* @suppress {visibility}
|
|
17
16
|
*/
|