ultimate_turbo_modal 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/phlex/deferred_render_with_main_content.rb +1 -1
- data/lib/ultimate_turbo_modal/base.rb +8 -4
- data/lib/ultimate_turbo_modal/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0dc2045f3ba7b76dd83c90130c780c4b3dbd4ecc7500e0d0e12e877ff200f26
|
4
|
+
data.tar.gz: 60aa5ecb836ebf21241493d1cb11072f6713650cf13f8818a254e3c3eadbc72c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b99ee6d886121bf9a3b483a117dc32f9395be41012da13444ad3890ed1c778c57754bd57b8b2808c28cceae34c1bd16f4e8505c6fb32d422cfe12ae8cd31d5e
|
7
|
+
data.tar.gz: 968c2f42bef6103f5b7a4b64bffcaf4ff84c281e9014cbabdbfe9d59ac6609e2953b7cc43852be6550617a08afcd4f07b0b951788c8563dc093e67c0d9952ac3
|
data/.tool-versions
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
ruby 3.
|
1
|
+
ruby 3.3.0
|
2
2
|
nodejs 18.9.0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [1.7.0] - 2024-12-28
|
2
|
+
|
3
|
+
- Fix Phlex deprecation warning
|
4
|
+
|
5
|
+
## [1.6.1] - 2024-01-10
|
6
|
+
|
7
|
+
- Added ability to specify data attributes for the content div within the modal. Useful to specify a Stimulus controller, for example.
|
8
|
+
|
1
9
|
## [1.6.0] - 2023-12-25
|
2
10
|
|
3
11
|
- Support for Ruby 3.3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ultimate_turbo_modal (1.
|
4
|
+
ultimate_turbo_modal (1.7.0)
|
5
5
|
phlex-rails (>= 1.0, < 2.0)
|
6
6
|
rails (>= 7)
|
7
7
|
stimulus-rails
|
@@ -130,7 +130,7 @@ GEM
|
|
130
130
|
net-smtp (0.4.0)
|
131
131
|
net-protocol
|
132
132
|
nio4r (2.5.9)
|
133
|
-
nokogiri (1.
|
133
|
+
nokogiri (1.16.0-arm64-darwin)
|
134
134
|
racc (~> 1.4)
|
135
135
|
parallel (1.23.0)
|
136
136
|
parser (3.2.2.4)
|
@@ -146,7 +146,7 @@ GEM
|
|
146
146
|
zeitwerk (~> 2.6)
|
147
147
|
psych (5.1.1.1)
|
148
148
|
stringio
|
149
|
-
racc (1.7.
|
149
|
+
racc (1.7.3)
|
150
150
|
rack (3.0.8)
|
151
151
|
rack-session (2.0.0)
|
152
152
|
rack (>= 3.0.0)
|
data/README.md
CHANGED
@@ -230,7 +230,7 @@ And the following code to `application.js`:
|
|
230
230
|
addEventListener("turbo:before-frame-render", (event) => {
|
231
231
|
event.detail.render = (currentElement, newElement) => {
|
232
232
|
Idiomorph.morph(currentElement, newElement, {
|
233
|
-
|
233
|
+
morphStyle: 'innerHTML'
|
234
234
|
})
|
235
235
|
}
|
236
236
|
})
|
@@ -11,6 +11,7 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
11
11
|
# @param header_divider [Boolean] Whether to show a divider between the header and the main content
|
12
12
|
# @param padding [Boolean] Whether to add padding around the modal content
|
13
13
|
# @param request [ActionDispatch::Request] The current Rails request object
|
14
|
+
# @param content_div_data [Hash] `data` attribute for the div where the modal content will be rendered
|
14
15
|
# @param title [String] The title of the modal
|
15
16
|
def initialize(
|
16
17
|
advance: UltimateTurboModal.configuration.advance,
|
@@ -22,6 +23,7 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
22
23
|
header: UltimateTurboModal.configuration.header,
|
23
24
|
header_divider: UltimateTurboModal.configuration.header_divider,
|
24
25
|
padding: UltimateTurboModal.configuration.padding,
|
26
|
+
content_div_data: nil,
|
25
27
|
request: nil, title: nil
|
26
28
|
)
|
27
29
|
@advance = !!advance
|
@@ -34,6 +36,7 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
34
36
|
@header = header
|
35
37
|
@header_divider = header_divider
|
36
38
|
@padding = padding
|
39
|
+
@content_div_data = content_div_data
|
37
40
|
@request = request
|
38
41
|
@title = title
|
39
42
|
|
@@ -46,7 +49,7 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
49
|
-
def
|
52
|
+
def view_template(&block)
|
50
53
|
if turbo_frame?
|
51
54
|
turbo_frame_tag("modal") do
|
52
55
|
modal(&block)
|
@@ -70,7 +73,7 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
70
73
|
|
71
74
|
private
|
72
75
|
|
73
|
-
attr_accessor :request, :allowed_click_outside_selector
|
76
|
+
attr_accessor :request, :allowed_click_outside_selector, :content_div_data
|
74
77
|
|
75
78
|
def padding? = !!@padding
|
76
79
|
|
@@ -164,11 +167,12 @@ class UltimateTurboModal::Base < Phlex::HTML
|
|
164
167
|
end
|
165
168
|
|
166
169
|
def div_inner(&block)
|
167
|
-
div(id: "modal-inner", class: self.class::DIV_INNER_CLASSES, &block)
|
170
|
+
div(id: "modal-inner", class: self.class::DIV_INNER_CLASSES, data: content_div_data, &block)
|
168
171
|
end
|
169
172
|
|
170
173
|
def div_content(&block)
|
171
|
-
|
174
|
+
data = (content_div_data || {}).merge({modal_target: "content"})
|
175
|
+
div(id: "modal-content", class: self.class::DIV_CONTENT_CLASSES, data:, &block)
|
172
176
|
end
|
173
177
|
|
174
178
|
def div_main(&block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultimate_turbo_modal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Mercier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex-rails
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.5.7
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: UTMR aims to be the be-all and end-all of Turbo Modals.
|