rails_modal_manager 1.0.50 → 1.0.52

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: 1580c0dddb5b53633cfdb943d27eab017b23498563308a4c7b163ce9654dfe2c
4
- data.tar.gz: 498e99470357e2d5afc2b7efab7ff8f36af5e5edaad6d8d51e7a3128936e83ca
3
+ metadata.gz: 9f0c284c73e8a2d5bf8c4a04293332dce7bc16a61cc53279e99dfa1c133e0894
4
+ data.tar.gz: 5215a66e121f1057d17420ce7407c7d4961f8cd1a21d16cf9303a3989abe7892
5
5
  SHA512:
6
- metadata.gz: f44e97638772289ca3c96c664f980d70795a1248656ff45ab408201881a04bf7e5570932d45d67f35c5980b7a7e42a6ec5dfc51cb419a0f10e663171952a063c
7
- data.tar.gz: fb456bdde62080b5f5165c34ace756b6d13f79cdb8bedc82e8696a11a864ed61bc94531579097741d75c096bca891444db23376fd56d4f3d0478deaa2a346325
6
+ metadata.gz: 13644c5657a20e5baa80b1304344cf9dcd411856f641e924882a657fed63ca67116a0e61603aa01ca0cf93bb49a3a5724a7117bf1bd797ec79d38348020ebdb7
7
+ data.tar.gz: a2af506573c6b393eb1fa10cfd4246d90a71bdd3d8235fa5e4728cb381d9923dad06aeaed870abf2c4dfb34e083fbe7adfb56a8f900800a73b8a2318a4cc731a
@@ -2082,8 +2082,9 @@
2082
2082
  }
2083
2083
 
2084
2084
  @media (max-width: 768px) {
2085
- /* ── peek 중인 사이드바: 얇은 폭(아이콘 너비) + 오버레이 + 1회 animation ── */
2086
- .rmm-modal.rmm-size-full .rmm-sidebar[data-peek="true"] {
2085
+ /* ── peek 중인 사이드바: 얇은 폭(아이콘 너비) + 오버레이 + 1회 animation ──
2086
+ v1.0.50 개선: size-full 조건 제거. 모바일 + 사이드바 있는 모든 모달에 작동. */
2087
+ .rmm-modal .rmm-sidebar[data-peek="true"] {
2087
2088
  position: absolute !important;
2088
2089
  top: var(--rmm-header-height) !important;
2089
2090
  left: 0 !important;
@@ -2097,11 +2098,11 @@
2097
2098
  animation: rmm-sidebar-peek 1000ms var(--rmm-ease-out) forwards;
2098
2099
  transition: none !important; /* animation 과 transition 충돌 방지 */
2099
2100
  }
2100
- .rmm-modal.rmm-size-full .rmm-sidebar[data-peek="true"] .rmm-sidebar-item-label,
2101
- .rmm-modal.rmm-size-full .rmm-sidebar[data-peek="true"] .rmm-sidebar-item-badge {
2101
+ .rmm-modal .rmm-sidebar[data-peek="true"] .rmm-sidebar-item-label,
2102
+ .rmm-modal .rmm-sidebar[data-peek="true"] .rmm-sidebar-item-badge {
2102
2103
  display: none;
2103
2104
  }
2104
- .rmm-modal.rmm-size-full .rmm-sidebar[data-peek="true"] .rmm-sidebar-item {
2105
+ .rmm-modal .rmm-sidebar[data-peek="true"] .rmm-sidebar-item {
2105
2106
  justify-content: center;
2106
2107
  padding: 10px 8px;
2107
2108
  }
@@ -93,16 +93,20 @@ export default class extends Controller {
93
93
  _runPeekIfReady() {
94
94
  if (this._peekDone) return true
95
95
  if (window.innerWidth >= 768) return false
96
- if (!this.isMobileMaximized()) return false
97
96
  const modal = this.element.closest('.rmm-modal')
98
97
  if (!modal) return false
99
98
  // rmm-active 가 붙은(= 실제로 보이는) 타이밍까지 기다린다
100
99
  if (!modal.classList.contains('rmm-active')) return false
101
100
 
102
- // 기존 legacy collapsed 클래스 정리 hidden 으로 진입
103
- this.element.classList.remove('rmm-sidebar-collapsed')
104
- this.sidebarModeValue = 'hidden'
105
- this.applySidebarMode()
101
+ // v1.0.50+ (개선): size-full 아니어도 모바일이고 사이드바가 있으면 peek.
102
+ // - size-full: 기존처럼 legacy collapsed 제거 후 hidden 으로 진입 (2상태 토글 용)
103
+ // - size-md 등 일반: collapsed 를 그대로 유지 (기본 drawer 상태)
104
+ const isFullSize = modal.classList.contains('rmm-size-full')
105
+ if (isFullSize) {
106
+ this.element.classList.remove('rmm-sidebar-collapsed')
107
+ this.sidebarModeValue = 'hidden'
108
+ this.applySidebarMode()
109
+ }
106
110
  this._triggerMobilePeek()
107
111
  this._peekDone = true
108
112
  this._peekObserver?.disconnect()
@@ -26,6 +26,9 @@ function renderButtonHtml(btn) {
26
26
  const attrs = [`class="${classes.join(" ")}"`]
27
27
  if (btn.disabled || btn.loading) attrs.push("disabled")
28
28
  if (btn.action) attrs.push(`data-action="${escapeHtml(btn.action)}"`)
29
+ // v1.0.52+: onclick 지원 — Stimulus 컨트롤러 scope 밖(footer 는 panel 밖에 있음)에서
30
+ // 본문의 저장 버튼을 프로그래밍적으로 클릭하거나 form.requestSubmit() 호출하는 용도.
31
+ if (btn.onclick) attrs.push(`onclick="${escapeHtml(btn.onclick)}"`)
29
32
  if (btn.id) attrs.push(`data-button-id="${escapeHtml(btn.id)}"`)
30
33
 
31
34
  return `<button type="button" ${attrs.join(" ")}>${escapeHtml(btn.label || "")}</button>`
@@ -45,7 +45,8 @@
45
45
  variant: b[:variant] || "secondary",
46
46
  disabled: b[:disabled] || false,
47
47
  loading: b[:loading] || false,
48
- action: b[:action]
48
+ action: b[:action],
49
+ onclick: b[:onclick]
49
50
  }.compact
50
51
  },
51
52
  message: item[:footer_message]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.50"
4
+ VERSION = "1.0.52"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_modal_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.50
4
+ version: 1.0.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs