{"version":3,"file":"kendo.floatinglabel.js","names":["__meta__","id","name","category","depends","hidden","$","undefined$1","kendo","window","Widget","ui","NS","EMPTY","FOCUSED","STATEDISABLED","NOCLICKCLASS","STATEREADONLY","FloatingLabel","extend","init","element","options","that","this","fn","call","widget","widgetWrapper","wrapper","refresh","_editable","readonly","disable","enable","style","width","css","addClass","notify","useReadOnlyClass","floatCheck","val","removeClass","floating","document","activeElement","input","destroy","off","toggleClass","on","bind","plugin","jQuery","kendo$1"],"sources":["kendo.floatinglabel.js"],"mappings":"MAAO,kBAEP,IAAIA,SAAW,CACXC,GAAI,gBACJC,KAAM,gBACNC,SAAU,YACVC,QAAS,CAAC,QACVC,QAAQ,IAGZ,SAAUC,EAAGC,GACT,IAAIC,EAAQC,OAAOD,MACfE,EAASF,EAAMG,GAAGD,OAClBC,EAAKH,EAAMG,GACXC,EAAK,sBAELC,EAAQ,UACRC,EAAU,UACVC,EAAgB,aAChBC,EAAe,aACfC,EAAgB,aAEhBC,EAAgBR,EAAOS,OAAO,CAC9BC,KAAM,SAASC,EAASC,GACpB,IAAIC,EAAOC,KAEXd,EAAOe,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACnCA,EAAUhB,EAAEa,QAAO,EAAM,CAAC,EAAGG,GAE7BC,EAAKI,OAASJ,EAAKD,QAAQK,OAC3BJ,EAAKK,cAAgBL,EAAKI,OAAOE,QAAQ,GAEzCN,EAAKO,UACLP,EAAKQ,UAAU,CACXC,SAAUT,EAAKD,QAAQK,OAAOL,QAAQU,WAAazB,GAAcgB,EAAKD,QAAQK,OAAOL,QAAQU,SAC7FC,QAASV,EAAKD,QAAQK,OAAOL,QAAQY,SAAW3B,IAAgBgB,EAAKD,QAAQK,OAAOL,QAAc,SAGlGC,EAAKK,cAAcO,MAAMC,QACzBb,EAAKF,QAAQgB,IAAI,QAASd,EAAKK,cAAcO,MAAMC,OACnDb,EAAKK,cAAcO,MAAMC,MAAQ,QAGrCb,EAAKF,QAAQiB,SA5BQ,8BA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AAG0C,OAAOnC,EACb,CA5GD,CA4GGT,OAAOD,MAAM8C,QAChB,IAAIC,QAAU/C,aAEL+C","sourcesContent":["import './kendo.core.js';\n\nvar __meta__ = {\n id: \"floatinglabel\",\n name: \"FloatingLabel\",\n category: \"framework\",\n depends: [\"core\"],\n hidden: true\n};\n\n(function($, undefined$1) {\n var kendo = window.kendo,\n Widget = kendo.ui.Widget,\n ui = kendo.ui,\n NS = \".kendoFloatingLabel\",\n FLOATINGLABELCONTAINER = \"k-floating-label-container\",\n EMPTY = \"k-empty\",\n FOCUSED = \"k-focus\",\n STATEDISABLED = \"k-disabled\",\n NOCLICKCLASS = \"k-no-click\",\n STATEREADONLY = \"k-readonly\";\n\n var FloatingLabel = 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.widget = that.options.widget;\n that.widgetWrapper = that.widget.wrapper[0];\n\n that.refresh();\n that._editable({\n readonly: that.options.widget.options.readonly !== undefined$1 ? that.options.widget.options.readonly : false,\n disable: that.options.widget.options.enable !== undefined$1 ? !(that.options.widget.options.enable) : false\n });\n\n if (that.widgetWrapper.style.width) {\n that.element.css(\"width\", that.widgetWrapper.style.width);\n that.widgetWrapper.style.width = \"100%\";\n }\n\n that.element.addClass(FLOATINGLABELCONTAINER);\n\n kendo.notify(that);\n },\n\n options: {\n name: 'FloatingLabel',\n widget: null,\n useReadOnlyClass: false,\n floatCheck: ({ element }) => !element.val()\n },\n\n readonly: function(readonly) {\n this._editable({\n readonly: readonly === undefined$1 ? true : readonly,\n disable: false\n });\n },\n\n enable: function(enable) {\n this._editable({\n readonly: false,\n disable: !(enable = enable === undefined$1 ? true : enable)\n });\n },\n\n refresh: function() {\n var that = this;\n var element = that.element;\n\n element\n .removeClass(EMPTY)\n .removeClass(FOCUSED);\n\n if (that.options.floatCheck({ element: that.options.widget.element, floating: that.element })) {\n element.addClass(EMPTY);\n }\n\n if (document.activeElement === that.options.widget.element[0]\n || (that.options.widget.input && document.activeElement === that.options.widget.input[0])) {\n\n element.addClass(FOCUSED);\n }\n },\n\n destroy: function() {\n var that = this;\n\n that.element.off(NS);\n Widget.fn.destroy.call(that);\n },\n\n _editable: function(options) {\n var that = this;\n var element = that.element;\n var disable = options.disable;\n var readonly = options.readonly;\n\n element.off(NS);\n\n if (!readonly && !disable) {\n element\n .removeClass(STATEDISABLED)\n .removeClass(that.options.useReadOnlyClass ? STATEREADONLY : NOCLICKCLASS);\n\n element.on(\"focusin\" + NS, that.refresh.bind(that));\n element.on(\"focusout\" + NS, that.refresh.bind(that));\n } else {\n element\n .toggleClass(STATEDISABLED, disable)\n .toggleClass(that.options.useReadOnlyClass ? STATEREADONLY : NOCLICKCLASS, readonly);\n }\n }\n });\n ui.plugin(FloatingLabel);\n})(window.kendo.jQuery);\nvar kendo$1 = kendo;\n\nexport { kendo$1 as default };\n"]}