UNPKG

material-components-vue

Version:
2 lines 11.9 kB
/*! For license information please see linear-progress.min.js.LICENSE */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=76)}({0:function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return o}),n.d(e,"e",function(){return s}),n.d(e,"c",function(){return a}),n.d(e,"d",function(){return u});var 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 i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}},1:function(t,e,n){"use strict";var r={inheritAttrs:!1},i=["primary","secondary","background","surface","on-primary","on-secondary","on-surface","primary-bg","secondary-bg","text-primary-on-light","text-secondary-on-light","text-hint-on-light","text-disabled-on-light","text-icon-on-light","text-primary-on-dark","text-secondary-on-dark","text-hint-on-dark","text-disabled-on-dark","text-icon-on-dark"],o={props:{theming:{type:String,default:""}},mounted:function(){-1<i.indexOf(this.theming)&&this.$el.classList.add("mdc-theme--"+this.theming)}};n.d(e,"a",function(){return r}),n.d(e,"b",function(){return o})},16:function(t,e,n){"use strict";n.d(e,"b",function(){return s}),n.d(e,"a",function(){return a});var r={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},i={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 o(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}function s(t,e){if(o(t)&&e in r){var n=t.document.createElement("div"),i=r[e],s=i.standard,a=i.prefixed;return s in n.style?s:a}return e}function a(t,e){if(o(t)&&e in i){var n=t.document.createElement("div"),r=i[e],s=r.standard,a=r.prefixed;return r.cssProperty in n.style?s:a}return e}},2:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}()},4:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=u):i&&(u=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var f=c.render;c.render=function(t,e){return u.call(e),f(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:c}}n.d(e,"a",function(){return r})},40:function(t,e,n){},5:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),i=n(2),o=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,r.d(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new i.a({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e){this.root_.addEventListener(t,e)},t.prototype.unlisten=function(t,e){this.root_.removeEventListener(t,e)},t.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)},t}()},7:function(t,e,n){"use strict";function r(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)}n.d(e,"a",function(){return r})},76:function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(5),o=n(16),s=n(2),a={CLOSED_CLASS:"mdc-linear-progress--closed",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed"},u={BUFFER_SELECTOR:".mdc-linear-progress__buffer",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"},c=function(t){function e(n){return t.call(this,r.a({},e.defaultAdapter,n))||this}return r.b(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.init=function(){this.isDeterminate_=!this.adapter_.hasClass(a.INDETERMINATE_CLASS),this.isReversed_=this.adapter_.hasClass(a.REVERSED_CLASS),this.progress_=0},e.prototype.setDeterminate=function(t){this.isDeterminate_=t,this.isDeterminate_?(this.adapter_.removeClass(a.INDETERMINATE_CLASS),this.setScale_(this.adapter_.getPrimaryBar(),this.progress_)):(this.adapter_.addClass(a.INDETERMINATE_CLASS),this.setScale_(this.adapter_.getPrimaryBar(),1),this.setScale_(this.adapter_.getBuffer(),1))},e.prototype.setProgress=function(t){this.progress_=t,this.isDeterminate_&&this.setScale_(this.adapter_.getPrimaryBar(),t)},e.prototype.setBuffer=function(t){this.isDeterminate_&&this.setScale_(this.adapter_.getBuffer(),t)},e.prototype.setReverse=function(t){this.isReversed_=t,this.isReversed_?this.adapter_.addClass(a.REVERSED_CLASS):this.adapter_.removeClass(a.REVERSED_CLASS)},e.prototype.open=function(){this.adapter_.removeClass(a.CLOSED_CLASS)},e.prototype.close=function(){this.adapter_.addClass(a.CLOSED_CLASS)},e.prototype.setScale_=function(t,e){if(t){var n="scaleX("+e+")";this.adapter_.setStyle(t,Object(o.b)(window,"transform"),n)}},e}(s.a),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.b(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"determinate",{set:function(t){this.foundation_.setDeterminate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"progress",{set:function(t){this.foundation_.setProgress(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{set:function(t){this.foundation_.setBuffer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{set:function(t){this.foundation_.setReverse(t)},enumerable:!0,configurable:!0}),e.prototype.open=function(){this.foundation_.open()},e.prototype.close=function(){this.foundation_.close()},e.prototype.getDefaultFoundation=function(){var t=this;return new c({addClass:function(e){return t.root_.classList.add(e)},getBuffer:function(){return t.root_.querySelector(c.strings.BUFFER_SELECTOR)},getPrimaryBar:function(){return t.root_.querySelector(c.strings.PRIMARY_BAR_SELECTOR)},hasClass:function(e){return t.root_.classList.contains(e)},removeClass:function(e){return t.root_.classList.remove(e)},setStyle:function(t,e,n){return t.style.setProperty(e,n)}})},e}(i.a),d=n(1),l={mixins:[d.a,d.b],props:{open:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},progress:{type:Number,validator:function(t){return 0<=t&&t<=1},default:1},buffer:{type:Number,validator:function(t){return 0<=t&&t<=1},default:1}},data:function(){return{mdcLinearProgress:void 0}},watch:{progress:function(){this.mdcLinearProgress.progress=this.progress},buffer:function(){this.mdcLinearProgress.buffer=this.buffer},indeterminate:function(){this.mdcLinearProgress.determinate=!this.indeterminate},reverse:function(){this.mdcLinearProgress.reverse=this.reverse},open:function(){this.open?this.mdcLinearProgress.open():this.mdcLinearProgress.close()}},mounted:function(){this.mdcLinearProgress=f.attachTo(this.$el),this.mdcLinearProgress.determinate=!this.indeterminate,this.mdcLinearProgress.reverse=this.reverse,this.mdcLinearProgress.progress=this.progress,this.mdcLinearProgress.buffer=this.buffer,this.open?this.mdcLinearProgress.open():this.mdcLinearProgress.close()},beforeDestroy:function(){this.mdcLinearProgress.destroy()}},p=n(4),m=Object(p.a)(l,function(){return this.$createElement,this._self._c,this._m(0)},[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mdc-linear-progress",attrs:{role:"progressbar"}},[n("div",{staticClass:"mdc-linear-progress__buffering-dots"}),t._v(" "),n("div",{staticClass:"mdc-linear-progress__buffer"}),t._v(" "),n("div",{staticClass:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},[n("span",{staticClass:"mdc-linear-progress__bar-inner"})]),t._v(" "),n("div",{staticClass:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},[n("span",{staticClass:"mdc-linear-progress__bar-inner"})])])}],!1,null,null,null).exports,h=(n(40),n(7)),_={install:function(t){t.component("m-linear-progress",m)}};e.default=_,Object(h.a)(_)}})});