blacklight-hierarchy 6.5.0 → 6.6.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: '0087020faf523fb8671351fa18c62b7d4f2bd09f254b24564a5a5d7aac9d5593'
4
- data.tar.gz: 6ffb7349402eea8340d105cc747d95d0089c94a552700f5f1106cb6fb069173a
3
+ metadata.gz: 653bcfc6322d881f68b3e497d01f83bae1e50a180734511849d5f3e34abc1cde
4
+ data.tar.gz: eca2782a3f9e8e1573ac4d8ce551bef7c8342e7bc9531d4a75a18da558c180df
5
5
  SHA512:
6
- metadata.gz: 66d064cea30098266d2276b2806775a348250f8f1eb9bd27958018502589dbd6402bf18273ab1cd034e85a6747ef0fa74aee88e93d0d1bda71552284c656d192
7
- data.tar.gz: 685bd238b6bec0f0c41d2b3bbd831111734c3b472f5949e8f27b90f13ffa3c387784d486b617b4cab07ba5b16e490bd6584c94b0c20e557f0c0479a5697107d3
6
+ metadata.gz: 761b1a427e8ceb7e8839898322469c8d54418308b8d193511570312c7427e6f6e7d15ef4b8afdf78d2bd8b023fc520d4e4204521f7b58988d0a654792d6930c5
7
+ data.tar.gz: a8b501673443997fa510da6a5cc68b3b62832fa514bd39396498df3b203a45fab11c5bccbbf5df7db6c510ddf1eb6a31cc1c49907a8e2219e58b6e79e4e45ab8
@@ -28,6 +28,10 @@ jobs:
28
28
  rails_version: "7.1.3.4"
29
29
  name: "Blacklight 7"
30
30
  blacklight_version: "7.38.0"
31
+ - ruby: "3.4"
32
+ rails_version: "8.0.2"
33
+ name: "Blacklight 9 beta"
34
+ blacklight_version: "9.0.0.beta2"
31
35
  env:
32
36
  BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
33
37
  steps:
data/README.md CHANGED
@@ -124,10 +124,6 @@ en:
124
124
  toggle_aria_label: Toggle call number section
125
125
  ```
126
126
 
127
- ### Javascript
128
-
129
- The javascript in this project requires jquery, but it's up to you to provide it in a way that best works for your project. You may consider the jquery-rails gem or if you use webpacker, you could use the jquery npm package.
130
-
131
127
  ## Caveats
132
128
 
133
129
  This code was ripped out of another project, and is still quite immature as a standalone project. Every effort has been made to make it as plug-and-play as possible, but it may stomp on Blacklight in unintended ways (e.g., ways that made sense in context of its former host app, but which aren't compatible with generic Blacklight). Proceed with caution, and report issues.
@@ -1,31 +1,31 @@
1
- Blacklight.onLoad(function(){
2
- Blacklight.do_hierarchical_facet_expand_contract_behavior();
3
- });
1
+ Blacklight.onLoad(() => Blacklight.do_hierarchical_facet_expand_contract_behavior())
4
2
 
5
- (function($) {
6
- Blacklight.do_hierarchical_facet_expand_contract_behavior = function() {
7
- $( Blacklight.do_hierarchical_facet_expand_contract_behavior.selector ).each (
8
- Blacklight.hierarchical_facet_expand_contract
9
- );
3
+ (() => {
4
+ Blacklight.do_hierarchical_facet_expand_contract_behavior = () => {
5
+ const elements = document.querySelectorAll(Blacklight.do_hierarchical_facet_expand_contract_behavior.selector)
6
+ elements.forEach(elem => Blacklight.hierarchical_facet_expand_contract(elem))
10
7
  }
11
- Blacklight.do_hierarchical_facet_expand_contract_behavior.selector = '[data-controller="b-h-collapsible"]';
12
- Blacklight.do_hierarchical_facet_expand_contract_behavior.handle = '[data-action="click->b-h-collapsible#toggle"]';
13
- Blacklight.do_hierarchical_facet_expand_contract_behavior.list = '[data-b-h-collapsible-target="list"]';
8
+ Blacklight.do_hierarchical_facet_expand_contract_behavior.selector = '[data-controller="b-h-collapsible"]'
9
+ Blacklight.do_hierarchical_facet_expand_contract_behavior.handle = '[data-action="click->b-h-collapsible#toggle"]'
10
+ Blacklight.do_hierarchical_facet_expand_contract_behavior.list = '[data-b-h-collapsible-target="list"]'
14
11
 
15
- Blacklight.hierarchical_facet_expand_contract = function() {
16
- var li = $(this);
17
- li.addClass('twiddle');
12
+ Blacklight.hierarchical_facet_expand_contract = (element) => {
13
+ element.classList.add('twiddle')
18
14
 
19
- $(Blacklight.do_hierarchical_facet_expand_contract_behavior.list, this).each(function() {
20
- if($('span.selected', this).length != 0){
21
- li.addClass('twiddle-open');
22
- li.children('.collapse').addClass('show');
15
+ const lists = element.querySelectorAll(Blacklight.do_hierarchical_facet_expand_contract_behavior.list)
16
+
17
+ lists.forEach((list) => {
18
+ if (list.querySelector('span.selected')) {
19
+ element.classList.add('twiddle-open')
20
+ const collapseElement = element.querySelector('.collapse')
21
+ if (collapseElement) {
22
+ collapseElement.classList.add('show')
23
+ }
23
24
  }
24
- });
25
+ })
25
26
 
26
27
  // attach the toggle behavior to the li tag
27
- li.children(Blacklight.do_hierarchical_facet_expand_contract_behavior.handle).click(function(e){
28
- li.toggleClass('twiddle-open');
29
- });
30
- };
31
- })(jQuery);
28
+ const handle = element.querySelector(Blacklight.do_hierarchical_facet_expand_contract_behavior.handle)
29
+ handle?.addEventListener('click', () => element.classList.toggle('twiddle-open'))
30
+ }
31
+ })()
@@ -88,6 +88,7 @@ $text-muted: #777 !default;
88
88
  display: flex;
89
89
  flex-wrap: wrap;
90
90
  padding: 3px 0;
91
+ align-items: center;
91
92
  }
92
93
 
93
94
  .h-leaf {
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Blacklight
4
4
  module Hierarchy
5
- class FacetFieldListComponent < Blacklight::FacetFieldListComponent
5
+ superklass = defined?(Blacklight::Facets::ListComponent) ? Blacklight::Facets::ListComponent : Blacklight::FacetFieldListComponent
6
+ class FacetFieldListComponent < superklass
6
7
  DELIMITER = '_'
7
8
 
8
9
  # @param [Blacklight::Configuration::FacetField] as defined in controller with config.add_facet_field (and with :partial => 'blacklight/hierarchy/facet_hierarchy')
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Hierarchy
3
- VERSION = '6.5.0'.freeze
3
+ VERSION = '6.6.0'.freeze
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -19,7 +19,6 @@
19
19
  "homepage": "https://github.com/sul-dlss/blacklight-hierarchy#readme",
20
20
  "devDependencies": {},
21
21
  "dependencies": {
22
- "blacklight-frontend": ">=7.1 || 8.0",
23
- "jquery": ">=3.0"
22
+ "blacklight-frontend": ">=7.1 <10.0.0"
24
23
  }
25
24
  }
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.5.0
4
+ version: 6.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael B. Klein
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-04 00:00:00.000000000 Z
10
+ date: 2025-06-18 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: blacklight