openproject-primer_view_components 0.49.0 → 0.49.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -255,10 +255,12 @@ let SelectPanelElement = class SelectPanelElement extends HTMLElement {
255
255
  this.dialog.removeAttribute('data-ready');
256
256
  this.invokerElement?.setAttribute('aria-expanded', 'false');
257
257
  // When we close the dialog, clear the filter input
258
- const fireSearchEvent = this.filterInputTextField.value.length > 0;
259
- this.filterInputTextField.value = '';
260
- if (fireSearchEvent) {
261
- this.filterInputTextField.dispatchEvent(new Event('input'));
258
+ if (this.filterInputTextField) {
259
+ const fireSearchEvent = this.filterInputTextField.value.length > 0;
260
+ this.filterInputTextField.value = '';
261
+ if (fireSearchEvent) {
262
+ this.filterInputTextField.dispatchEvent(new Event('input'));
263
+ }
262
264
  }
263
265
  this.dispatchEvent(new CustomEvent('panelClosed', {
264
266
  detail: { panel: this },
@@ -465,10 +465,13 @@ export class SelectPanelElement extends HTMLElement {
465
465
  this.dialog.removeAttribute('data-ready')
466
466
  this.invokerElement?.setAttribute('aria-expanded', 'false')
467
467
  // When we close the dialog, clear the filter input
468
- const fireSearchEvent = this.filterInputTextField.value.length > 0
469
- this.filterInputTextField.value = ''
470
- if (fireSearchEvent) {
471
- this.filterInputTextField.dispatchEvent(new Event('input'))
468
+
469
+ if (this.filterInputTextField) {
470
+ const fireSearchEvent = this.filterInputTextField.value.length > 0
471
+ this.filterInputTextField.value = ''
472
+ if (fireSearchEvent) {
473
+ this.filterInputTextField.dispatchEvent(new Event('input'))
474
+ }
472
475
  }
473
476
 
474
477
  this.dispatchEvent(
@@ -18,18 +18,18 @@ module Primer
18
18
 
19
19
  # Replacements for some classnames that end up being a different argument key
20
20
  REPLACEMENT_KEYS = {
21
- Regexp.new("^f") => "font_size",
22
- Regexp.new("^anim") => "animation",
23
- Regexp.new("^v-align") => "vertical_align",
24
- Regexp.new("^d") => "display",
25
- Regexp.new("^wb") => "word_break",
26
- Regexp.new("^v") => "visibility",
27
- Regexp.new("^width") => "w",
28
- Regexp.new("^height") => "h",
29
- Regexp.new("^color-bg") => "bg",
30
- Regexp.new("^color-border") => "border_color",
31
- Regexp.new("^color-fg") => "color",
32
- Regexp.new("^rounded") => "border_radius"
21
+ "f" => "font_size",
22
+ "anim" => "animation",
23
+ "v-align" => "vertical_align",
24
+ "d" => "display",
25
+ "wb" => "word_break",
26
+ "v" => "visibility",
27
+ "width" => "w",
28
+ "height" => "h",
29
+ "color-bg" => "bg",
30
+ "color-border" => "border_color",
31
+ "color-fg" => "color",
32
+ "rounded" => "border_radius"
33
33
  }.freeze
34
34
 
35
35
  SUPPORTED_KEY_CACHE = Hash.new { |h, k| h[k] = !UTILITIES[k].nil? }
@@ -190,7 +190,7 @@ module Primer
190
190
 
191
191
  def infer_selector_key(selector)
192
192
  REPLACEMENT_KEYS.each do |k, v|
193
- return v.to_sym if selector.match?(k)
193
+ return v.to_sym if selector.start_with?(k)
194
194
  end
195
195
  selector.split("-").first.to_sym
196
196
  end
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 49
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
@@ -7,9 +7,9 @@
7
7
  open_on_load: open_on_load
8
8
  )) do |panel| %>
9
9
  <% panel.with_show_button { "Panel" } %>
10
- <% panel.with_item(label: "GitHub", href: "https://github.com") %>
11
- <% panel.with_item(label: "Microsoft", href: "https://microsoft.com", active: true) %>
12
10
  <% panel.with_item(label: "Primer", href: "https://primer.style") %>
11
+ <% panel.with_item(label: "Microsoft", href: "https://microsoft.com", active: true) %>
12
+ <% panel.with_item(label: "GitHub", href: "https://github.com") %>
13
13
  <% panel.with_item(label: "Catalyst", href: "https://catalyst.rocks") %>
14
14
  <% end %>
15
15
 
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.49.0
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source