<?php

namespace GriffinForms\Admin\Html\FormControls;

class InputNumber extends \GriffinForms\Admin\Html\FormControls\Format
{
    protected $step;
    protected $min;
    protected $max;

    protected function setCssClass()
    {
        if (!empty($this->data['app_context'])) {
            $this->css_class = 'class="form-control gf-app-control-input griffinforms-' . $this->purgeString($this->name) . ' griffinforms-' . strtolower($this->meta) . ' griffinforms-formcontrol"';
        }
    }

    public function html()
    {
        echo '<input type="number" ' . wp_kses_post($this->attr_name) . ' ';
        $this->getAttr('css_class');
        $this->getAttr('css_id');
        $this->getAttr('step');
        $this->getAttr('min');
        $this->getAttr('max');
        echo 'value="' . esc_attr($this->value) . '">';
        
    }
}
