@material/linear-progress
Advanced tools
Comparing version 4.0.0-canary.905884690.0 to 4.0.0-canary.062ade5c0.0
@@ -32,2 +32,3 @@ /** | ||
addClass(className: string): void; | ||
forceLayout(): void; | ||
getBuffer(): HTMLElement | null; | ||
@@ -34,0 +35,0 @@ getPrimaryBar(): HTMLElement | null; |
@@ -6,2 +6,64 @@ # Change Log | ||
# [4.0.0-canary.062ade5c0.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.062ade5c0.0) (2019-10-17) | ||
### Bug Fixes | ||
* **linear-progress:** Fix indeterminate animation bug ([#5180](https://github.com/material-components/material-components-web/issues/5180)) ([062ade5](https://github.com/material-components/material-components-web/commit/062ade5)) | ||
* **linear-progress:** Prefix animation keyframes to prevent clashing ([#5155](https://github.com/material-components/material-components-web/issues/5155)) ([fc0e474](https://github.com/material-components/material-components-web/commit/fc0e474)) | ||
* **linear-progress:** Restore buffer after determinate is toggl… ([#5156](https://github.com/material-components/material-components-web/issues/5156)) ([09b1598](https://github.com/material-components/material-components-web/commit/09b1598)) | ||
### BREAKING CHANGES | ||
* **linear-progress:** MDCLinearProgressAdapter adapter has new `forceLayout` method | ||
# [4.0.0-canary.735147131.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.735147131.0) (2019-10-16) | ||
### Bug Fixes | ||
* **linear-progress:** Prefix animation keyframes to prevent clashing ([#5155](https://github.com/material-components/material-components-web/issues/5155)) ([fc0e474](https://github.com/material-components/material-components-web/commit/fc0e474)) | ||
* **linear-progress:** Restore buffer after determinate is toggl… ([#5156](https://github.com/material-components/material-components-web/issues/5156)) ([09b1598](https://github.com/material-components/material-components-web/commit/09b1598)) | ||
# [4.0.0-canary.5dc45b82a.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.5dc45b82a.0) (2019-10-16) | ||
### Bug Fixes | ||
* **linear-progress:** Prefix animation keyframes to prevent clashing ([#5155](https://github.com/material-components/material-components-web/issues/5155)) ([fc0e474](https://github.com/material-components/material-components-web/commit/fc0e474)) | ||
* **linear-progress:** Restore buffer after determinate is toggl… ([#5156](https://github.com/material-components/material-components-web/issues/5156)) ([09b1598](https://github.com/material-components/material-components-web/commit/09b1598)) | ||
# [4.0.0-canary.22d7ad2fb.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.22d7ad2fb.0) (2019-10-15) | ||
### Bug Fixes | ||
* **linear-progress:** Prefix animation keyframes to prevent clashing ([#5155](https://github.com/material-components/material-components-web/issues/5155)) ([fc0e474](https://github.com/material-components/material-components-web/commit/fc0e474)) | ||
* **linear-progress:** Restore buffer after determinate is toggl… ([#5156](https://github.com/material-components/material-components-web/issues/5156)) ([09b1598](https://github.com/material-components/material-components-web/commit/09b1598)) | ||
# [4.0.0-canary.199534d61.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.199534d61.0) (2019-09-27) | ||
**Note:** Version bump only for package @material/linear-progress | ||
# [4.0.0-canary.905884690.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.905884690.0) (2019-09-16) | ||
@@ -8,0 +70,0 @@ |
@@ -74,2 +74,3 @@ /** | ||
addClass: function (className) { return _this.root_.classList.add(className); }, | ||
forceLayout: function () { return _this.root_.offsetWidth; }, | ||
getBuffer: function () { return _this.root_.querySelector(MDCLinearProgressFoundation.strings.BUFFER_SELECTOR); }, | ||
@@ -76,0 +77,0 @@ getPrimaryBar: function () { return _this.root_.querySelector(MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR); }, |
@@ -45,2 +45,3 @@ // Generated by dts-bundle v0.7.3 | ||
addClass(className: string): void; | ||
forceLayout(): void; | ||
getBuffer(): HTMLElement | null; | ||
@@ -47,0 +48,0 @@ getPrimaryBar(): HTMLElement | null; |
@@ -542,2 +542,5 @@ /** | ||
}, | ||
forceLayout: function forceLayout() { | ||
return _this.root_.offsetWidth; | ||
}, | ||
getBuffer: function getBuffer() { | ||
@@ -704,2 +707,5 @@ return _this.root_.querySelector(foundation_1.MDCLinearProgressFoundation.strings.BUFFER_SELECTOR); | ||
}, | ||
forceLayout: function forceLayout() { | ||
return undefined; | ||
}, | ||
getBuffer: function getBuffer() { | ||
@@ -729,2 +735,3 @@ return null; | ||
this.progress_ = 0; | ||
this.buffer_ = 1; | ||
}; | ||
@@ -736,3 +743,14 @@ MDCLinearProgressFoundation.prototype.setDeterminate = function (isDeterminate) { | ||
this.setScale_(this.adapter_.getPrimaryBar(), this.progress_); | ||
this.setScale_(this.adapter_.getBuffer(), this.buffer_); | ||
} else { | ||
if (this.isReversed_) { | ||
// Adding/removing REVERSED_CLASS starts a translate animation, while | ||
// adding INDETERMINATE_CLASS starts a scale animation. Here, we reset | ||
// the translate animation in order to keep it in sync with the new | ||
// scale animation that will start from adding INDETERMINATE_CLASS | ||
// below. | ||
this.adapter_.removeClass(constants_1.cssClasses.REVERSED_CLASS); | ||
this.adapter_.forceLayout(); | ||
this.adapter_.addClass(constants_1.cssClasses.REVERSED_CLASS); | ||
} | ||
this.adapter_.addClass(constants_1.cssClasses.INDETERMINATE_CLASS); | ||
@@ -750,2 +768,3 @@ this.setScale_(this.adapter_.getPrimaryBar(), 1); | ||
MDCLinearProgressFoundation.prototype.setBuffer = function (value) { | ||
this.buffer_ = value; | ||
if (this.isDeterminate_) { | ||
@@ -757,2 +776,12 @@ this.setScale_(this.adapter_.getBuffer(), value); | ||
this.isReversed_ = isReversed; | ||
if (!this.isDeterminate_) { | ||
// Adding INDETERMINATE_CLASS starts a scale animation, while | ||
// adding/removing REVERSED_CLASS starts a translate animation. Here, we | ||
// reset the scale animation in order to keep it in sync with the new | ||
// translate animation that will start from adding/removing REVERSED_CLASS | ||
// below. | ||
this.adapter_.removeClass(constants_1.cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.forceLayout(); | ||
this.adapter_.addClass(constants_1.cssClasses.INDETERMINATE_CLASS); | ||
} | ||
if (this.isReversed_) { | ||
@@ -759,0 +788,0 @@ this.adapter_.addClass(constants_1.cssClasses.REVERSED_CLASS); |
@@ -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 r={},o.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=(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=r,e.default=r},1:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.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(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var i=n(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,n){this.root_.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var r;void 0===n&&(n=!1),"function"==typeof CustomEvent?r=new CustomEvent(t,{bubbles:n,detail:e}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(r)},a);function a(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];this.root_=t,this.initialize.apply(this,o(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=s,e.default=s},12:function(t,e,n){"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 n=t.document.createElement("div"),r=s[e],o=r.standard,i=r.prefixed;return o in n.style?o:i}return e},e.getCorrectEventName=function(t,e){if(u(t)&&e in a){var n=t.document.createElement("div"),r=a[e],o=r.standard,i=r.prefixed;return r.cssProperty in n.style?o:i}return e}},135:function(t,n,e){"use strict";function r(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),r(e(136)),r(e(78)),r(e(77))},136:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(1),a=n(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)},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,n){return t.style.setProperty(e,n)}};return new a.MDCLinearProgressFoundation(t)},c);function c(){return null!==i&&i.apply(this,arguments)||this}e.MDCLinearProgress=u},77:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s,a=n(12),u=n(0),c=n(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(){},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},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.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.isDeterminate_&&this.setScale_(this.adapter_.getBuffer(),t)},d.prototype.setReverse=function(t){this.isReversed_=t,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 n="scaleX("+e+")";this.adapter_.setStyle(t,a.getCorrectPropertyName(window,"transform"),n)}},d);function d(t){return s.call(this,i({},d.defaultAdapter,t))||this}e.MDCLinearProgressFoundation=f,e.default=f},78:function(t,e,n){"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=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},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 n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},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(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var n,r}); | ||
!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}); |
@@ -39,2 +39,3 @@ /** | ||
private progress_; | ||
private buffer_; | ||
constructor(adapter?: Partial<MDCLinearProgressAdapter>); | ||
@@ -41,0 +42,0 @@ init(): void; |
@@ -50,2 +50,3 @@ /** | ||
addClass: function () { return undefined; }, | ||
forceLayout: function () { return undefined; }, | ||
getBuffer: function () { return null; }, | ||
@@ -65,2 +66,3 @@ getPrimaryBar: function () { return null; }, | ||
this.progress_ = 0; | ||
this.buffer_ = 1; | ||
}; | ||
@@ -72,4 +74,15 @@ MDCLinearProgressFoundation.prototype.setDeterminate = function (isDeterminate) { | ||
this.setScale_(this.adapter_.getPrimaryBar(), this.progress_); | ||
this.setScale_(this.adapter_.getBuffer(), this.buffer_); | ||
} | ||
else { | ||
if (this.isReversed_) { | ||
// Adding/removing REVERSED_CLASS starts a translate animation, while | ||
// adding INDETERMINATE_CLASS starts a scale animation. Here, we reset | ||
// the translate animation in order to keep it in sync with the new | ||
// scale animation that will start from adding INDETERMINATE_CLASS | ||
// below. | ||
this.adapter_.removeClass(cssClasses.REVERSED_CLASS); | ||
this.adapter_.forceLayout(); | ||
this.adapter_.addClass(cssClasses.REVERSED_CLASS); | ||
} | ||
this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS); | ||
@@ -87,2 +100,3 @@ this.setScale_(this.adapter_.getPrimaryBar(), 1); | ||
MDCLinearProgressFoundation.prototype.setBuffer = function (value) { | ||
this.buffer_ = value; | ||
if (this.isDeterminate_) { | ||
@@ -94,2 +108,12 @@ this.setScale_(this.adapter_.getBuffer(), value); | ||
this.isReversed_ = isReversed; | ||
if (!this.isDeterminate_) { | ||
// Adding INDETERMINATE_CLASS starts a scale animation, while | ||
// adding/removing REVERSED_CLASS starts a translate animation. Here, we | ||
// reset the scale animation in order to keep it in sync with the new | ||
// translate animation that will start from adding/removing REVERSED_CLASS | ||
// below. | ||
this.adapter_.removeClass(cssClasses.INDETERMINATE_CLASS); | ||
this.adapter_.forceLayout(); | ||
this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS); | ||
} | ||
if (this.isReversed_) { | ||
@@ -96,0 +120,0 @@ this.adapter_.addClass(cssClasses.REVERSED_CLASS); |
{ | ||
"name": "@material/linear-progress", | ||
"description": "The Material Components for the web linear progress indicator component", | ||
"version": "4.0.0-canary.905884690.0", | ||
"version": "4.0.0-canary.062ade5c0.0", | ||
"license": "MIT", | ||
@@ -21,6 +21,6 @@ "main": "dist/mdc.linearProgress.js", | ||
"dependencies": { | ||
"@material/animation": "^4.0.0-canary.905884690.0", | ||
"@material/base": "^4.0.0-canary.905884690.0", | ||
"@material/feature-targeting": "^4.0.0-canary.905884690.0", | ||
"@material/theme": "^4.0.0-canary.905884690.0", | ||
"@material/animation": "4.0.0-canary.062ade5c0.0", | ||
"@material/base": "4.0.0-canary.062ade5c0.0", | ||
"@material/feature-targeting": "4.0.0-canary.062ade5c0.0", | ||
"@material/theme": "4.0.0-canary.062ade5c0.0", | ||
"tslib": "^1.9.3" | ||
@@ -31,3 +31,3 @@ }, | ||
}, | ||
"gitHead": "df7fbf65943b1227b1bf145a2774abe7710b1e30" | ||
"gitHead": "e2025b4ba4d9837dcc1063934417df1eefaf29ec" | ||
} |
@@ -98,2 +98,3 @@ <!--docs: | ||
| `hasClass(className: string) => boolean` | Returns boolean indicating whether the root element has a given class. | | ||
| `forceLayout() => void` | Force-trigger a layout on the root element. This is needed to restart animations correctly. | | ||
| `getPrimaryBar() => Element` | Returns the primary bar element. | | ||
@@ -100,0 +101,0 @@ | `getBuffer() => Element` | Returns the buffer element. | |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
223972
1949
128
+ Added@material/animation@4.0.0-canary.062ade5c0.0(transitive)
+ Added@material/base@4.0.0-canary.062ade5c0.0(transitive)
+ Added@material/feature-targeting@4.0.0-canary.062ade5c0.0(transitive)
+ Added@material/theme@4.0.0-canary.062ade5c0.0(transitive)
- Removed@material/animation@4.0.0(transitive)
- Removed@material/base@4.0.0(transitive)
- Removed@material/feature-targeting@4.0.0(transitive)
- Removed@material/theme@4.0.0(transitive)