yummy-guide-generic-administrate 0.8.19 → 0.8.20
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/app/assets/stylesheets/yummy_guide_administrate/components.scss +17 -0
- data/app/views/yummy_guide/administrate/administrate/application/_collection.html.erb +2 -1
- data/lib/yummy_guide/administrate/version.rb +1 -1
- data/spec/yummy_guide/administrate/column_resizer_asset_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80717c9b4b3431c6d830aa3364e4e731eb53758755cee3ed3d265d605d22549c
|
|
4
|
+
data.tar.gz: 6352ff8d1f0e18c879ce79fe160aea19221c796fd1f9ca85dcb9ccbab8c54c39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa85ed3939027282dcc7eb7c30f9c8b95a9c1ed9b5cbe56b17c6126c81d6fdf67ebb314b4e333a8c02cacd597f9f34958ec672c969082d8675411ea0d36ced3a
|
|
7
|
+
data.tar.gz: 9ce39cfffdb9d190e0f2a67838487818aedc47dec192d9e3c7c8a06689d1241b532131840e828a24d2466c9ef6db82dd784aacbf4dc1d44691f2726981b89c93
|
|
@@ -260,6 +260,15 @@
|
|
|
260
260
|
overflow: visible;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
// Embedded tables opt in so the wrapper, not the page, owns both scroll axes.
|
|
264
|
+
.scroll-table[data-css-sticky-table][data-constrained-scroll],
|
|
265
|
+
.home-table__wrapper[data-css-sticky-table][data-constrained-scroll] {
|
|
266
|
+
--admin-sticky-actions-right: 0px; // pin Actions to the box edge, not to the page padding
|
|
267
|
+
max-block-size: calc(100dvh - var(--admin-sticky-page-header-height, 8rem) - 5rem);
|
|
268
|
+
overflow: auto;
|
|
269
|
+
overscroll-behavior: contain;
|
|
270
|
+
}
|
|
271
|
+
|
|
263
272
|
.scroll-table[data-css-sticky-table] table,
|
|
264
273
|
.sticky-table-scroll[data-css-sticky-table] table,
|
|
265
274
|
.home-table__wrapper[data-css-sticky-table] table,
|
|
@@ -1646,6 +1655,14 @@ body.admin-filter-open {
|
|
|
1646
1655
|
width: 100vw !important;
|
|
1647
1656
|
}
|
|
1648
1657
|
|
|
1658
|
+
// Constrained tables live inside a padded card, so fit the card instead of the viewport.
|
|
1659
|
+
body :is(.scroll-table, .home-table__wrapper)[data-css-sticky-table][data-constrained-scroll] {
|
|
1660
|
+
inline-size: 100% !important;
|
|
1661
|
+
max-inline-size: 100% !important;
|
|
1662
|
+
max-width: 100% !important;
|
|
1663
|
+
width: 100% !important;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1649
1666
|
body.admin-navigation-mobile-open:has([data-css-sticky-table]) :is(.scroll-table, .sticky-table-scroll, .home-table__wrapper, .table-wrap, .af__table__content)[data-css-sticky-table] {
|
|
1650
1667
|
overflow: hidden !important;
|
|
1651
1668
|
touch-action: none;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<% column_width_storage_scope = local_assigns[:column_width_storage_scope].presence %>
|
|
2
|
+
<% constrained_scroll = local_assigns[:constrained_scroll] %>
|
|
2
3
|
<% table_definition = yummy_guide_administrate_collection_table_definition(
|
|
3
4
|
page: page,
|
|
4
5
|
collection_presenter: collection_presenter,
|
|
5
6
|
column_width_storage_scope: column_width_storage_scope
|
|
6
7
|
) %>
|
|
7
|
-
<div class="scroll-table" data-css-sticky-table
|
|
8
|
+
<div class="scroll-table" data-css-sticky-table<%= " data-constrained-scroll" if constrained_scroll %>>
|
|
8
9
|
<table
|
|
9
10
|
aria-labelledby="<%= table_title %>"
|
|
10
11
|
data-fixed-columns-count="<%= table_definition.fixed_columns_count %>"
|
|
@@ -257,6 +257,14 @@ RSpec.describe "column resizer assets" do
|
|
|
257
257
|
expect(components_source).to include("width: var(--admin-sticky-actions-right, 0px)")
|
|
258
258
|
end
|
|
259
259
|
|
|
260
|
+
it "supports opt-in scrolling for embedded sticky tables" do
|
|
261
|
+
expect(components_source).to include("[data-constrained-scroll]")
|
|
262
|
+
expect(components_source).to include(".home-table__wrapper[data-css-sticky-table][data-constrained-scroll]")
|
|
263
|
+
expect(components_source).to include("max-block-size: calc(100dvh - var(--admin-sticky-page-header-height, 8rem) - 5rem)")
|
|
264
|
+
expect(components_source).to include("overscroll-behavior: contain")
|
|
265
|
+
expect(components_source).to include("--admin-sticky-actions-right: 0px;")
|
|
266
|
+
end
|
|
267
|
+
|
|
260
268
|
# PC表示ではsticky tableをページ全体スクロールで扱うことを静的に確認する
|
|
261
269
|
it "expands the main content to the sticky table width on desktop" do
|
|
262
270
|
expect(components_source).to include("@media screen and (min-width: 768px)")
|