Пример #1
0
 private string?GetItemClassString(SelectedItem item) => CssBuilder.Default("multi-select-menu-item")
 .AddClass("active", GetCheckedState(item))
 .Build();
Пример #2
0
 /// <summary>
 /// 获得明细行小图标样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetDetailCaretClassString(TItem item) => CssBuilder.Default("fa fa-caret-right")
 .AddClass("fa-rotate-90", ExpandRows.Contains(item))
 .Build();
Пример #3
0
 /// <summary>
 /// 树形数据展开小箭头
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetTreeClassString(TItem item) => CssBuilder.Default("is-tree")
 .AddClass("fa fa-caret-right", CheckTreeChildren(item))
 .AddClass("fa-rotate-90", TryGetTreeNodeByItem(item, out var node) && node.IsExpand)
 .AddClass("fa-spin fa-spinner", IsLoadChildren)
 .Build();
Пример #4
0
 /// <summary>
 /// 获得 Header 中表头文字样式
 /// </summary>
 /// <param name="col"></param>
 /// <returns></returns>
 protected string?GetHeaderTextClassString(ITableColumn col) => CssBuilder.Default("table-text")
 .AddClass("text-left", col.Align == Alignment.Left)
 .AddClass("text-right", col.Align == Alignment.Right)
 .AddClass("text-center", col.Align == Alignment.Center)
 .Build();
Пример #5
0
 /// <summary>
 /// 获得 周日期样式
 /// </summary>
 /// <param name="offset"></param>
 /// <returns></returns>
 protected string?GetWeekDayClassString(int offset)
 {
     return(CssBuilder.Default("week-header")
            .AddClass("is-today", Value.AddDays(offset - (int)Value.DayOfWeek) == DateTime.Today)
            .Build());
 }
Пример #6
0
 /// <summary>
 /// 获得 SubTree 样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetSubTreeLinkClassString(TreeItem item) => CssBuilder.Default("nav-link show collapse")
 .AddClass("collapsed", !item.IsExpanded)
 .Build();
Пример #7
0
 /// <summary>
 /// 获得指定列头固定列样式
 /// </summary>
 /// <param name="col"></param>
 /// <returns></returns>
 protected string?GetFixedCellClassString(ITableColumn col) => CssBuilder.Default()
 .AddClass("fixed", col.Fixed)
 .AddClass("fixed-right", col.Fixed && IsTail(col))
 .Build();
Пример #8
0
 /// <summary>
 /// 获得/设置 TreeItem 图标
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string?GetIconClassString(TreeItem item) => CssBuilder.Default("tree-icon")
 .AddClass(item.Icon)
 .Build();
Пример #9
0
 /// <summary>
 /// 获得/设置 TreeItem 小箭头样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string?GetCaretClassString(TreeItem item) => CssBuilder.Default("fa fa-caret-right")
 .AddClass("invisible", !item.Items.Any())
 .AddClass("fa-rotate-90", item.IsExpanded)
 .Build();
Пример #10
0
 /// <summary>
 /// 检查是否 active
 /// </summary>
 /// <param name="index"></param>
 /// <param name="css"></param>
 /// <returns></returns>
 protected string?CheckActive(int index, string?css = null) => CssBuilder.Default(css)
 .AddClass("active", index == 0)
 .Build();
Пример #11
0
 /// <summary>
 /// 获得明细行样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetDetailRowClassString(TItem item) => CssBuilder.Default("is-detail")
 .AddClass("show", ExpandRows.Contains(item))
 .Build();
Пример #12
0
 /// <summary>
 /// 设置当前项是否 Active 方法
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string?ActiveItem(SelectedItem item) => CssBuilder.Default("dropdown-item")
 .AddClass("active", () => item.Value == CurrentValueAsString)
 .AddClass("is-disabled", item.IsDisabled)
 .Build();
Пример #13
0
 /// <summary>
 /// 获得 图标样式
 /// </summary>
 /// <returns></returns>
 internal string?ToIconClassString() => CssBuilder.Default("timeline-item-icon")
 .AddClass(Icon, !string.IsNullOrEmpty(Icon))
 .AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None)
 .Build();
Пример #14
0
 /// <summary>
 /// 获得 时间线节点样式
 /// </summary>
 internal string?ToNodeClassString() => CssBuilder.Default("timeline-item-node-normal timeline-item-node")
 .AddClass($"bg-{Color.ToDescriptionString()}", Color != Color.None && string.IsNullOrEmpty(Icon))
 .AddClass("is-icon", !string.IsNullOrEmpty(Icon))
 .Build();
Пример #15
0
 /// <summary>
 /// 获取消息样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected virtual string?GetClassString(ConsoleMessageItem item)
 {
     return(CssBuilder.Default()
            .AddClass($"text-{item.Color.ToDescriptionString()}", item.Color != Color.None)
            .Build());
 }
Пример #16
0
 /// <summary>
 /// 获得/设置 当前行样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string?GetItemClassString(TreeItem item) => CssBuilder.Default("tree-item")
 .AddClass("active", ActiveItem == item)
 .Build();
Пример #17
0
 /// <summary>
 /// 获得 TreeNode 样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetTreeItemClassString(TreeItem item) => CssBuilder.Default("tree-item")
 .AddClass("is-expanded", item.IsExpanded)
 .Build();
Пример #18
0
 /// <summary>
 /// 获得/设置 TreeNode 样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string?GetTreeNodeClassString(TreeItem item) => CssBuilder.Default("tree-ul")
 .AddClass("show", item.IsExpanded)
 .Build();
Пример #19
0
 /// <summary>
 /// 获得 SubTree 样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetSubTreeClassString(TreeItem item) => CssBuilder.Default("collapse-item collapse")
 .AddClass("show", item.IsExpanded)
 .Build();
Пример #20
0
 /// <summary>
 /// 设置当前项是否 Active 方法
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected virtual string?ActiveItem(SelectedItem item) => CssBuilder.Default("dropdown-item")
 .AddClass("active", () => item.Value == SelectedItem?.Value)
 .Build();
Пример #21
0
 /// <summary>
 /// 获取指定列头样式字符串
 /// </summary>
 /// <param name="col"></param>
 /// <returns></returns>
 protected string?GetHeaderWrapperClassString(ITableColumn col) => CssBuilder.Default("table-cell")
 .AddClass("is-sort", col.Sortable)
 .AddClass("is-filter", col.Filterable)
 .Build();
Пример #22
0
 /// <summary>
 /// 获得 候选项样式
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?ItemClassString(string item) => CssBuilder.Default("dropdown-item")
 .AddClass("active", item == _selectedItem)
 .Build();
Пример #23
0
 /// <summary>
 /// 获取指定列头样式字符串
 /// </summary>
 /// <param name="col"></param>
 /// <returns></returns>
 protected string?GetHeaderClassString(ITableColumn col) => CssBuilder.Default()
 .AddClass("sortable", col.Sortable)
 .AddClass("filterable", col.Filterable)
 .AddClass(GetFixedCellClassString(col))
 .Build();
Пример #24
0
 /// <summary>
 /// 获得 当前样式名称
 /// </summary>
 protected string?GetClassName(int index) => CssBuilder.Default("time-spinner-item")
 .AddClass("prev", ViewModel switch
 {
 /// <summary>
 /// 获得 过滤小图标样式
 /// </summary>
 protected string?GetFilterClassString(string fieldName) => CssBuilder.Default("fa fa-fw fa-filter")
 .AddClass("active", Filters.ContainsKey(fieldName))
 .Build();
Пример #26
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="collapsed"></param>
 /// <returns></returns>
 protected string?GetButtonClassString(bool collapsed) => CssBuilder.Default("btn btn-link")
 .AddClass("collapsed", collapsed)
 .Build();
Пример #27
0
 /// <summary>
 /// 明细行首小图标单元格样式
 /// </summary>
 protected string?GetDetailBarClassString(TItem item) => CssBuilder.Default("table-cell is-bar")
 .AddClass("is-load", DetailRows.Contains(item))
 .Build();
Пример #28
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="collpased"></param>
 /// <returns></returns>
 protected string?GetClassString(bool collpased) => CssBuilder.Default("collapse-item")
 .AddClass("collapse", collpased)
 .AddClass("collapse show", !collpased)
 .Build();
Пример #29
0
 /// <summary>
 /// 树形数据展开小箭头
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected string?GetTreeStyleString(TItem item) => CssBuilder.Default()
 .AddClass($"margin-right: .5rem;")
 .AddClass($"margin-left: {GetIndentSize(item)}px;")
 .Build();
Пример #30
0
 private string?GetClassString(bool active) => CssBuilder.Default("tabs-item")
 .AddClass("is-active", active)
 .AddClass("is-closeable", TabSet?.ShowClose ?? false)
 .Build();