Progress Indicators
The MDC Progress Indicator component exposes common foundation and component interfaces for a progress indicator. Components that implement these interfaces include linear progress and circular progress.
Material Design progress & activity requirements.
Installation
npm install @material/progress-indicator
Basic Usage
MDCProgressIndicatorFoundation API
MDC Progress Indicator Foundation exposes the following methods:
Method Signature | Description |
---|
setDeterminate(value: boolean) => void | Toggles the component between the determinate and indeterminate state. |
setProgress(value: number) => void | Sets the progress to this value. Value should be between [0, 1]. |
open() => void | Puts the component in the open state. |
close() => void | Puts the component in the closed state. |
MDCProgressIndicator Component API
MDC Progress Indicator exposes the following API:
Method Signature | Description |
---|
determinate: boolean | Whether the indicator is in the determinate or indeterminate state. |
progress: number | The current progress. Value should be between [0, 1]. |
open() => void | Puts the component in the open state. |
close() => void | Puts the component in the closed state. |
9.0.0 (2020-12-29)
Bug Fixes
- data-table: fix style ordering wrt select & use new variable-width mixin (afb6889), closes #6599
- list: add support for density scaling. (419e035)
- list: add support for non-interactive list roles. (fc8b045)
- list: ensure divider appears in IE high contrast mode. (eff7b46)
- Adding tests. (240c5f7)
- adjust meta baseline and update color mixins. (07f3e01)
- Document stylelint exceptions (f89d8b8)
- notched-outline: fix notched outline no-label style (99cfb6b)
- select: debounce click on anchor (b39094d)
- slider: Adjust hidden input dimensions to take slider dimensions, such that screenreader focus indicators show a highlight around the entire slider. (fd22355)
- slider: Fix bug where value indicator container took space and could be hovered over / clicked when hidden. (832668d)
- slider: Remove big step options. Now that we're using a native range input, big step is not customizable - we follow browser defaults for big step. (ae27b44)
- slider: Update both thumbs' value indicator UI's if layout is invoked with undefined
thumb
. (489d4c2) - tabs: Expose min width mixin and set to 90px per spec. (c4ab987)
Code Refactoring
- Remove MDC theme's deep-get, used sass:map's get API instead. (37fbae1)
Features
- banner: Add mobile-stacked variant support to banner. (a0b2db2)
- checkbox: Add CSS custom properties to MDC checkbox for density theming (9244508)
- checkbox: Add validation to MDC Checkbox theme mixin (2d5f32d)
- circular-progress: do not require HTML without whitespaces (8648b82)
- linear-progress: remove aria-valuemin/max attrs for indeterminate (4321323)
- list: support ctrl + a keyboard shortcut (eefef49), closes #6366
- select: add mixin for variable width (30c11bf)
- slider: Add hidden input to slider, to support forms submission. This is also prep for moving to use an <input type="range"> behind the scenes, in order to support touch-based AT's. (b98d15d)
- slider: Modify continuous slider to use step value by default, and give clients the option to customize step value for continuous sliders. (7ad038e)
- slider: Use input with type="range" to back slider component. This ensures that sliders can be adjusted with touch-based assistive technologies, as the current ARIA spec for sliders is not compatible with e.g. TalkBack/Android. (9083b7d)
- theme: Added validation mixin to validate provided theme configuration keys (1c156d6)
- tooltip: Add positioning adjustment and position specification for rich tooltips. Rich tooltips default to the END position and does not support CENTER positioning. (384a8ee)
- tooltip: Added persistent variant for rich tooltips that shows/hides based on mouse clicks on the anchor element. Clicks on elements other than the anchor will also hide the persistent variant. (9775856)
- tooltip: Adjust tooltip position on
scroll
and resize
events. This ensures that the tooltip remains pinned to the anchor element despite page movement. (a415276) - tooltip: Adjusting tooltip positioning logic so that the tooltip remains within the viewport even if the anchor element is partially off-screen. (482ff90)
- tooltip: Hide rich tooltip if mouse leaves rich tooltip. Rich tooltip persists if mouse leaves rich tooltip and enters anchor. (6d8574f)
- tooltip: Make persistent rich tooltips persist when click target is within the rich tooltip. (fb194dd)
- tooltip: Reducing minimum threshold distance between tooltip and viewport from 32px to 8px. (23491cf)
- tooltip: Restore focus to the anchor element when the ESC button is pressed while the focus is in the tooltip for rich tooltips. Default rich tooltips should have focus restored to anchor and not have rich tooltips show. (eabf9d5)
- tooltip: Set up base sass for rich tooltip. Rich tooltips are currently in development and is not yet ready for use. (4ae94ff)
- tooltip: Set up rich tooltip to persist if mouse leaves anchor and enters rich tooltip. (c927a5d)
- tooltip: The aria-expanded attribute of the anchor element will only be changed for anchor elements with interactive rich tooltips. Non-interactive rich tooltip anchor elements do not have the aria-haspopup and aria-expanded attributes. (c5dda80)
- tooltip: When the anchor element blurs, the rich tooltip will only be hidden if the focus is changed to a non-rich tooltip element. (6871336)
- tooltip: When the rich tooltip element focuses out, hide the rich tooltip if the new focused element is not the anchor element or an element within the rich tooltip. (1085c3b)
- Added global variable to conditionally emit CSS selector fallback declarations (7b0e2b3)
BREAKING CHANGES
- tooltip: Added adapter method:
- tooltipContainsElement(element: HTMLElement): boolean;
Rich tooltips are currently in development and is not yet ready for use.
PiperOrigin-RevId: 346325244
- Removed
deep-get()
API from mdc-theme, use sass:map
's get() API instead.
PiperOrigin-RevId: 345257138
- tooltip: Added adapter method:
- anchorContainsElement(element: HTMLElement): boolean;
Rich tooltips are currently in development and is not yet ready for use.
PiperOrigin-RevId: 345221617
- slider: Slider is now backed by an input of type="range". Additionally, adapter methods (focusInput, isInputFocused, registerInputEventHandler, deregisterInputEventHandler) were added.
PiperOrigin-RevId: 344116908
- tooltip: Added adapter methods:
- setAnchorAttribute(attr: string, value: string): void;
- registerEventHandler<K extends EventType>(
evtType: K, handler: SpecificEventListener<K>): void;
- deregisterEventHandler<K extends EventType>(
evtType: K, handler: SpecificEventListener<K>): void;
Rich tooltips are currently in development and is not yet ready for use.
PiperOrigin-RevId: 343894231
- slider: Adds slider adapter methods (get/setInputValue, get/setInputAttribute, removeInputAttribute). Slider DOM structure now contains a hidden input.
PiperOrigin-RevId: 343157208