bullet_train-themes-light 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5406556a62531e9774a94096ca32c05fcaf5cb65d08c6cd58a930f832192529
4
- data.tar.gz: d58b25628453a6808437a1b4905bf192e13cfc4926d3ad570cc0b56340db5ef3
3
+ metadata.gz: 89d8d353ebbebe4d434daa7ce82098c4719caf9cacece1f0a059b3cfb6ae3dc6
4
+ data.tar.gz: 6723e251304aee89039b63cdbf5d7a06bb3b6d56e59e02a8cef2369b267bb08b
5
5
  SHA512:
6
- metadata.gz: be6114a7645236ea77d635587a14a9e7aa2f8983c018a720d0a31f491b719f1f9721bedfe2a09456f1d84cc35ecbb59e1cf8b74fe5379e74e4a92c72a7ce73c0
7
- data.tar.gz: 53ffafd2d0b9749e64964cadb05efa8aca4b89e0a0c76ad2ad7c845a34b7927fd1f01f11c8098ceed38fb127ff2ad99b7685070ae840139078c5103752deb9c5
6
+ metadata.gz: d1126a39d7d33624ff8a664389880f028b406bd92151647ae084a14358432513ccb2f73a6bd0f9e9d8767adf30cb8c76b530f3a5014c017bb19c3257bdddca47
7
+ data.tar.gz: '06670948f0906c2405f0b58893f3ef746d44f7d8e32e8056df27da69b4d14a12bf6247fc18b67af66dd633dee7e8ee349ff4717b2bbb3428d149a62f557f1d50'
@@ -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 %>
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.5.1"
4
+ VERSION = "1.5.2"
5
5
  end
6
6
  end
7
7
  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.5.1
4
+ version: 1.5.2
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-02 00:00:00.000000000 Z
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -133,11 +133,13 @@ files:
133
133
  - app/javascript/application.light.js
134
134
  - app/views/showcase/engine/_head.html.erb
135
135
  - app/views/showcase/previews/field_partials/_about_field_partials.erb
136
+ - app/views/showcase/previews/field_partials/_address_field.html.erb
136
137
  - app/views/showcase/previews/field_partials/_buttons.html.erb
137
138
  - app/views/showcase/previews/field_partials/_cloudinary_image.html.erb
138
139
  - app/views/showcase/previews/field_partials/_color_picker.html.erb
139
140
  - app/views/showcase/previews/field_partials/_date_and_time_field.html.erb
140
141
  - app/views/showcase/previews/field_partials/_date_field.html.erb
142
+ - app/views/showcase/previews/field_partials/_dependent_fields_frame.html.erb
141
143
  - app/views/showcase/previews/field_partials/_email_field.html.erb
142
144
  - app/views/showcase/previews/field_partials/_emoji_field.html.erb
143
145
  - app/views/showcase/previews/field_partials/_file_field.html.erb
@@ -149,6 +151,8 @@ files:
149
151
  - app/views/showcase/previews/field_partials/_text_area.html.erb
150
152
  - app/views/showcase/previews/field_partials/_text_field.html.erb
151
153
  - app/views/showcase/previews/field_partials/_trix_editor.html.erb
154
+ - app/views/showcase/previews/field_partials/attribute_partials/_about_attribute_partials.html.erb
155
+ - app/views/showcase/previews/field_partials/attribute_partials/_address.html.erb
152
156
  - app/views/showcase/previews/partials/_alert.html.erb
153
157
  - app/views/showcase/previews/partials/_box.html.erb
154
158
  - app/views/showcase/previews/partials/_breadcrumb.html.erb