403Webshell
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/ilovecveti.ru/bitrix/js/ui/stamp/uploader/src/header/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/ui/stamp/uploader/src/header/header.js
import {Tag, Cache, Loc, Type, Dom, Text} from 'main.core';
import {Button} from 'ui.buttons';

import './css/style.css';

type HeaderOptions = {
	contact: {
		label: string,
		href: string,
	},
	contactsList: Array<any>,
};

export default class Header
{
	cache = new Cache.MemoryCache();

	constructor(options)
	{
		this.setOptions(options);
	}

	setOptions(options: HeaderOptions)
	{
		this.cache.set('options', {...options});
	}

	getOptions(): HeaderOptions
	{
		return this.cache.get('options', {});
	}

	setValue(value: string)
	{
		if (Type.isString(value) || Type.isNumber(value))
		{
			this.getValueLayout().textContent = value;
		}
	}

	getValueLayout(): HTMLDivElement
	{
		return this.cache.remember('valueLayout', () => {
			return Tag.render`
				<div class="ui-stamp-uploader-header-text-value">
					<span title="${Text.encode(this.getOptions().contact.label)}">${Text.encode(this.getOptions().contact.label)}</span>
				</div>
			`;
		});
	}

	getChangeContactButton(): Button
	{
		return this.cache.remember('changeContactButton', () => {
			return new Button({
				text: Loc.getMessage('UI_STAMP_UPLOADER_HEADER_CHANGE_CONTACT_BUTTON_LABEL'),
				size: Button.Size.EXTRA_SMALL,
				color: Button.Color.LIGHT_BORDER,
				round: true,
			});
		});
	}

	getLayout(): HTMLDivElement
	{
		return this.cache.remember('headerLayout', () => {
			return Tag.render`
				<div class="ui-stamp-uploader-header">
					<div class="ui-stamp-uploader-header-icon">
						<div class="ui-stamp-uploader-header-icon-image"></div>
					</div>
					<div class="ui-stamp-uploader-header-text">
						<div class="ui-stamp-uploader-header-text-label">
							${Loc.getMessage('UI_STAMP_UPLOADER_HEADER_TITLE')}
						</div>
						${this.getValueLayout()}
					</div>
					<div class="ui-stamp-uploader-header-action">
						
					</div>
				</div>
			`;
		});
	}

	appendTo(target: HTMLElement)
	{
		if (Type.isDomNode(target))
		{
			Dom.append(this.getLayout(), target);
		}
	}

	prependTo(target: HTMLElement)
	{
		if (Type.isDomNode(target))
		{
			Dom.prepend(this.getLayout(), target);
		}
	}

	renderTo(target: HTMLElement)
	{
		this.appendTo(target);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit