VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /proc/self/root/var/www/html/libs/absol-form/js/components/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/html/libs/absol-form/js/components/TrackBarInput.js
import {_} from "../core/FCore";
import ScalableComponent from "../core/ScalableComponent";
import inheritComponentClass from "../core/inheritComponentClass";
import InputAttributeHandlers, {InputAttributeNames} from "./handlers/InputAttributeHandlers";
import {AssemblerInstance} from "../core/Assembler";
import TrackBar from "./TrackBar";

function TrackBarInput() {
    ScalableComponent.call(this);
}

inheritComponentClass(TrackBarInput, ScalableComponent);

TrackBarInput.prototype.tag = 'TrackBarInput';
TrackBarInput.prototype.menuIcon = 'span.mdi.mdi-source-commit.mdi-rotate-90'

TrackBarInput.prototype.render = function () {
    return _('trackbarinput');
};

Object.assign(TrackBarInput.prototype.attributeHandlers, InputAttributeHandlers);

TrackBarInput.prototype.attributeHandlers.value = {
    set: TrackBar.prototype.attributeHandlers.value.set,
    get: TrackBar.prototype.attributeHandlers.value.get,
    descriptor: function () {
        return {
            type: 'number',
            max: this.domElt.rightValue,
            min: this.domElt.leftValue,
            floatFixed: 2,
            dependency: ['leftValue', 'rightValue']
        };
    }
};

TrackBarInput.prototype.attributeHandlers.leftValue = {
    set: function (value) {
        this.domElt.leftValue = value;
    },
    get: function () {
        return this.domElt.leftValue;
    },
    descriptor: function () {
        return {
            type: 'number',
            max: this.domElt.rightValue,
            floatFixed: 2,
            dependency: ['rightValue', 'value']
        };
    }
};


TrackBarInput.prototype.attributeHandlers.rightValue = {
    set: function (value) {
        this.domElt.rightValue = value;
    },
    get: function () {
        return this.domElt.rightValue;
    },
    descriptor: function () {
        return {
            type: 'number',
            min: this.domElt.leftValue,
            floatFixed: 2,
            dependency: ['leftValue', 'value']
        };
    }
};

TrackBarInput.prototype.attributeHandlers.unit = {
    set: function (value) {
        this.domElt.unit = value;
    },
    get: function () {
        return this.domElt.unit;
    },
    descriptor: function () {
        return {
            type: 'text'
        };
    }
};

TrackBarInput.prototype.pinHandlers.value = Object.assign({}, TrackBar.prototype.pinHandlers.value,
    {
        descriptor: function () {
            return {
                type: 'number',
                max: this.domElt.rightValue,
                min: this.domElt.leftValue,
                floatFixed: 2
            };
        }
    });

TrackBarInput.prototype.onCreate = function () {
    ScalableComponent.prototype.onCreate.apply(this, arguments);
    this.style.height = 26;
};

TrackBarInput.prototype.onCreated = function () {
    ScalableComponent.prototype.onCreated.apply(this, arguments);
    this.domElt.on('change', function (){
        this.pinFire('value');
    }.bind(this));
};


TrackBarInput.prototype.measureMinSize = function () {
    return { width: 40, height: 26 };
};

AssemblerInstance.addClass(TrackBarInput);

export default TrackBarInput;

VaKeR 2022