// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using OneOf;
namespace AntDesign
{
///
/// ModalOptions, ConfirmOptions and DialogOptions base class
///
public class DialogOptionsBase
{
#region static and const
///
/// default Dialog close icon
///
internal static readonly RenderFragment DefaultCloseIcon = (builder) =>
{
builder.OpenComponent(0);
builder.AddAttribute(1, "Type", "close");
builder.AddAttribute(2, "Theme", "outline");
builder.CloseComponent();
};
///
/// default modal footer
///
internal static readonly RenderFragment DefaultFooter = (builder) =>
{
builder.OpenComponent(0);
builder.CloseComponent();
};
#endregion
///
/// class name prefix
///
public string PrefixCls { get; set; } = "ant-modal";
///
/// Cancel Button's props
///
public ButtonProps CancelButtonProps { get; set; }
///
/// modal default footer cancel text
///
public OneOf CancelText { get; set; } = "Cancel";
///
/// whether center display
///
public bool Centered { get; set; }
///
/// get or set the modal parent DOM
///
public ElementReference? GetContainer { get; set; } = null;
///
/// Whether support press esc to close
///
public bool Keyboard { get; set; } = true;
///
/// Whether show mask or not
///
public bool Mask { get; set; } = true;
///
/// Whether to close the modal dialog when the mask (area outside the modal) is clicked
///
public bool MaskClosable { get; set; }
///
/// Style for dialog's mask element
///
public string MaskStyle { get; set; }
///
/// Ok Button's props
///
public ButtonProps OkButtonProps { get; set; }
///
/// Text of the OK button
///
public OneOf OkText { get; set; } = "OK";
///
/// Button type of the OK button
///
public string OkType { get; set; } = ButtonType.Primary;
///
/// The modal dialog's title of String
///
public string Title { get; set; } = null;
///
/// The modal dialog's title of RenderFragment
///
public RenderFragment TitleTemplate { get; set; }
///
/// Width of the modal dialog
///
public OneOf Width { get; set; }
///
/// The z-index of the Modal
///
public int ZIndex { get; set; } = 1000;
///
/// Is RTL
///
public bool Rtl { get; set; } = false;
}
}