<?php

namespace GriffinForms\Admin\Html\FormControls\Field\ValidationTraits;

trait InputCheckbox
{
    protected $min_checks;
    protected $max_checks;
    
    protected function setMinChecks()
    {
        $this->min_checks = $this->fixEmptyValue('min_checks', '');
    }
    
    protected function setMaxChecks()
    {
        $this->max_checks = $this->fixEmptyValue('max_checks', '');
    }
    
    private function minChecks()
    {
        $field = new \GriffinForms\Admin\Html\FormControls\InputNumber('min_checks', $this->min_checks);
        
        echo '<div class="">Minimum Checks</div>';
        echo '<div class="mb-2">';
        $field->html();
        echo '</div>';
    }
    
    private function maxChecks()
    {
        $field = new \GriffinForms\Admin\Html\FormControls\InputNumber('max_checks', $this->max_checks);
        
        echo '<div class="">Maximum Checks</div>';
        echo '<div class="">';
        $field->html();
        echo '</div>';
    }
    
    protected function validationOptionsInputCheckbox()
    {       
        echo '<div class="row">';
        
        echo '<div class="col-md-12 gf-validation-options" id="gf-custom-parameters-wrap">';
        
        $this->minChecks();
        $this->maxChecks();
        
        echo '</div>';
        
        echo '</div>';
    }
    
    protected function inputCheckboxJs()
    {
        echo '';
    }
}