openproject-primer_view_components 0.91.0 → 0.91.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -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/action_menu/action_menu_element.js +1 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +1 -0
- data/app/controllers/primer/view_components/action_menu_controller.rb +1 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/action_menu_preview/with_deferred_content_near_bottom_of_viewport.html.erb +10 -0
- data/previews/primer/alpha/action_menu_preview.rb +7 -0
- data/static/info_arch.json +13 -0
- data/static/previews.json +13 -0
- metadata +2 -1
|
@@ -480,6 +480,7 @@ _ActionMenuElement_handleItemActivated = function _ActionMenuElement_handleItemA
|
|
|
480
480
|
_ActionMenuElement_handleIncludeFragmentReplaced = function _ActionMenuElement_handleIncludeFragmentReplaced() {
|
|
481
481
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get)?.focus();
|
|
482
482
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_softDisableItems).call(this);
|
|
483
|
+
this.overlay?.update();
|
|
483
484
|
// async items have loaded, so component is ready
|
|
484
485
|
this.setAttribute('data-ready', 'true');
|
|
485
486
|
};
|
|
@@ -472,6 +472,7 @@ export class ActionMenuElement extends HTMLElement {
|
|
|
472
472
|
#handleIncludeFragmentReplaced() {
|
|
473
473
|
this.#firstItem?.focus()
|
|
474
474
|
this.#softDisableItems()
|
|
475
|
+
this.overlay?.update()
|
|
475
476
|
|
|
476
477
|
// async items have loaded, so component is ready
|
|
477
478
|
this.setAttribute('data-ready', 'true')
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%# The invoker is pinned near the bottom of the viewport, leaving enough room for the loading %>
|
|
2
|
+
<%# spinner placeholder to fit below it but not enough for the full deferred content, reproducing %>
|
|
3
|
+
<%# the scenario from DREAM-729. The `delay` param forces the fragment response to arrive after the %>
|
|
4
|
+
<%# overlay has already been positioned using the placeholder's size, instead of racing the fetch %>
|
|
5
|
+
<%# against the initial position calculation. %>
|
|
6
|
+
<div style="position: fixed; bottom: 100px; right: 0;">
|
|
7
|
+
<%= render(Primer::Alpha::ActionMenu.new(menu_id: "deferred-bottom", src: primer_view_components.action_menu_deferred_path(delay: 0.3))) do |menu| %>
|
|
8
|
+
<% menu.with_show_button { "Menu with deferred content" } %>
|
|
9
|
+
<% end %>
|
|
10
|
+
</div>
|
|
@@ -310,6 +310,13 @@ module Primer
|
|
|
310
310
|
render_with_template(locals: { nest_in_sub_menu: nest_in_sub_menu })
|
|
311
311
|
end
|
|
312
312
|
|
|
313
|
+
# @label With deferred content near the bottom of the viewport
|
|
314
|
+
#
|
|
315
|
+
# @hidden
|
|
316
|
+
def with_deferred_content_near_bottom_of_viewport
|
|
317
|
+
render_with_template
|
|
318
|
+
end
|
|
319
|
+
|
|
313
320
|
# @label With deferred preloaded content
|
|
314
321
|
#
|
|
315
322
|
def with_deferred_preloaded_content
|
data/static/info_arch.json
CHANGED
|
@@ -1438,6 +1438,19 @@
|
|
|
1438
1438
|
]
|
|
1439
1439
|
}
|
|
1440
1440
|
},
|
|
1441
|
+
{
|
|
1442
|
+
"preview_path": "primer/alpha/action_menu/with_deferred_content_near_bottom_of_viewport",
|
|
1443
|
+
"name": "with_deferred_content_near_bottom_of_viewport",
|
|
1444
|
+
"snapshot": "false",
|
|
1445
|
+
"skip_rules": {
|
|
1446
|
+
"wont_fix": [
|
|
1447
|
+
"region"
|
|
1448
|
+
],
|
|
1449
|
+
"will_fix": [
|
|
1450
|
+
"color-contrast"
|
|
1451
|
+
]
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1441
1454
|
{
|
|
1442
1455
|
"preview_path": "primer/alpha/action_menu/with_deferred_preloaded_content",
|
|
1443
1456
|
"name": "with_deferred_preloaded_content",
|
data/static/previews.json
CHANGED
|
@@ -632,6 +632,19 @@
|
|
|
632
632
|
]
|
|
633
633
|
}
|
|
634
634
|
},
|
|
635
|
+
{
|
|
636
|
+
"preview_path": "primer/alpha/action_menu/with_deferred_content_near_bottom_of_viewport",
|
|
637
|
+
"name": "with_deferred_content_near_bottom_of_viewport",
|
|
638
|
+
"snapshot": "false",
|
|
639
|
+
"skip_rules": {
|
|
640
|
+
"wont_fix": [
|
|
641
|
+
"region"
|
|
642
|
+
],
|
|
643
|
+
"will_fix": [
|
|
644
|
+
"color-contrast"
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
},
|
|
635
648
|
{
|
|
636
649
|
"preview_path": "primer/alpha/action_menu/with_deferred_preloaded_content",
|
|
637
650
|
"name": "with_deferred_preloaded_content",
|
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.91.
|
|
4
|
+
version: 0.91.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub Open Source
|
|
@@ -985,6 +985,7 @@ files:
|
|
|
985
985
|
- previews/primer/alpha/action_menu_preview/two_menus.html.erb
|
|
986
986
|
- previews/primer/alpha/action_menu_preview/with_actions.html.erb
|
|
987
987
|
- previews/primer/alpha/action_menu_preview/with_deferred_content.html.erb
|
|
988
|
+
- previews/primer/alpha/action_menu_preview/with_deferred_content_near_bottom_of_viewport.html.erb
|
|
988
989
|
- previews/primer/alpha/auto_complete_preview.rb
|
|
989
990
|
- previews/primer/alpha/banner_preview.rb
|
|
990
991
|
- previews/primer/alpha/banner_preview/with_action_button.html.erb
|