@material/web 1.0.0-pre.4 → 1.0.0-pre.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/badge/lib/_badge.scss +2 -10
- package/button/lib/_elevated-button.scss +5 -30
- package/button/lib/_elevation.scss +1 -16
- package/button/lib/_filled-button.scss +4 -31
- package/button/lib/_icon.scss +1 -0
- package/button/lib/_outlined-button.scss +6 -23
- package/button/lib/_shared.scss +20 -54
- package/button/lib/_text-button.scss +8 -34
- package/button/lib/_tonal-button.scss +5 -28
- package/button/lib/button.d.ts +2 -0
- package/button/lib/button.js +5 -1
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-styles.css.js +1 -1
- package/button/lib/elevated-styles.css.js.map +1 -1
- package/button/lib/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.js.map +1 -1
- package/button/lib/outlined-styles.css.js +1 -1
- package/button/lib/outlined-styles.css.js.map +1 -1
- package/button/lib/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +1 -2
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/chips/_assist-chip.scss +6 -0
- package/chips/_suggestion-chip.scss +6 -0
- package/chips/assist-chip.d.ts +20 -0
- package/chips/assist-chip.js +24 -0
- package/chips/assist-chip.js.map +1 -0
- package/chips/lib/_assist-chip.scss +27 -0
- package/chips/lib/_shared.scss +183 -0
- package/chips/lib/_suggestion-chip.scss +30 -0
- package/chips/lib/assist-chip.d.ts +11 -0
- package/chips/lib/assist-chip.js +12 -0
- package/chips/lib/assist-chip.js.map +1 -0
- package/chips/lib/assist-styles.css.js +9 -0
- package/chips/lib/assist-styles.css.js.map +1 -0
- package/{menusurface/lib/menu-surface-styles.scss → chips/lib/assist-styles.scss} +3 -3
- package/chips/lib/chip.d.ts +29 -0
- package/chips/lib/chip.js +110 -0
- package/chips/lib/chip.js.map +1 -0
- package/chips/lib/shared-styles.css.js +9 -0
- package/chips/lib/shared-styles.css.js.map +1 -0
- package/{autocomplete → chips}/lib/shared-styles.scss +1 -1
- package/chips/lib/suggestion-chip.d.ts +11 -0
- package/chips/lib/suggestion-chip.js +12 -0
- package/chips/lib/suggestion-chip.js.map +1 -0
- package/chips/lib/suggestion-styles.css.js +9 -0
- package/chips/lib/suggestion-styles.css.js.map +1 -0
- package/{autocomplete/lib/autocompletelist/autocomplete-list-styles.scss → chips/lib/suggestion-styles.scss} +3 -3
- package/chips/suggestion-chip.d.ts +20 -0
- package/chips/suggestion-chip.js +24 -0
- package/chips/suggestion-chip.js.map +1 -0
- package/dialog/lib/_dialog.scss +7 -5
- package/dialog/lib/_tokens.scss +1 -2
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.js +1 -1
- package/dialog/lib/dialog.js.map +1 -1
- package/elevation/lib/_elevation.scss +1 -21
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/fab/lib/_fab-extended.scss +3 -10
- package/fab/lib/_fab.scss +0 -3
- package/fab/lib/_shared.scss +3 -25
- package/fab/lib/fab-extended-styles.css.js +1 -1
- package/fab/lib/fab-extended-styles.css.js.map +1 -1
- package/fab/lib/fab-shared-styles.css.js +1 -1
- package/fab/lib/fab-shared-styles.css.js.map +1 -1
- package/fab/lib/fab-shared.d.ts +0 -1
- package/fab/lib/fab-shared.js +1 -7
- package/fab/lib/fab-shared.js.map +1 -1
- package/field/lib/field.d.ts +4 -1
- package/field/lib/field.js +7 -0
- package/field/lib/field.js.map +1 -1
- package/focus/lib/_focus-ring.scss +13 -7
- package/focus/lib/_md-comp-focus-ring.scss +1 -2
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +1 -12
- package/iconbutton/lib/_filled-tonal-icon-button.scss +1 -12
- package/iconbutton/lib/_outlined-icon-button.scss +1 -13
- package/iconbutton/lib/_shared.scss +10 -6
- package/iconbutton/lib/_standard-icon-button.scss +5 -12
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/icon-button.js +0 -2
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/iconbutton/lib/outlined-styles.css.js +1 -1
- package/iconbutton/lib/outlined-styles.css.js.map +1 -1
- package/iconbutton/lib/shared-styles.css.js +1 -1
- package/iconbutton/lib/shared-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/list/lib/_list.scss +15 -8
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +41 -44
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item.d.ts +1 -0
- package/list/lib/listitem/list-item.js +4 -1
- package/list/lib/listitem/list-item.js.map +1 -1
- package/menu/lib/_menu.scss +6 -9
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu.d.ts +22 -9
- package/menu/lib/menu.js +74 -26
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/menu-item.js +1 -1
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.js +2 -1
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +16 -0
- package/menu/lib/shared.js +16 -0
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +4 -0
- package/menu/lib/submenuitem/sub-menu-item.js +9 -2
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/surfacePositionController.d.ts +10 -2
- package/menu/lib/surfacePositionController.js +6 -2
- package/menu/lib/surfacePositionController.js.map +1 -1
- package/menu/lib/typeaheadController.d.ts +5 -0
- package/menu/lib/typeaheadController.js +7 -3
- package/menu/lib/typeaheadController.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +1 -4
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
- package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
- package/navigationdrawer/lib/_shared.scss +0 -9
- package/navigationtab/lib/_navigation-tab.scss +4 -10
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/_radio.scss +1 -2
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/segmentedbutton/lib/_shared.scss +0 -2
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/slider/lib/_slider.scss +1 -4
- package/slider/lib/_tokens.scss +2 -8
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +1 -7
- package/textfield/lib/_outlined-text-field.scss +1 -7
- package/tokens/_index.scss +101 -2
- package/tokens/_md-comp-assist-chip.scss +68 -0
- package/tokens/_md-comp-badge.scss +34 -0
- package/tokens/_md-comp-banner.scss +23 -0
- package/tokens/_md-comp-bottom-app-bar.scss +21 -0
- package/tokens/_md-comp-carousel-item.scss +23 -0
- package/tokens/_md-comp-checkbox.scss +21 -0
- package/tokens/_md-comp-circular-progress-indicator.scss +22 -0
- package/tokens/_md-comp-data-table.scss +23 -0
- package/tokens/_md-comp-date-input-modal.scss +23 -0
- package/tokens/_md-comp-date-picker-docked.scss +25 -0
- package/tokens/_md-comp-date-picker-modal.scss +25 -0
- package/tokens/_md-comp-dialog.scss +43 -0
- package/tokens/_md-comp-divider.scss +17 -0
- package/tokens/_md-comp-elevated-button.scss +58 -0
- package/tokens/_md-comp-elevated-card.scss +23 -0
- package/tokens/_md-comp-extended-fab-branded.scss +38 -0
- package/tokens/_md-comp-extended-fab-primary.scss +38 -0
- package/tokens/_md-comp-extended-fab-secondary.scss +41 -0
- package/tokens/_md-comp-extended-fab-surface.scss +38 -0
- package/tokens/_md-comp-extended-fab-tertiary.scss +41 -0
- package/tokens/_md-comp-fab-branded-large.scss +23 -0
- package/tokens/_md-comp-fab-branded.scss +23 -0
- package/tokens/_md-comp-fab-primary-large.scss +23 -0
- package/tokens/_md-comp-fab-primary-small.scss +23 -0
- package/tokens/_md-comp-fab-primary.scss +23 -0
- package/tokens/_md-comp-fab-secondary-large.scss +23 -0
- package/tokens/_md-comp-fab-secondary-small.scss +23 -0
- package/tokens/_md-comp-fab-secondary.scss +23 -0
- package/tokens/_md-comp-fab-surface-large.scss +23 -0
- package/tokens/_md-comp-fab-surface-small.scss +23 -0
- package/tokens/_md-comp-fab-surface.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-large.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-small.scss +23 -0
- package/tokens/_md-comp-fab-tertiary.scss +23 -0
- package/tokens/_md-comp-filled-autocomplete.scss +25 -0
- package/tokens/_md-comp-filled-button.scss +58 -0
- package/tokens/_md-comp-filled-card.scss +23 -0
- package/tokens/_md-comp-filled-icon-button.scss +21 -0
- package/tokens/_md-comp-filled-menu-button.scss +25 -0
- package/tokens/_md-comp-filled-select.scss +25 -0
- package/tokens/_md-comp-filled-text-field.scss +46 -0
- package/tokens/_md-comp-filled-tonal-button.scss +59 -0
- package/tokens/_md-comp-filled-tonal-icon-button.scss +24 -0
- package/tokens/_md-comp-filter-chip.scss +38 -0
- package/tokens/_md-comp-full-screen-dialog.scss +25 -0
- package/tokens/_md-comp-icon-button.scss +21 -0
- package/tokens/_md-comp-input-chip.scss +38 -0
- package/tokens/_md-comp-linear-progress-indicator.scss +22 -0
- package/tokens/_md-comp-list.scss +58 -0
- package/tokens/_md-comp-menu.scss +21 -0
- package/tokens/_md-comp-navigation-bar.scss +25 -0
- package/tokens/_md-comp-navigation-drawer.scss +25 -0
- package/tokens/_md-comp-navigation-rail.scss +25 -0
- package/tokens/_md-comp-outlined-autocomplete.scss +28 -0
- package/tokens/_md-comp-outlined-button.scss +56 -0
- package/tokens/_md-comp-outlined-card.scss +23 -0
- package/tokens/_md-comp-outlined-icon-button.scss +21 -0
- package/tokens/_md-comp-outlined-menu-button.scss +23 -0
- package/tokens/_md-comp-outlined-segmented-button.scss +38 -0
- package/tokens/_md-comp-outlined-select.scss +25 -0
- package/tokens/_md-comp-outlined-text-field.scss +44 -0
- package/tokens/_md-comp-plain-tooltip.scss +21 -0
- package/tokens/_md-comp-primary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-radio-button.scss +19 -0
- package/tokens/_md-comp-rich-tooltip.scss +25 -0
- package/tokens/_md-comp-scrim.scss +17 -0
- package/tokens/_md-comp-search-bar.scss +25 -0
- package/tokens/_md-comp-search-view.scss +23 -0
- package/tokens/_md-comp-secondary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-sheet-bottom.scss +21 -0
- package/tokens/_md-comp-sheet-floating.scss +21 -0
- package/tokens/_md-comp-sheet-side.scss +25 -0
- package/tokens/_md-comp-slider.scss +38 -0
- package/tokens/_md-comp-snackbar.scss +25 -0
- package/tokens/_md-comp-standard-menu-button.scss +23 -0
- package/tokens/_md-comp-suggestion-chip.scss +72 -0
- package/tokens/_md-comp-switch.scss +21 -0
- package/tokens/_md-comp-text-button.scss +56 -0
- package/tokens/_md-comp-time-input.scss +25 -0
- package/tokens/_md-comp-time-picker.scss +25 -0
- package/tokens/_md-comp-top-app-bar-large.scss +23 -0
- package/tokens/_md-comp-top-app-bar-medium.scss +23 -0
- package/tokens/_md-comp-top-app-bar-small-centered.scss +26 -0
- package/tokens/_md-comp-top-app-bar-small.scss +23 -0
- package/tokens/_md-ref-palette.scss +12 -0
- package/tokens/_md-ref-typeface.scss +12 -0
- package/tokens/_md-sys-color.scss +25 -0
- package/tokens/_md-sys-elevation.scss +30 -0
- package/tokens/_md-sys-motion.scss +12 -0
- package/tokens/_md-sys-shape.scss +12 -0
- package/tokens/_md-sys-state.scss +12 -0
- package/tokens/_md-sys-typescale.scss +17 -0
- package/autocomplete/_filled-autocomplete.scss +0 -6
- package/autocomplete/_outlined-autocomplete.scss +0 -6
- package/autocomplete/autocomplete-item.d.ts +0 -19
- package/autocomplete/autocomplete-item.js +0 -22
- package/autocomplete/autocomplete-item.js.map +0 -1
- package/autocomplete/autocomplete-list.d.ts +0 -19
- package/autocomplete/autocomplete-list.js +0 -23
- package/autocomplete/autocomplete-list.js.map +0 -1
- package/autocomplete/autocomplete-surface.d.ts +0 -19
- package/autocomplete/autocomplete-surface.js +0 -23
- package/autocomplete/autocomplete-surface.js.map +0 -1
- package/autocomplete/filled-autocomplete.d.ts +0 -28
- package/autocomplete/filled-autocomplete.js +0 -46
- package/autocomplete/filled-autocomplete.js.map +0 -1
- package/autocomplete/lib/_filled-autocomplete.scss +0 -189
- package/autocomplete/lib/_outlined-autocomplete.scss +0 -178
- package/autocomplete/lib/_shared.scss +0 -25
- package/autocomplete/lib/autocomplete.d.ts +0 -54
- package/autocomplete/lib/autocomplete.js +0 -265
- package/autocomplete/lib/autocomplete.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js +0 -14
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/harness.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/harness.js +0 -12
- package/autocomplete/lib/autocompleteitem/harness.js.map +0 -1
- package/autocomplete/lib/autocompletelist/_autocomplete-list.scss +0 -13
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js +0 -9
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletelist/autocomplete-list.d.ts +0 -14
- package/autocomplete/lib/autocompletelist/autocomplete-list.js +0 -21
- package/autocomplete/lib/autocompletelist/autocomplete-list.js.map +0 -1
- package/autocomplete/lib/autocompletelist/harness.d.ts +0 -11
- package/autocomplete/lib/autocompletelist/harness.js +0 -12
- package/autocomplete/lib/autocompletelist/harness.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/_autocomplete-surface.scss +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js +0 -9
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.scss +0 -10
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js +0 -21
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js.map +0 -1
- package/autocomplete/lib/filled-styles.css.d.ts +0 -1
- package/autocomplete/lib/filled-styles.css.js +0 -9
- package/autocomplete/lib/filled-styles.css.js.map +0 -1
- package/autocomplete/lib/filled-styles.scss +0 -10
- package/autocomplete/lib/outlined-styles.css.d.ts +0 -1
- package/autocomplete/lib/outlined-styles.css.js +0 -9
- package/autocomplete/lib/outlined-styles.css.js.map +0 -1
- package/autocomplete/lib/outlined-styles.scss +0 -10
- package/autocomplete/lib/shared-styles.css.js +0 -9
- package/autocomplete/lib/shared-styles.css.js.map +0 -1
- package/autocomplete/outlined-autocomplete.d.ts +0 -28
- package/autocomplete/outlined-autocomplete.js +0 -46
- package/autocomplete/outlined-autocomplete.js.map +0 -1
- package/chips/action/delete-action.d.ts +0 -18
- package/chips/action/delete-action.js +0 -20
- package/chips/action/delete-action.js.map +0 -1
- package/chips/action/lib/action.d.ts +0 -47
- package/chips/action/lib/action.js +0 -162
- package/chips/action/lib/action.js.map +0 -1
- package/chips/action/lib/constants.d.ts +0 -62
- package/chips/action/lib/constants.js +0 -69
- package/chips/action/lib/constants.js.map +0 -1
- package/chips/action/lib/delete-action.d.ts +0 -20
- package/chips/action/lib/delete-action.js +0 -65
- package/chips/action/lib/delete-action.js.map +0 -1
- package/chips/action/lib/events.d.ts +0 -14
- package/chips/action/lib/events.js +0 -16
- package/chips/action/lib/events.js.map +0 -1
- package/chips/action/lib/link-action.d.ts +0 -19
- package/chips/action/lib/link-action.js +0 -55
- package/chips/action/lib/link-action.js.map +0 -1
- package/chips/action/lib/presentational-action.d.ts +0 -15
- package/chips/action/lib/presentational-action.js +0 -30
- package/chips/action/lib/presentational-action.js.map +0 -1
- package/chips/action/lib/primary-action.d.ts +0 -28
- package/chips/action/lib/primary-action.js +0 -88
- package/chips/action/lib/primary-action.js.map +0 -1
- package/chips/action/lib/selectable-action.d.ts +0 -17
- package/chips/action/lib/selectable-action.js +0 -67
- package/chips/action/lib/selectable-action.js.map +0 -1
- package/chips/action/lib/types.d.ts +0 -23
- package/chips/action/lib/types.js +0 -7
- package/chips/action/lib/types.js.map +0 -1
- package/chips/action/link-action.d.ts +0 -18
- package/chips/action/link-action.js +0 -20
- package/chips/action/link-action.js.map +0 -1
- package/chips/action/presentational-action.d.ts +0 -18
- package/chips/action/presentational-action.js +0 -20
- package/chips/action/presentational-action.js.map +0 -1
- package/chips/action/primary-action.d.ts +0 -18
- package/chips/action/primary-action.js +0 -20
- package/chips/action/primary-action.js.map +0 -1
- package/chips/action/selectable-action.d.ts +0 -18
- package/chips/action/selectable-action.js +0 -20
- package/chips/action/selectable-action.js.map +0 -1
- package/chips/chip/lib/_assist-chip-theme.scss +0 -99
- package/chips/chip/lib/_chip-theme.scss +0 -1285
- package/chips/chip/lib/_chip.scss +0 -444
- package/chips/chip/lib/_filter-chip-theme.scss +0 -130
- package/chips/chip/lib/_input-chip-theme.scss +0 -91
- package/chips/chip/lib/_suggestion-chip-theme.scss +0 -92
- package/chips/chip/lib/action-chip.d.ts +0 -18
- package/chips/chip/lib/action-chip.js +0 -39
- package/chips/chip/lib/action-chip.js.map +0 -1
- package/chips/chip/lib/adapter.d.ts +0 -50
- package/chips/chip/lib/adapter.js +0 -7
- package/chips/chip/lib/adapter.js.map +0 -1
- package/chips/chip/lib/animationframe.d.ts +0 -31
- package/chips/chip/lib/animationframe.js +0 -66
- package/chips/chip/lib/animationframe.js.map +0 -1
- package/chips/chip/lib/chip.d.ts +0 -43
- package/chips/chip/lib/chip.js +0 -134
- package/chips/chip/lib/chip.js.map +0 -1
- package/chips/chip/lib/constants.d.ts +0 -43
- package/chips/chip/lib/constants.js +0 -48
- package/chips/chip/lib/constants.js.map +0 -1
- package/chips/chip/lib/foundation.d.ts +0 -41
- package/chips/chip/lib/foundation.js +0 -255
- package/chips/chip/lib/foundation.js.map +0 -1
- package/chips/chip/lib/link-chip.d.ts +0 -21
- package/chips/chip/lib/link-chip.js +0 -53
- package/chips/chip/lib/link-chip.js.map +0 -1
- package/chips/chip/lib/presentational-chip.d.ts +0 -18
- package/chips/chip/lib/presentational-chip.js +0 -39
- package/chips/chip/lib/presentational-chip.js.map +0 -1
- package/chips/chip/lib/selectable-chip.d.ts +0 -22
- package/chips/chip/lib/selectable-chip.js +0 -57
- package/chips/chip/lib/selectable-chip.js.map +0 -1
- package/chips/chip/lib/types.d.ts +0 -42
- package/chips/chip/lib/types.js +0 -7
- package/chips/chip/lib/types.js.map +0 -1
- package/chips/chipset/lib/_chip-set-theme.scss +0 -50
- package/chips/chipset/lib/_chip-set.scss +0 -48
- package/chips/chipset/lib/adapter.d.ts +0 -45
- package/chips/chipset/lib/adapter.js +0 -7
- package/chips/chipset/lib/adapter.js.map +0 -1
- package/chips/chipset/lib/constants.d.ts +0 -26
- package/chips/chipset/lib/constants.js +0 -30
- package/chips/chipset/lib/constants.js.map +0 -1
- package/chips/chipset/lib/foundation.d.ts +0 -68
- package/chips/chipset/lib/foundation.js +0 -314
- package/chips/chipset/lib/foundation.js.map +0 -1
- package/chips/chipset/lib/types.d.ts +0 -41
- package/chips/chipset/lib/types.js +0 -7
- package/chips/chipset/lib/types.js.map +0 -1
- package/menusurface/_menu-surface.scss +0 -6
- package/menusurface/lib/_md-comp-menu-surface.scss +0 -31
- package/menusurface/lib/_menu-surface.scss +0 -122
- package/menusurface/lib/adapter.d.ts +0 -46
- package/menusurface/lib/adapter.js +0 -7
- package/menusurface/lib/adapter.js.map +0 -1
- package/menusurface/lib/constants.d.ts +0 -71
- package/menusurface/lib/constants.js +0 -83
- package/menusurface/lib/constants.js.map +0 -1
- package/menusurface/lib/foundation.d.ts +0 -176
- package/menusurface/lib/foundation.js +0 -544
- package/menusurface/lib/foundation.js.map +0 -1
- package/menusurface/lib/menu-surface-styles.css.d.ts +0 -1
- package/menusurface/lib/menu-surface-styles.css.js +0 -9
- package/menusurface/lib/menu-surface-styles.css.js.map +0 -1
- package/menusurface/lib/menu-surface.d.ts +0 -62
- package/menusurface/lib/menu-surface.js +0 -347
- package/menusurface/lib/menu-surface.js.map +0 -1
- package/menusurface/lib/types.d.ts +0 -19
- package/menusurface/lib/types.js +0 -7
- package/menusurface/lib/types.js.map +0 -1
- package/menusurface/menu-surface.d.ts +0 -14
- package/menusurface/menu-surface.js +0 -17
- package/menusurface/menu-surface.js.map +0 -1
- package/sass/_elevation.scss +0 -159
- package/sass/_resolvers.scss +0 -16
- package/sass/_typography.scss +0 -39
- package/tokens/v0_160/_index.scss +0 -107
- package/tokens/v0_160/_md-comp-assist-chip.scss +0 -109
- package/tokens/v0_160/_md-comp-badge.scss +0 -58
- package/tokens/v0_160/_md-comp-banner.scss +0 -75
- package/tokens/v0_160/_md-comp-bottom-app-bar.scss +0 -35
- package/tokens/v0_160/_md-comp-carousel-item.scss +0 -65
- package/tokens/v0_160/_md-comp-checkbox.scss +0 -126
- package/tokens/v0_160/_md-comp-circular-progress-indicator.scss +0 -39
- package/tokens/v0_160/_md-comp-data-table.scss +0 -96
- package/tokens/v0_160/_md-comp-date-input-modal.scss +0 -89
- package/tokens/v0_160/_md-comp-date-picker-docked.scss +0 -246
- package/tokens/v0_160/_md-comp-date-picker-modal.scss +0 -305
- package/tokens/v0_160/_md-comp-dialog.scss +0 -123
- package/tokens/v0_160/_md-comp-divider.scss +0 -25
- package/tokens/v0_160/_md-comp-elevated-button.scss +0 -91
- package/tokens/v0_160/_md-comp-elevated-card.scss +0 -59
- package/tokens/v0_160/_md-comp-extended-fab-branded.scss +0 -86
- package/tokens/v0_160/_md-comp-extended-fab-primary.scss +0 -94
- package/tokens/v0_160/_md-comp-extended-fab-secondary.scss +0 -95
- package/tokens/v0_160/_md-comp-extended-fab-surface.scss +0 -90
- package/tokens/v0_160/_md-comp-extended-fab-tertiary.scss +0 -95
- package/tokens/v0_160/_md-comp-fab-branded-large.scss +0 -60
- package/tokens/v0_160/_md-comp-fab-branded.scss +0 -60
- package/tokens/v0_160/_md-comp-fab-primary-large.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-primary-small.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-primary.scss +0 -65
- package/tokens/v0_160/_md-comp-fab-secondary-large.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-secondary-small.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-secondary.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-surface-large.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-surface-small.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-surface.scss +0 -64
- package/tokens/v0_160/_md-comp-fab-tertiary-large.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-tertiary-small.scss +0 -66
- package/tokens/v0_160/_md-comp-fab-tertiary.scss +0 -66
- package/tokens/v0_160/_md-comp-filled-autocomplete.scss +0 -267
- package/tokens/v0_160/_md-comp-filled-button.scss +0 -89
- package/tokens/v0_160/_md-comp-filled-card.scss +0 -58
- package/tokens/v0_160/_md-comp-filled-icon-button.scss +0 -79
- package/tokens/v0_160/_md-comp-filled-menu-button.scss +0 -98
- package/tokens/v0_160/_md-comp-filled-select.scss +0 -272
- package/tokens/v0_160/_md-comp-filled-text-field.scss +0 -189
- package/tokens/v0_160/_md-comp-filled-tonal-button.scss +0 -99
- package/tokens/v0_160/_md-comp-filled-tonal-icon-button.scss +0 -86
- package/tokens/v0_160/_md-comp-filter-chip.scss +0 -209
- package/tokens/v0_160/_md-comp-full-screen-dialog.scss +0 -111
- package/tokens/v0_160/_md-comp-icon-button.scss +0 -70
- package/tokens/v0_160/_md-comp-input-chip.scss +0 -184
- package/tokens/v0_160/_md-comp-linear-progress-indicator.scss +0 -41
- package/tokens/v0_160/_md-comp-list.scss +0 -248
- package/tokens/v0_160/_md-comp-menu.scss +0 -121
- package/tokens/v0_160/_md-comp-navigation-bar.scss +0 -114
- package/tokens/v0_160/_md-comp-navigation-drawer.scss +0 -162
- package/tokens/v0_160/_md-comp-navigation-rail.scss +0 -131
- package/tokens/v0_160/_md-comp-outlined-autocomplete.scss +0 -257
- package/tokens/v0_160/_md-comp-outlined-button.scss +0 -84
- package/tokens/v0_160/_md-comp-outlined-card.scss +0 -65
- package/tokens/v0_160/_md-comp-outlined-icon-button.scss +0 -79
- package/tokens/v0_160/_md-comp-outlined-menu-button.scss +0 -94
- package/tokens/v0_160/_md-comp-outlined-segmented-button.scss +0 -112
- package/tokens/v0_160/_md-comp-outlined-select.scss +0 -262
- package/tokens/v0_160/_md-comp-outlined-text-field.scss +0 -171
- package/tokens/v0_160/_md-comp-plain-tooltip.scss +0 -55
- package/tokens/v0_160/_md-comp-primary-navigation-tab.scss +0 -121
- package/tokens/v0_160/_md-comp-radio-button.scss +0 -68
- package/tokens/v0_160/_md-comp-rich-tooltip.scss +0 -121
- package/tokens/v0_160/_md-comp-scrim.scss +0 -25
- package/tokens/v0_160/_md-comp-search-bar.scss +0 -99
- package/tokens/v0_160/_md-comp-search-view.scss +0 -93
- package/tokens/v0_160/_md-comp-secondary-navigation-tab.scss +0 -84
- package/tokens/v0_160/_md-comp-sheet-bottom.scss +0 -45
- package/tokens/v0_160/_md-comp-sheet-floating.scss +0 -34
- package/tokens/v0_160/_md-comp-sheet-side.scss +0 -91
- package/tokens/v0_160/_md-comp-slider.scss +0 -114
- package/tokens/v0_160/_md-comp-snackbar.scss +0 -127
- package/tokens/v0_160/_md-comp-standard-menu-button.scss +0 -98
- package/tokens/v0_160/_md-comp-suggestion-chip.scss +0 -125
- package/tokens/v0_160/_md-comp-switch.scss +0 -136
- package/tokens/v0_160/_md-comp-text-button.scss +0 -77
- package/tokens/v0_160/_md-comp-time-input.scss +0 -218
- package/tokens/v0_160/_md-comp-time-picker.scss +0 -264
- package/tokens/v0_160/_md-comp-top-app-bar-large.scss +0 -63
- package/tokens/v0_160/_md-comp-top-app-bar-medium.scss +0 -63
- package/tokens/v0_160/_md-comp-top-app-bar-small-centered.scss +0 -66
- package/tokens/v0_160/_md-comp-top-app-bar-small.scss +0 -64
- package/tokens/v0_160/_md-ref-palette.scss +0 -107
- package/tokens/v0_160/_md-ref-typeface.scss +0 -21
- package/tokens/v0_160/_md-sys-color.scss +0 -904
- package/tokens/v0_160/_md-sys-elevation.scss +0 -21
- package/tokens/v0_160/_md-sys-motion.scss +0 -53
- package/tokens/v0_160/_md-sys-shape.scss +0 -30
- package/tokens/v0_160/_md-sys-state.scss +0 -19
- package/tokens/v0_160/_md-sys-typescale.scss +0 -284
- package/tokens/v0_160/index.test.css.d.ts +0 -1
- package/tokens/v0_160/index.test.css.js +0 -9
- package/tokens/v0_160/index.test.css.js.map +0 -1
- package/tokens/v0_160/index.test.scss +0 -584
- package/tokens/v0_160/lib.test.css.d.ts +0 -1
- package/tokens/v0_160/lib.test.css.js +0 -9
- package/tokens/v0_160/lib.test.css.js.map +0 -1
- package/tokens/v0_160/lib.test.scss +0 -663
- /package/{autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts → chips/lib/assist-styles.css.d.ts} +0 -0
- /package/{autocomplete → chips}/lib/shared-styles.css.d.ts +0 -0
- /package/{autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts → chips/lib/suggestion-styles.css.d.ts} +0 -0
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { MDCChipActionFocusBehavior, MDCChipActionInteractionTrigger, MDCChipActionType } from '../../action/lib/constants.js';
|
|
7
|
-
import { AnimationFrame } from './animationframe.js';
|
|
8
|
-
import { MDCChipAnimation, MDCChipAttributes, MDCChipCssClasses, MDCChipEvents } from './constants.js';
|
|
9
|
-
var Direction;
|
|
10
|
-
(function (Direction) {
|
|
11
|
-
Direction[Direction["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
12
|
-
Direction[Direction["LEFT"] = 1] = "LEFT";
|
|
13
|
-
Direction[Direction["RIGHT"] = 2] = "RIGHT";
|
|
14
|
-
})(Direction || (Direction = {}));
|
|
15
|
-
var AnimationKeys;
|
|
16
|
-
(function (AnimationKeys) {
|
|
17
|
-
AnimationKeys["SELECTION"] = "selection";
|
|
18
|
-
AnimationKeys["EXIT"] = "exit";
|
|
19
|
-
})(AnimationKeys || (AnimationKeys = {}));
|
|
20
|
-
/**
|
|
21
|
-
* MDCChipFoundation provides a foundation for all chips.
|
|
22
|
-
*/
|
|
23
|
-
export class MDCChipFoundation {
|
|
24
|
-
static get defaultAdapter() {
|
|
25
|
-
return {
|
|
26
|
-
addClass: () => undefined,
|
|
27
|
-
emitEvent: () => undefined,
|
|
28
|
-
getActions: () => [],
|
|
29
|
-
getAttribute: () => null,
|
|
30
|
-
getElementID: () => '',
|
|
31
|
-
getOffsetWidth: () => 0,
|
|
32
|
-
hasClass: () => false,
|
|
33
|
-
isActionDisabled: () => false,
|
|
34
|
-
isActionFocusable: () => false,
|
|
35
|
-
isActionSelectable: () => false,
|
|
36
|
-
isActionSelected: () => false,
|
|
37
|
-
isRTL: () => false,
|
|
38
|
-
removeClass: () => undefined,
|
|
39
|
-
setActionDisabled: () => undefined,
|
|
40
|
-
setActionFocus: () => undefined,
|
|
41
|
-
setActionSelected: () => undefined,
|
|
42
|
-
setStyleProperty: () => undefined,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
constructor(adapter) {
|
|
46
|
-
this.adapter = { ...MDCChipFoundation.defaultAdapter, ...adapter };
|
|
47
|
-
this.animFrame = new AnimationFrame();
|
|
48
|
-
}
|
|
49
|
-
destroy() {
|
|
50
|
-
this.animFrame.cancelAll();
|
|
51
|
-
}
|
|
52
|
-
getElementID() {
|
|
53
|
-
return this.adapter.getElementID();
|
|
54
|
-
}
|
|
55
|
-
setDisabled(isDisabled) {
|
|
56
|
-
const actions = this.getActions();
|
|
57
|
-
for (const action of actions) {
|
|
58
|
-
this.adapter.setActionDisabled(action, isDisabled);
|
|
59
|
-
}
|
|
60
|
-
if (isDisabled) {
|
|
61
|
-
this.adapter.addClass(MDCChipCssClasses.DISABLED);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.adapter.removeClass(MDCChipCssClasses.DISABLED);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
isDisabled() {
|
|
68
|
-
const actions = this.getActions();
|
|
69
|
-
for (const action of actions) {
|
|
70
|
-
if (this.adapter.isActionDisabled(action)) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
getActions() {
|
|
77
|
-
return this.adapter.getActions();
|
|
78
|
-
}
|
|
79
|
-
isActionFocusable(action) {
|
|
80
|
-
return this.adapter.isActionFocusable(action);
|
|
81
|
-
}
|
|
82
|
-
isActionSelectable(action) {
|
|
83
|
-
return this.adapter.isActionSelectable(action);
|
|
84
|
-
}
|
|
85
|
-
isActionSelected(action) {
|
|
86
|
-
return this.adapter.isActionSelected(action);
|
|
87
|
-
}
|
|
88
|
-
setActionFocus(action, focus) {
|
|
89
|
-
this.adapter.setActionFocus(action, focus);
|
|
90
|
-
}
|
|
91
|
-
setActionSelected(action, isSelected) {
|
|
92
|
-
this.adapter.setActionSelected(action, isSelected);
|
|
93
|
-
this.animateSelection(isSelected);
|
|
94
|
-
}
|
|
95
|
-
startAnimation(animation) {
|
|
96
|
-
if (animation === MDCChipAnimation.ENTER) {
|
|
97
|
-
this.adapter.addClass(MDCChipCssClasses.ENTER);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (animation === MDCChipAnimation.EXIT) {
|
|
101
|
-
this.adapter.addClass(MDCChipCssClasses.EXIT);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
handleAnimationEnd(event) {
|
|
106
|
-
const { animationName } = event;
|
|
107
|
-
if (animationName === MDCChipAnimation.ENTER) {
|
|
108
|
-
this.adapter.removeClass(MDCChipCssClasses.ENTER);
|
|
109
|
-
this.adapter.emitEvent(MDCChipEvents.ANIMATION, {
|
|
110
|
-
chipID: this.getElementID(),
|
|
111
|
-
animation: MDCChipAnimation.ENTER,
|
|
112
|
-
addedAnnouncement: this.getAddedAnnouncement(),
|
|
113
|
-
isComplete: true,
|
|
114
|
-
});
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (animationName === MDCChipAnimation.EXIT) {
|
|
118
|
-
this.adapter.removeClass(MDCChipCssClasses.EXIT);
|
|
119
|
-
this.adapter.addClass(MDCChipCssClasses.HIDDEN);
|
|
120
|
-
const width = this.adapter.getOffsetWidth();
|
|
121
|
-
this.adapter.setStyleProperty('width', `${width}px`);
|
|
122
|
-
// Wait two frames so the width gets applied correctly.
|
|
123
|
-
this.animFrame.request(AnimationKeys.EXIT, () => {
|
|
124
|
-
this.animFrame.request(AnimationKeys.EXIT, () => {
|
|
125
|
-
this.adapter.setStyleProperty('width', '0');
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
handleTransitionEnd() {
|
|
131
|
-
if (!this.adapter.hasClass(MDCChipCssClasses.HIDDEN))
|
|
132
|
-
return;
|
|
133
|
-
this.adapter.emitEvent(MDCChipEvents.ANIMATION, {
|
|
134
|
-
chipID: this.getElementID(),
|
|
135
|
-
animation: MDCChipAnimation.EXIT,
|
|
136
|
-
removedAnnouncement: this.getRemovedAnnouncement(),
|
|
137
|
-
isComplete: true,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
handleActionInteraction({ detail }) {
|
|
141
|
-
const { source, actionID } = detail;
|
|
142
|
-
const isSelectable = this.adapter.isActionSelectable(source);
|
|
143
|
-
const isSelected = this.adapter.isActionSelected(source);
|
|
144
|
-
this.adapter.emitEvent(MDCChipEvents.INTERACTION, {
|
|
145
|
-
chipID: this.getElementID(),
|
|
146
|
-
shouldRemove: this.shouldRemove(detail),
|
|
147
|
-
actionID,
|
|
148
|
-
isSelectable,
|
|
149
|
-
isSelected,
|
|
150
|
-
source,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
handleActionNavigation({ detail }) {
|
|
154
|
-
const { source, key } = detail;
|
|
155
|
-
const isRTL = this.adapter.isRTL();
|
|
156
|
-
const isTrailingActionFocusable = this.adapter.isActionFocusable(MDCChipActionType.TRAILING);
|
|
157
|
-
const isPrimaryActionFocusable = this.adapter.isActionFocusable(MDCChipActionType.PRIMARY);
|
|
158
|
-
const dir = this.directionFromKey(key, isRTL);
|
|
159
|
-
const shouldNavigateToTrailing = source === MDCChipActionType.PRIMARY &&
|
|
160
|
-
dir === Direction.RIGHT && isTrailingActionFocusable;
|
|
161
|
-
const shouldNavigateToPrimary = source === MDCChipActionType.TRAILING &&
|
|
162
|
-
dir === Direction.LEFT && isPrimaryActionFocusable;
|
|
163
|
-
if (shouldNavigateToTrailing) {
|
|
164
|
-
this.navigateActions({ from: source, to: MDCChipActionType.TRAILING });
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
if (shouldNavigateToPrimary) {
|
|
168
|
-
this.navigateActions({ from: source, to: MDCChipActionType.PRIMARY });
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
this.adapter.emitEvent(MDCChipEvents.NAVIGATION, {
|
|
172
|
-
chipID: this.getElementID(),
|
|
173
|
-
isRTL,
|
|
174
|
-
source,
|
|
175
|
-
key,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
directionFromKey(key, isRTL) {
|
|
179
|
-
const isLeftKey = key === 'ArrowLeft';
|
|
180
|
-
const isRightKey = key === 'ArrowRight';
|
|
181
|
-
if (!isRTL && isLeftKey || isRTL && isRightKey) {
|
|
182
|
-
return Direction.LEFT;
|
|
183
|
-
}
|
|
184
|
-
if (!isRTL && isRightKey || isRTL && isLeftKey) {
|
|
185
|
-
return Direction.RIGHT;
|
|
186
|
-
}
|
|
187
|
-
return Direction.UNSPECIFIED;
|
|
188
|
-
}
|
|
189
|
-
navigateActions(nav) {
|
|
190
|
-
this.adapter.setActionFocus(nav.from, MDCChipActionFocusBehavior.NOT_FOCUSABLE);
|
|
191
|
-
this.adapter.setActionFocus(nav.to, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);
|
|
192
|
-
}
|
|
193
|
-
shouldRemove({ source, trigger }) {
|
|
194
|
-
if (trigger === MDCChipActionInteractionTrigger.BACKSPACE_KEY ||
|
|
195
|
-
trigger === MDCChipActionInteractionTrigger.DELETE_KEY) {
|
|
196
|
-
return true;
|
|
197
|
-
}
|
|
198
|
-
return source === MDCChipActionType.TRAILING;
|
|
199
|
-
}
|
|
200
|
-
getRemovedAnnouncement() {
|
|
201
|
-
const msg = this.adapter.getAttribute(MDCChipAttributes.DATA_REMOVED_ANNOUNCEMENT);
|
|
202
|
-
return msg || undefined;
|
|
203
|
-
}
|
|
204
|
-
getAddedAnnouncement() {
|
|
205
|
-
const msg = this.adapter.getAttribute(MDCChipAttributes.DATA_ADDED_ANNOUNCEMENT);
|
|
206
|
-
return msg || undefined;
|
|
207
|
-
}
|
|
208
|
-
animateSelection(isSelected) {
|
|
209
|
-
this.resetAnimationStyles();
|
|
210
|
-
// Wait two frames to ensure the animation classes are unset
|
|
211
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
212
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
213
|
-
this.updateSelectionStyles(isSelected);
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
resetAnimationStyles() {
|
|
218
|
-
this.adapter.removeClass(MDCChipCssClasses.SELECTING);
|
|
219
|
-
this.adapter.removeClass(MDCChipCssClasses.DESELECTING);
|
|
220
|
-
this.adapter.removeClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);
|
|
221
|
-
this.adapter.removeClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);
|
|
222
|
-
}
|
|
223
|
-
updateSelectionStyles(isSelected) {
|
|
224
|
-
const hasIcon = this.adapter.hasClass(MDCChipCssClasses.WITH_PRIMARY_ICON);
|
|
225
|
-
if (hasIcon && isSelected) {
|
|
226
|
-
this.adapter.addClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);
|
|
227
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
228
|
-
this.adapter.addClass(MDCChipCssClasses.SELECTED);
|
|
229
|
-
});
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
if (hasIcon && !isSelected) {
|
|
233
|
-
this.adapter.addClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);
|
|
234
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
235
|
-
this.adapter.removeClass(MDCChipCssClasses.SELECTED);
|
|
236
|
-
});
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
if (isSelected) {
|
|
240
|
-
this.adapter.addClass(MDCChipCssClasses.SELECTING);
|
|
241
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
242
|
-
this.adapter.addClass(MDCChipCssClasses.SELECTED);
|
|
243
|
-
});
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
if (!isSelected) {
|
|
247
|
-
this.adapter.addClass(MDCChipCssClasses.DESELECTING);
|
|
248
|
-
this.animFrame.request(AnimationKeys.SELECTION, () => {
|
|
249
|
-
this.adapter.removeClass(MDCChipCssClasses.SELECTED);
|
|
250
|
-
});
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
//# sourceMappingURL=foundation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["foundation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,0BAA0B,EAAE,+BAA+B,EAAE,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAI7H,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAQrG,IAAK,SAIJ;AAJD,WAAK,SAAS;IACZ,uDAAW,CAAA;IACX,yCAAI,CAAA;IACJ,2CAAK,CAAA;AACP,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED,IAAK,aAGJ;AAHD,WAAK,aAAa;IAChB,wCAAuB,CAAA;IACvB,8BAAa,CAAA;AACf,CAAC,EAHI,aAAa,KAAb,aAAa,QAGjB;AAED;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAG5B,MAAM,KAAK,cAAc;QACvB,OAAO;YACL,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;YACzB,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;YAC1B,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE;YACpB,YAAY,EAAE,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CAAC,QAAQ,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;YACH,OAAO;SACR;QAED,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE;gBACnD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO;SACR;IACH,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {MDCChipActionFocusBehavior, MDCChipActionInteractionTrigger, MDCChipActionType} from '../../action/lib/constants.js';\nimport {MDCChipActionInteractionEventDetail} from '../../action/lib/types.js';\n\nimport {MDCChipAdapter} from './adapter.js';\nimport {AnimationFrame} from './animationframe.js';\nimport {MDCChipAnimation, MDCChipAttributes, MDCChipCssClasses, MDCChipEvents} from './constants.js';\nimport {ActionInteractionEvent, ActionNavigationEvent, MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail} from './types.js';\n\ninterface Navigation {\n from: MDCChipActionType;\n to: MDCChipActionType;\n}\n\nenum Direction {\n UNSPECIFIED, // Default\n LEFT,\n RIGHT,\n}\n\nenum AnimationKeys {\n SELECTION = 'selection',\n EXIT = 'exit',\n}\n\n/**\n * MDCChipFoundation provides a foundation for all chips.\n */\nexport class MDCChipFoundation {\n private readonly adapter: MDCChipAdapter;\n\n static get defaultAdapter(): MDCChipAdapter {\n return {\n addClass: () => undefined,\n emitEvent: () => undefined,\n getActions: () => [],\n getAttribute: () => null,\n getElementID: () => '',\n getOffsetWidth: () => 0,\n hasClass: () => false,\n isActionDisabled: () => false,\n isActionFocusable: () => false,\n isActionSelectable: () => false,\n isActionSelected: () => false,\n isRTL: () => false,\n removeClass: () => undefined,\n setActionDisabled: () => undefined,\n setActionFocus: () => undefined,\n setActionSelected: () => undefined,\n setStyleProperty: () => undefined,\n };\n }\n\n private readonly animFrame: AnimationFrame;\n\n constructor(adapter?: Partial<MDCChipAdapter>) {\n this.adapter = {...MDCChipFoundation.defaultAdapter, ...adapter};\n this.animFrame = new AnimationFrame();\n }\n\n destroy() {\n this.animFrame.cancelAll();\n }\n\n getElementID() {\n return this.adapter.getElementID();\n }\n\n setDisabled(isDisabled: boolean) {\n const actions = this.getActions();\n for (const action of actions) {\n this.adapter.setActionDisabled(action, isDisabled);\n }\n\n if (isDisabled) {\n this.adapter.addClass(MDCChipCssClasses.DISABLED);\n } else {\n this.adapter.removeClass(MDCChipCssClasses.DISABLED);\n }\n }\n\n isDisabled(): boolean {\n const actions = this.getActions();\n for (const action of actions) {\n if (this.adapter.isActionDisabled(action)) {\n return true;\n }\n }\n return false;\n }\n\n getActions(): MDCChipActionType[] {\n return this.adapter.getActions();\n }\n\n isActionFocusable(action: MDCChipActionType): boolean {\n return this.adapter.isActionFocusable(action);\n }\n\n isActionSelectable(action: MDCChipActionType): boolean {\n return this.adapter.isActionSelectable(action);\n }\n\n isActionSelected(action: MDCChipActionType): boolean {\n return this.adapter.isActionSelected(action);\n }\n\n setActionFocus(action: MDCChipActionType, focus: MDCChipActionFocusBehavior) {\n this.adapter.setActionFocus(action, focus);\n }\n\n setActionSelected(action: MDCChipActionType, isSelected: boolean) {\n this.adapter.setActionSelected(action, isSelected);\n this.animateSelection(isSelected);\n }\n\n startAnimation(animation: MDCChipAnimation) {\n if (animation === MDCChipAnimation.ENTER) {\n this.adapter.addClass(MDCChipCssClasses.ENTER);\n return;\n }\n\n if (animation === MDCChipAnimation.EXIT) {\n this.adapter.addClass(MDCChipCssClasses.EXIT);\n return;\n }\n }\n\n handleAnimationEnd(event: AnimationEvent) {\n const {animationName} = event;\n if (animationName === MDCChipAnimation.ENTER) {\n this.adapter.removeClass(MDCChipCssClasses.ENTER);\n this.adapter.emitEvent<MDCChipAnimationEventDetail>(\n MDCChipEvents.ANIMATION, {\n chipID: this.getElementID(),\n animation: MDCChipAnimation.ENTER,\n addedAnnouncement: this.getAddedAnnouncement(),\n isComplete: true,\n });\n return;\n }\n\n if (animationName === MDCChipAnimation.EXIT) {\n this.adapter.removeClass(MDCChipCssClasses.EXIT);\n this.adapter.addClass(MDCChipCssClasses.HIDDEN);\n const width = this.adapter.getOffsetWidth();\n this.adapter.setStyleProperty('width', `${width}px`);\n // Wait two frames so the width gets applied correctly.\n this.animFrame.request(AnimationKeys.EXIT, () => {\n this.animFrame.request(AnimationKeys.EXIT, () => {\n this.adapter.setStyleProperty('width', '0');\n });\n });\n }\n }\n\n handleTransitionEnd() {\n if (!this.adapter.hasClass(MDCChipCssClasses.HIDDEN)) return;\n\n this.adapter.emitEvent<MDCChipAnimationEventDetail>(\n MDCChipEvents.ANIMATION, {\n chipID: this.getElementID(),\n animation: MDCChipAnimation.EXIT,\n removedAnnouncement: this.getRemovedAnnouncement(),\n isComplete: true,\n });\n }\n\n handleActionInteraction({detail}: ActionInteractionEvent) {\n const {source, actionID} = detail;\n const isSelectable = this.adapter.isActionSelectable(source);\n const isSelected = this.adapter.isActionSelected(source);\n\n this.adapter.emitEvent<MDCChipInteractionEventDetail>(\n MDCChipEvents.INTERACTION, {\n chipID: this.getElementID(),\n shouldRemove: this.shouldRemove(detail),\n actionID,\n isSelectable,\n isSelected,\n source,\n });\n }\n\n handleActionNavigation({detail}: ActionNavigationEvent) {\n const {source, key} = detail;\n const isRTL = this.adapter.isRTL();\n const isTrailingActionFocusable =\n this.adapter.isActionFocusable(MDCChipActionType.TRAILING);\n const isPrimaryActionFocusable =\n this.adapter.isActionFocusable(MDCChipActionType.PRIMARY);\n const dir = this.directionFromKey(key, isRTL);\n\n const shouldNavigateToTrailing = source === MDCChipActionType.PRIMARY &&\n dir === Direction.RIGHT && isTrailingActionFocusable;\n\n const shouldNavigateToPrimary = source === MDCChipActionType.TRAILING &&\n dir === Direction.LEFT && isPrimaryActionFocusable;\n\n if (shouldNavigateToTrailing) {\n this.navigateActions({from: source, to: MDCChipActionType.TRAILING});\n return;\n }\n\n if (shouldNavigateToPrimary) {\n this.navigateActions({from: source, to: MDCChipActionType.PRIMARY});\n return;\n }\n\n this.adapter.emitEvent<MDCChipNavigationEventDetail>(\n MDCChipEvents.NAVIGATION, {\n chipID: this.getElementID(),\n isRTL,\n source,\n key,\n });\n }\n\n private directionFromKey(key: string, isRTL: boolean): Direction {\n const isLeftKey = key === 'ArrowLeft';\n const isRightKey = key === 'ArrowRight';\n if (!isRTL && isLeftKey || isRTL && isRightKey) {\n return Direction.LEFT;\n }\n\n if (!isRTL && isRightKey || isRTL && isLeftKey) {\n return Direction.RIGHT;\n }\n\n return Direction.UNSPECIFIED;\n }\n\n private navigateActions(nav: Navigation) {\n this.adapter.setActionFocus(\n nav.from, MDCChipActionFocusBehavior.NOT_FOCUSABLE);\n this.adapter.setActionFocus(\n nav.to, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);\n }\n\n private shouldRemove({source, trigger}: MDCChipActionInteractionEventDetail):\n boolean {\n if (trigger === MDCChipActionInteractionTrigger.BACKSPACE_KEY ||\n trigger === MDCChipActionInteractionTrigger.DELETE_KEY) {\n return true;\n }\n\n return source === MDCChipActionType.TRAILING;\n }\n\n private getRemovedAnnouncement(): string|undefined {\n const msg =\n this.adapter.getAttribute(MDCChipAttributes.DATA_REMOVED_ANNOUNCEMENT);\n return msg || undefined;\n }\n\n private getAddedAnnouncement(): string|undefined {\n const msg =\n this.adapter.getAttribute(MDCChipAttributes.DATA_ADDED_ANNOUNCEMENT);\n return msg || undefined;\n }\n\n private animateSelection(isSelected: boolean) {\n this.resetAnimationStyles();\n // Wait two frames to ensure the animation classes are unset\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.updateSelectionStyles(isSelected);\n });\n });\n }\n\n private resetAnimationStyles() {\n this.adapter.removeClass(MDCChipCssClasses.SELECTING);\n this.adapter.removeClass(MDCChipCssClasses.DESELECTING);\n this.adapter.removeClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);\n this.adapter.removeClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);\n }\n\n private updateSelectionStyles(isSelected: boolean) {\n const hasIcon = this.adapter.hasClass(MDCChipCssClasses.WITH_PRIMARY_ICON);\n if (hasIcon && isSelected) {\n this.adapter.addClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.adapter.addClass(MDCChipCssClasses.SELECTED);\n });\n return;\n }\n\n if (hasIcon && !isSelected) {\n this.adapter.addClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.adapter.removeClass(MDCChipCssClasses.SELECTED);\n });\n return;\n }\n\n if (isSelected) {\n this.adapter.addClass(MDCChipCssClasses.SELECTING);\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.adapter.addClass(MDCChipCssClasses.SELECTED);\n });\n return;\n }\n\n if (!isSelected) {\n this.adapter.addClass(MDCChipCssClasses.DESELECTING);\n this.animFrame.request(AnimationKeys.SELECTION, () => {\n this.adapter.removeClass(MDCChipCssClasses.SELECTED);\n });\n return;\n }\n }\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import '../../action/link-action.js';
|
|
7
|
-
import { TemplateResult } from 'lit';
|
|
8
|
-
import { Chip } from './chip.js';
|
|
9
|
-
/** @soyCompatible */
|
|
10
|
-
export declare class LinkChip extends Chip {
|
|
11
|
-
href: string;
|
|
12
|
-
target: string;
|
|
13
|
-
/**
|
|
14
|
-
* @soyTemplate
|
|
15
|
-
* @soyAttributes attributes: .md3-chip
|
|
16
|
-
* @soyAttributes linkAttributes: .md3-chip__action
|
|
17
|
-
*/
|
|
18
|
-
protected render(): TemplateResult;
|
|
19
|
-
/** @soyTemplate */
|
|
20
|
-
private renderPrimaryAction;
|
|
21
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { __decorate, __metadata } from "tslib";
|
|
7
|
-
// import '@material/web/chips/action.js';
|
|
8
|
-
import '../../action/link-action.js';
|
|
9
|
-
import { html } from 'lit';
|
|
10
|
-
import { property } from 'lit/decorators.js';
|
|
11
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
12
|
-
import { Chip } from './chip.js';
|
|
13
|
-
/** @soyCompatible */
|
|
14
|
-
export class LinkChip extends Chip {
|
|
15
|
-
/**
|
|
16
|
-
* @soyTemplate
|
|
17
|
-
* @soyAttributes attributes: .md3-chip
|
|
18
|
-
* @soyAttributes linkAttributes: .md3-chip__action
|
|
19
|
-
*/
|
|
20
|
-
render() {
|
|
21
|
-
return html `
|
|
22
|
-
<span class="${classMap(this.getRootClasses())}" role="row">
|
|
23
|
-
${this.renderOverlay()}
|
|
24
|
-
<span class="md3-chip__cell md3-chip__cell--primary" role="gridcell">
|
|
25
|
-
${this.renderPrimaryAction()}
|
|
26
|
-
</span>
|
|
27
|
-
${this.renderDeleteAction()}
|
|
28
|
-
</span>`;
|
|
29
|
-
}
|
|
30
|
-
/** @soyTemplate */
|
|
31
|
-
renderPrimaryAction() {
|
|
32
|
-
return html `
|
|
33
|
-
<md-link-action
|
|
34
|
-
?disabled=${this.disabled}
|
|
35
|
-
?isFocusable=${this.isFocusable}
|
|
36
|
-
?isTouchable=${this.isTouchable}
|
|
37
|
-
.icon=${this.icon}
|
|
38
|
-
.label=${this.label}
|
|
39
|
-
.ariaLabel=${this.ariaLabel}
|
|
40
|
-
.href=${this.href}
|
|
41
|
-
.target=${this.target}>
|
|
42
|
-
</md-link-action>`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
__decorate([
|
|
46
|
-
property({ type: String }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], LinkChip.prototype, "href", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
property({ type: String }),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], LinkChip.prototype, "target", void 0);
|
|
53
|
-
//# sourceMappingURL=link-chip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-chip.js","sourceRoot":"","sources":["link-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,0CAA0C;AAC1C,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,qBAAqB;AACrB,MAAM,OAAO,QAAS,SAAQ,IAAI;IAKhC;;;;OAIG;IACgB,MAAM;QACvB,OAAO,IAAI,CAAA;qBACM,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;UAC1C,IAAI,CAAC,aAAa,EAAE;;YAElB,IAAI,CAAC,mBAAmB,EAAE;;UAE5B,IAAI,CAAC,kBAAkB,EAAE;cACrB,CAAC;IACb,CAAC;IAED,mBAAmB;IACX,mBAAmB;QACzB,OAAO,IAAI,CAAA;;sBAEO,IAAI,CAAC,QAAQ;yBACV,IAAI,CAAC,WAAW;yBAChB,IAAI,CAAC,WAAW;kBACvB,IAAI,CAAC,IAAI;mBACR,IAAI,CAAC,KAAK;uBACN,IAAI,CAAC,SAAS;kBACnB,IAAI,CAAC,IAAI;oBACP,IAAI,CAAC,MAAM;wBACP,CAAC;IACvB,CAAC;CACF;AAlCC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;sCAAe;AAExC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;wCAAiB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// import '@material/web/chips/action.js';\nimport '../../action/link-action.js';\n\nimport {html, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {Chip} from './chip.js';\n\n/** @soyCompatible */\nexport class LinkChip extends Chip {\n @property({type: String}) href!: string;\n\n @property({type: String}) target!: string;\n\n /**\n * @soyTemplate\n * @soyAttributes attributes: .md3-chip\n * @soyAttributes linkAttributes: .md3-chip__action\n */\n protected override render(): TemplateResult {\n return html`\n <span class=\"${classMap(this.getRootClasses())}\" role=\"row\">\n ${this.renderOverlay()}\n <span class=\"md3-chip__cell md3-chip__cell--primary\" role=\"gridcell\">\n ${this.renderPrimaryAction()}\n </span>\n ${this.renderDeleteAction()}\n </span>`;\n }\n\n /** @soyTemplate */\n private renderPrimaryAction(): TemplateResult {\n return html`\n <md-link-action\n ?disabled=${this.disabled}\n ?isFocusable=${this.isFocusable}\n ?isTouchable=${this.isTouchable}\n .icon=${this.icon}\n .label=${this.label}\n .ariaLabel=${this.ariaLabel}\n .href=${this.href}\n .target=${this.target}>\n </md-link-action>`;\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import '../../action/presentational-action.js';
|
|
7
|
-
import { TemplateResult } from 'lit';
|
|
8
|
-
import { Chip } from './chip.js';
|
|
9
|
-
/** @soyCompatible */
|
|
10
|
-
export declare class PresentationalChip extends Chip {
|
|
11
|
-
/**
|
|
12
|
-
* @soyTemplate
|
|
13
|
-
* @soyAttributes attributes: .md3-chip
|
|
14
|
-
*/
|
|
15
|
-
protected render(): TemplateResult;
|
|
16
|
-
/** @soyTemplate */
|
|
17
|
-
private renderPrimaryAction;
|
|
18
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import '../../action/presentational-action.js';
|
|
7
|
-
import { html } from 'lit';
|
|
8
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
9
|
-
import { Chip } from './chip.js';
|
|
10
|
-
/** @soyCompatible */
|
|
11
|
-
export class PresentationalChip extends Chip {
|
|
12
|
-
/**
|
|
13
|
-
* @soyTemplate
|
|
14
|
-
* @soyAttributes attributes: .md3-chip
|
|
15
|
-
*/
|
|
16
|
-
render() {
|
|
17
|
-
return html `
|
|
18
|
-
<span class="${classMap(this.getRootClasses())}" role="row">
|
|
19
|
-
${this.renderOverlay()}
|
|
20
|
-
<span class="md3-chip__cell md3-chip__cell--primary" role="gridcell">
|
|
21
|
-
${this.renderPrimaryAction()}
|
|
22
|
-
</span>
|
|
23
|
-
${this.renderDeleteAction()}
|
|
24
|
-
</span>`;
|
|
25
|
-
}
|
|
26
|
-
/** @soyTemplate */
|
|
27
|
-
renderPrimaryAction() {
|
|
28
|
-
return html `
|
|
29
|
-
<md-presentational-action
|
|
30
|
-
?disabled=${this.disabled}
|
|
31
|
-
?isFocusable=${this.isFocusable}
|
|
32
|
-
?isTouchable=${this.isTouchable}
|
|
33
|
-
.icon=${this.icon}
|
|
34
|
-
.label=${this.label}
|
|
35
|
-
.ariaLabel=${this.ariaLabel}>
|
|
36
|
-
</md-presentational-action>`;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=presentational-chip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presentational-chip.js","sourceRoot":"","sources":["presentational-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,uCAAuC,CAAC;AAE/C,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,qBAAqB;AACrB,MAAM,OAAO,kBAAmB,SAAQ,IAAI;IAC1C;;;OAGG;IACgB,MAAM;QACvB,OAAO,IAAI,CAAA;qBACM,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;UAC1C,IAAI,CAAC,aAAa,EAAE;;YAElB,IAAI,CAAC,mBAAmB,EAAE;;UAE5B,IAAI,CAAC,kBAAkB,EAAE;cACrB,CAAC;IACb,CAAC;IAED,mBAAmB;IACX,mBAAmB;QACzB,OAAO,IAAI,CAAA;;sBAEO,IAAI,CAAC,QAAQ;yBACV,IAAI,CAAC,WAAW;yBAChB,IAAI,CAAC,WAAW;kBACvB,IAAI,CAAC,IAAI;mBACR,IAAI,CAAC,KAAK;uBACN,IAAI,CAAC,SAAS;kCACH,CAAC;IACjC,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../action/presentational-action.js';\n\nimport {html, TemplateResult} from 'lit';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {Chip} from './chip.js';\n\n/** @soyCompatible */\nexport class PresentationalChip extends Chip {\n /**\n * @soyTemplate\n * @soyAttributes attributes: .md3-chip\n */\n protected override render(): TemplateResult {\n return html`\n <span class=\"${classMap(this.getRootClasses())}\" role=\"row\">\n ${this.renderOverlay()}\n <span class=\"md3-chip__cell md3-chip__cell--primary\" role=\"gridcell\">\n ${this.renderPrimaryAction()}\n </span>\n ${this.renderDeleteAction()}\n </span>`;\n }\n\n /** @soyTemplate */\n private renderPrimaryAction(): TemplateResult {\n return html`\n <md-presentational-action\n ?disabled=${this.disabled}\n ?isFocusable=${this.isFocusable}\n ?isTouchable=${this.isTouchable}\n .icon=${this.icon}\n .label=${this.label}\n .ariaLabel=${this.ariaLabel}>\n </md-presentational-action>`;\n }\n}\n\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import '../../action/selectable-action.js';
|
|
7
|
-
import { TemplateResult } from 'lit';
|
|
8
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
9
|
-
import { Chip } from './chip.js';
|
|
10
|
-
/** @soyCompatible */
|
|
11
|
-
export declare class SelectableChip extends Chip {
|
|
12
|
-
selected: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @soyTemplate
|
|
15
|
-
* @soyAttributes attributes: .md3-chip
|
|
16
|
-
*/
|
|
17
|
-
protected render(): TemplateResult;
|
|
18
|
-
/** @soyTemplate */
|
|
19
|
-
protected getRootClasses(): ClassInfo;
|
|
20
|
-
/** @soyTemplate */
|
|
21
|
-
private renderPrimaryAction;
|
|
22
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { __decorate, __metadata } from "tslib";
|
|
7
|
-
import '../../action/selectable-action.js';
|
|
8
|
-
import { html } from 'lit';
|
|
9
|
-
import { property } from 'lit/decorators.js';
|
|
10
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
-
import { Chip } from './chip.js';
|
|
12
|
-
/** @soyCompatible */
|
|
13
|
-
export class SelectableChip extends Chip {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.selected = false;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @soyTemplate
|
|
20
|
-
* @soyAttributes attributes: .md3-chip
|
|
21
|
-
*/
|
|
22
|
-
render() {
|
|
23
|
-
return html `
|
|
24
|
-
<span class="${classMap(this.getRootClasses())}" role="presentation">
|
|
25
|
-
${this.renderOverlay()}
|
|
26
|
-
${this.renderPrimaryAction()}
|
|
27
|
-
${this.renderDeleteAction()}
|
|
28
|
-
</span>`;
|
|
29
|
-
}
|
|
30
|
-
/** @soyTemplate */
|
|
31
|
-
getRootClasses() {
|
|
32
|
-
return {
|
|
33
|
-
...super.getRootClasses(),
|
|
34
|
-
'md3-chip--with-primary-graphic': true,
|
|
35
|
-
'md3-chip--selectable': true,
|
|
36
|
-
'md3-chip--selected': this.selected,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/** @soyTemplate */
|
|
40
|
-
renderPrimaryAction() {
|
|
41
|
-
return html `
|
|
42
|
-
<md-selectable-action
|
|
43
|
-
?disabled=${this.disabled}
|
|
44
|
-
?selected=${this.selected}
|
|
45
|
-
?isFocusable=${this.isFocusable}
|
|
46
|
-
?isTouchable=${this.isTouchable}
|
|
47
|
-
.icon=${this.icon}
|
|
48
|
-
.label=${this.label}
|
|
49
|
-
.ariaLabel=${this.ariaLabel}>
|
|
50
|
-
</md-selectable-action>`;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
__decorate([
|
|
54
|
-
property({ type: Boolean, reflect: true }),
|
|
55
|
-
__metadata("design:type", Object)
|
|
56
|
-
], SelectableChip.prototype, "selected", void 0);
|
|
57
|
-
//# sourceMappingURL=selectable-chip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectable-chip.js","sourceRoot":"","sources":["selectable-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,mCAAmC,CAAC;AAE3C,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,qBAAqB;AACrB,MAAM,OAAO,cAAe,SAAQ,IAAI;IAAxC;;QAC4C,aAAQ,GAAG,KAAK,CAAC;IAsC7D,CAAC;IApCC;;;OAGG;IACgB,MAAM;QACvB,OAAO,IAAI,CAAA;qBACM,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;UAC1C,IAAI,CAAC,aAAa,EAAE;UACpB,IAAI,CAAC,mBAAmB,EAAE;UAC1B,IAAI,CAAC,kBAAkB,EAAE;cACrB,CAAC;IACb,CAAC;IAED,mBAAmB;IACA,cAAc;QAC/B,OAAO;YACL,GAAG,KAAK,CAAC,cAAc,EAAE;YACzB,gCAAgC,EAAE,IAAI;YACtC,sBAAsB,EAAE,IAAI;YAC5B,oBAAoB,EAAE,IAAI,CAAC,QAAQ;SACpC,CAAC;IACJ,CAAC;IAED,mBAAmB;IACX,mBAAmB;QACzB,OAAO,IAAI,CAAA;;sBAEO,IAAI,CAAC,QAAQ;sBACb,IAAI,CAAC,QAAQ;yBACV,IAAI,CAAC,WAAW;yBAChB,IAAI,CAAC,WAAW;kBACvB,IAAI,CAAC,IAAI;mBACR,IAAI,CAAC,KAAK;uBACN,IAAI,CAAC,SAAS;8BACP,CAAC;IAC7B,CAAC;CACF;AAtCC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;gDAAkB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../action/selectable-action.js';\n\nimport {html, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {Chip} from './chip.js';\n\n/** @soyCompatible */\nexport class SelectableChip extends Chip {\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * @soyTemplate\n * @soyAttributes attributes: .md3-chip\n */\n protected override render(): TemplateResult {\n return html`\n <span class=\"${classMap(this.getRootClasses())}\" role=\"presentation\">\n ${this.renderOverlay()}\n ${this.renderPrimaryAction()}\n ${this.renderDeleteAction()}\n </span>`;\n }\n\n /** @soyTemplate */\n protected override getRootClasses(): ClassInfo {\n return {\n ...super.getRootClasses(),\n 'md3-chip--with-primary-graphic': true,\n 'md3-chip--selectable': true,\n 'md3-chip--selected': this.selected,\n };\n }\n\n /** @soyTemplate */\n private renderPrimaryAction(): TemplateResult {\n return html`\n <md-selectable-action\n ?disabled=${this.disabled}\n ?selected=${this.selected}\n ?isFocusable=${this.isFocusable}\n ?isTouchable=${this.isTouchable}\n .icon=${this.icon}\n .label=${this.label}\n .ariaLabel=${this.ariaLabel}>\n </md-selectable-action>`;\n }\n}\n\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { MDCChipActionType } from '../../action/lib/constants.js';
|
|
7
|
-
import { MDCChipActionInteractionEventDetail, MDCChipActionNavigationEventDetail } from '../../action/lib/types.js';
|
|
8
|
-
import { MDCChipAnimation } from './constants.js';
|
|
9
|
-
/** MDCChipInteractionEventDetail provides details for the interaction event. */
|
|
10
|
-
export interface MDCChipInteractionEventDetail {
|
|
11
|
-
actionID: string;
|
|
12
|
-
chipID: string;
|
|
13
|
-
source: MDCChipActionType;
|
|
14
|
-
shouldRemove: boolean;
|
|
15
|
-
isSelectable: boolean;
|
|
16
|
-
isSelected: boolean;
|
|
17
|
-
}
|
|
18
|
-
/** MDCChipNavigationEventDetail provides details for the navigation event. */
|
|
19
|
-
export interface MDCChipNavigationEventDetail {
|
|
20
|
-
chipID: string;
|
|
21
|
-
source: MDCChipActionType;
|
|
22
|
-
key: string;
|
|
23
|
-
isRTL: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* MDCChipAnimationEventDetail provides details for the animation event.
|
|
27
|
-
*/
|
|
28
|
-
export interface MDCChipAnimationEventDetail {
|
|
29
|
-
chipID: string;
|
|
30
|
-
animation: MDCChipAnimation;
|
|
31
|
-
isComplete: boolean;
|
|
32
|
-
addedAnnouncement?: string;
|
|
33
|
-
removedAnnouncement?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* MDCChipActionInteractionEvent is the custom event for the interaction event.
|
|
37
|
-
*/
|
|
38
|
-
export type ActionInteractionEvent = CustomEvent<MDCChipActionInteractionEventDetail>;
|
|
39
|
-
/**
|
|
40
|
-
* MDCChipActionInteractionEvent is the custom event for the interaction event.
|
|
41
|
-
*/
|
|
42
|
-
export type ActionNavigationEvent = CustomEvent<MDCChipActionNavigationEventDetail>;
|
package/chips/chip/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {MDCChipActionType} from '../../action/lib/constants.js';\nimport {MDCChipActionInteractionEventDetail, MDCChipActionNavigationEventDetail} from '../../action/lib/types.js';\n\nimport {MDCChipAnimation} from './constants.js';\n\n/** MDCChipInteractionEventDetail provides details for the interaction event. */\nexport interface MDCChipInteractionEventDetail {\n actionID: string;\n chipID: string;\n source: MDCChipActionType;\n shouldRemove: boolean;\n isSelectable: boolean;\n isSelected: boolean;\n}\n\n/** MDCChipNavigationEventDetail provides details for the navigation event. */\nexport interface MDCChipNavigationEventDetail {\n chipID: string;\n source: MDCChipActionType;\n key: string;\n isRTL: boolean;\n}\n\n/**\n * MDCChipAnimationEventDetail provides details for the animation event.\n */\nexport interface MDCChipAnimationEventDetail {\n chipID: string;\n animation: MDCChipAnimation;\n isComplete: boolean;\n addedAnnouncement?: string;\n removedAnnouncement?: string;\n}\n\n/**\n * MDCChipActionInteractionEvent is the custom event for the interaction event.\n */\nexport type ActionInteractionEvent =\n CustomEvent<MDCChipActionInteractionEventDetail>;\n\n/**\n * MDCChipActionInteractionEvent is the custom event for the interaction event.\n */\nexport type ActionNavigationEvent =\n CustomEvent<MDCChipActionNavigationEventDetail>;\n"]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// go/keep-sorted start
|
|
8
|
-
@use 'sass:math';
|
|
9
|
-
// go/keep-sorted end
|
|
10
|
-
|
|
11
|
-
// stylelint-disable selector-class-pattern -- MDC internal usage.
|
|
12
|
-
|
|
13
|
-
$space-between-chips: 8px;
|
|
14
|
-
|
|
15
|
-
///
|
|
16
|
-
/// Sets the horiontal space between the chips in the chip set.
|
|
17
|
-
/// @param {Number} $space - The horizontal space between the chips.
|
|
18
|
-
///
|
|
19
|
-
@mixin horizontal-space-between-chips($space) {
|
|
20
|
-
///
|
|
21
|
-
/// We should use the column-gap property when our browser matrix allows.
|
|
22
|
-
///
|
|
23
|
-
|
|
24
|
-
.md3-chip-set__chips {
|
|
25
|
-
// Set the margin to the negative horizontal space to account for chips
|
|
26
|
-
// being inset on the leading edge.
|
|
27
|
-
// TODO(b/248173007): Explore using CSS grid layout instead.
|
|
28
|
-
margin-inline-start: -$space;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.md3-chip {
|
|
32
|
-
margin-inline-start: $space;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
///
|
|
37
|
-
/// Sets the vertical space between the chips in the chip set.
|
|
38
|
-
/// @param {Number} $space - The vertical space between the chips.
|
|
39
|
-
///
|
|
40
|
-
@mixin vertical-space-between-chips($space) {
|
|
41
|
-
///
|
|
42
|
-
/// We should use the row-gap property when our browser matrix allows.
|
|
43
|
-
///
|
|
44
|
-
|
|
45
|
-
.md3-chip {
|
|
46
|
-
// Set top and bottom to half the vertical space since there's no
|
|
47
|
-
// well supported method for vertical wrapping gaps.
|
|
48
|
-
margin-block: math.div($space, 2);
|
|
49
|
-
}
|
|
50
|
-
}
|