bullet_train-themes-light 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/showcase/previews/field_partials/_address_field.html.erb +22 -0
- data/app/views/showcase/previews/field_partials/_dependent_fields_frame.html.erb +45 -0
- data/app/views/showcase/previews/field_partials/attribute_partials/_about_attribute_partials.html.erb +15 -0
- data/app/views/showcase/previews/field_partials/attribute_partials/_address.html.erb +24 -0
- data/lib/bullet_train/themes/light/version.rb +1 -1
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19cf0cf57050e3fe4f12b237b215e54dbe5025297c9e894811be13d286e5188c
|
4
|
+
data.tar.gz: f82cac7ca5945bbc90797c708a281b8000a95cdeacb61be1add1dfb03ca6f5db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70bb2368df9cb120c07e16a40d285966eb3d7ee997c70edb2a6db72491a914e5252302c5791606c929055e726332433d6add89e4fff7c51c3a59a61804261a66
|
7
|
+
data.tar.gz: 6c09b68de9ac5b0c43e8700267c67a6fe71653c8f848ecdf36f8643bcd476ed212f4eefd489e3fc62dd17cca68de92322204ef2258cdee26e6411e96f06a688a
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% showcase.description do %>
|
2
|
+
When you're building forms, use Bullet Train's Field Partials for your form fields. They DRY-up all the presentation logic without needing a third-party dependency like Formtastic.
|
3
|
+
<br/>
|
4
|
+
<br/>
|
5
|
+
Read much more about them in the extensive <a href="https://bullettrain.co/docs/field-partials" target="_blank">developer documentation</a>.
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<% form_with model: Scaffolding::CompletelyConcrete::TangibleThing.new, url: "#" do |form| %>
|
9
|
+
<%
|
10
|
+
form.object.address_value = Address.new
|
11
|
+
%>
|
12
|
+
|
13
|
+
<% showcase.sample "Basic" do %>
|
14
|
+
<%= render 'shared/fields/address_field', form: form, method: :address_value %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%# To display further options use `showcase.options.x` as options with a block will clear the old options. See `_options.html.erb` for an example. %>
|
19
|
+
<% showcase.options do |o| %>
|
20
|
+
<% o.required :form, "Reference to the form object", type: "ActionView::Helpers::FormBuilder" %>
|
21
|
+
<% o.required :method, "Attribute of the model" %>
|
22
|
+
<% end %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<% showcase.description do %>
|
2
|
+
Follows the <a href="/docs/field-partials/dynamic-forms-dependent-fields.md" target="_blank">Dependent Fields Pattern (See developer documentation)</a> to display form fields that depend on the value of another field.
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% form_with model: Scaffolding::CompletelyConcrete::TangibleThing.new, url: "#" do |form| %>
|
6
|
+
<%
|
7
|
+
form.object.boolean_button_value = false
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% showcase.sample "Basic" do %>
|
11
|
+
<%# here we're wrapping the field to trap the `change` event %>
|
12
|
+
<%= tag.div data: {
|
13
|
+
'controller': "dependable",
|
14
|
+
'action': 'change->dependable#updateDependents',
|
15
|
+
'dependable-dependents-selector-value': "##{form.field_id(:button, :dependent_fields)}"
|
16
|
+
} do %>
|
17
|
+
<%= render "shared/fields/buttons",
|
18
|
+
form: form,
|
19
|
+
method: :boolean_button_value,
|
20
|
+
other_options: { label: "Should I present more fields?" } %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= render "shared/fields/dependent_fields_frame",
|
24
|
+
id: form.field_id(:button, :dependent_fields),
|
25
|
+
form: form,
|
26
|
+
dependable_fields: [:boolean_button_value] do %>
|
27
|
+
|
28
|
+
<div class="my-3">
|
29
|
+
<% if form.object.boolean_button_value %>
|
30
|
+
<strong>More fields would be shown here.</strong>
|
31
|
+
<% else %>
|
32
|
+
<em>No fields should be shown here.</em>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<%# To display further options use `showcase.options.x` as options with a block will clear the old options. See `_options.html.erb` for an example. %>
|
41
|
+
<% showcase.options do |o| %>
|
42
|
+
<% o.required :id, "id of the turbo_frame element" %>
|
43
|
+
<% o.required :form, "Reference to the form object", type: "ActionView::Helpers::FormBuilder" %>
|
44
|
+
<% o.required :dependable_fields, "Attributes of the model for the fields on whose values this frame depends", type: "Array" %>
|
45
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% showcase.description do %>
|
2
|
+
Attribute partials are used to display a single attribute of a model, within an `index` table colum or the resource's `show` screen.
|
3
|
+
|
4
|
+
Read more about them and about the form field partials in the extensive <a href="https://bullettrain.co/docs/field-partials" target="_blank">developer documentation</a>.
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<%= partial.body.optional.yield Scaffolding::CompletelyConcrete::TangibleThing.new %>
|
8
|
+
|
9
|
+
|
10
|
+
<%# To display further options use `showcase.options.x` as options with a block will clear the old options. See `_options.html.erb` for an example. %>
|
11
|
+
<% showcase.options do |o| %>
|
12
|
+
<% o.required :object, "Reference to the model object", type: "Object" %>
|
13
|
+
<% o.required :attribute, "Attribute of the model" %>
|
14
|
+
<%= partial.options.optional.yield o %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= render "showcase/previews/field_partials/attribute_partials/about_attribute_partials", showcase: showcase do |partial| %>
|
2
|
+
<% partial.body do |object| %>
|
3
|
+
<% object.address_value = Address.new(
|
4
|
+
country_id: 233,
|
5
|
+
address_one: "2800 East Observatory Road",
|
6
|
+
city: "Los Angeles",
|
7
|
+
region_id: 1416,
|
8
|
+
postal_code: "90027"
|
9
|
+
)
|
10
|
+
%>
|
11
|
+
|
12
|
+
<% showcase.sample "Multi-line" do %>
|
13
|
+
<%= render 'shared/attributes/address', object: object, attribute: :address_value %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% showcase.sample "One-line" do %>
|
17
|
+
<%= render 'shared/attributes/address', object: object, attribute: :address_value, one_line: true %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<% partial.options do |o| %>
|
22
|
+
<% o.optional :one_line, "Render into a single line", type: "Boolean" %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-themes-light
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: masamune-ast
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.2.1
|
55
69
|
description: 'Bullet Train Themes: Light'
|
56
70
|
email:
|
57
71
|
- andrew.culver@gmail.com
|
@@ -133,11 +147,13 @@ files:
|
|
133
147
|
- app/javascript/application.light.js
|
134
148
|
- app/views/showcase/engine/_head.html.erb
|
135
149
|
- app/views/showcase/previews/field_partials/_about_field_partials.erb
|
150
|
+
- app/views/showcase/previews/field_partials/_address_field.html.erb
|
136
151
|
- app/views/showcase/previews/field_partials/_buttons.html.erb
|
137
152
|
- app/views/showcase/previews/field_partials/_cloudinary_image.html.erb
|
138
153
|
- app/views/showcase/previews/field_partials/_color_picker.html.erb
|
139
154
|
- app/views/showcase/previews/field_partials/_date_and_time_field.html.erb
|
140
155
|
- app/views/showcase/previews/field_partials/_date_field.html.erb
|
156
|
+
- app/views/showcase/previews/field_partials/_dependent_fields_frame.html.erb
|
141
157
|
- app/views/showcase/previews/field_partials/_email_field.html.erb
|
142
158
|
- app/views/showcase/previews/field_partials/_emoji_field.html.erb
|
143
159
|
- app/views/showcase/previews/field_partials/_file_field.html.erb
|
@@ -149,6 +165,8 @@ files:
|
|
149
165
|
- app/views/showcase/previews/field_partials/_text_area.html.erb
|
150
166
|
- app/views/showcase/previews/field_partials/_text_field.html.erb
|
151
167
|
- app/views/showcase/previews/field_partials/_trix_editor.html.erb
|
168
|
+
- app/views/showcase/previews/field_partials/attribute_partials/_about_attribute_partials.html.erb
|
169
|
+
- app/views/showcase/previews/field_partials/attribute_partials/_address.html.erb
|
152
170
|
- app/views/showcase/previews/partials/_alert.html.erb
|
153
171
|
- app/views/showcase/previews/partials/_box.html.erb
|
154
172
|
- app/views/showcase/previews/partials/_breadcrumb.html.erb
|