<?php

    return [
        "type"           => "sliderItems",
        "model"          => App\Models\SliderItem::class,
        "label"          => "Slider Items",
        "label_singular" => "Slider Item",
        "group"          => "content types",
        "order"          => TRUE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "type",
                "label"         => "Slider Item Type",
                "type"          => "selectBox",
                "list"          => [
                    "image" => "Image",
                    // "video" => "Video"
                ],
                "defaultValue"  => "image",
                "preValidation" => "trim",
                "validation"    => "",
                "placement"     => "sidebar",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "image",
                "label"         => "Image",
                "type"          => "mediaPicker",
                "multiple"      => FALSE,
                "mediaType"     => ["image", "svg"],
                "parent"        => [
                    "name"   => "type",
                    "values" => ["image"]
                ]
            ],
            [
                "name"          => "video",
                "label"         => "Video",
                "type"          => "textBox",
                "maxLength"     => 500,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:500",
                "parent"        => [
                    "name"   => "type",
                    "values" => ["video"]
                ]
            ],
            [
                "name"          => "description",
                "label"         => "Description",
                "type"          => "textArea",
                "maxLength"     => 500,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:500",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "cta",
                "label"         => "Call to action",
                "type"          => "link",
                "multiLanguage" => TRUE,
                "objectTypes"   => ["page"],
                "maxLabel"      => 50,
                "required"      => false,
            ],
            [
                "name"          => "position",
                "label"         => "Position",
                "type"          => "selectBox",
                "list"          => [
                    "center" => "Center",
                    "left" => "Left",
                    "right" => "Right",
                    "top" => "top",
                    "bottom" => "bottom",
                ],
                "defaultValue"  => "center",
                "preValidation" => "trim",
                "validation"    => "nullable|in:left,center,right,top,bottom",
                "placement"     => "sidebar",
            ],
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
