keystone_ui 0.103.0 → 0.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/keystone_ui/configuration.rb +1 -1
- data/lib/keystone_ui/version.rb +1 -1
- data/lib/keystone_ui/visible_navigation.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4717973c5a1106c54fcd645ff0b367193cdacfe0f85c95bebeab069036c685b
|
|
4
|
+
data.tar.gz: '0656539328817c3df406f5f2db6a554fa6be4b26dfcc9e252277ad6e263e3ae6'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8ee28d4ee7533d92a7277e502670afa205bdd2de83e3e0605f6d22088cb2210bd90d574e0fa26e5d618b69376db80828b70b3d79ebddd7ca26169e974b7ed8f
|
|
7
|
+
data.tar.gz: cbe656ac4ed91ff876ed87e892ed9ecd2b8abfe6d1d098e7892e376855046996345d836f488284d68169c61854a0a6ba9c0fb2340d0ffd0ccaa703939c5211c9
|
|
@@ -4,7 +4,7 @@ require "keystone_ui/navigation_group"
|
|
|
4
4
|
|
|
5
5
|
module KeystoneUi
|
|
6
6
|
class Configuration
|
|
7
|
-
attr_accessor :accent, :surface, :theme_mode_supplier, :look_supplier, :trail_supplier, :preference_supplier, :current_tab_supplier, :text_diff_line_limit
|
|
7
|
+
attr_accessor :accent, :surface, :theme_mode_supplier, :look_supplier, :trail_supplier, :preference_supplier, :current_tab_supplier, :hidden_group_supplier, :text_diff_line_limit
|
|
8
8
|
attr_reader :tailwind_imports, :tailwind_sources, :looks, :default_look, :navigation_groups
|
|
9
9
|
|
|
10
10
|
def initialize
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "keystone_ui/configuration"
|
|
3
4
|
require "keystone_ui/navigation_order"
|
|
4
5
|
|
|
5
6
|
module KeystoneUi
|
|
@@ -7,8 +8,9 @@ module KeystoneUi
|
|
|
7
8
|
Group = Struct.new(:label, :tabs, :active, :standalone, keyword_init: true)
|
|
8
9
|
Tab = Struct.new(:label, :href, :active, :count, keyword_init: true)
|
|
9
10
|
|
|
10
|
-
def initialize(declared_groups, view:, saved_order:, current_tab:)
|
|
11
|
+
def initialize(declared_groups, view:, saved_order:, current_tab:, hidden_group: KeystoneUi.configuration.hidden_group_supplier)
|
|
11
12
|
@declared_groups = declared_groups
|
|
13
|
+
@hidden_group = hidden_group
|
|
12
14
|
@view = view
|
|
13
15
|
@saved_order = saved_order
|
|
14
16
|
@current_tab = current_tab
|
|
@@ -22,10 +24,15 @@ module KeystoneUi
|
|
|
22
24
|
|
|
23
25
|
def permitted
|
|
24
26
|
@declared_groups
|
|
27
|
+
.reject { |group| hidden?(group) }
|
|
25
28
|
.map { |group| [ group, group.tabs_permitted_for(@view) ] }
|
|
26
29
|
.reject { |_group, tabs| tabs.empty? }
|
|
27
30
|
end
|
|
28
31
|
|
|
32
|
+
def hidden?(group)
|
|
33
|
+
@hidden_group&.call(@view, group.label)
|
|
34
|
+
end
|
|
35
|
+
|
|
29
36
|
def visible_group(group, tabs)
|
|
30
37
|
visible_tabs = tabs.map { |tab| visible_tab(tab) }
|
|
31
38
|
Group.new(label: group.label, tabs: visible_tabs, active: visible_tabs.any?(&:active), standalone: group.standalone?)
|