{"version":3,"file":"kendo.html.button.js","names":["__meta__","id","name","category","description","depends","features","$","undefined$1","kendo","window","HTMLBase","html","KBUTTONICON","HTMLButton","extend","init","element","options","that","this","fn","call","wrapper","addClass","attr","type","_addClasses","iconElement","_textElement","icon","iconClass","spriteCssClass","imageUrl","size","rounded","fillMode","themeColor","stylingOptions","span","img","isEmpty","contents","filter","hasClass","each","idx","el","nodeType","trim","nodeValue","length","children","first","prependTo","ui","newSpan","document","createElement","parentNode","insertBefore","appendChild","classList","add","renderButton","arguments","isPlainObject","cssProperties","registerPrefix","registerValues","prop","values","fillModeValues","concat","roundedValues","jQuery","kendo$1"],"sources":["kendo.html.button.js"],"mappings":"MAAO,6BACA,mBAEP,IAAIA,SAAW,CACXC,GAAI,cACJC,KAAM,cACNC,SAAU,MACVC,YAAa,kDACbC,QAAS,CAAE,YAAa,SACxBC,SAAU,KAGd,SAAUC,EAAGC,GACT,IAAIC,EAAQC,OAAOD,MACfE,EAAWF,EAAMG,KAAKD,SAGtBE,EAAc,gBAYdC,EAAaH,EAASI,OAAO,CAC7BC,KAAM,SAASC,EAASC,GACpB,IAAIC,EAAOC,KACXT,EAASU,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACrCC,EAAKI,QAAUJ,EAAKF,QAAQO,SAjBtB,aAmBDL,EAAKF,QAAQQ,KAAK,SAAWN,EAAKD,QAAQQ,MAC3CP,EAAKF,QAAQQ,KAAK,OAAQN,EAAKD,QAAQQ,MAG3CP,EAAKQ,cACLR,EAAKS,cACLT,EAAKU,cACT,EACAX,QAAS,CACLhB,KAAM,aACNwB,KAAM,SACNI,KAAM,GACNC,UAAW,GACXC,eAAgB,GAChBC,SAAU,GACVC,KAAM,SACNC,QAAS,SACTC,SAAU,QACVC,WAAY,OACZC,eAAgB,CAAE,OAAQ,UAAW,WAAY,eAErDV,YAAa,WACT,IAOIW,EAAMC,EAAKC,EAPXtB,EAAOC,KACPH,EAAUE,EAAKF,QACfC,EAAUC,EAAKD,QACfY,EAA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AAKF,EAAGG,WAAWC,OAAS,EAAG,CAC7E,GAAoB,IAAhBJ,EAAGC,SAAgB,CACnB,IAAIQ,EAAUC,SAASC,cAAc,QAErCX,EAAGY,WAAWC,aAAaJ,EAAST,GACpCS,EAAQK,YAAYd,GACpBA,EAAKS,CACT,CAEAT,EAAGe,UAAUC,IAvGX,gBAwGN,CACJ,GACJ,IAGJxD,EAAEQ,OAAON,EAAMG,KAAM,CACjBoD,aA5Ge,SAAS/C,EAASC,GAMjC,OAdR,YASY+C,UAAU,IAAsB1D,EAAE2D,cAAcD,UAAU,OAC1D/C,EAAUD,EACVA,EAAUV,EAAE,sBAGT,IAAKO,EAAWG,EAASC,GAAUN,MAC9C,EAsGIE,WAAYA,IAGhBL,EAAM0D,cAAcC,eAAe,aAAc,aAEjD3D,EAAM0D,cAAcE,eAAe,aAAc,CAAC,CAC9CC,KAAM,WACNC,OAAQ9D,EAAM0D,cAAcK,eAAeC,OAAO,CAAC,UACpD,CACCH,KAAM,UACNC,OAAQ9D,EAAM0D,cAAcO,cAAcD,OAAO,CAAC,CAAC,OAAQ,YAGlE,CAlID,CAkIG/D,OAAOD,MAAMkE,QAChB,IAAIC,QAAUnE,aAELmE","sourcesContent":["import './kendo.html.base.js';\nimport './kendo.icons.js';\n\nvar __meta__ = {\n id: \"html.button\",\n name: \"Html.Button\",\n category: \"web\",\n description: \"HTML rendering utility for Kendo UI for jQuery.\",\n depends: [ \"html.base\", \"icons\" ],\n features: []\n};\n\n(function($, undefined$1) {\n var kendo = window.kendo,\n HTMLBase = kendo.html.HTMLBase,\n\n KBUTTON = \"k-button\",\n KBUTTONICON = \"k-button-icon\",\n KBUTTONTEXT = \"k-button-text\";\n\n var renderButton = function(element, options) {\n if (arguments[0] === undefined$1 || $.isPlainObject(arguments[0])) {\n options = element;\n element = $(\"\");\n }\n\n return (new HTMLButton(element, options)).html();\n };\n\n var HTMLButton = HTMLBase.extend({\n init: function(element, options) {\n var that = this;\n HTMLBase.fn.init.call(that, element, options);\n that.wrapper = that.element.addClass(KBUTTON);\n\n if (!that.element.attr(\"type\") && that.options.type) {\n that.element.attr(\"type\", that.options.type);\n }\n\n that._addClasses();\n that.iconElement();\n that._textElement();\n },\n options: {\n name: \"HTMLButton\",\n type: \"button\",\n icon: \"\",\n iconClass: \"\",\n spriteCssClass: \"\",\n imageUrl: \"\",\n size: \"medium\",\n rounded: \"medium\",\n fillMode: \"solid\",\n themeColor: \"base\",\n stylingOptions: [ \"size\", \"rounded\", \"fillMode\", \"themeColor\" ]\n },\n iconElement: function() {\n var that = this,\n element = that.element,\n options = that.options,\n icon = options.icon,\n iconClass = options.iconClass,\n spriteCssClass = options.spriteCssClass,\n imageUrl = options.imageUrl,\n span, img, isEmpty;\n\n if (spriteCssClass || imageUrl || icon || iconClass) {\n isEmpty = true;\n\n element.contents().filter(function() {\n return (!$(this).hasClass(\"k-sprite\") && !$(this).hasClass(\"k-icon\") && !$(this).hasClass(\"k-svg-icon\") && !$(this).hasClass(\"k-image\"));\n }).each(function(idx, el) {\n if (el.nodeType == 1 || el.nodeType == 3 && kendo.trim(el.nodeValue).length > 0) {\n isEmpty = false;\n }\n });\n }\n\n if (isEmpty) {\n that.element.addClass(\"k-icon-button\");\n }\n\n if (imageUrl) {\n img = element.children(\"img.k-image\").first();\n if (!img[0]) {\n img = $('\"icon\"').prependTo(element);\n }\n img.attr(\"src\", imageUrl);\n img.addClass(KBUTTONICON);\n } else if (icon || iconClass) {\n span = element.children(\"span.k-icon, span.k-svg-icon\").first();\n if (!span[0]) {\n span = $(kendo.ui.icon({ icon, iconClass })).prependTo(element);\n } else {\n kendo.ui.icon(span, { icon, iconClass });\n }\n\n span.addClass(KBUTTONICON);\n } else if (spriteCssClass) {\n span = element.children(\"span.k-sprite\").first();\n if (!span[0]) {\n span = $('').prependTo(element);\n }\n span.addClass(spriteCssClass + \" \" + KBUTTONICON);\n }\n },\n _textElement: function() {\n var element = this.element;\n\n element.contents().filter(function() {\n return (!$(this).hasClass(KBUTTONICON) && !$(this).hasClass(\"k-sprite\") && !$(this).hasClass(\"k-icon\") && !$(this).hasClass(\"k-image\"));\n }).each(function(idx, el) {\n if (el.nodeType == 1 || el.nodeType == 3 && kendo.trim(el.nodeValue).length > 0) {\n if (el.nodeType === 3) {\n var newSpan = document.createElement('span');\n\n el.parentNode.insertBefore(newSpan, el);\n newSpan.appendChild(el);\n el = newSpan;\n }\n\n el.classList.add(KBUTTONTEXT);\n }\n });\n }\n });\n\n $.extend(kendo.html, {\n renderButton: renderButton,\n HTMLButton: HTMLButton\n });\n\n kendo.cssProperties.registerPrefix(\"HTMLButton\", \"k-button-\");\n\n kendo.cssProperties.registerValues(\"HTMLButton\", [{\n prop: \"fillMode\",\n values: kendo.cssProperties.fillModeValues.concat([\"link\"])\n }, {\n prop: \"rounded\",\n values: kendo.cssProperties.roundedValues.concat([['full', 'full']])\n }]);\n\n})(window.kendo.jQuery);\nvar kendo$1 = kendo;\n\nexport { kendo$1 as default };\n"]}