UNPKG

@zeit-ui/vue

Version:

A popular UI framework for Vue

2 lines 5.38 kB
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["textarea"]=t():e["textarea"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"432c":function(e,t,n){},"7ce0":function(e,t,n){},ad70:function(e,t,n){"use strict";var r=n("432c"),i=n.n(r);i.a},ba8f:function(e,t,n){"use strict";var r=n("7ce0"),i=n.n(r);i.a},f6fd:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},fb15:function(e,t,n){"use strict";n.r(t);var r,i={};(n.r(i),n.d(i,"enums",(function(){return s})),n.d(i,"isMac",(function(){return u})),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"zi-textarea-container"},[n("div",{staticClass:"zi-textarea-wrapper"},[n("textarea",e._g(e._b({directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"zi-textarea",class:[{disabled:e.disabled},e.type],attrs:{disabled:e.disabled,rows:e.rows},domProps:{value:e.model},on:{input:function(t){t.target.composing||(e.model=t.target.value)}}},"textarea",e.$attrs,!1),e.customListeners))])])},a=[],s=function(e){return function(t){return!!Array.isArray(e)&&!!e.find((function(e){return e===t}))}},u=function(){if("undefined"===typeof window||!window.navigator)return!1;var e=navigator.userAgent.toLowerCase();return/macintosh|mac os x/i.test(e)},c=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=n.width,i=n.height,o=function(e,t){if(!e)return 0;var n=e.includes("px")?+e.split("px")[0]:e.includes("%")?+e.split("%")[0]*t*.01:e;return Number.isNaN(+n)?0:+n};return{width:o("".concat(r),t.width),height:o("".concat(i),t.height)}},l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"expand"},on:{enter:e.enter,"after-enter":e.afterEnter,leave:e.leave}},[e._t("default")],2)},f=[],d={name:"zi-transition-expand",methods:{enter:function(e){var t=c(e),n=t.width;e.style.width="".concat(n,"px"),e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";var r=c(e),i=r.height;e.style.width=null,e.style.position=null,e.style.visibility=null,e.style.height=0,c(e);var o=setTimeout((function(){e.style.height="".concat(i,"px"),clearTimeout(o)}),0)},afterEnter:function(e){e.style.height="auto"},leave:function(e){var t=c(e),n=t.height;e.style.height="".concat(n,"px"),c(e);var r=setTimeout((function(){e.style.height=0,clearTimeout(r)}),0)},afterLeave:function(e){e.style.height=null}}},p=d;n("ba8f");function v(e,t,n,r,i,o,a,s){var u,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(e,t){return u.call(t),l(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:e,options:c}}var h=v(p,l,f,!1,null,null,null),m=(h.exports,new Map,{name:"zi-textarea",inheritAttrs:!0,props:{value:[String,Number],disabled:Boolean,rows:{type:Number,default:3},type:{type:String,validator:i.enums(["primary","danger","success","warning"]),default:"primary"}},data:function(){return{privateModel:""}},computed:{model:{get:function(){return void 0===this.value?this.privateModel:this.value},set:function(e){this.privateModel=e,this.$emit("input",e)}},customListeners:function(){var e=this,t={};return Object.keys(this.$listeners).forEach((function(n){"input"!==n&&(t[n]=e.$listeners[n])})),t}}}),y=m,g=(n("ad70"),v(y,o,a,!1,null,"2a4ceb52",null)),b=g.exports;b.install=function(e){e.component(b.name,b)};var x=b;t["default"]=x}})["default"]})); //# sourceMappingURL=textarea.umd.min.js.map