<?php

namespace GriffinForms\Admin\Html\Pages\Single;

trait FetchFields
{
    protected function hiddenField()
    {
        $field = new \GriffinForms\Admin\Html\FormControls\HiddenField($this->prop, $this->value);
        $field->html();
    }
    
    protected function inputText($data = '')
    {
        return new \GriffinForms\Admin\Html\FormControls\InputText($this->prop, $this->value, $data);
        $field;
    }  
    
    protected function inputUrl()
    {
        return new \GriffinForms\Admin\Html\FormControls\InputUrl($this->prop, $this->value);
    }
    
    protected function selectField($options = '', $data = '')
    {
        $field = new \GriffinForms\Admin\Html\FormControls\SelectField($this->prop, $this->value, $data);
        $field->selectOptions($options);
        $field;
    }    
    
    protected function multiSelect($options = '', $data = '')
    {
        $field = new \GriffinForms\Admin\Html\FormControls\MultiSelect($this->prop, $this->value, $data);
        $field->selectOptions($options);
        $field->html();
    }
    
    protected function toggleCheckboxField($options = '', $data = '')
    {
        $field = new \GriffinForms\Admin\Html\FormControls\ToggleCheckBox($this->prop, $this->value, $data);
        $field;
    }   
    
    protected function inputNumber($data = '')
    {
        return new \GriffinForms\Admin\Html\FormControls\InputNumber($this->prop, $this->value, $data);
    }
    
    protected function selectObject($data = '')
    {
        $field = new \GriffinForms\Admin\Html\FormControls\selectObject($this->prop, $this->value, $data);
        $field;
    }
    
    protected function richText($data = '')
    {
        $field = new \GriffinForms\Admin\Html\FormControls\RichText($this->prop, $this->value, $data);
        $field->html();
    }   
    
    protected function multiInput($data = '')
    {
        return new \GriffinForms\Admin\Html\FormControls\MultiInput($this->prop, $this->value, $data);
    }    
    
    protected function textArea($data = '')
    {
        return new \GriffinForms\Admin\Html\FormControls\TextArea($this->prop, $this->value, $data);
    }
}