From 04273a7b8de5fe97c70e6d8b0a23e012fc2652a2 Mon Sep 17 00:00:00 2001 From: Argo-AscioTech Date: Mon, 18 Dec 2023 12:53:31 +0800 Subject: [PATCH 1/2] refactor(TreeView): update sass file use variable --- .../Components/TreeView/TreeView.razor.scss | 24 +++++++++---------- .../wwwroot/scss/theme/bootstrap.blazor.scss | 13 ++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/BootstrapBlazor/Components/TreeView/TreeView.razor.scss b/src/BootstrapBlazor/Components/TreeView/TreeView.razor.scss index 882b1097c0e..0d1d5a0d809 100644 --- a/src/BootstrapBlazor/Components/TreeView/TreeView.razor.scss +++ b/src/BootstrapBlazor/Components/TreeView/TreeView.razor.scss @@ -1,16 +1,16 @@ -.tree-view { +.tree-view { + --bb-tree-padding: #{$bb-tree-padding}; + --bb-tree-margin: #{$bb-tree-margin}; + --bb-tree-ul-padding-left: #{$bb-tree-ul-padding-left}; + --bb-tree-item-margin: #{$bb-tree-item-margin}; + --bb-tree-icon-width: #{$bb-tree-icon-width}; + --bb-tree-check-margin: #{$bb-tree-check-margin}; + --bb-tree-node-padding: #{$bb-tree-node-padding}; + --bb-tree-item-active-color: #{$bb-tree-item-active-color}; + --bb-tree-item-active-bg: #{$bb-tree-item-active-bg}; + --bb-tree-item-hover-bg: #{$bb-tree-item-hover-bg}; + --bb-tree-icon-margin-right: #{$bb-tree-icon-margin-right}; position: relative; - --bb-tree-padding: 0; - --bb-tree-margin: 0; - --bb-tree-ul-padding-left: 20px; - --bb-tree-item-margin: 1px 0; - --bb-tree-icon-width: 22px; - --bb-tree-check-margin: 0 4px; - --bb-tree-node-padding: .25rem .5rem; - --bb-tree-item-active-color: #409eff; - --bb-tree-item-active-bg: #e9ecef; - --bb-tree-item-hover-bg: var(--bs-secondary); - --bb-tree-icon-margin-right: .5rem; } .tree-view .tree-root { diff --git a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss index cfdabc79f3b..03a976005dc 100644 --- a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss +++ b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss @@ -610,4 +610,17 @@ $bb-transfer-panel-item-width: 160px; $bb-transfer-buttons-padding: 0 30px; $bb-transfer-filter-focus-border-color: #409eff; +// TreeView +$bb-tree-padding: 0; +$bb-tree-margin: 0; +$bb-tree-ul-padding-left: 20px; +$bb-tree-item-margin: 1px 0; +$bb-tree-icon-width: 22px; +$bb-tree-check-margin: 0 4px; +$bb-tree-node-padding: .25rem .5rem; +$bb-tree-item-active-color: #409eff; +$bb-tree-item-active-bg: #e9ecef; +$bb-tree-item-hover-bg: var(--bs-secondary); +$bb-tree-icon-margin-right: .5rem; + @import "../components.scss"; From 6404c320e1aa0eb70020a1ec8a8fc41b289b206c Mon Sep 17 00:00:00 2001 From: Argo-AscioTech Date: Mon, 18 Dec 2023 12:53:42 +0800 Subject: [PATCH 2/2] doc: update sample code --- .../Components/Samples/TreeViews.razor | 38 +++++++++---------- src/BootstrapBlazor.Server/Locales/en.json | 2 +- src/BootstrapBlazor.Server/Locales/zh.json | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor b/src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor index 48ad96e45f9..b4123bd28f8 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor @@ -6,8 +6,8 @@

@Localizer["TreeViewsDescription"]

-
Tree @((MarkupString)Localizer["TreeViewsTips1"].Value) TItem="TreeFoo"
-
    +
    Tree @((MarkupString)Localizer["TreeViewsTips1"].Value) TItem="TreeFoo"
    +
    • @((MarkupString)Localizer["TreeViewsTips2"].Value)
    • @((MarkupString)Localizer["TreeViewsTips3"].Value)
    • @((MarkupString)Localizer["TreeViewsTips4"].Value)
    • @@ -26,7 +26,7 @@ -

      @((MarkupString)Localizer["TreeViewNormalDescription"].Value)

      +
      @((MarkupString)Localizer["TreeViewNormalDescription"].Value)
      @@ -34,11 +34,11 @@ -

      +

      @((MarkupString)Localizer["TreeViewCheckboxTips1"].Value)
      @((MarkupString)Localizer["TreeViewCheckboxTips2"].Value)
      -

      -
      +
      +
      @@ -49,7 +49,7 @@
      - +
      @@ -57,48 +57,48 @@ -

      @((MarkupString)Localizer["TreeViewTreeDisableDescription"].Value)

      +
      @((MarkupString)Localizer["TreeViewTreeDisableDescription"].Value)
      -

      @((MarkupString)Localizer["TreeViewAccordionModelDescription"].Value)

      +
      @((MarkupString)Localizer["TreeViewAccordionModelDescription"].Value)
      -

      +

      @((MarkupString)Localizer["TreeViewDefaultExpandDescription"].Value) -

      +
      -

      +

      @((MarkupString)Localizer["TreeViewTreeDisplayIconDescription"].Value) -

      +
      -

      +

      @((MarkupString)Localizer["TreeViewTreeClickExpandDescription"].Value) -

      +
      -

      @((MarkupString)Localizer["TreeViewTreeValidationFormDescription"].Value)

      +
      @((MarkupString)Localizer["TreeViewTreeValidationFormDescription"].Value)
      @@ -107,9 +107,9 @@ -

      +

      @((MarkupString)Localizer["TreeViewTreeLazyLoadingDescription"].Value) -

      +
      @@ -141,4 +141,4 @@ - + diff --git a/src/BootstrapBlazor.Server/Locales/en.json b/src/BootstrapBlazor.Server/Locales/en.json index 23aa1385063..9556f6c7e5a 100644 --- a/src/BootstrapBlazor.Server/Locales/en.json +++ b/src/BootstrapBlazor.Server/Locales/en.json @@ -658,7 +658,7 @@ "TreeViewShowSkeletonTitle": "Loading skeleton screen", "TreeViewShowSkeletonIntro": "By setting ShowSkeleton, the component displays the skeleton screen when the data is loaded asynchronously", "TreeViewShowSkeletonButtonText": "Asynchronous loading", - "TreeViewsAttrs": "TreeItem property" + "TreeViewsAttribute": "TreeItem property" }, "BootstrapBlazor.Server.Components.Samples.Trees": { "TreeIntro": "

      Obsolete,The TreeView provides more functions", diff --git a/src/BootstrapBlazor.Server/Locales/zh.json b/src/BootstrapBlazor.Server/Locales/zh.json index 2e94632b090..17cbf4580ba 100644 --- a/src/BootstrapBlazor.Server/Locales/zh.json +++ b/src/BootstrapBlazor.Server/Locales/zh.json @@ -658,7 +658,7 @@ "TreeViewShowSkeletonTitle": "加载骨架屏", "TreeViewShowSkeletonIntro": "通过设置 ShowSkeleton 使异步加载数据时组件显示骨架屏", "TreeViewShowSkeletonButtonText": "异步加载", - "TreeViewsAttrs": "TreeItem 属性" + "TreeViewsAttribute": "TreeItem 属性" }, "BootstrapBlazor.Server.Components.Samples.Trees": { "TreeIntro": "

      本组件已弃用,请使用新组件 TreeView 提供更多功能",