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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c85a364e43e99ea2fcb9440143675804196ced1b1d46b211cd202e1664232581
4
- data.tar.gz: e6974ae9c103179acfc9fe77347336dac3feae4e305f1008dbc2ebd18eb1bd26
3
+ metadata.gz: 80717c9b4b3431c6d830aa3364e4e731eb53758755cee3ed3d265d605d22549c
4
+ data.tar.gz: 6352ff8d1f0e18c879ce79fe160aea19221c796fd1f9ca85dcb9ccbab8c54c39
5
5
  SHA512:
6
- metadata.gz: bddc130440fc835aabeca11cc79dafcaaecfcd6f06ab4c37a18318b618a4d20b835436e5f766adb4f31a4e25f391a447dbdce40af0e2694b2101f426f2153109
7
- data.tar.gz: 87927272596c5bbb430f78982a5ba8d4e20626c88b907fa14613708a49de8d4dc357d8fe4c8160719f00a8e3d159aaea74dee74678aa1c22f5c41430fbadb117
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 %>"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module YummyGuide
4
4
  module Administrate
5
- VERSION = "0.8.19"
5
+ VERSION = "0.8.20"
6
6
  end
7
7
  end
@@ -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)")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yummy-guide-generic-administrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.19
4
+ version: 0.8.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - akatsuki-kk