{"version":3,"file":"kendo.skeletoncontainer.min.js","names":["global","factory","exports","module","require","define","amd","globalThis","self","kendoskeletoncontainer","js","this","$","kendo","window","ui","Widget","SkeletonContainer","extend","init","element","options","that","fn","call","addClass","_setWrapperStyles","_initItems","_initTemplate","_aria","name","animation","grid","template","height","width","setOptions","deepExtend","empty","getOptions","attr","role","progress","messages","loading","shape","settings","item","items","i","length","toLowerCase","css","format","colStart","colSpan","rowStart","rowSpan","appendTo","replace","append","_addClasses","shapes","animations","find","removeAttr","j","columns","rows","gap","plugin","jQuery"],"sources":["kendo.skeletoncontainer.js"],"mappings":"CAAA,SAAWA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBA,OAAOD,QAAUD,EAAQG,QAAQ,kBAC9E,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,CAAC,kBAAmBJ,KACvED,EAA+B,oBAAfO,WAA6BA,WAAaP,GAAUQ,MAAcC,uBAAyBT,EAAOS,wBAA0B,CAAC,EAAGT,EAAOS,uBAAuBC,GAAKT,IACvL,CAJD,CAIGU,MAAM,WAgKL,OAxJA,SAAUC,GACN,IAAIC,EAAQC,OAAOD,MACfE,EAAKF,EAAME,GACXC,EAASD,EAAGC,OAKZC,EAAoBD,EAAOE,OAAQ,CACnCC,KAAM,SAASC,EAASC,GACpB,IAAIC,EAAOX,KAEXK,EAAOO,GAAGJ,KAAKK,KAAKF,EAAMF,EAASC,GAEnCC,EAAKF,QAAUR,EAAEQ,GAASK,SARd,wBAUZH,EAAKI,oBACLJ,EAAKK,aACLL,EAAKM,gBACLN,EAAKO,OACT,EAEAR,QAAS,CACLS,KAAM,oBACNC,UAAW,QACXC,KAAM,KACNC,SAAU,KACVC,OAAQ,GACRC,MAAO,IAGXC,WAAY,SAASf,GACjBR,EAAMwB,WAAW1B,KAAKU,QAASA,GAC/BV,KAAKS,QAAQkB,QACb3B,KAAKQ,KAAKR,KAAKS,QAAST,KAAKU,QACjC,EAEAkB,WAAY,WAGR,OAFa3B,EA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CvD,KAAKS,QACA4C,KAAK,eAAiBD,EAAWG,GAAK,KACtCD,WAAW,cAAgBF,EAAWG,IACtCzC,SAAS,cAAgBsC,EAAWG,GAEjD,EAEAxC,kBAAmB,WACf,IAAIJ,EAAOX,KACPU,EAAUC,EAAKD,QACfW,EAAOX,EAAQW,KACfD,EAAYV,EAAQU,UAAUoB,cAE9BnB,GACAV,EAAKF,QACAgC,IAAI,CACD,wBAAyBvC,EAAMwC,OAAO,mBAAoBrB,EAAKmC,SAC/D,qBAAsBtD,EAAMwC,OAAO,mBAAoBrB,EAAKoC,MAC5D,cAAepC,EAAKqC,KAAO,CAAC,GAAGF,QAAU,KACzC,WAAYnC,EAAKqC,KAAO,CAAC,GAAGD,KAAO,OAEtC3C,SAAS,YAGlBH,EAAKF,QAAQgC,IAAI,CACbjB,MAAkC,iBAAlBd,EAAQc,MAAqBd,EAAQc,MAAQd,EAAQc,MAAQ,KAC7ED,OAAoC,iBAAnBb,EAAQa,OAAsBb,EAAQa,OAASb,EAAQa,OAAS,OAGnE,SAAdH,GACAT,EAAKF,QAAQK,SAAsB,QAAbM,EA1Ib,kBACC,mBA2IlB,IAGJhB,EAAGuD,OAAOrD,EAEb,CArJD,CAqJGH,OAAOD,MAAM0D,QACF1D,KAIjB","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('kendo.core.js')) :\n typeof define === 'function' && define.amd ? define(['kendo.core'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.kendoskeletoncontainer = global.kendoskeletoncontainer || {}, global.kendoskeletoncontainer.js = factory()));\n})(this, (function () {\n var __meta__ = {\n id: \"skeletoncontainer\",\n name: \"SkeletonContainer\",\n category: \"web\",\n depends: [ \"core\"]\n };\n\n (function($) {\n var kendo = window.kendo,\n ui = kendo.ui,\n Widget = ui.Widget,\n WAVE_ANIMATION = \"k-skeleton-wave\",\n PULSE_ANIMATION = \"k-skeleton-pulse\",\n WRAPPER_CLASS = \"k-skeleton-container\";\n\n var SkeletonContainer = Widget.extend( {\n init: function(element, options) {\n var that = this;\n\n Widget.fn.init.call(that, element, options);\n\n that.element = $(element).addClass(WRAPPER_CLASS);\n\n that._setWrapperStyles();\n that._initItems();\n that._initTemplate();\n that._aria();\n },\n\n options: {\n name: \"SkeletonContainer\",\n animation: \"pulse\",\n grid: null,\n template: null,\n height: \"\",\n width: \"\"\n },\n\n setOptions: function(options) {\n kendo.deepExtend(this.options, options);\n this.element.empty();\n this.init(this.element, this.options);\n },\n\n getOptions: function() {\n var result = $.extend(true, {}, this.options);\n\n return result;\n },\n\n _aria: function() {\n var element = this.element;\n\n element.attr({\n \"role\": \"alert\",\n \"aria-live\": \"polite\",\n \"aria-label\": kendo.ui.progress.messages.loading\n });\n },\n\n _initItems: function() {\n if (!this.options.grid) {\n return;\n }\n\n var that = this;\n var grid = that.options.grid;\n var items = grid.items;\n var shape;\n var settings;\n var item;\n\n for (var i = 0; i < items.length; i++) {\n settings = items[i];\n item = $(\"
\");\n\n shape = settings.shape.toLowerCase();\n\n item\n .css({\n \"grid-column\": kendo.format(\"{0} / span {1}\",settings.colStart, settings.colSpan),\n \"grid-row\": kendo.format(\"{0} / span {1}\",settings.rowStart, settings.rowSpan)\n })\n \t\t\t\t\t.addClass(\"k-skeleton\")\n .addClass(kendo.format(\"k-skeleton-{0}\", shape === \"rectangle\" ? \"rect\" : shape));\n\n item.appendTo(that.element);\n }\n },\n\n _initTemplate: function() {\n if (!this.options.template || this.options.grid) {\n return;\n }\n\n var template = kendo.template(this.options.template)({});\n\n template = template\n .replace(/data-animation/gi, \"k-skeleton\")\n .replace(/data-shape/gi, \"k-skeleton\")\n .replace(/k-skeleton-rectangle/gi, \"k-skeleton-rect\");\n\n this.element.append(template);\n\n this._addClasses();\n },\n\n _addClasses: function() {\n var shapes = [\"circle\", \"rect\", \"text\"];\n var animations = [\"wave\", \"pulse\"];\n\n for (var i = 0; i < shapes.length; i++) {\n this.element\n .find(\"[k-skeleton-\" + shapes[i] + \"]\")\n .removeAttr(\"k-skeleton-\" + shapes[i])\n .addClass(\"k-skeleton k-skeleton-\" + shapes[i] + \"\");\n }\n\n for (var j = 0; j < animations.length; j++) {\n this.element\n .find(\"[k-skeleton-\" + animations[j] + \"]\")\n .removeAttr(\"k-skeleton-\" + animations[j])\n .addClass(\"k-skeleton-\" + animations[j] + \"\");\n }\n },\n\n _setWrapperStyles: function() {\n var that = this;\n var options = that.options;\n var grid = options.grid;\n var animation = options.animation.toLowerCase();\n\n if (grid) {\n that.element\n .css({\n \"grid-template-columns\": kendo.format(\"repeat({0}, 1fr)\", grid.columns),\n \"grid-template-rows\": kendo.format(\"repeat({0}, 1fr)\", grid.rows),\n \"column-gap\": (grid.gap || {}).columns + \"px\",\n \"row-gap\": (grid.gap || {}).rows + \"px\"\n })\n .addClass(\"k-d-grid\");\n }\n\n that.element.css({\n \"width\": typeof options.width === \"string\" ? options.width : options.width + \"px\",\n \"height\": typeof options.height === \"string\" ? options.height : options.height + \"px\"\n });\n\n if (animation !== \"none\") {\n that.element.addClass(animation == \"wave\" ? WAVE_ANIMATION : PULSE_ANIMATION);\n }\n }\n });\n\n ui.plugin(SkeletonContainer);\n\n })(window.kendo.jQuery);\n var kendo$1 = kendo;\n\n return kendo$1;\n\n}));\n"]}