@keeer/material-components-vue
Version:
Material Design components for Vue.js
2 lines • 11.9 kB
JavaScript
/*! 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 r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return r={},t.m=e={0:function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"e",(function(){return s})),r.d(e,"c",(function(){return a})),r.d(e,"d",(function(){return u}));var 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 i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])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],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function a(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.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}},17:function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return a}));var n={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 n){var r=t.document.createElement("div"),i=n[e],s=i.standard,a=i.prefixed;return s in r.style?s:a}return e}function a(t,e){if(o(t)&&e in i){var r=t.document.createElement("div"),n=i[e],s=n.standard,a=n.prefixed;return n.cssProperty in r.style?s:a}return e}},2:function(t,e,r){"use strict";var n={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)}};r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return o}))},3:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=(Object.defineProperty(i,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),i.prototype.init=function(){},i.prototype.destroy=function(){},i);function i(t){void 0===t&&(t={}),this.adapter_=t}},4:function(t,e,r){"use strict";function n(t,e,r,n,i,o,s,a){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=r,c._compiled=!0),n&&(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}}r.d(e,"a",(function(){return n}))},41:function(t,e,r){},5:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0),i=r(3),o=(s.attachTo=function(t){return new s(t,new i.a({}))},s.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},s.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},s.prototype.initialSyncWithDOM=function(){},s.prototype.destroy=function(){this.foundation_.destroy()},s.prototype.listen=function(t,e,r){this.root_.addEventListener(t,e,r)},s.prototype.unlisten=function(t,e,r){this.root_.removeEventListener(t,e,r)},s.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)},s);function s(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,n.d(r)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}},7:function(t,e,r){"use strict";function n(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)}r.d(e,"a",(function(){return n}))},76:function(t,e,r){"use strict";r.r(e);var n,i=r(0),o=r(5),s=r(17),a=r(3),u={CLOSED_CLASS:"mdc-linear-progress--closed",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed"},c={BUFFER_SELECTOR:".mdc-linear-progress__buffer",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"},f=(n=a.a,i.b(d,n),Object.defineProperty(d,"cssClasses",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(d,"strings",{get:function(){return c},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(u.INDETERMINATE_CLASS),this.isReversed_=this.adapter_.hasClass(u.REVERSED_CLASS),this.progress_=0},d.prototype.setDeterminate=function(t){this.isDeterminate_=t,this.isDeterminate_?(this.adapter_.removeClass(u.INDETERMINATE_CLASS),this.setScale_(this.adapter_.getPrimaryBar(),this.progress_)):(this.adapter_.addClass(u.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(u.REVERSED_CLASS):this.adapter_.removeClass(u.REVERSED_CLASS)},d.prototype.open=function(){this.adapter_.removeClass(u.CLOSED_CLASS)},d.prototype.close=function(){this.adapter_.addClass(u.CLOSED_CLASS)},d.prototype.setScale_=function(t,e){if(t){var r="scaleX("+e+")";this.adapter_.setStyle(t,Object(s.b)(window,"transform"),r)}},d);function d(t){return n.call(this,i.a({},d.defaultAdapter,t))||this}var l,p=(l=o.a,i.b(m,l),m.attachTo=function(t){return new m(t)},Object.defineProperty(m.prototype,"determinate",{set:function(t){this.foundation_.setDeterminate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(m.prototype,"progress",{set:function(t){this.foundation_.setProgress(t)},enumerable:!0,configurable:!0}),Object.defineProperty(m.prototype,"buffer",{set:function(t){this.foundation_.setBuffer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(m.prototype,"reverse",{set:function(t){this.foundation_.setReverse(t)},enumerable:!0,configurable:!0}),m.prototype.open=function(){this.foundation_.open()},m.prototype.close=function(){this.foundation_.close()},m.prototype.getDefaultFoundation=function(){var t=this;return new f({addClass:function(e){return t.root_.classList.add(e)},getBuffer:function(){return t.root_.querySelector(f.strings.BUFFER_SELECTOR)},getPrimaryBar:function(){return t.root_.querySelector(f.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,r){return t.style.setProperty(e,r)}})},m);function m(){return null!==l&&l.apply(this,arguments)||this}var h=r(2),_={mixins:[h.a,h.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=p.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()}},y=r(4),b=Object(y.a)(_,(function(){this.$createElement;return this._self._c,this._m(0)}),[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"mdc-linear-progress",attrs:{role:"progressbar"}},[r("div",{staticClass:"mdc-linear-progress__buffering-dots"}),t._v(" "),r("div",{staticClass:"mdc-linear-progress__buffer"}),t._v(" "),r("div",{staticClass:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},[r("span",{staticClass:"mdc-linear-progress__bar-inner"})]),t._v(" "),r("div",{staticClass:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},[r("span",{staticClass:"mdc-linear-progress__bar-inner"})])])}],!1,null,null,null).exports,g=(r(41),r(7)),v={install:function(t){t.component("m-linear-progress",b)}};e.default=v,Object(g.a)(v)}},t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=76);function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e,r}));