{"version":3,"file":"kendo.textbox.js","names":["__meta__","id","name","category","description","depends","$","undefined$1","kendo","window","Widget","ui","isPlainObject","NS","CHANGE","DISABLED","READONLY","INPUT","INPUT_EV","FOCUSED","STATEDISABLED","NOCLICKCLASS","ARIA_DISABLED","TextBox","extend","init","element","options","that","this","fn","call","value","val","readonly","Boolean","attr","enable","placeholder","_wrapper","_label","_editable","disable","addClass","icon","_icon","notify","_applyCssClasses","events","label","rounded","size","fillMode","_value","floatingLabel","refresh","focus","destroy","off","style","width","removeClass","setOptions","_inputLabel","remove","_floatingLabelContainer","unwrap","deepExtend","wrapper","toggleClass","prop","on","_focusin","bind","_focusout","_change","_input","prepend","iconClass","e","newValue","trigger","originalEvent","floating","labelText","content","wrap","parent","FloatingLabel","widget","isFunction","guid","insertBefore","DOMElement","cssText","className","cssProperties","registerPrefix","registerValues","values","roundedValues","concat","plugin","jQuery","kendo$1"],"sources":["kendo.textbox.js"],"mappings":"MAAO,wBACA,iCACA,mBAEP,IAAIA,SAAW,CACXC,GAAI,UACJC,KAAM,UACNC,SAAU,MACVC,YAAa,uGACbC,QAAS,CAAC,OAAQ,gBAAiB,WAGvC,SAAUC,EAAGC,GACT,IAAIC,EAAQC,OAAOD,MACfE,EAASF,EAAMG,GAAGD,OAClBC,EAAKH,EAAMG,GACXC,EAAgBN,EAAEM,cAClBC,EAAK,gBACLC,EAAS,SACTC,EAAW,WACXC,EAAW,WACXC,EAAQ,gBACRC,EAAW,QACXC,EAAU,UAEVC,EAAgB,aAChBC,EAAe,aACfC,EAAgB,gBAEhBC,EAAUb,EAAOc,OAAO,CACxBC,KAAM,SAASC,EAASC,GACpB,IAAIC,EAAOC,KAEXnB,EAAOoB,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACnCA,EAAUrB,EAAEkB,QAAO,EAAM,GAAIG,GAE7BC,EAAKD,QAAQK,MAAQL,EAAQK,OAASJ,EAAKF,QAAQO,MACnDL,EAAKD,QAAQO,SAAWP,EAAQO,WAAa3B,E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,EAAU1C,EAAQ4D,KAAK,2CAA2CC,UAC1D,GAAG5B,MAAMmC,QAAUD,EAAWlC,MAAMmC,QAC5CD,EAAWlC,MAAMC,MAAQ,OAPd/B,KAQNuC,QAAUA,EAAQzB,SAASkD,EAAWE,WAAWlC,YAAY,6BAI1ErD,EAAMwF,cAAcC,eAAe,UAAW,YAE9CzF,EAAMwF,cAAcE,eAAe,UAAW,CAAC,CAC3C5B,KAAM,UACN6B,OAAQ3F,EAAMwF,cAAcI,cAAcC,OAAO,CAAC,CAAC,OAAQ,aAG/D1F,EAAG2F,OAAO/E,GA3Qd,CA4QGd,OAAOD,MAAM+F,QAChB,IAAIC,QAAUhG,aAELgG","sourcesContent":["import './kendo.core.js';\nimport './kendo.floatinglabel.js';\nimport './kendo.icons.js';\n\nvar __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: [\"core\", \"floatinglabel\", \"icons\"]\n};\n\n(function($, undefined$1) {\n var kendo = window.kendo,\n Widget = kendo.ui.Widget,\n ui = kendo.ui,\n isPlainObject = $.isPlainObject,\n NS = \".kendoTextBox\",\n CHANGE = \"change\",\n DISABLED = \"disabled\",\n READONLY = \"readonly\",\n INPUT = \"k-input-inner\",\n INPUT_EV = \"input\",\n FOCUSED = \"k-focus\",\n LABELCLASSES = \"k-label k-input-label\",\n STATEDISABLED = \"k-disabled\",\n NOCLICKCLASS = \"k-no-click\",\n ARIA_DISABLED = \"aria-disabled\";\n\n var TextBox = Widget.extend({\n init: function(element, options) {\n var that = this;\n\n Widget.fn.init.call(that, element, options);\n options = $.extend(true, {}, options);\n\n that.options.value = options.value || that.element.val();\n that.options.readonly = options.readonly !== undefined$1 ? options.readonly : Boolean(that.element.attr(\"readonly\"));\n that.options.enable = options.enable !== undefined$1 ? options.enable : !(Boolean(that.element.attr(\"disabled\")));\n that.options.placeholder = options.placeholder || that.element.attr(\"placeholder\");\n\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\n that.element\n .addClass(INPUT)\n .attr(\"placeholder\", that.options.placeholder)\n .attr(\"autocomplete\", \"off\");\n\n if (options.icon) {\n that._icon();\n }\n\n kendo.notify(that);\n that._applyCssClasses();\n },\n\n events: [\n CHANGE,\n INPUT_EV\n ],\n\n options: {\n name: 'TextBox',\n value: '',\n readonly: false,\n enable: true,\n placeholder: '',\n label: null,\n rounded: \"medium\",\n size: \"medium\",\n fillMode: \"solid\",\n icon: null\n },\n\n value: function(value) {\n var that = this;\n\n if (value === undefined$1) {\n return that._value;\n }\n\n that._value = value;\n that.element.val(value);\n\n if (that.floatingLabel) {\n that.floatingLabel.refresh();\n }\n },\n\n readonly: function(readonly) {\n var that = this;\n\n this._editable({\n readonly: readonly === undefined$1 ? true : readonly,\n disable: false\n });\n\n if (that.floatingLabel) {\n that.floatingLabel.readonly(readonly === undefined$1 ? true : readonly);\n }\n },\n\n enable: function(enable) {\n var that = this;\n\n this._editable({\n readonly: false,\n disable: !(enable = enable === undefined$1 ? true : enable)\n });\n\n if (that.floatingLabel) {\n that.floatingLabel.enable(enable = enable === undefined$1 ? true : enable);\n }\n },\n\n focus: function() {\n var that = this;\n\n that.element[0].focus();\n },\n\n destroy: function() {\n var that = this;\n\n if (that.floatingLabel) {\n that.floatingLabel.destroy();\n }\n\n that.element.off(NS);\n that.element[0].style.width = \"\";\n that.element.removeClass(INPUT);\n Widget.fn.destroy.call(that);\n },\n\n setOptions: function(options) {\n this.destroy();\n\n if (this._inputLabel) {\n this._inputLabel.remove();\n this._inputLabel = null;\n }\n\n if (this._floatingLabelContainer) {\n this.floatingLabel.destroy();\n this.floatingLabel = null;\n this.element.unwrap();\n this.element.unwrap();\n this._floatingLabelContainer = null;\n } else {\n this.element.unwrap();\n }\n\n kendo.deepExtend(this.options, options);\n this.init(this.element, this.options);\n },\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\n element.off(NS);\n\n if (!readonly && !disable) {\n element.prop(DISABLED, false)\n .prop(READONLY, false)\n .attr(ARIA_DISABLED, false);\n\n wrapper.removeClass(STATEDISABLED)\n .removeClass(NOCLICKCLASS);\n\n element.on(\"focusin\" + NS, that._focusin.bind(that));\n element.on(\"focusout\" + NS, that._focusout.bind(that));\n element.on(\"change\" + NS, that._change.bind(that));\n element.on(INPUT_EV + NS, that._input.bind(that));\n } else {\n element.attr(DISABLED, disable)\n .attr(READONLY, readonly)\n .attr(ARIA_DISABLED, disable);\n\n wrapper.toggleClass(STATEDISABLED, disable)\n .toggleClass(NOCLICKCLASS, readonly);\n }\n },\n\n _icon: function() {\n this.wrapper.prepend(kendo.ui.icon({ icon: this.options.icon, iconClass: \"k-input-icon\" }));\n },\n\n _input: function(e) {\n var that = this;\n var newValue = that.element.val();\n\n that.trigger(INPUT_EV, { value: newValue, originalEvent: e });\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\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\n if (floating) {\n that._floatingLabelContainer = that.wrapper.wrap(\"\").parent();\n that.floatingLabel = new kendo.ui.FloatingLabel(that._floatingLabelContainer, { widget: that });\n }\n\n if (kendo.isFunction(labelText)) {\n labelText = labelText.call(that);\n }\n\n if (!labelText) {\n labelText = \"\";\n }\n\n if (!id) {\n id = options.name + \"_\" + kendo.guid();\n element.attr(\"id\", id);\n }\n\n that._inputLabel = $(\"'\").insertBefore(that.wrapper);\n }\n },\n\n _focusin: function() {\n var that = this;\n\n that.wrapper.addClass(FOCUSED);\n },\n\n _focusout: function() {\n var that = this;\n\n that.wrapper.removeClass(FOCUSED);\n },\n\n _change: function(e) {\n var that = this;\n var newValue = that.element.val();\n\n that._value = newValue;\n\n that.trigger(CHANGE, { value: newValue, originalEvent: e });\n },\n\n _wrapper: function() {\n var that = this;\n var element = that.element;\n var DOMElement = element[0];\n var wrapper;\n\n wrapper = element.wrap(\"\").parent();\n wrapper[0].style.cssText = DOMElement.style.cssText;\n DOMElement.style.width = \"100%\";\n that.wrapper = wrapper.addClass(DOMElement.className).removeClass('input-validation-error');\n }\n });\n\n kendo.cssProperties.registerPrefix(\"TextBox\", \"k-input-\");\n\n kendo.cssProperties.registerValues(\"TextBox\", [{\n prop: \"rounded\",\n values: kendo.cssProperties.roundedValues.concat([['full', 'full']])\n }]);\n\n ui.plugin(TextBox);\n})(window.kendo.jQuery);\nvar kendo$1 = kendo;\n\nexport { kendo$1 as default };\n"]}