plutonium 0.21.1 → 0.22.0
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/lib/plutonium/ui/component/kit.rb +1 -1
- data/lib/plutonium/ui/display/components/markdown.rb +1 -1
- data/lib/plutonium/ui/form/resource.rb +27 -24
- data/lib/plutonium/ui/panel.rb +9 -2
- data/lib/plutonium/ui/table/components/pagy_info.rb +0 -8
- data/lib/plutonium/version.rb +1 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b7671d043400785ca24363d24a18b8b4562dfeaf6bf4f9d8cb03ac92dfa17cc
|
4
|
+
data.tar.gz: '092938ea8c152f8505a597db56e20e3ec423fefc3a549eba7437800eccce823e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b409e381c34bf2cede9f71a35652a0357cd78cce109c08b0d2f6f3fa1b5848e63d6da849802b8e84f7d104b0f07d7fc97d9c2d7f4669f8abc8e5b5ae120a1a16
|
7
|
+
data.tar.gz: 0d137d2b3d62b96eff4ad5f550325045b67c6395de74d1f87c5c48eb32ba0514facca68203ad3fedcca3445f1300931e55081de4204386434db40c80dd42d17b
|
@@ -61,36 +61,39 @@ module Plutonium
|
|
61
61
|
input_definition = definition.defined_inputs[name] || {}
|
62
62
|
input_options = input_definition[:options] || {}
|
63
63
|
|
64
|
-
condition = input_options[:condition] || field_options[:condition]
|
65
|
-
return if condition && !instance_exec(&condition)
|
66
|
-
|
67
64
|
tag = input_options[:as] || field_options[:as]
|
68
|
-
tag_attributes =
|
69
|
-
input_options.except(:wrapper, :as, :pre_submit, :condition)
|
65
|
+
tag_attributes = input_options.except(:wrapper, :as, :pre_submit, :condition)
|
70
66
|
if input_options[:pre_submit]
|
71
|
-
tag_attributes[
|
72
|
-
"data-action"
|
73
|
-
] = "change->form#preSubmit"
|
67
|
+
tag_attributes["data-action"] = "change->form#preSubmit"
|
74
68
|
end
|
75
|
-
tag_block =
|
76
|
-
|
77
|
-
|
78
|
-
tag ||= f.inferred_field_component
|
79
|
-
f.send(:"#{tag}_tag", **tag_attributes)
|
80
|
-
end
|
81
|
-
|
82
|
-
wrapper_options = input_options[:wrapper] || {}
|
83
|
-
if !wrapper_options[:class] || !wrapper_options[:class].include?("col-span")
|
84
|
-
# temp hack to allow col span overrides
|
85
|
-
# TODO: remove once we complete theming, which will support merges
|
86
|
-
wrapper_options[:class] = tokens("col-span-full", wrapper_options[:class])
|
69
|
+
tag_block = input_definition[:block] || ->(f) do
|
70
|
+
tag ||= f.inferred_field_component
|
71
|
+
f.send(:"#{tag}_tag", **tag_attributes)
|
87
72
|
end
|
88
73
|
|
89
74
|
field_options = field_options.except(:as, :condition)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
75
|
+
|
76
|
+
condition = input_options[:condition] || field_options[:condition]
|
77
|
+
conditionally_hidden = condition && !instance_exec(&condition)
|
78
|
+
if conditionally_hidden
|
79
|
+
# Do not render the field, but still create field
|
80
|
+
# Phlexi form will record it without rendering it, allowing us to extract its value
|
81
|
+
form.field(name, **field_options) do |f|
|
82
|
+
instance_exec(f, &tag_block)
|
83
|
+
end
|
84
|
+
else
|
85
|
+
wrapper_options = input_options[:wrapper] || {}
|
86
|
+
if !wrapper_options[:class] || !wrapper_options[:class].include?("col-span")
|
87
|
+
# temp hack to allow col span overrides
|
88
|
+
# TODO: remove once we complete theming, which will support merges
|
89
|
+
wrapper_options[:class] = tokens("col-span-full", wrapper_options[:class])
|
90
|
+
end
|
91
|
+
|
92
|
+
render form.field(name, **field_options).wrapped(
|
93
|
+
**wrapper_options
|
94
|
+
) do |f|
|
95
|
+
render instance_exec(f, &tag_block)
|
96
|
+
end
|
94
97
|
end
|
95
98
|
end
|
96
99
|
|
data/lib/plutonium/ui/panel.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Plutonium
|
2
2
|
module UI
|
3
3
|
class Panel < Plutonium::UI::Component::Base
|
4
|
-
include Phlex::DeferredRender
|
5
|
-
|
6
4
|
def initialize
|
7
5
|
@items = []
|
8
6
|
end
|
@@ -19,6 +17,15 @@ module Plutonium
|
|
19
17
|
@content = content
|
20
18
|
end
|
21
19
|
|
20
|
+
def before_template
|
21
|
+
vanish do
|
22
|
+
@items.each do |item|
|
23
|
+
render item
|
24
|
+
end
|
25
|
+
end
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
22
29
|
def view_template
|
23
30
|
wrapped do
|
24
31
|
render_toolbar if render_toolbar?
|
@@ -34,11 +34,6 @@ module Plutonium
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def per_page_selector
|
37
|
-
original_attributes = Phlex::HTML::EVENT_ATTRIBUTES
|
38
|
-
temp_attributes = Phlex::HTML::EVENT_ATTRIBUTES.dup
|
39
|
-
temp_attributes.delete("onchange")
|
40
|
-
Phlex::HTML.const_set(:EVENT_ATTRIBUTES, temp_attributes)
|
41
|
-
|
42
37
|
div(
|
43
38
|
class: "flex items-center space-x-2 mt-2 md:mt-0",
|
44
39
|
data_controller: "select-navigator"
|
@@ -55,9 +50,6 @@ module Plutonium
|
|
55
50
|
end
|
56
51
|
end
|
57
52
|
end
|
58
|
-
ensure
|
59
|
-
# TODO: remove this once Phlex adds support for SafeValues
|
60
|
-
Phlex::HTML.const_set(:EVENT_ATTRIBUTES, original_attributes)
|
61
53
|
end
|
62
54
|
|
63
55
|
def select_classes
|
data/lib/plutonium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plutonium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Froelich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '2.0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '2.0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: phlex-rails
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,58 +196,58 @@ dependencies:
|
|
196
196
|
name: phlexi-form
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 0.9.0
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - "
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 0.9.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: phlexi-table
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 0.1.0
|
216
216
|
type: :runtime
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 0.1.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: phlexi-display
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
|
-
- - "
|
227
|
+
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
229
|
+
version: 0.1.0
|
230
230
|
type: :runtime
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
|
-
- - "
|
234
|
+
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version:
|
236
|
+
version: 0.1.0
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: phlexi-menu
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- - "
|
241
|
+
- - "~>"
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
243
|
+
version: 0.3.0
|
244
244
|
type: :runtime
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- - "
|
248
|
+
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
250
|
+
version: 0.3.0
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: tailwind_merge
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|