@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 3.68 kB
JavaScript
module.exports=function(e){function t(n){if(a[n])return a[n].exports;var l=a[n]={exports:{},id:n,loaded:!1};return e[n].call(l.exports,l,l.exports,t),l.loaded=!0,l.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}({0:function(e,t,a){e.exports=a(1434)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1049:function(e,t){e.exports=require("./kendo.core")},1296:function(e,t){e.exports=require("./kendo.floatinglabel")},1434:function(e,t,a){var n,l,o;!function(r,define){l=[a(1049),a(1296)],n=r,o="function"==typeof n?n.apply(t,l):n,!(void 0!==o&&(e.exports=o))}(function(){return function(e,t){var a=window.kendo,n=a.ui.Widget,l=a.ui,o=e.isPlainObject,r=".kendoTextArea",i="change",s="disabled",u="readonly",d="k-input",p="k-state-focused",c="k-label k-input-label",f="k-state-disabled",b="k-no-click",v="aria-disabled",g="k-textarea-container",m=e.proxy,y=n.extend({init:function(l,o){var r=this;n.fn.init.call(r,l,o),o=e.extend(!0,{},o),r.options.value=o.value||r.element.val(),r.options.readonly=o.readonly!==t?o.readonly:!!r.element.attr("readonly"),r.options.enable=o.enable!==t?o.enable:!!!r.element.attr("disabled"),r.options.placeholder=o.placeholder||r.element.attr("placeholder"),r.options.value.replace(/\s/g,"").length||(r.options.value="",r.element.val("")),r.value(r.options.value),r._wrapper(),r._label(),r._editable({readonly:r.options.readonly,disable:!r.options.enable}),r._applyAttributes(),r.element.addClass(d).css("resize",r.options.resizable).attr("autocomplete","off"),a.notify(r)},events:[i],attributes:["maxLength","rows","placeholder"],options:{name:"TextArea",value:"",readonly:!1,enable:!0,placeholder:"",label:null,resizable:"none",maxLength:null,cols:20,rows:1},_applyAttributes:function(){var e,t=this,a={};for(e in t.attributes)a[t.attributes[e]]=t.options[t.attributes[e]];t.element.attr(a)},value:function(e){var a=this;return e===t?a._value:(a._value=e,a.element.val(e),t)},readonly:function(e){var a=this;this._editable({readonly:e===t||e,disable:!1}),a.floatingLabel&&a.floatingLabel.readonly(e===t||e)},enable:function(e){var a=this;this._editable({readonly:!1,disable:!(e=e===t||e)}),a.floatingLabel&&a.floatingLabel.enable(e=e===t||e)},focus:function(){var e=this;e.element[0].focus()},destroy:function(){var e=this;e.floatingLabel&&e.floatingLabel.destroy(),e.element.off(r),n.fn.destroy.call(e)},_editable:function(e){var t=this,a=t.element,n=t.wrapper,l=e.disable,o=e.readonly;a.off(r),o||l?(a.attr(s,l).attr(u,o).attr(v,l),n.toggleClass(f,l).toggleClass(b,o)):(a.removeAttr(s).removeAttr(u).attr(v,!1),n.removeClass(f).removeClass(b),a.on("focusin"+r,m(t._focusin,t)),a.on("focusout"+r,m(t._focusout,t)))},_label:function(){var t,n,l=this,r=l.element,i=l.options,s=r.attr("id");null!==i.label&&(t=!!o(i.label)&&i.label.floating,n=o(i.label)?i.label.content:i.label,t&&(l._floatingLabelContainer=l.wrapper.wrap("<span></span>").parent(),l.floatingLabel=new a.ui.FloatingLabel(l._floatingLabelContainer,{widget:l}),l._floatingLabelContainer.addClass(g)),a.isFunction(n)&&(n=n.call(l)),n||(n=""),s||(s=i.name+"_"+a.guid(),r.attr("id",s)),l._inputLabel=e("<label class='"+c+"' for='"+s+"'>"+n+"</label>'").insertBefore(l.wrapper))},_focusin:function(){var e=this;e.wrapper.addClass(p)},_focusout:function(){var e=this,t=e._value,a=e.element.val();e.wrapper.removeClass(p),t!==a&&(e._value=a,e.trigger(i))},_wrapper:function(){var e=this,t=e.element,a=t[0],n=t.wrap("<span class='k-widget k-textarea'></span>").parent();n[0].style.cssText=a.style.cssText,a.style.width="100%",e.wrapper=n.addClass(a.className).removeClass("input-validation-error")}});l.plugin(y)}(window.kendo.jQuery),window.kendo},a(3))}});