Your IP : 3.149.28.7


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

{"version":3,"file":"label.bundle.js","sources":["../src/label-color.js","../src/label-size.js","../src/label.js"],"sourcesContent":["/**\n * @namespace {BX.UI}\n */\nexport default class LabelColor\n{\n\tstatic DEFAULT = 'ui-label-default';\n\tstatic DANGER = 'ui-label-danger';\n\tstatic SUCCESS = 'ui-label-success';\n\tstatic WARNING = 'ui-label-warning';\n\tstatic PRIMARY = 'ui-label-primary';\n\tstatic SECONDARY = 'ui-label-secondary';\n\tstatic LIGHT = 'ui-label-light';\n\tstatic TAG_SECONDARY = 'ui-label-tag-secondary';\n\tstatic TAG_LIGHT = 'ui-label-tag-light';\n\tstatic LIGHT_BLUE = 'ui-label-lightblue';\n\tstatic LIGHT_GREEN = 'ui-label-lightgreen';\n\tstatic ORANGE = 'ui-label-orange';\n\tstatic LIGHT_ORANGE = 'ui-label-lightorange';\n\tstatic YELLOW = 'ui-label-yellow';\n\tstatic LIGHT_YELLOW = 'ui-label-lightyellow';\n\tstatic LIGHT_RED = 'ui-label-lightred';\n\tstatic LAVENDER = 'ui-label-lavender';\n\tstatic COPILOT_LIGHT = 'ui-label-copilot-light';\n\tstatic COPILOT_LIGHT_REVERSE = 'ui-label-copilot-light-reverse';\n}\n","/**\n * @namespace {BX.UI}\n */\nexport default class LabelSize\n{\n\tstatic MD = 'ui-label-md';\n\tstatic SM = 'ui-label-sm';\n\tstatic LG = 'ui-label-lg';\n}","// @flow\n\nimport {Tag, Type, Dom} from 'main.core';\nimport LabelColor from './label-color';\nimport LabelSize from './label-size';\nimport { Loader } from 'main.loader';\nimport { Icon, Main } from 'ui.icon-set.api.core';\nimport 'ui.icon-set.main';\nimport 'ui.design-tokens';\nimport './style.css';\n\ntype LabelOptions = {\n\ttext: string;\n\tcolor: LabelColor;\n\tsize: LabelSize;\n\tlink: string;\n\tfill: boolean;\n\tcustomClass: string;\n\ticon: Object;\n\tstatus: string;\n\tloader: Loader;\n};\n\nexport default class Label {\n\n\tstatic Color = LabelColor;\n\tstatic Size = LabelSize;\n\n\ttext: string;\n\tcolor: string;\n\tsize: string;\n\tlink: string;\n\tfill: boolean;\n\tcustomClass: string;\n\ticon: Object;\n\tstatus: string;\n\tloader: Loader;\n\tnode: Object\n\n\tconstructor(options: LabelOptions)\n\t{\n\t\tthis.text = options.text;\n\t\tthis.color = options.color;\n\t\tthis.size = options.size;\n\t\tthis.link = options.link;\n\t\tthis.icon = options.icon;\n\t\tthis.fill = !!options.fill ? true : options.fill;\n\t\tthis.customClass = options.customClass;\n\t\tthis.classList = \"ui-label\";\n\t\tthis.status = options.status;\n\t\tthis.node = {\n\t\t\tcontainer: null,\n\t\t\tstatus: null\n\t\t};\n\n\n\t\tthis.setText(this.text);\n\t\tthis.setLink(this.link);\n\t\tthis.setColor(this.color);\n\t\tthis.setFill(this.fill);\n\n\t\tthis.setCustomClass(this.customClass);\n\t}\n\n\t//region COLOR\n\tsetColor(color: string)\n\t{\n\t\tthis.color = color;\n\t\tthis.setClassList();\n\t}\n\n\tgetColor()\n\t{\n\t\treturn this.color;\n\t}\n\n\t// endregion\n\n\t//region FILL\n\tsetFill(fill: boolean)\n\t{\n\t\tthis.fill = !!fill ? true : false;\n\t\tthis.setClassList();\n\t}\n\n\tgetFill()\n\t{\n\t\treturn this.fill;\n\t}\n\n\t// endregion\n\n\t//region SIZE\n\tsetSize(size: string)\n\t{\n\t\tthis.size = size;\n\t\tthis.setClassList();\n\t}\n\n\tgetSize()\n\t{\n\t\treturn this.size;\n\t}\n\n\t// endregion\n\n\t//region LINK\n\tsetLink(link: string)\n\t{\n\t\tthis.link = link;\n\t}\n\n\tgetLink()\n\t{\n\t\treturn this.link;\n\t}\n\n\t// endregion\n\n\t//region TEXT\n\tsetText(text: string): this\n\t{\n\t\tthis.text = text;\n\t\tif (Type.isStringFilled(text))\n\t\t{\n\t\t\tthis.getTextContainer().textContent = text;\n\t\t}\n\t}\n\n\tgetText()\n\t{\n\t\treturn this.text;\n\t}\n\n\tgetTextContainer()\n\t{\n\t\tif (!this.textContainer)\n\t\t{\n\t\t\tthis.textContainer = Tag.render`<span class=\"ui-label-inner\">${this.getText()}</span>`;\n\t\t}\n\n\t\treturn this.textContainer;\n\t}\n\n\t// endregion\n\n\t//region CUSTOM CLASS\n\tsetCustomClass(customClass: string)\n\t{\n\t\tthis.customClass = customClass;\n\t\tthis.updateClassList();\n\t}\n\n\tgetCustomClass()\n\t{\n\t\treturn this.customClass;\n\t}\n\n\t// endregion\n\n\t//region CLASS LIST\n\tsetClassList()\n\t{\n\t\tthis.classList = \"ui-label\";\n\n\t\tif(typeof this.getColor() != \"undefined\")\n\t\t{\n\t\t\tthis.classList = this.classList + \" \" + this.color;\n\t\t}\n\n\t\tif(typeof this.getSize() != \"undefined\")\n\t\t{\n\t\t\tthis.classList = this.classList + \" \" + this.size;\n\t\t}\n\n\t\tif(typeof this.getCustomClass() != \"undefined\")\n\t\t{\n\t\t\tthis.classList = this.classList + \" \" + this.customClass;\n\t\t}\n\n\t\tif(this.fill)\n\t\t{\n\t\t\tthis.classList = this.classList + \" ui-label-fill\";\n\t\t}\n\n\t\tthis.updateClassList()\n\t}\n\n\tgetClassList()\n\t{\n\t\treturn this.classList;\n\t}\n\n\tupdateClassList()\n\t{\n\t\tif (!this.node.container)\n\t\t{\n\t\t\tthis.getContainer()\n\t\t}\n\n\t\tthis.node.container.setAttribute(\"class\", this.classList);\n\t}\n\n\tgetIconAction()\n\t{\n\t\tthis.iconNode = Tag.render`<div class=\"ui-label-icon\"></div>`;\n\n\t\tfor(let key in this.icon)\n\t\t{\n\t\t\tthis.iconNode.addEventListener(key, this.icon[key])\n\t\t}\n\n\t\treturn this.iconNode;\n\t}\n\n\tgetLoader() : Loader\n\t{\n\t\tif (!this.loader)\n\t\t{\n\t\t\tthis.loader = new Loader({\n\t\t\t\tsize: 12,\n\t\t\t});\n\t\t}\n\n\t\treturn this.loader;\n\t}\n\n\tsetStatus(status: string) : void\n\t{\n\t\tif (status)\n\t\t{\n\t\t\tthis.status = status;\n\t\t}\n\n\t\tDom.clean(this.getContainerStatus());\n\t\tthis.getContainerStatus().classList.remove('--icon');\n\n\t\tif (this.status.toLocaleUpperCase() === 'LOADING')\n\t\t{\n\t\t\tthis.getLoader().show(this.getContainerStatus());\n\t\t}\n\t\t\n\t\tif (this.status.toLocaleUpperCase() === 'CHECK')\n\t\t{\n\t\t\tlet icon = new Icon({\n\t\t\t\ticon: Main.CHECK,\n\t\t\t\tsize: 10\n\t\t\t});\n\n\t\t\tthis.getContainerStatus().classList.add('--icon');\n\t\t\tthis.getContainerStatus().appendChild(icon.render());\n\t\t}\n\t}\n\n\tgetContainerStatus() : HTMLElement\n\t{\n\t\tif (!this.node.status)\n\t\t{\n\t\t\tthis.node.status = Tag.render`\n\t\t\t\t<div class=\"ui-label-status\"></div>\n\t\t\t`;\n\t\t}\n\n\t\treturn this.node.status;\n\t}\n\n\t// endregion\n\n\tgetContainer() : HTMLElement\n\t{\n\t\tif (!this.node.container)\n\t\t{\n\n\t\t\tif (this.getLink())\n\t\t\t{\n\t\t\t\tthis.node.container = Tag.render`<a href=\"${this.link}\" class=\"${this.getClassList()}\">\n\t\t\t\t\t${this.getContainerStatus()}\n\t\t\t\t\t${this.getTextContainer()}\n\t\t\t\t</a>`;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.node.container = Tag.render`<div class=\"${this.getClassList()}\">\n\t\t\t\t\t${this.getContainerStatus()}\n\t\t\t\t\t${this.getTextContainer()}\n\t\t\t\t</div>`;\n\t\t\t}\n\n\t\t\tif (typeof this.icon === 'object')\n\t\t\t{\n\t\t\t\tthis.node.container.appendChild(this.getIconAction());\n\t\t\t}\n\t\t}\n\n\t\treturn this.node.container;\n\t}\n\n\trender(): HTMLElement\n\t{\n\t\tif (this.status)\n\t\t{\n\t\t\tthis.setStatus(this.status);\n\t\t}\n\n\t\treturn this.getContainer();\n\t}\n\n}"],"names":["LabelColor","DEFAULT","DANGER","SUCCESS","WARNING","PRIMARY","SECONDARY","LIGHT","TAG_SECONDARY","TAG_LIGHT","LIGHT_BLUE","LIGHT_GREEN","ORANGE","LIGHT_ORANGE","YELLOW","LIGHT_YELLOW","LIGHT_RED","LAVENDER","COPILOT_LIGHT","COPILOT_LIGHT_REVERSE","LabelSize","MD","SM","LG","Label","constructor","options","text","color","size","link","icon","fill","customClass","classList","status","node","container","setText","setLink","setColor","setFill","setCustomClass","setClassList","getColor","getFill","setSize","getSize","getLink","Type","isStringFilled","getTextContainer","textContent","getText","textContainer","Tag","render","updateClassList","getCustomClass","getClassList","getContainer","setAttribute","getIconAction","iconNode","key","addEventListener","getLoader","loader","Loader","setStatus","Dom","clean","getContainerStatus","remove","toLocaleUpperCase","show","Icon","Main","CHECK","add","appendChild","Color","Size"],"mappings":";;;;;CAAA;CACA;CACA;AACA,CAAe,MAAMA,UAAU,CAC/B;CADqBA,UAAU,CAEvBC,OAAO,GAAG,kBAAkB;CAFfD,UAAU,CAGvBE,MAAM,GAAG,iBAAiB;CAHbF,UAAU,CAIvBG,OAAO,GAAG,kBAAkB;CAJfH,UAAU,CAKvBI,OAAO,GAAG,kBAAkB;CALfJ,UAAU,CAMvBK,OAAO,GAAG,kBAAkB;CANfL,UAAU,CAOvBM,SAAS,GAAG,oBAAoB;CAPnBN,UAAU,CAQvBO,KAAK,GAAG,gBAAgB;CARXP,UAAU,CASvBQ,aAAa,GAAG,wBAAwB;CAT3BR,UAAU,CAUvBS,SAAS,GAAG,oBAAoB;CAVnBT,UAAU,CAWvBU,UAAU,GAAG,oBAAoB;CAXpBV,UAAU,CAYvBW,WAAW,GAAG,qBAAqB;CAZtBX,UAAU,CAavBY,MAAM,GAAG,iBAAiB;CAbbZ,UAAU,CAcvBa,YAAY,GAAG,sBAAsB;CAdxBb,UAAU,CAevBc,MAAM,GAAG,iBAAiB;C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