using FNZCM.BlazorWasm.UI.Components.FnzBootstrap.Bases;
using Newtonsoft.Json;

namespace FNZCM.BlazorWasm.UI.Components.FnzBootstrap.Modal
{
    public class Options : OptionsBase
    {
        private BackdropMode backdrop = BackdropMode.On;
        private bool keyboard = true;
        private bool focus = true;

        [JsonProperty("backdrop")]
        [JsonConverter(typeof(BackdropsJsonConverter))]
        public BackdropMode Backdrop
        {
            get => backdrop;
            set
            {
                if (backdrop != value) _isChanged = true;
                backdrop = value;
            }
        }

        [JsonProperty("keyboard")]
        public bool Keyboard
        {
            get => keyboard;
            set
            {
                if (keyboard != value) _isChanged = true;
                keyboard = value;
            }
        }
        
        [JsonProperty("focus")]
        public bool Focus
        {
            get => focus;
            set
            {
                if (focus != value) _isChanged = true;
                focus = value;
            }
        }
    }
}
