<?php

namespace Planaday\Html\Tags\Form;

use Planaday\Html\Tags\Form\Booking\BookingFormTagHandler;
use Planaday\Html\Tags\Form\CourseSearch\LabelSelect\LabelSelect;
use Planaday\Html\Tags\Form\CourseSearch\LocationSelect\LocationSelect;
use Planaday\Html\Tags\Form\FormTag\FormTag;
use Planaday\Html\Tags\Form\GenericInput\ActionButton\ActionButton;
use Planaday\Html\Tags\Form\GenericInput\AttributeSelect\AttributeSelect;
use Planaday\Html\Tags\Form\GenericInput\CheckboxInput\CheckboxInput;
use Planaday\Html\Tags\Form\GenericInput\HiddenInput\HiddenInput;
use Planaday\Html\Tags\Form\GenericInput\InputOption\InputOption;
use Planaday\Html\Tags\Form\GenericInput\MappedIntRadio\MappedIntRadio;
use Planaday\Html\Tags\Form\GenericInput\PageSelect\PageSelect;
use Planaday\Html\Tags\Form\GenericInput\RadioInput\RadioInput;
use Planaday\Html\Tags\Form\GenericInput\SelectInput\SelectInput;
use Planaday\Html\Tags\Form\GenericInput\TextInput\TextInput;
use Planaday\Html\Tags\TagHandlerTemplate;
use Planaday\Utility\DependencyInjection\Container;

class FormTagsHandler extends TagHandlerTemplate {
	public function __construct() {
		$this->tags = [
			FormTag::TAG         => function ( Container $registry ) {
				return new FormTag( $registry );
			},
			LocationSelect::TAG  => function ( Container $registry ) {
				return new LocationSelect( $registry );
			},
			LabelSelect::TAG     => function ( Container $registry ) {
				return new LabelSelect( $registry );
			},
			AttributeSelect::TAG => function ( Container $registry ) {
				return new AttributeSelect( $registry );
			},
			TextInput::TAG       => function ( Container $registry ) {
				return new TextInput( $registry );
			},
			CheckboxInput::TAG   => function ( Container $registry ) {
				return new CheckboxInput( $registry );
			},
			RadioInput::TAG      => function ( Container $registry ) {
				return new RadioInput( $registry );
			},
			SelectInput::TAG     => function ( Container $registry ) {
				return new SelectInput( $registry );
			},
			PageSelect::TAG      => function ( Container $registry ) {
				return new PageSelect( $registry );
			},
			InputOption::TAG     => function ( Container $registry ) {
				return new InputOption( $registry );
			},
			HiddenInput::TAG     => function ( Container $registry ) {
				return new HiddenInput( $registry );
			},
			MappedIntRadio::TAG  => function ( Container $registry ) {
				return new MappedIntRadio( $registry );
			},
			ActionButton::TAG  => function ( Container $registry ) {
				return new ActionButton( $registry );
			}
		];

		$this->tagHandlers = [
			new BookingFormTagHandler()
		];
	}
}