Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/loader/dist/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/loader/dist/loader.bundle.js.map |
{"version":3,"file":"loader.bundle.js","sources":["../src/index.js"],"sourcesContent":["import { Dom, Tag, Type } from 'main.core';\nimport './style.css';\n\nexport class Loader\n{\n\tconstructor(options)\n\t{\n\t\tthis.target = Type.isDomNode(options.target) ? options.target : null;\n\t\tthis.type = Type.isString(options.type) ? options.type : null;\n\t\tthis.size = Type.isString(options.size) ? options.size : null;\n\t\tthis.color = options.color ? options.color : null;\n\n\t\tthis.layout = {\n\t\t\tcontainer: null,\n\t\t\tbulletContainer: null,\n\t\t};\n\t}\n\n\t#getContainer()\n\t{\n\t\tif (!this.layout.container)\n\t\t{\n\t\t\tthis.layout.container = Tag.render`\n\t\t\t\t<div class=\"ui-loader__container ui-loader__scope\">\n\t\t\t\t\t${this.type === 'BULLET' ? this.bulletLoader() : ''}\n\t\t\t\t</div>\n\t\t\t`;\n\t\t}\n\n\t\treturn this.layout.container;\n\t}\n\n\tbulletLoader()\n\t{\n\t\tconst color = this.color ? `background: ${this.color};` : '';\n\n\t\tif (!this.layout.bulletContainer)\n\t\t{\n\t\t\tthis.layout.bulletContainer = Tag.render`\n\t\t\t\t<div class=\"ui-loader__bullet\">\n\t\t\t\t\t<div style=\"${color}\" class=\"ui-loader__bullet_item\"></div>\n\t\t\t\t\t<div style=\"${color}\" class=\"ui-loader__bullet_item\"></div>\n\t\t\t\t\t<div style=\"${color}\" class=\"ui-loader__bullet_item\"></div>\n\t\t\t\t\t<div style=\"${color}\" class=\"ui-loader__bullet_item\"></div>\n\t\t\t\t\t<div style=\"${color}\" class=\"ui-loader__bullet_item\"></div>\n\t\t\t\t</div>\n\t\t\t`;\n\t\t}\n\n\t\tthis.layout.container = document.querySelector('.ui-loader__bullet');\n\n\t\treturn this.layout.bulletContainer;\n\t}\n\n\tshow()\n\t{\n\t\tthis.layout.container.style.display = 'block';\n\t}\n\n\thide()\n\t{\n\t\tthis.layout.container.style.display = '';\n\t}\n\n\trender()\n\t{\n\t\tif (!Type.isDomNode(this.target))\n\t\t{\n\t\t\tconsole.warn('BX.LiveChatRestClient: your auth-token has expired, send query with a new token');\n\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDom.append(this.#getContainer(), this.target);\n\n\t\t\tif (this.type === 'BULLET')\n\t\t\t{\n\t\t\t\tif (this.size)\n\t\t\t\t{\n\t\t\t\t\tif (this.size.toUpperCase() === 'XS')\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.addClass(this.layout.container, 'ui-loader__bullet--xs');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.size.toUpperCase() === 'S')\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.addClass(this.layout.container, 'ui-loader__bullet--sm');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.size.toUpperCase() === 'M')\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.addClass(this.layout.container, 'ui-loader__bullet--md');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.size.toUpperCase() === 'L')\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.addClass(this.layout.container, 'ui-loader__bullet--lg');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.size.toUpperCase() === 'XL')\n\t\t\t\t\t{\n\t\t\t\t\t\tDom.addClass(this.layout.container, 'ui-loader__bullet--xl');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["Loader","constructor","options","target","Type","isDomNode","type","isString","size","color","layout","container","bulletContainer","bulletLoader","Tag","render","document","querySelector","show","style","display","hide","console","warn","Dom","append","toUpperCase","addClass"],"mappings":";;;;;;;;AAAA,CACqB;AAErB,CAAO,MAAMA,MAAM,CACnB;GACCC,WAAW,CAACC,OAAO,EACnB;KAAA;OAAA;;KACC,IAAI,CAACC,MAAM,GAAGC,cAAI,CAACC,SAAS,C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