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/rospirotorg.ru/bitrix/js/ui/stepprocessing/src/fields/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/stepprocessing/src/fields/text-field.js
// @flow

import {Type, Tag} from 'main.core';
import type { OptionsField } from '../process-types';
import { BaseField } from './base-field';
import { DialogStyle } from '../dialog';

export class TextField extends BaseField
{
	type: string = 'text';
	className: string = DialogStyle.ProcessOptionText;
	rows: number = 10;
	cols: number = 50;

	constructor(options: OptionsField)
	{
		super(options);

		if (options.textSize)
		{
			this.cols = options.textSize;
		}
		if (options.textLine)
		{
			this.rows = options.textLine;
		}
	}

	setValue(value: string)
	{
		this.value = value;
		if (this.field)
		{
			this.field.value = this.value;
		}
		return this;
	}
	getValue(): string
	{
		if (this.field && this.disabled !== true)
		{
			if (typeof(this.field.value) !== 'undefined')
			{
				this.value = this.field.value;
			}
		}
		return this.value;
	}

	isFilled(): boolean
	{
		if (this.field)
		{
			if (typeof(this.field.value) !== 'undefined')
			{
				return Type.isStringFilled(this.field.value);
			}
		}
		return false;
	}

	render(): HTMLElement
	{
		if (!this.field)
		{
			this.field = Tag.render`<textarea id="${this.id}" name="${this.name}" cols="${this.cols}" rows="${this.rows}"></textarea>`;
		}
		if (this.value)
		{
			this.field.value = this.value;
		}
		return this.field;
	}

	lock(flag: boolean = true)
	{
		this.disabled = flag;
		this.field.disabled = !!flag;
		return this;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit