@material/linear-progress
Advanced tools
Comparing version 5.0.0-canary.821871e04.0 to 5.0.0-canary.a5dbd8a2a.0
@@ -37,3 +37,5 @@ /** | ||
removeClass(className: string): void; | ||
removeAttribute(name: string): void; | ||
setAttribute(name: string, value: string): void; | ||
setStyle(el: HTMLElement, styleProperty: string, value: string): void; | ||
} |
@@ -6,4 +6,10 @@ # Change Log | ||
# [5.0.0-canary.821871e04.0](https://github.com/material-components/material-components-web/compare/v4.0.0...v5.0.0-canary.821871e04.0) (2019-11-08) | ||
# [5.0.0-canary.a5dbd8a2a.0](https://github.com/material-components/material-components-web/compare/v4.0.0...v5.0.0-canary.a5dbd8a2a.0) (2019-12-03) | ||
**Note:** Version bump only for package @material/linear-progress | ||
* fix(linear-progress) support aria attributes (#5248) ([7084b40](https://github.com/material-components/material-components-web/commit/7084b40)), closes [#5248](https://github.com/material-components/material-components-web/issues/5248) | ||
### BREAKING CHANGES | ||
* Adds new adapter methods to MDCLinearProgressAdapter. |
@@ -78,3 +78,9 @@ /** | ||
hasClass: function (className) { return _this.root_.classList.contains(className); }, | ||
removeAttribute: function (attributeName) { | ||
_this.root_.removeAttribute(attributeName); | ||
}, | ||
removeClass: function (className) { return _this.root_.classList.remove(className); }, | ||
setAttribute: function (attributeName, value) { | ||
_this.root_.setAttribute(attributeName, value); | ||
}, | ||
setStyle: function (el, styleProperty, value) { return el.style.setProperty(styleProperty, value); }, | ||
@@ -81,0 +87,0 @@ }; |
@@ -29,4 +29,5 @@ /** | ||
export declare const strings: { | ||
ARIA_VALUENOW: string; | ||
BUFFER_SELECTOR: string; | ||
PRIMARY_BAR_SELECTOR: string; | ||
}; |
@@ -29,2 +29,3 @@ /** | ||
export var strings = { | ||
ARIA_VALUENOW: 'aria-valuenow', | ||
BUFFER_SELECTOR: '.mdc-linear-progress__buffer', | ||
@@ -31,0 +32,0 @@ PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar', |
@@ -50,2 +50,4 @@ // Generated by dts-bundle v0.7.3 | ||
removeClass(className: string): void; | ||
removeAttribute(name: string): void; | ||
setAttribute(name: string, value: string): void; | ||
setStyle(el: HTMLElement, styleProperty: string, value: string): void; | ||
@@ -121,2 +123,3 @@ } | ||
export const strings: { | ||
ARIA_VALUENOW: string; | ||
BUFFER_SELECTOR: string; | ||
@@ -159,2 +162,3 @@ PRIMARY_BAR_SELECTOR: string; | ||
static readonly strings: { | ||
ARIA_VALUENOW: string; | ||
BUFFER_SELECTOR: string; | ||
@@ -161,0 +165,0 @@ PRIMARY_BAR_SELECTOR: string; |
@@ -554,5 +554,11 @@ /** | ||
}, | ||
removeAttribute: function removeAttribute(attributeName) { | ||
_this.root_.removeAttribute(attributeName); | ||
}, | ||
removeClass: function removeClass(className) { | ||
return _this.root_.classList.remove(className); | ||
}, | ||
setAttribute: function setAttribute(attributeName, value) { | ||
_this.root_.setAttribute(attributeName, value); | ||
}, | ||
setStyle: function setStyle(el, styleProperty, value) { | ||
@@ -609,2 +615,3 @@ return el.style.setProperty(styleProperty, value); | ||
exports.strings = { | ||
ARIA_VALUENOW: 'aria-valuenow', | ||
BUFFER_SELECTOR: '.mdc-linear-progress__buffer', | ||
@@ -720,5 +727,11 @@ PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar' | ||
}, | ||
removeAttribute: function removeAttribute() { | ||
return undefined; | ||
}, | ||
removeClass: function removeClass() { | ||
return undefined; | ||
}, | ||
setAttribute: function setAttribute() { | ||
return undefined; | ||
}, | ||
setStyle: function setStyle() { | ||
@@ -742,2 +755,3 @@ return undefined; | ||
this.adapter_.removeClass(constants_1.cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.setAttribute(constants_1.strings.ARIA_VALUENOW, this.progress_.toString()); | ||
this.setScale_(this.adapter_.getPrimaryBar(), this.progress_); | ||
@@ -757,2 +771,3 @@ this.setScale_(this.adapter_.getBuffer(), this.buffer_); | ||
this.adapter_.addClass(constants_1.cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.removeAttribute(constants_1.strings.ARIA_VALUENOW); | ||
this.setScale_(this.adapter_.getPrimaryBar(), 1); | ||
@@ -766,2 +781,3 @@ this.setScale_(this.adapter_.getBuffer(), 1); | ||
this.setScale_(this.adapter_.getPrimaryBar(), value); | ||
this.adapter_.setAttribute(constants_1.strings.ARIA_VALUENOW, value.toString()); | ||
} | ||
@@ -768,0 +784,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.linearProgress=e():(t.mdc=t.mdc||{},t.mdc.linearProgress=e())}(this,function(){return n={},o.m=r={0:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(Object.defineProperty(o,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),o.prototype.init=function(){},o.prototype.destroy=function(){},o);function o(t){void 0===t&&(t={}),this.adapter_=t}e.MDCFoundation=n,e.default=n},1:function(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),s=(a.attachTo=function(t){return new a(t,new i.MDCFoundation({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,r){this.root_.addEventListener(t,e,r)},a.prototype.unlisten=function(t,e,r){this.root_.removeEventListener(t,e,r)},a.prototype.emit=function(t,e,r){var n;void 0===r&&(r=!1),"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:r,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,r,!1,e),this.root_.dispatchEvent(n)},a);function a(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this.root_=t,this.initialize.apply(this,o(r)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=s,e.default=s},12:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},a={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function u(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}e.getCorrectPropertyName=function(t,e){if(u(t)&&e in s){var r=t.document.createElement("div"),n=s[e],o=n.standard,i=n.prefixed;return o in r.style?o:i}return e},e.getCorrectEventName=function(t,e){if(u(t)&&e in a){var r=t.document.createElement("div"),n=a[e],o=n.standard,i=n.prefixed;return n.cssProperty in r.style?o:i}return e}},135:function(t,r,e){"use strict";function n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(e(136)),n(e(78)),n(e(77))},136:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i,s=r(1),a=r(77),u=(i=s.MDCComponent,o(c,i),c.attachTo=function(t){return new c(t)},Object.defineProperty(c.prototype,"determinate",{set:function(t){this.foundation_.setDeterminate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"progress",{set:function(t){this.foundation_.setProgress(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{set:function(t){this.foundation_.setBuffer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"reverse",{set:function(t){this.foundation_.setReverse(t)},enumerable:!0,configurable:!0}),c.prototype.open=function(){this.foundation_.open()},c.prototype.close=function(){this.foundation_.close()},c.prototype.getDefaultFoundation=function(){var e=this,t={addClass:function(t){return e.root_.classList.add(t)},forceLayout:function(){return e.root_.offsetWidth},getBuffer:function(){return e.root_.querySelector(a.MDCLinearProgressFoundation.strings.BUFFER_SELECTOR)},getPrimaryBar:function(){return e.root_.querySelector(a.MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR)},hasClass:function(t){return e.root_.classList.contains(t)},removeClass:function(t){return e.root_.classList.remove(t)},setStyle:function(t,e,r){return t.style.setProperty(e,r)}};return new a.MDCLinearProgressFoundation(t)},c);function c(){return null!==i&&i.apply(this,arguments)||this}e.MDCLinearProgress=u},77:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s,a=r(12),u=r(0),c=r(78),f=(s=u.MDCFoundation,o(d,s),Object.defineProperty(d,"cssClasses",{get:function(){return c.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(d,"strings",{get:function(){return c.strings},enumerable:!0,configurable:!0}),Object.defineProperty(d,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},getBuffer:function(){return null},getPrimaryBar:function(){return null},hasClass:function(){return!1},removeClass:function(){},setStyle:function(){}}},enumerable:!0,configurable:!0}),d.prototype.init=function(){this.isDeterminate_=!this.adapter_.hasClass(c.cssClasses.INDETERMINATE_CLASS),this.isReversed_=this.adapter_.hasClass(c.cssClasses.REVERSED_CLASS),this.progress_=0,this.buffer_=1},d.prototype.setDeterminate=function(t){this.isDeterminate_=t,this.isDeterminate_?(this.adapter_.removeClass(c.cssClasses.INDETERMINATE_CLASS),this.setScale_(this.adapter_.getPrimaryBar(),this.progress_),this.setScale_(this.adapter_.getBuffer(),this.buffer_)):(this.isReversed_&&(this.adapter_.removeClass(c.cssClasses.REVERSED_CLASS),this.adapter_.forceLayout(),this.adapter_.addClass(c.cssClasses.REVERSED_CLASS)),this.adapter_.addClass(c.cssClasses.INDETERMINATE_CLASS),this.setScale_(this.adapter_.getPrimaryBar(),1),this.setScale_(this.adapter_.getBuffer(),1))},d.prototype.setProgress=function(t){this.progress_=t,this.isDeterminate_&&this.setScale_(this.adapter_.getPrimaryBar(),t)},d.prototype.setBuffer=function(t){this.buffer_=t,this.isDeterminate_&&this.setScale_(this.adapter_.getBuffer(),t)},d.prototype.setReverse=function(t){this.isReversed_=t,this.isDeterminate_||(this.adapter_.removeClass(c.cssClasses.INDETERMINATE_CLASS),this.adapter_.forceLayout(),this.adapter_.addClass(c.cssClasses.INDETERMINATE_CLASS)),this.isReversed_?this.adapter_.addClass(c.cssClasses.REVERSED_CLASS):this.adapter_.removeClass(c.cssClasses.REVERSED_CLASS)},d.prototype.open=function(){this.adapter_.removeClass(c.cssClasses.CLOSED_CLASS)},d.prototype.close=function(){this.adapter_.addClass(c.cssClasses.CLOSED_CLASS)},d.prototype.setScale_=function(t,e){if(t){var r="scaleX("+e+")";this.adapter_.setStyle(t,a.getCorrectPropertyName(window,"transform"),r)}},d);function d(t){return s.call(this,i({},d.defaultAdapter,t))||this}e.MDCLinearProgressFoundation=f,e.default=f},78:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cssClasses={CLOSED_CLASS:"mdc-linear-progress--closed",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed"},e.strings={BUFFER_SELECTOR:".mdc-linear-progress__buffer",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"}}},o.c=n,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=135);function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var r,n}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.linearProgress=e():(t.mdc=t.mdc||{},t.mdc.linearProgress=e())}(this,function(){return n={},o.m=r={0:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(Object.defineProperty(o,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),o.prototype.init=function(){},o.prototype.destroy=function(){},o);function o(t){void 0===t&&(t={}),this.adapter_=t}e.MDCFoundation=n,e.default=n},1:function(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),s=(a.attachTo=function(t){return new a(t,new i.MDCFoundation({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,r){this.root_.addEventListener(t,e,r)},a.prototype.unlisten=function(t,e,r){this.root_.removeEventListener(t,e,r)},a.prototype.emit=function(t,e,r){var n;void 0===r&&(r=!1),"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:r,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,r,!1,e),this.root_.dispatchEvent(n)},a);function a(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this.root_=t,this.initialize.apply(this,o(r)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=s,e.default=s},12:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},a={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function u(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}e.getCorrectPropertyName=function(t,e){if(u(t)&&e in s){var r=t.document.createElement("div"),n=s[e],o=n.standard,i=n.prefixed;return o in r.style?o:i}return e},e.getCorrectEventName=function(t,e){if(u(t)&&e in a){var r=t.document.createElement("div"),n=a[e],o=n.standard,i=n.prefixed;return n.cssProperty in r.style?o:i}return e}},135:function(t,r,e){"use strict";function n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(e(136)),n(e(78)),n(e(77))},136:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i,s=r(1),a=r(77),u=(i=s.MDCComponent,o(c,i),c.attachTo=function(t){return new c(t)},Object.defineProperty(c.prototype,"determinate",{set:function(t){this.foundation_.setDeterminate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"progress",{set:function(t){this.foundation_.setProgress(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{set:function(t){this.foundation_.setBuffer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"reverse",{set:function(t){this.foundation_.setReverse(t)},enumerable:!0,configurable:!0}),c.prototype.open=function(){this.foundation_.open()},c.prototype.close=function(){this.foundation_.close()},c.prototype.getDefaultFoundation=function(){var r=this,t={addClass:function(t){return r.root_.classList.add(t)},forceLayout:function(){return r.root_.offsetWidth},getBuffer:function(){return r.root_.querySelector(a.MDCLinearProgressFoundation.strings.BUFFER_SELECTOR)},getPrimaryBar:function(){return r.root_.querySelector(a.MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR)},hasClass:function(t){return r.root_.classList.contains(t)},removeAttribute:function(t){r.root_.removeAttribute(t)},removeClass:function(t){return r.root_.classList.remove(t)},setAttribute:function(t,e){r.root_.setAttribute(t,e)},setStyle:function(t,e,r){return t.style.setProperty(e,r)}};return new a.MDCLinearProgressFoundation(t)},c);function c(){return null!==i&&i.apply(this,arguments)||this}e.MDCLinearProgress=u},77:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s,a=r(12),u=r(0),c=r(78),f=(s=u.MDCFoundation,o(d,s),Object.defineProperty(d,"cssClasses",{get:function(){return c.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(d,"strings",{get:function(){return c.strings},enumerable:!0,configurable:!0}),Object.defineProperty(d,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},getBuffer:function(){return null},getPrimaryBar:function(){return null},hasClass:function(){return!1},removeAttribute:function(){},removeClass:function(){},setAttribute:function(){},setStyle:function(){}}},enumerable:!0,configurable:!0}),d.prototype.init=function(){this.isDeterminate_=!this.adapter_.hasClass(c.cssClasses.INDETERMINATE_CLASS),this.isReversed_=this.adapter_.hasClass(c.cssClasses.REVERSED_CLASS),this.progress_=0,this.buffer_=1},d.prototype.setDeterminate=function(t){this.isDeterminate_=t,this.isDeterminate_?(this.adapter_.removeClass(c.cssClasses.INDETERMINATE_CLASS),this.adapter_.setAttribute(c.strings.ARIA_VALUENOW,this.progress_.toString()),this.setScale_(this.adapter_.getPrimaryBar(),this.progress_),this.setScale_(this.adapter_.getBuffer(),this.buffer_)):(this.isReversed_&&(this.adapter_.removeClass(c.cssClasses.REVERSED_CLASS),this.adapter_.forceLayout(),this.adapter_.addClass(c.cssClasses.REVERSED_CLASS)),this.adapter_.addClass(c.cssClasses.INDETERMINATE_CLASS),this.adapter_.removeAttribute(c.strings.ARIA_VALUENOW),this.setScale_(this.adapter_.getPrimaryBar(),1),this.setScale_(this.adapter_.getBuffer(),1))},d.prototype.setProgress=function(t){this.progress_=t,this.isDeterminate_&&(this.setScale_(this.adapter_.getPrimaryBar(),t),this.adapter_.setAttribute(c.strings.ARIA_VALUENOW,t.toString()))},d.prototype.setBuffer=function(t){this.buffer_=t,this.isDeterminate_&&this.setScale_(this.adapter_.getBuffer(),t)},d.prototype.setReverse=function(t){this.isReversed_=t,this.isDeterminate_||(this.adapter_.removeClass(c.cssClasses.INDETERMINATE_CLASS),this.adapter_.forceLayout(),this.adapter_.addClass(c.cssClasses.INDETERMINATE_CLASS)),this.isReversed_?this.adapter_.addClass(c.cssClasses.REVERSED_CLASS):this.adapter_.removeClass(c.cssClasses.REVERSED_CLASS)},d.prototype.open=function(){this.adapter_.removeClass(c.cssClasses.CLOSED_CLASS)},d.prototype.close=function(){this.adapter_.addClass(c.cssClasses.CLOSED_CLASS)},d.prototype.setScale_=function(t,e){if(t){var r="scaleX("+e+")";this.adapter_.setStyle(t,a.getCorrectPropertyName(window,"transform"),r)}},d);function d(t){return s.call(this,i({},d.defaultAdapter,t))||this}e.MDCLinearProgressFoundation=f,e.default=f},78:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cssClasses={CLOSED_CLASS:"mdc-linear-progress--closed",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed"},e.strings={ARIA_VALUENOW:"aria-valuenow",BUFFER_SELECTOR:".mdc-linear-progress__buffer",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"}}},o.c=n,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=135);function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var r,n}); |
@@ -32,2 +32,3 @@ /** | ||
static readonly strings: { | ||
ARIA_VALUENOW: string; | ||
BUFFER_SELECTOR: string; | ||
@@ -34,0 +35,0 @@ PRIMARY_BAR_SELECTOR: string; |
@@ -54,3 +54,5 @@ /** | ||
hasClass: function () { return false; }, | ||
removeAttribute: function () { return undefined; }, | ||
removeClass: function () { return undefined; }, | ||
setAttribute: function () { return undefined; }, | ||
setStyle: function () { return undefined; }, | ||
@@ -72,2 +74,3 @@ }; | ||
this.adapter_.removeClass(cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.setAttribute(strings.ARIA_VALUENOW, this.progress_.toString()); | ||
this.setScale_(this.adapter_.getPrimaryBar(), this.progress_); | ||
@@ -88,2 +91,3 @@ this.setScale_(this.adapter_.getBuffer(), this.buffer_); | ||
this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.removeAttribute(strings.ARIA_VALUENOW); | ||
this.setScale_(this.adapter_.getPrimaryBar(), 1); | ||
@@ -97,2 +101,3 @@ this.setScale_(this.adapter_.getBuffer(), 1); | ||
this.setScale_(this.adapter_.getPrimaryBar(), value); | ||
this.adapter_.setAttribute(strings.ARIA_VALUENOW, value.toString()); | ||
} | ||
@@ -99,0 +104,0 @@ }; |
{ | ||
"name": "@material/linear-progress", | ||
"description": "The Material Components for the web linear progress indicator component", | ||
"version": "5.0.0-canary.821871e04.0", | ||
"version": "5.0.0-canary.a5dbd8a2a.0", | ||
"license": "MIT", | ||
@@ -21,6 +21,6 @@ "main": "dist/mdc.linearProgress.js", | ||
"dependencies": { | ||
"@material/animation": "5.0.0-canary.821871e04.0", | ||
"@material/base": "5.0.0-canary.821871e04.0", | ||
"@material/feature-targeting": "5.0.0-canary.821871e04.0", | ||
"@material/theme": "5.0.0-canary.821871e04.0", | ||
"@material/animation": "5.0.0-canary.a5dbd8a2a.0", | ||
"@material/base": "5.0.0-canary.a5dbd8a2a.0", | ||
"@material/feature-targeting": "5.0.0-canary.a5dbd8a2a.0", | ||
"@material/theme": "5.0.0-canary.a5dbd8a2a.0", | ||
"tslib": "^1.9.3" | ||
@@ -31,3 +31,3 @@ }, | ||
}, | ||
"gitHead": "20a91d4645dd0fd2db7a61459d752f390e050899" | ||
"gitHead": "8a67c95c393a733414be4fc008baf7637a9509b2" | ||
} |
@@ -42,4 +42,5 @@ <!--docs: | ||
### HTML Structure | ||
```html | ||
<div role="progressbar" class="mdc-linear-progress"> | ||
<div role="progressbar" class="mdc-linear-progress" aria-label="Example Progress Bar" aria-valuemin="0" aria-valuemax="1" aria-valuenow="0"> | ||
<div class="mdc-linear-progress__buffering-dots"></div> | ||
@@ -56,2 +57,15 @@ <div class="mdc-linear-progress__buffer"></div> | ||
### Accessibility | ||
Progress bars conform to the [WAI-ARIA Progressbar Specification](https://www.w3.org/TR/wai-aria/#progressbar). The supported ARIA attributes for this progress bar are: | ||
| Attribute | Description | | ||
| --------- | ----------- | | ||
| `aria-label` | Label indicating how the progress bar should be announced to the user. | | ||
| `aria-valuemin` | The minimum numeric value of the progress bar, which should always be `0`. | | ||
| `aria-valuemax` | The maximum numeric value of the progress bar, which should always be `1`. | | ||
| `aria-valuenow` | A numeric value between `aria-valuemin` and `aria-valuemax` indicating the progress value of the primary progress bar. This attribute is removed in indeterminate progress bars. | | ||
Note that `aria-label`, `aria-valuemin`, and `aria-valuemax` are static and must be configured in the HTML. `aria-valuenow` is updated dynamically by the foundation when the progress value is updated in determinate progress bars. | ||
### Styles | ||
@@ -98,2 +112,3 @@ ```scss | ||
| `addClass(className: string) => void` | Adds a class to the root element. | | ||
| `removeAttribute(attributeName: string) => void` | Removes the specified attribute from the root element. | | ||
| `removeClass(className: string) => void` | Removes a class from the root element. | | ||
@@ -104,2 +119,3 @@ | `hasClass(className: string) => boolean` | Returns boolean indicating whether the root element has a given class. | | ||
| `getBuffer() => Element` | Returns the buffer element. | | ||
| `setAttribute(attributeName: string, value: string) => void` | Sets the specified attribute on the root element. | | ||
| `setStyle(el: Element, styleProperty: string, value: string) => void` | Sets the inline style on the given element. | | ||
@@ -106,0 +122,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
217247
1986
144
+ Added@material/animation@5.0.0-canary.a5dbd8a2a.0(transitive)
+ Added@material/base@5.0.0-canary.a5dbd8a2a.0(transitive)
+ Added@material/feature-targeting@5.0.0-canary.a5dbd8a2a.0(transitive)
+ Added@material/theme@5.0.0-canary.a5dbd8a2a.0(transitive)
- Removed@material/animation@5.0.0-canary.821871e04.0(transitive)
- Removed@material/base@5.0.0-canary.821871e04.0(transitive)
- Removed@material/feature-targeting@5.0.0-canary.821871e04.0(transitive)
- Removed@material/theme@5.0.0-canary.821871e04.0(transitive)