Ejemplo n.º 1
0
 /// <summary>
 /// 创建组件所需要的 class 类。
 /// </summary>
 /// <param name="collection">css 类名称集合。</param>
 protected override void CreateComponentCssClass(ICollection <string> collection)
 {
     collection.Add("position-absolute");
     collection.Add(ComponentUtil.GetColorCssClass(Color, "bg-"));
     collection.Add("w-100");
     collection.Add("overflow-hidden");
     collection.Add(IsShown ? "d-flex" : "d-none");
     collection.Add("flex-column flex-fill");
 }
Ejemplo n.º 2
0
 protected override void CreateComponentCssClass(ICollection <string> collection)
 {
     collection.Add(ComponentUtil.GetColorCssClass(Color, "bg-"));
     collection.Add("progress-bar");
     if (Striped)
     {
         collection.Add("progress-bar-striped");
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 构造组件所需 class 类。
        /// </summary>
        /// <param name="collection"></param>
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            collection.Add("badge");
            collection.Add(ComponentUtil.GetColorCssClass(Color, "badge-"));

            if (Pill)
            {
                collection.Add("badge-pill");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 创建 alert 元素的 css 的名称。
        /// </summary>
        /// <param name="collection">样式集合。</param>
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            collection.Add("alert");
            collection.Add(ComponentUtil.GetColorCssClass(Color, "alert-"));
            collection.Add("fade");
            if (IsShown)
            {
                collection.Add("show");
            }

            if (Dismisable)
            {
                collection.Add("alert-dismissible");
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 创建组件所需要的 class 类。
        /// </summary>
        /// <param name="collection">css 类名称集合。</param>
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            if (Overlay)
            {
                collection.Add("card-img-overlay");
            }
            else
            {
                collection.Add("card-body");
            }

            if (Parent.Color.HasValue && Parent.Bordered)
            {
                collection.Add(ComponentUtil.GetColorCssClass(Parent.Color.Value, "text-"));
            }
        }
Ejemplo n.º 6
0
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            var spinnerClass = Grow ? "grow" : "border";

            collection.Add($"spinner-{spinnerClass}");

            if (Color.HasValue)
            {
                collection.Add(ComponentUtil.GetColorCssClass(Color.Value, "text-"));
            }

            if (Size != Size.Default)
            {
                collection.Add(ComponentUtil.GetSizeCssClass(Size, $"spinner-{spinnerClass}-"));
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 创建组件所需要的 class 类。
        /// </summary>
        /// <param name="collection">css 类名称集合。</param>
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            collection.Add("card");
            if (Color.HasValue)
            {
                if (Bordered)
                {
                    collection.Add(ComponentUtil.GetColorCssClass(Color.Value, "border-"));
                }
                else
                {
                    collection.Add(ComponentUtil.GetColorCssClass(Color.Value, "bg-"));
                    collection.Add(ComponentUtil.GetReverseColorCssClass(Color.Value, "text-"));
                }
            }

            if (AlignHeight)
            {
                collection.Add("h-100");
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 构建按钮的 class 名称。
        /// </summary>
        protected override void CreateComponentCssClass(ICollection <string> collection)
        {
            collection.Add("btn");

            if (Blocked)
            {
                collection.Add("btn-block");
            }

            collection.Add(string.Format(" btn{0}-{1}", (Outline ? "-outline" : string.Empty), ComponentUtil.GetColorCssClass(Color)));
            if (Size != Size.Default)
            {
                collection.Add(ComponentUtil.GetSizeCssClass(Size, "btn-"));
            }

            if (Actived)
            {
                collection.Add("active");
            }
        }