Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/entity-selector/src/dialog/tabs/ |
Upload File : |
import { Cache, Dom, Tag, Type } from 'main.core'; import type Tab from '../tabs/tab'; export default class BaseStub { tab: Tab = null; autoShow: boolean = true; cache = new Cache.MemoryCache(); content: HTMLElement = null; constructor(tab: Tab, options: { [option: string]: any }) { this.options = Type.isPlainObject(options) ? options : {}; this.tab = tab; this.autoShow = this.getOption('autoShow', true); } /** * @abstract */ render(): HTMLElement { throw new Error('You must implement render() method.'); } getTab(): Tab { return this.tab; } getOuterContainer() { return this.cache.remember('outer-container', () => { return Tag.render` <div class="ui-selector-tab-stub">${this.render()}</div> `; }); } isAutoShow(): boolean { return this.autoShow; } show(): void { Dom.append(this.getOuterContainer(), this.getTab().getContainer()); /*requestAnimationFrame(() => { Dom.addClass(this.getOuterContainer(), 'ui-selector-tab-stub--show'); });*/ } hide(): void { // Dom.removeClass(this.getOuterContainer(), 'ui-selector-tab-stub--show'); Dom.remove(this.getOuterContainer()); } getOptions(): { [option: string]: any } { return this.options; } getOption(option: string, defaultValue?: any): any { if (!Type.isUndefined(this.options[option])) { return this.options[option]; } else if (!Type.isUndefined(defaultValue)) { return defaultValue; } return null; } }