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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/select_panel_element.js +6 -4
- data/app/components/primer/alpha/select_panel_element.ts +7 -4
- data/lib/primer/classify/utilities.rb +13 -13
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/select_panel_preview/list_of_links.html.erb +2 -2
- metadata +1 -1
@@ -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
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
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
|
-
|
469
|
-
this.filterInputTextField
|
470
|
-
|
471
|
-
this.filterInputTextField.
|
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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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.
|
193
|
+
return v.to_sym if selector.start_with?(k)
|
194
194
|
end
|
195
195
|
selector.split("-").first.to_sym
|
196
196
|
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
|
|