Your IP : 18.222.182.149


Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/main/loader/dist/
Upload File :
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/main/loader/dist/loader.bundle.js.map

{"version":3,"file":"loader.bundle.js","sources":["../src/layout.js","../src/utils.js","../src/loader.js"],"sourcesContent":["import {Tag} from 'main.core';\n\nexport default function layout()\n{\n\tconst container = Tag.render`\n\t\t<div class=\"main-ui-loader main-ui-hide\">\n\t\t\t<svg class=\"main-ui-loader-svg\" viewBox=\"25 25 50 50\">\n\t\t\t\t<circle class=\"main-ui-loader-svg-circle\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-miterlimit=\"10\">\n\t\t\t</svg>\n\t\t</div>\n\t`;\n\n\tconst circle = container.querySelector('.main-ui-loader-svg-circle');\n\n\treturn {container, circle};\n}","import {Type, Event, Tag, Dom} from 'main.core';\n\n\nexport function show(element)\n{\n\tif (!Type.isDomNode(element))\n\t{\n\t\treturn Promise.reject(new Error('element is not Element'));\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tif (\n\t\t\telement.dataset.isShown === 'false'\n\t\t\t|| !element.dataset.isShown\n\t\t)\n\t\t{\n\t\t\tconst handler = (event) => {\n\t\t\t\tif (event.animationName === 'showMainLoader')\n\t\t\t\t{\n\t\t\t\t\tEvent.unbind(element, 'animationend', handler);\n\t\t\t\t\tresolve(event);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tEvent.bind(element, 'animationend', handler);\n\n\t\t\tTag.attrs(element)`\n\t\t\t\tdata-is-shown: true;\n\t\t\t`;\n\n\t\t\tTag.style(element)`\n\t\t\t\tdisplay: null;\n\t\t\t`;\n\n\t\t\tDom.removeClass(element, 'main-ui-hide');\n\t\t\tDom.addClass(element, 'main-ui-show');\n\t\t}\n\t});\n}\n\nexport function hide(element)\n{\n\tif (!Type.isDomNode(element))\n\t{\n\t\treturn Promise.reject(new Error('element is not Element'));\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tif (element.dataset.isShown === 'true')\n\t\t{\n\t\t\tconst handler = function handler(event) {\n\t\t\t\tif (event.animationName === 'hideMainLoader')\n\t\t\t\t{\n\t\t\t\t\tTag.style(element)`\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t`;\n\n\t\t\t\t\tEvent.unbind(element, 'animationend', handler);\n\t\t\t\t\tresolve(event);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tEvent.bind(element, 'animationend', handler);\n\n\t\t\tTag.attrs(element)`\n\t\t\t\tdata-is-shown: false;\n\t\t\t`;\n\n\t\t\tDom.removeClass(element, 'main-ui-show');\n\t\t\tDom.addClass(element, 'main-ui-hide');\n\t\t}\n\t});\n}","import {\n\ttype,\n\tappend,\n\tremove,\n\taddClass,\n\tremoveClass,\n} from 'main.core';\nimport layout from './layout';\nimport {show, hide} from './utils';\nimport './loader.css';\n\nconst defaultOptions = {\n\tsize: 110,\n};\n\nconst STATE_READY = 'ready';\nconst STATE_SHOWN = 'shown';\nconst STATE_HIDDEN = 'hidden';\n\nexport class Loader\n{\n\tdata = layout();\n\tstate = STATE_READY;\n\tcurrentTarget = null;\n\n\tconstructor(options = {})\n\t{\n\t\tconst currentOptions = {...defaultOptions, ...options};\n\t\tthis.currentTarget = currentOptions.target;\n\t\tthis.setOptions(currentOptions);\n\t}\n\n\tget layout()\n\t{\n\t\treturn this.data.container;\n\t}\n\n\tget circle()\n\t{\n\t\treturn this.data.circle;\n\t}\n\n\tcreateLayout()\n\t{\n\t\treturn this.layout;\n\t}\n\n\tshow(target = null)\n\t{\n\t\treturn new Promise(() => {\n\t\t\tconst targetElement = target || this.currentTarget;\n\n\t\t\tif (\n\t\t\t\ttype.isDomNode(targetElement)\n\t\t\t\t&& targetElement !== this.layout.parentNode\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.currentTarget = targetElement;\n\t\t\t\tappend(this.layout, targetElement);\n\t\t\t}\n\n\t\t\tif (this.state !== STATE_SHOWN)\n\t\t\t{\n\t\t\t\tthis.state = STATE_SHOWN;\n\t\t\t\treturn show(this.layout);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\t}\n\n\thide()\n\t{\n\t\treturn new Promise(() => {\n\t\t\tif (this.state !== STATE_HIDDEN)\n\t\t\t{\n\t\t\t\tthis.state = STATE_HIDDEN;\n\t\t\t\treturn hide(this.layout);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tisShown()\n\t{\n\t\treturn this.state === STATE_SHOWN;\n\t}\n\n\tdestroy()\n\t{\n\t\tremove(this.layout);\n\t}\n\n\tsetOptions({target, size, color, offset, mode})\n\t{\n\t\tconst layoutStyles = new Map();\n\t\tconst circleStyles = new Map();\n\n\t\tif (type.isDomNode(target))\n\t\t{\n\t\t\tthis.currentTarget = target;\n\t\t}\n\n\t\tif (type.isNumber(size))\n\t\t{\n\t\t\tlayoutStyles.set('width', `${size}px`);\n\t\t\tlayoutStyles.set('height', `${size}px`);\n\t\t}\n\n\t\tif (type.isString(color))\n\t\t{\n\t\t\tcircleStyles.set('stroke', color);\n\t\t}\n\n\t\tif (type.isObjectLike(offset))\n\t\t{\n\t\t\tconst prefix = /^inline$|^custom$/.test(mode) ? '' : 'margin-';\n\n\t\t\tif (type.isString(offset.top))\n\t\t\t{\n\t\t\t\tlayoutStyles.set(`${prefix}top`, offset.top);\n\t\t\t}\n\n\t\t\tif (type.isString(offset.left))\n\t\t\t{\n\t\t\t\tlayoutStyles.set(`${prefix}left`, offset.left);\n\t\t\t}\n\t\t}\n\n\t\tif (mode === 'inline')\n\t\t{\n\t\t\taddClass(this.layout, 'main-ui-loader-inline');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tremoveClass(this.layout, 'main-ui-loader-inline');\n\t\t}\n\n\t\tif (mode === 'custom')\n\t\t{\n\t\t\taddClass(this.layout, 'main-ui-loader-custom');\n\t\t\tremoveClass(this.layout, 'main-ui-loader-inline');\n\t\t}\n\n\t\tlayoutStyles.forEach((value, key) => {\n\t\t\tthis.layout.style[key] = value;\n\t\t});\n\n\t\tcircleStyles.forEach((value, key) => {\n\t\t\tthis.circle.style[key] = value;\n\t\t});\n\t}\n}"],"names":["layout","container","Tag","render","circle","querySelector","show","element","Type","isDomNode","Promise","reject","Error","resolve","dataset","isShown","handler","event","animationName","Event","unbind","bind","attrs","style","Dom","removeClass","addClass","hide","defaultOptions","size","STATE_READY","STATE_SHOWN","STATE_HIDDEN","Loader","options","currentOptions","currentTarget","target","setOptions","targetElement","type","parentNode","append","state","remove","color","offset","mode","layoutStyles","Map","circleStyles","isNumber","set","isString","isObjectLike","prefix","test","top","left","forEach","value","key","data"],"mappings":";;;;;;;;;;;;CAEe,SAASA,MAAT,GACf;CACC,MAAMC,SAAS,GAAGC,aAAG,CAACC,MAAP,mBAAf;CAQA,MAAMC,MAAM,GAAGH,SAAS,CAACI,aAAV,CAAwB,4BAAxB,CAAf;CAEA,SAAO;CAACJ,IAAAA,SAAS,EAATA,SAAD;CAAYG,IAAAA,MAAM,EAANA;CAAZ,GAAP;CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCZM,SAASE,IAAT,CAAcC,OAAd,EACP;CACC,MAAI,CAACC,cAAI,CAACC,SAAL,CAAeF,OAAf,CAAL,EACA;CACC,WAAOG,OAAO,CAACC,MAAR,CAAe,IAAIC,KAAJ,CAAU,wBAAV,CAAf,CAAP;CACA;;CAED,SAAO,IAAIF,OAAJ,CAAY,UAACG,OAAD,EAAa;CAC/B,QACCN,OAAO,CAACO,OAAR,CAAgBC,OAAhB,KAA4B,OAA5B,IACG,CAACR,OAAO,CAACO,OAAR,CAAgBC,OAFrB,EAIA;CACC,UAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;CAC1B,YAAIA,KAAK,CAACC,aAAN,KAAwB,gBAA5B,EACA;CACCC,UAAAA,eAAK,CAACC,MAAN,CAAab,OAAb,EAAsB,cAAtB,EAAsCS,OAAtC;CACAH,UAAAA,OAA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