material-components-vue
Version:
Material Design components for Vue.js
2 lines • 8.87 kB
JavaScript
/*! For license information please see floating-label.min.js.LICENSE */
!function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e=n();for(var o in e)("object"==typeof exports?exports:t)[o]=e[o]}}(window,(function(){return e={},t.m=n={0:function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return i})),e.d(n,"e",(function(){return a})),e.d(n,"c",(function(){return u})),e.d(n,"d",(function(){return s}));var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function r(t,n){function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var i=function(){return(i=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function a(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function u(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var o,r,i=e.call(t),a=[];try{for(;(void 0===n||0<n--)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(r)throw r.error}}return a}function s(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(u(arguments[n]));return t}},16:function(t,n,e){"use strict";var o=e(0),r=e(3),i={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"};e.d(n,"a",(function(){return u}));var a,u=(a=r.a,o.b(s,a),Object.defineProperty(s,"cssClasses",{get:function(){return i},enumerable:!0,configurable:!0}),Object.defineProperty(s,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),s.prototype.init=function(){this.adapter_.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},s.prototype.destroy=function(){this.adapter_.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},s.prototype.getWidth=function(){return this.adapter_.getWidth()},s.prototype.shake=function(t){var n=s.cssClasses.LABEL_SHAKE;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)},s.prototype.float=function(t){var n=s.cssClasses,e=n.LABEL_FLOAT_ABOVE,o=n.LABEL_SHAKE;t?this.adapter_.addClass(e):(this.adapter_.removeClass(e),this.adapter_.removeClass(o))},s.prototype.handleShakeAnimationEnd_=function(){var t=s.cssClasses.LABEL_SHAKE;this.adapter_.removeClass(t)},s);function s(t){var n=a.call(this,o.a({},s.defaultAdapter,t))||this;return n.shakeAnimationEndHandler_=function(){return n.handleShakeAnimationEnd_()},n}},2:function(t,n,e){"use strict";var o={inheritAttrs:!1},r=["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"],i={props:{theming:{type:String,default:""}},mounted:function(){-1<r.indexOf(this.theming)&&this.$el.classList.add("mdc-theme--"+this.theming)}};e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return i}))},21:function(t,n,e){"use strict";e.d(n,"a",(function(){return u}));var o,r=e(0),i=e(5),a=e(16),u=(o=i.a,r.b(s,o),s.attachTo=function(t){return new s(t)},s.prototype.shake=function(t){this.foundation_.shake(t)},s.prototype.float=function(t){this.foundation_.float(t)},s.prototype.getWidth=function(){return this.foundation_.getWidth()},s.prototype.getDefaultFoundation=function(){var t=this,n={addClass:function(n){return t.root_.classList.add(n)},removeClass:function(n){return t.root_.classList.remove(n)},getWidth:function(){return t.root_.scrollWidth},registerInteractionHandler:function(n,e){return t.listen(n,e)},deregisterInteractionHandler:function(n,e){return t.unlisten(n,e)}};return new a.a(n)},s);function s(){return null!==o&&o.apply(this,arguments)||this}},3:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=(Object.defineProperty(r,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),r.prototype.init=function(){},r.prototype.destroy=function(){},r);function r(t){void 0===t&&(t={}),this.adapter_=t}},36:function(t,n,e){},4:function(t,n,e){"use strict";function o(t,n,e,o,r,i,a,u){var s,c="function"==typeof t?t.options:t;if(n&&(c.render=n,c.staticRenderFns=e,c._compiled=!0),o&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(s=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=s):r&&(s=u?function(){r.call(this,this.$root.$options.shadowRoot)}:r),s)if(c.functional){c._injectStyles=s;var l=c.render;c.render=function(t,n){return s.call(n),l(t,n)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:c}}e.d(n,"a",(function(){return o}))},5:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=e(0),r=e(3),i=(a.attachTo=function(t){return new a(t,new r.a({}))},a.prototype.initialize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},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,n,e){this.root_.addEventListener(t,n,e)},a.prototype.unlisten=function(t,n,e){this.root_.removeEventListener(t,n,e)},a.prototype.emit=function(t,n,e){var o;void 0===e&&(e=!1),"function"==typeof CustomEvent?o=new CustomEvent(t,{bubbles:e,detail:n}):(o=document.createEvent("CustomEvent")).initCustomEvent(t,e,!1,n),this.root_.dispatchEvent(o)},a);function a(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];this.root_=t,this.initialize.apply(this,o.d(e)),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}},7:function(t,n,e){"use strict";function o(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)}e.d(n,"a",(function(){return o}))},89:function(t,n,e){"use strict";e.r(n);var o=e(21),r=e(2),i={mixins:[r.a,r.b],props:{floatAbove:{type:Boolean,default:!1},shake:{type:Boolean,default:!1}},data:function(){return{mdcFloatingLabel:void 0}},computed:{classes:function(){return{"mdc-floating-label--float-above":this.floatAbove,"mdc-floating-label--shake":this.shake}}},mounted:function(){this.mdcFloatingLabel=o.a.attachTo(this.$el)},beforeDestroy:function(){this.mdcFloatingLabel.destroy()}},a=e(4),u=Object(a.a)(i,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return"m-select"===t.$parent.$options._componentTag?e("span",t._b({staticClass:"mdc-floating-label",class:t.classes},"span",t.$attrs,!1),[t._t("default")],2):e("label",t._b({staticClass:"mdc-floating-label",class:t.classes},"label",t.$attrs,!1),[t._t("default")],2)}),[],!1,null,null,null).exports,s=(e(36),e(7)),c={install:function(t){t.component("m-floating-label",u)}};n.default=c,Object(s.a)(c)}},t.c=e,t.d=function(n,e,o){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:o})},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(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)t.d(o,r,function(t){return n[t]}.bind(null,r));return o},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},t.p="",t(t.s=89);function t(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return n[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n,e}));