openproject-primer_view_components 0.61.0 → 0.61.1

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.
@@ -5,8 +5,8 @@
5
5
  <% if count? %>
6
6
  <%= count %>
7
7
  <% end %>
8
- <%= render(Primer::Beta::Octicon.new(icon: "chevron-up", data: { target: "collapsible-header.arrowUp" })) %>
9
- <%= render(Primer::Beta::Octicon.new(icon: "chevron-down", hidden: true, data: { target: "collapsible-header.arrowDown" })) %>
8
+ <%= render(Primer::Beta::Octicon.new(icon: "chevron-up", hidden: @collapsed, data: { target: "collapsible-header.arrowUp" })) %>
9
+ <%= render(Primer::Beta::Octicon.new(icon: "chevron-down", hidden: !@collapsed, data: { target: "collapsible-header.arrowDown" })) %>
10
10
  <% end %>
11
11
  <%= flex.with_row do %>
12
12
  <% if description? %>
@@ -39,6 +39,7 @@ module Primer
39
39
  }
40
40
  }
41
41
  )
42
+ system_arguments[:hidden] = @collapsed
42
43
 
43
44
  Primer::Beta::Text.new(**system_arguments, &block)
44
45
  }
@@ -26,16 +26,16 @@ export class CollapsibleElement extends HTMLElement {
26
26
  }
27
27
  hideAll() {
28
28
  // For whatever reason, setting `hidden` directly does not work on the SVGs
29
- this.arrowDown.removeAttribute('hidden');
30
- this.arrowUp.setAttribute('hidden', '');
29
+ this.arrowDown?.removeAttribute('hidden');
30
+ this.arrowUp?.setAttribute('hidden', '');
31
31
  for (const el of this.collapsibleElements) {
32
32
  el.hidden = true;
33
33
  }
34
34
  this.classList.add(`${this.baseClass}--collapsed`);
35
35
  }
36
36
  expandAll() {
37
- this.arrowUp.removeAttribute('hidden');
38
- this.arrowDown.setAttribute('hidden', '');
37
+ this.arrowUp?.removeAttribute('hidden');
38
+ this.arrowDown?.setAttribute('hidden', '');
39
39
  for (const el of this.collapsibleElements) {
40
40
  el.hidden = false;
41
41
  }
@@ -24,8 +24,8 @@ export abstract class CollapsibleElement extends HTMLElement {
24
24
 
25
25
  hideAll() {
26
26
  // For whatever reason, setting `hidden` directly does not work on the SVGs
27
- this.arrowDown.removeAttribute('hidden')
28
- this.arrowUp.setAttribute('hidden', '')
27
+ this.arrowDown?.removeAttribute('hidden')
28
+ this.arrowUp?.setAttribute('hidden', '')
29
29
 
30
30
  for (const el of this.collapsibleElements) {
31
31
  el.hidden = true
@@ -35,8 +35,8 @@ export abstract class CollapsibleElement extends HTMLElement {
35
35
  }
36
36
 
37
37
  expandAll() {
38
- this.arrowUp.removeAttribute('hidden')
39
- this.arrowDown.setAttribute('hidden', '')
38
+ this.arrowUp?.removeAttribute('hidden')
39
+ this.arrowDown?.setAttribute('hidden', '')
40
40
 
41
41
  for (const el of this.collapsibleElements) {
42
42
  el.hidden = false
@@ -1,7 +1,6 @@
1
1
  <%= render(Primer::BaseComponent.new(**@system_arguments)) do %>
2
2
  <%= render(Primer::OpenProject::FlexLayout.new) do |flex| %>
3
- <%= flex.with_row(mb: 3,
4
- classes: "CollapsibleSection--triggerArea",
3
+ <%= flex.with_row(classes: "CollapsibleSection--triggerArea",
5
4
  data: { action: "click:collapsible-section#toggle" }) do %>
6
5
  <%= render(Primer::OpenProject::FlexLayout.new(display: :flex, align_items: :center)) do |header| %>
7
6
  <%= header.with_column do %>
@@ -11,15 +10,15 @@
11
10
  <%= caption %>
12
11
  <% end %>
13
12
  <%= header.with_column do %>
14
- <%= render(Primer::Beta::Octicon.new(icon: "chevron-up", data: { target: "collapsible-section.arrowUp" })) %>
15
- <%= render(Primer::Beta::Octicon.new(icon: "chevron-down", hidden: true, data: { target: "collapsible-section.arrowDown" })) %>
13
+ <%= render(Primer::Beta::Octicon.new(icon: "chevron-up", hidden: @collapsed, data: { target: "collapsible-section.arrowUp" })) %>
14
+ <%= render(Primer::Beta::Octicon.new(icon: "chevron-down", hidden: !@collapsed, data: { target: "collapsible-section.arrowDown" })) %>
16
15
  <% end %>
17
16
  <%= header.with_column(flex: 1, text_align: :right) do %>
18
17
  <%= additional_information %>
19
18
  <% end %>
20
19
  <% end %>
21
20
  <% end %>
22
- <%= flex.with_row(data: { targets: "collapsible-section.collapsibleElements" }) do %>
21
+ <%= flex.with_row(hidden: @collapsed, mt: 3, data: { targets: "collapsible-section.collapsibleElements" }) do %>
23
22
  <%= collapsible_content %>
24
23
  <% end %>
25
24
  <% end %>
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 61
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.61.0
4
+ version: 0.61.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-11 00:00:00.000000000 Z
12
+ date: 2025-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview