{"version":3,"sources":["kendo.textbox.js"],"names":["f","define","$","undefined","kendo","window","Widget","ui","isPlainObject","NS","CHANGE","DISABLED","READONLY","INPUT","FOCUSED","LABELCLASSES","STATEDISABLED","NOCLICKCLASS","ARIA_DISABLED","proxy","TextBox","extend","init","element","options","that","this","fn","call","value","val","readonly","attr","enable","placeholder","_wrapper","_label","_editable","disable","addClass","notify","events","name","label","_value","floatingLabel","focus","destroy","off","wrapper","toggleClass","removeAttr","removeClass","on","_focusin","_focusout","floating","labelText","id","content","_floatingLabelContainer","wrap","parent","FloatingLabel","widget","isFunction","guid","_inputLabel","insertBefore","newValue","trigger","DOMElement","style","cssText","width","_inputWrapper","className","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,iBACH,aACA,uBACDD,IACL,WAwJE,MA7IC,UAAUE,EAAGC,GAAb,GACOC,GAAQC,OAAOD,MAAOE,EAASF,EAAMG,GAAGD,OAAQC,EAAKH,EAAMG,GAAIC,EAAgBN,EAAEM,cAAeC,EAAK,gBAAiBC,EAAS,SAAUC,EAAW,WAAYC,EAAW,WAAYC,EAAQ,UAAWC,EAAU,kBAAmBC,EAAe,wBAAyBC,EAAgB,mBAAoBC,EAAe,aAAcC,EAAgB,gBAAiBC,EAAQjB,EAAEiB,MAC3XC,EAAUd,EAAOe,QACjBC,KAAM,SAAUC,EAASC,GACrB,GAAIC,GAAOC,IACXpB,GAAOqB,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACnCA,EAAUtB,EAAEmB,QAAO,KAAUG,GAC7BC,EAAKD,QAAQK,MAAQL,EAAQK,OAASJ,EAAKF,QAAQO,MACnDL,EAAKD,QAAQO,SAAWP,EAAQO,WAAa5B,EAAYqB,EAAQO,WAAmBN,EAAKF,QAAQS,KAAK,YACtGP,EAAKD,QAAQS,OAAST,EAAQS,SAAW9B,EAAYqB,EAAQS,UAAkBR,EAAKF,QAAQS,KAAK,Y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AQG,YAAYtC,GACrBe,IAAUwC,IACV5C,EAAKmB,OAASyB,EACd5C,EAAK6C,QAAQ5D,KAGrByB,SAAU,WAAA,GACFV,GAAOC,KACPH,EAAUE,EAAKF,QACfgD,EAAahD,EAAQ,GACrB0B,EACM1B,EAAQsC,KAAK,4CAA8CC,QACrEb,GAAQ,GAAGuB,MAAMC,QAAUF,EAAWC,MAAMC,QAC5CF,EAAWC,MAAME,MAAQ,OACzBjD,EAAKkD,cAAgBlD,EAAKwB,QAAUA,EAAQV,SAASgC,EAAWK,WAAWxB,YAAY,4BAG/F7C,GAAGsE,OAAOzD,IACZf,OAAOD,MAAM0E,QACRzE,OAAOD,OACE,kBAAVH,SAAwBA,OAAO8E,IAAM9E,OAAS,SAAU+E,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.textbox.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.textbox', [\n 'kendo.core',\n 'kendo.floatinglabel'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'textbox',\n name: 'TextBox',\n category: 'web',\n description: 'The TextBox widget enables you to style and provide a floating label functionality to input elements',\n depends: [\n 'core',\n 'floatinglabel'\n ]\n };\n (function ($, undefined) {\n var kendo = window.kendo, Widget = kendo.ui.Widget, ui = kendo.ui, isPlainObject = $.isPlainObject, NS = '.kendoTextBox', CHANGE = 'change', DISABLED = 'disabled', READONLY = 'readonly', INPUT = 'k-input', FOCUSED = 'k-state-focused', LABELCLASSES = 'k-label k-input-label', STATEDISABLED = 'k-state-disabled', NOCLICKCLASS = 'k-no-click', ARIA_DISABLED = 'aria-disabled', proxy = $.proxy;\n var TextBox = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(that, element, options);\n options = $.extend(true, {}, options);\n that.options.value = options.value || that.element.val();\n that.options.readonly = options.readonly !== undefined ? options.readonly : Boolean(that.element.attr('readonly'));\n that.options.enable = options.enable !== undefined ? options.enable : !Boolean(that.element.attr('disabled'));\n that.options.placeholder = options.placeholder || that.element.attr('placeholder');\n that.value(that.options.value);\n that._wrapper();\n that._label();\n that._editable({\n readonly: that.options.readonly,\n disable: !that.options.enable\n });\n that.element.addClass(INPUT).attr('placeholder', that.options.placeholder).attr('autocomplete', 'off');\n kendo.notify(that);\n },\n events: [CHANGE],\n options: {\n name: 'TextBox',\n value: '',\n readonly: false,\n enable: true,\n placeholder: '',\n label: null\n },\n value: function (value) {\n var that = this;\n if (value === undefined) {\n return that._value;\n }\n that._value = value;\n that.element.val(value);\n },\n readonly: function (readonly) {\n var that = this;\n this._editable({\n readonly: readonly === undefined ? true : readonly,\n disable: false\n });\n if (that.floatingLabel) {\n that.floatingLabel.readonly(readonly === undefined ? true : readonly);\n }\n },\n enable: function (enable) {\n var that = this;\n this._editable({\n readonly: false,\n disable: !(enable = enable === undefined ? true : enable)\n });\n if (that.floatingLabel) {\n that.floatingLabel.enable(enable = enable === undefined ? true : enable);\n }\n },\n focus: function () {\n var that = this;\n that.element[0].focus();\n },\n destroy: function () {\n var that = this;\n if (that.floatingLabel) {\n that.floatingLabel.destroy();\n }\n that.element.off(NS);\n Widget.fn.destroy.call(that);\n },\n _editable: function (options) {\n var that = this;\n var element = that.element;\n var wrapper = that.wrapper;\n var disable = options.disable;\n var readonly = options.readonly;\n element.off(NS);\n if (!readonly && !disable) {\n element.removeAttr(DISABLED).removeAttr(READONLY).attr(ARIA_DISABLED, false);\n wrapper.removeClass(STATEDISABLED).removeClass(NOCLICKCLASS);\n element.on('focusin' + NS, proxy(that._focusin, that));\n element.on('focusout' + NS, proxy(that._focusout, that));\n } else {\n element.attr(DISABLED, disable).attr(READONLY, readonly).attr(ARIA_DISABLED, disable);\n wrapper.toggleClass(STATEDISABLED, disable).toggleClass(NOCLICKCLASS, readonly);\n }\n },\n _label: function () {\n var that = this;\n var element = that.element;\n var options = that.options;\n var id = element.attr('id');\n var floating;\n var labelText;\n if (options.label !== null) {\n floating = isPlainObject(options.label) ? options.label.floating : false;\n labelText = isPlainObject(options.label) ? options.label.content : options.label;\n if (floating) {\n that._floatingLabelContainer = that.wrapper.wrap('').parent();\n that.floatingLabel = new kendo.ui.FloatingLabel(that._floatingLabelContainer, { widget: that });\n }\n if (kendo.isFunction(labelText)) {\n labelText = labelText.call(that);\n }\n if (!labelText) {\n labelText = '';\n }\n if (!id) {\n id = options.name + '_' + kendo.guid();\n element.attr('id', id);\n }\n that._inputLabel = $('\\'').insertBefore(that.wrapper);\n }\n },\n _focusin: function () {\n var that = this;\n that.wrapper.addClass(FOCUSED);\n },\n _focusout: function () {\n var that = this;\n var value = that._value;\n var newValue = that.element.val();\n that.wrapper.removeClass(FOCUSED);\n if (value !== newValue) {\n that._value = newValue;\n that.trigger(CHANGE);\n }\n },\n _wrapper: function () {\n var that = this;\n var element = that.element;\n var DOMElement = element[0];\n var wrapper;\n wrapper = element.wrap('').parent();\n wrapper[0].style.cssText = DOMElement.style.cssText;\n DOMElement.style.width = '100%';\n that._inputWrapper = that.wrapper = wrapper.addClass(DOMElement.className).removeClass('input-validation-error');\n }\n });\n ui.plugin(TextBox);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}