blacklight-hierarchy 6.6.0 → 6.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 653bcfc6322d881f68b3e497d01f83bae1e50a180734511849d5f3e34abc1cde
4
- data.tar.gz: eca2782a3f9e8e1573ac4d8ce551bef7c8342e7bc9531d4a75a18da558c180df
3
+ metadata.gz: 141fa38233321f2397dfd254b51bc790f0be05647b5e3d6d907084999c73c6dc
4
+ data.tar.gz: d13151db84464e2c7485488e33b97fa455adf64823944e09fa40f41e4441cd7e
5
5
  SHA512:
6
- metadata.gz: 761b1a427e8ceb7e8839898322469c8d54418308b8d193511570312c7427e6f6e7d15ef4b8afdf78d2bd8b023fc520d4e4204521f7b58988d0a654792d6930c5
7
- data.tar.gz: a8b501673443997fa510da6a5cc68b3b62832fa514bd39396498df3b203a45fab11c5bccbbf5df7db6c510ddf1eb6a31cc1c49907a8e2219e58b6e79e4e45ab8
6
+ metadata.gz: 2bb3a06e042232ab2d95f68276692100e322723b99dc8b70c7f5dbdf28238b14e7fcaa5486becd5b95c7a97c0df5703614bac09fa75a61800e18ec47ae72891a
7
+ data.tar.gz: 024e46f594e967e271e57ee64f7cc0994a67ce0d7529625d422176feba5b5f7de62276774c2a3466e63795249e8d4a21525a158af6d7cf1e942ee94fbb8e0487
data/README.md CHANGED
@@ -100,13 +100,13 @@ config.add_facet_field 'tag_facet', sort: 'alpha', label: 'Tag', component: Blac
100
100
  ```
101
101
 
102
102
  ### Changing the icons
103
- We store our closed/open icons as the SASS variables `$b-h-closed-icon` and `$b-h-closed-icon` in `hierarchy.scss`. By default we use SVGs provided by the [Font Awesome](https://github.com/FortAwesome/Font-Awesome) library. To change the icon, reassign these SASS variables with new SVG code.
103
+ We store our closed/open icons as the CSS variables `--bl-h-closed-icon` and `--bl-h-closed-icon` in `hierarchy.css`. By default we use SVGs provided by the [Font Awesome](https://github.com/FortAwesome/Font-Awesome) library. To change the icon, reassign these CSS variables with new SVG code.
104
104
 
105
- ```scss
106
- /* app/assets/stylesheets/blacklight/hierarchy/hierarchy.scss */
105
+ ```css
106
+ /* app/assets/stylesheets/blacklight/hierarchy/hierarchy.css */
107
107
 
108
- // plus sign
109
- $b-h-closed-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
108
+ /* plus sign */
109
+ --bl-h-closed-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free %28Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License%29 Copyright 2022 Fonticons, Inc. --%3e%3cpath d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/%3e%3c/svg%3e");
110
110
  ```
111
111
 
112
112
 
@@ -0,0 +1,100 @@
1
+ :root {
2
+ --bl-h-remove-color: var(--bs-secondary-color);
3
+
4
+ /* plus sign */
5
+ --bl-h-closed-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free %28Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License%29 Copyright 2022 Fonticons, Inc. --%3e%3cpath d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/%3e%3c/svg%3e");
6
+
7
+ /* minus sign */
8
+ --bl-h-opened-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free %28Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License%29 Copyright 2022 Fonticons, Inc. --%3e%3cpath d='M312 232C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H312zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/%3e%3c/svg%3e");
9
+ }
10
+
11
+ .facet-hierarchy {
12
+ list-style-type: none;
13
+ padding-left: 0;
14
+ flex: 1 1 100%;
15
+ width: 100%;
16
+
17
+ ul {
18
+ list-style-type: none;
19
+ padding-left: 0.75rem;
20
+ flex: 1 1 100%;
21
+ width: 100%;
22
+ }
23
+
24
+ .facet-label {
25
+ flex: 1;
26
+ }
27
+
28
+ .facet-select {
29
+ flex: 1;
30
+ word-break: break-word;
31
+ }
32
+
33
+ .facet-count {
34
+ float: right;
35
+ flex: 0 0 auto;
36
+ padding-left: 0.5rem;
37
+ }
38
+
39
+ .toggle-handle {
40
+ border: 0;
41
+ margin: 0;
42
+ width: 1.5rem;
43
+ height: 1.5rem;
44
+ padding: 0;
45
+ vertical-align: top;
46
+ display: flex;
47
+ align-items: flex-start;
48
+
49
+ .closed,
50
+ .opened {
51
+ display: none;
52
+ }
53
+ }
54
+
55
+ .twiddle > .toggle-handle {
56
+ background-color: transparent;
57
+ }
58
+
59
+ .twiddle > .toggle-handle .toggle-icon {
60
+ background-position: center;
61
+ background-repeat: no-repeat;
62
+ margin-top: 0.25rem;
63
+ min-height: 1.1rem;
64
+ min-width: 1.1rem;
65
+ }
66
+
67
+ .twiddle > .toggle-handle .closed {
68
+ background-image: var(--bl-h-closed-icon);
69
+ display: inline-block;
70
+ }
71
+
72
+ .twiddle > .toggle-handle .opened {
73
+ display: none;
74
+ }
75
+
76
+ .twiddle-open > .toggle-handle .closed {
77
+ display: none;
78
+ }
79
+
80
+ .twiddle-open > .toggle-handle .opened {
81
+ background-image: var(--bl-h-opened-icon);
82
+ display: inline-block;
83
+ }
84
+
85
+ .h-node,
86
+ .h-leaf {
87
+ display: flex;
88
+ flex-wrap: wrap;
89
+ padding: 3px 0;
90
+ align-items: center;
91
+ }
92
+
93
+ .h-leaf {
94
+ padding-left: 1.5rem;
95
+ }
96
+
97
+ .remove {
98
+ color: var(--bl-h-remove-color);
99
+ }
100
+ }
@@ -1,8 +1,5 @@
1
1
  <span class="facet-label">
2
2
  <%= content_tag :span, label_value, id: id, class: 'selected' %>
3
3
  </span>
4
- <%= link_to(remove_href, class: 'remove') do %>
5
- <span class="remove-icon" aria-hidden="true">✖</span>
6
- <span class="sr-only"><%= t('blacklight.search.facets.selected.remove') %></span>
7
- <% end %>
4
+ <%= remove_link %>
8
5
  <%= render_facet_count %>
@@ -3,6 +3,7 @@
3
3
  module Blacklight
4
4
  module Hierarchy
5
5
  # Standard display of a SELECTED facet value, no link, special span with class, and 'remove' button.
6
+ # This is similar to Blacklight::Facet::SelectedValueComponent
6
7
  class SelectedQfacetValueComponent < QfacetValueComponent
7
8
  def initialize(field_name:, item:)
8
9
  @field_name = field_name
@@ -14,6 +15,13 @@ module Blacklight
14
15
  def remove_href
15
16
  helpers.search_action_path(helpers.search_state.filter(field_name).remove(item.qvalue).params)
16
17
  end
18
+
19
+ def remove_link
20
+ link_to(remove_href, class: "remove ps-2", rel: "nofollow") do
21
+ render(Blacklight::Icons::RemoveComponent.new(aria_hidden: true)) +
22
+ tag.span(t(:'blacklight.search.facets.selected.remove'), class: 'visually-hidden')
23
+ end
24
+ end
17
25
  end
18
26
  end
19
27
  end
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Hierarchy
3
- VERSION = '6.6.0'.freeze
3
+ VERSION = '6.7.0'.freeze
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-hierarchy",
3
- "version": "6.4.0",
3
+ "version": "6.7.0",
4
4
  "description": "[![Build Status](https://github.com/sul-dlss/blacklight-hierarchy/workflows/CI/badge.svg)](https://github.com/sul-dlss/blacklight-hierarchy/actions?query=branch%3Amain)",
5
5
  "main": "app/assets/javascripts/blacklight/hierarchy/hierarchy.js",
6
6
  "files": [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-hierarchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0
4
+ version: 6.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael B. Klein
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-06-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: blacklight
@@ -152,7 +152,7 @@ files:
152
152
  - Rakefile
153
153
  - app/assets/javascripts/blacklight/hierarchy/blacklight_hierarchy_controller.js
154
154
  - app/assets/javascripts/blacklight/hierarchy/hierarchy.js
155
- - app/assets/stylesheets/blacklight/hierarchy/hierarchy.scss
155
+ - app/assets/stylesheets/blacklight/hierarchy/hierarchy.css
156
156
  - app/components/blacklight/hierarchy/facet_field_component.html.erb
157
157
  - app/components/blacklight/hierarchy/facet_field_component.rb
158
158
  - app/components/blacklight/hierarchy/facet_field_list_component.html.erb
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  requirements: []
203
- rubygems_version: 3.6.3
203
+ rubygems_version: 3.6.9
204
204
  specification_version: 4
205
205
  summary: Hierarchical Facets for Blacklight
206
206
  test_files:
@@ -1,101 +0,0 @@
1
- // plus sign
2
- $b-h-closed-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
3
- // minus sign
4
- $b-h-opened-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M312 232C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H312zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
5
-
6
- $text-muted: #777 !default;
7
-
8
- :root {
9
- --text-muted: #{$text-muted};
10
- }
11
-
12
- .facet-hierarchy {
13
- list-style-type: none;
14
- padding-left: 0;
15
- flex: 1 1 100%;
16
- width: 100%;
17
-
18
- ul {
19
- list-style-type: none;
20
- padding-left: 0.75rem;
21
- flex: 1 1 100%;
22
- width: 100%;
23
- }
24
-
25
- .facet-label {
26
- flex: 1;
27
- }
28
-
29
- .facet-select {
30
- flex: 1;
31
- word-break: break-word;
32
- }
33
-
34
- .facet-count {
35
- float: right;
36
- flex: 0 0 auto;
37
- padding-left: 0.5rem;
38
- }
39
-
40
- .toggle-handle {
41
- border: 0;
42
- margin: 0;
43
- width: 1.5rem;
44
- height: 1.5rem;
45
- padding: 0;
46
- vertical-align: top;
47
- display: flex;
48
- align-items: flex-start;
49
-
50
- .closed,
51
- .opened {
52
- display: none;
53
- }
54
- }
55
-
56
- .twiddle > .toggle-handle {
57
- background-color: transparent;
58
- }
59
-
60
- .twiddle > .toggle-handle .toggle-icon {
61
- background-position: center;
62
- background-repeat: no-repeat;
63
- margin-top: 0.25rem;
64
- min-height: 1.1rem;
65
- min-width: 1.1rem;
66
- }
67
-
68
- .twiddle > .toggle-handle .closed {
69
- background-image: escape-svg($b-h-closed-icon);
70
- display: inline-block;
71
- }
72
-
73
- .twiddle > .toggle-handle .opened {
74
- display: none;
75
- }
76
-
77
- .twiddle-open > .toggle-handle .closed {
78
- display: none;
79
- }
80
-
81
- .twiddle-open > .toggle-handle .opened {
82
- background-image: escape-svg($b-h-opened-icon);
83
- display: inline-block;
84
- }
85
-
86
- .h-node,
87
- .h-leaf {
88
- display: flex;
89
- flex-wrap: wrap;
90
- padding: 3px 0;
91
- align-items: center;
92
- }
93
-
94
- .h-leaf {
95
- padding-left: 1.5rem;
96
- }
97
-
98
- .remove {
99
- color: var(--text-muted);
100
- }
101
- }