<?php
/**
 * Field content tab controls
 * @var string $prefix
 * @var string $widget_id
 * @var Repeater $field
 */

use Elementor\Controls_Manager;
use Elementor\Repeater;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

$field->add_control(
	$prefix . 'placeholder',
	[
		'label'       => esc_attr__( 'Placeholder', 'advanced-fields-for-elementor-forms' ),
		'type'        => Controls_Manager::TEXT,
		'control_tab' => Controls_Manager::TAB_CONTENT,
		'default'     => '',
	]
);

$field->add_control(
	$prefix . 'min',
	[
		'label'          => esc_html__( 'Min. Date', 'advanced-fields-for-elementor-forms' ),
		'type'           => Controls_Manager::DATE_TIME,
		'control_tab'    => Controls_Manager::TAB_CONTENT,
		'label_block'    => false,
		'picker_options' => [
			'enableTime' => true,
		],
		'ai'             => [
			'active' => false,
		],
	]
);

$field->add_control(
	$prefix . 'max',
	[
		'label'          => esc_html__( 'Max. Date', 'advanced-fields-for-elementor-forms' ),
		'type'           => Controls_Manager::DATE_TIME,
		'control_tab'    => Controls_Manager::TAB_CONTENT,
		'label_block'    => false,
		'picker_options' => [
			'enableTime' => true,
		],
		'ai'             => [
			'active' => false,
		],
	]
);

$field->add_control(
	$prefix . 'isNative',
	[
		'label'        => esc_html__( 'Native HTML5', 'advanced-fields-for-elementor-forms' ),
		'type'         => Controls_Manager::SWITCHER,
		'control_tab'  => Controls_Manager::TAB_CONTENT,
		'return_value' => 'yes',
		'default'      => 'no',
	]
);

$field->add_control(
	$prefix . 'time_24hr',
	[
		'label'        => esc_html__( 'Time 24hr', 'advanced-fields-for-elementor-forms' ),
		'description'  => esc_html__( 'Displays time picker in 24 hour mode without AM/PM selection when enabled', 'advanced-fields-for-elementor-forms' ),
		'type'         => Controls_Manager::SWITCHER,
		'control_tab'  => Controls_Manager::TAB_CONTENT,
		'return_value' => 'yes',
		'default'      => 'no',
		'condition'    => [
			$prefix . 'isNative!' => 'yes',
		],
	]
);
