uawdijnntqw1x1x1
IP : 3.21.43.72
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
kirov.axolotls.ru
/
bitrix
/
js
/
ui
/
vue
/
..
/
label
/
src
/
label.js
/
/
// @flow import {Dom, Tag, Type} from 'main.core'; import LabelColor from './label-color'; import LabelSize from './label-size'; type LabelOptions = { text: string; color: LabelColor; size: LabelSize; link: string; fill: boolean; customClass: string; }; export default class Label { static Color = LabelColor; static Size = LabelSize; text: string; color: string; size: string; link: string; fill: boolean; customClass: string; constructor(options: LabelOptions) { this.text = options.text; this.color = options.color; this.size = options.size; this.link = options.link; this.fill = !!options.fill ? true : options.fill; this.customClass = options.customClass; this.classList = "ui-label"; this.setText(this.text); this.setLink(this.link); this.setColor(this.color); this.setFill(this.fill); this.setCustomClass(this.customClass); } //region COLOR setColor(color: string) { this.color = color; this.setClassList(); } getColor() { return this.color; } // endregion //region FILL setFill(fill: boolean) { this.fill = !!fill ? true : false; this.setClassList(); } getFill() { return this.fill; } // endregion //region SIZE setSize(size: string) { this.size = size; this.setClassList(); } getSize() { return this.size; } // endregion //region LINK setLink(link: string) { this.link = link; } getLink() { return this.link; } // endregion //region TEXT setText(text: string): this { this.text = text; if (Type.isStringFilled(text)) { this.getTextContainer().textContent = text; } } getText() { return this.text; } getTextContainer() { if (!this.textContainer) { this.textContainer = Tag.render`<span class="ui-label-inner">${this.getText()}</span>`; } return this.textContainer; } // endregion //region CUSTOM CLASS setCustomClass(customClass: string) { this.customClass = customClass; this.updateClassList(); } getCustomClass() { return this.customClass; } // endregion //region CLASS LIST setClassList() { this.classList = "ui-label"; if(typeof this.getColor() != "undefined") { this.classList = this.classList + " " + this.color; } if(typeof this.getSize() != "undefined") { this.classList = this.classList + " " + this.size; } if(typeof this.getCustomClass() != "undefined") { this.classList = this.classList + " " + this.customClass; } if(this.fill) { this.classList = this.classList + " ui-label-fill"; } this.updateClassList() } getClassList() { return this.classList; } updateClassList() { if (!this.container) { this.getContainer() } this.container.setAttribute("class", this.classList); } // endregion getContainer() { if (this.getLink()) { this.container = Tag.render`<a href="${this.link}" class="${this.getClassList()}">${this.getTextContainer()}</a>`; } else { this.container = Tag.render`<div class="${this.getClassList()}">${this.getTextContainer()}</div>`; } return this.container; } render(): HTMLElement { return this.getContainer(); } }
/var/www/axolotl/data/www/kirov.axolotls.ru/bitrix/js/ui/vue/../label/src/label.js