bullet_train-themes-tailwind_css 1.2.21 → 1.2.22

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: 4568a7ffc50e2170d5b3bc556221cd91404f763fe8059601584ec4c4c0022930
4
- data.tar.gz: ca52b1f46ef092a050faf52154ec17f6f169e32c883873a0ca0b25ac1e6185ae
3
+ metadata.gz: 0dfdc37f0d9dc9a03f3be223f4e135e8d25199f0a9fb7fe86901ccc3467db132
4
+ data.tar.gz: 1ee9ca86d1848f25bb3eacb691fb0dfd2c47b833f4b615ae096685c865d27624
5
5
  SHA512:
6
- metadata.gz: b7db098f94c09ea6bcb8a36d60d5bdad458b22d6c2eaf8a7558d91bc0f7cb206e387cce9588e59451d642f76156cecf878fb9eac4be6380423fb4ebe0a7b02fc
7
- data.tar.gz: 57788d376bd800840075cc1fd8c6154a9a99f7b1480856469fdfc4c143180238d52a71ec7e2d8f62c71c182ef129985863ecda58d3d10a8f2cd3209728c2d578
6
+ metadata.gz: 9488edcdce37d06b4f9cc7d966a6faaef29ae9155f59a66e09468e10d8d7b2acee71610752a1286520627916d572daf2a74f5cf5ca7344d4c98e156dc0cc4cdf
7
+ data.tar.gz: 41e651885bb3bd26d9166ee8e3005dfb85858f0e748523633ea44456efca998ccc15ed06da6604acb3dfbe537d53b390d110b68ebb26d0b14507859591cc2297
@@ -0,0 +1,56 @@
1
+ <% yield %>
2
+
3
+ <%
4
+ form ||= current_fields_form
5
+ single_check_box ||= false
6
+ multiple ||= false
7
+ option_field_options ||= {}
8
+ append_class ||= ''
9
+ labels = labels_for(form, method) if form
10
+
11
+ # Since we don't know at this point which tag we'll be using, we specify
12
+ # the class only once here for simplicity and apply it to one of the following tags:
13
+ # 1. form.check_box
14
+ # 2. check_box
15
+ # 4. form.radio_button
16
+ #
17
+ # the `append_class` local can be used to append any other styles desired for the element.
18
+ option_field_options[:class] ||= "focus:ring-blue h-4 w-4 text-blue border-slate-300 dark:bg-slate-800 dark:border-slate-900 #{"rounded" if multiple || single_check_box}"
19
+ option_field_options[:class] += " #{append_class}"
20
+ %>
21
+
22
+ <% if single_check_box %>
23
+ <% if form %>
24
+ <div class="flex items-center">
25
+ <%= form.check_box method, option_field_options %>
26
+ <%= form.label method, class: 'ml-2' %>
27
+ </div>
28
+ <% else %>
29
+ <% value = option_field_options.delete(:value) %>
30
+ <% checked = option_field_options.delete(:checked) %>
31
+ <%= check_box_tag method, value, checked, option_field_options %>
32
+ <% end %>
33
+ <% else %>
34
+ <% options.each do |value, label| %>
35
+ <label class="relative flex items-start mb-3">
36
+ <div class="flex items-center h-5">
37
+ <% if multiple %>
38
+ <% checked_value = form.object.send(method).nil? ? nil : form.object.send(method).map(&:to_s).include?(value.to_s) %>
39
+ <%= form.check_box method, {
40
+ multiple: multiple, checked: checked_value, data: option_field_options[:data], class: option_field_options[:class]
41
+ }, value, "" %>
42
+ <% else %>
43
+ <%= form.radio_button method, value, {class: option_field_options[:class]} %>
44
+ <% end %>
45
+ </div>
46
+ <div class="ml-2.5 text-sm">
47
+ <div class="select-none"><%= label %></div>
48
+ <% if labels.options_help&.dig(value)&.present? %>
49
+ <p class="mt-0.5 text-xs text-slate-500">
50
+ <%= labels.options_help.dig(value) %>
51
+ </p>
52
+ <% end %>
53
+ </div>
54
+ </label>
55
+ <% end %>
56
+ <% end %>
@@ -27,6 +27,10 @@ end
27
27
 
28
28
  %>
29
29
 
30
+ <%#
31
+ # TODO: We should either remove this, or move the Action Models `bulk_action_select`
32
+ # partial here to bullet_train-core because this cannot work with the setup we currently have.
33
+ %>
30
34
  <% if multiple && (show_select_all_top || show_select_all_bottom) %>
31
35
  <% select_all = capture do %>
32
36
  <div class="flex">
@@ -71,35 +75,7 @@ end
71
75
  <% end %>
72
76
 
73
77
  <%= tag.div class: ["max-w-lg": !use_columns, "max-w-3xl": use_columns, "columns-[var(--column-width,_15ch)_3]": use_columns] do %>
74
-
75
- <% options.each do |value, label| %>
76
-
77
- <label class="relative flex items-start mb-3">
78
- <div class="flex items-center h-5">
79
-
80
- <% if multiple %>
81
- <% checked_value = form.object.send(method).nil? ? nil : form.object.send(method).map(&:to_s).include?(value.to_s) %>
82
- <%= form.check_box method, {
83
- multiple: multiple, checked: checked_value,
84
- data: option_field_options[:data],
85
- class: "focus:ring-blue h-4 w-4 text-blue border-slate-300 rounded"
86
- }, value, "" %>
87
- <% else %>
88
- <%= form.radio_button method, value, {class: "focus:ring-blue h-4 w-4 text-blue border-slate-300", data: option_field_options[:data]} %>
89
- <% end %>
90
-
91
- </div>
92
- <div class="ml-2.5 text-sm">
93
- <div class="select-none"><%= label %></div>
94
- <% if labels.options_help&.dig(value)&.present? %>
95
- <p class="mt-0.5 text-xs text-slate-500">
96
- <%= labels.options_help.dig(value) %>
97
- </p>
98
- <% end %>
99
- </div>
100
- </label>
101
-
102
- <% end %>
78
+ <%= render 'shared/fields/option', method: method, form: form, option_field_options: option_field_options, multiple: multiple, options: options %>
103
79
  <% end %>
104
80
 
105
81
  <% if multiple && !show_select_all_top && show_select_all_bottom %>
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module TailwindCss
4
- VERSION = "1.2.21"
4
+ VERSION = "1.2.22"
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-tailwind_css
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.21
4
+ version: 1.2.22
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-03-11 00:00:00.000000000 Z
11
+ date: 2023-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -88,6 +88,7 @@ files:
88
88
  - app/views/themes/tailwind_css/fields/_date_field.html.erb
89
89
  - app/views/themes/tailwind_css/fields/_field.html.erb
90
90
  - app/views/themes/tailwind_css/fields/_file_field.html.erb
91
+ - app/views/themes/tailwind_css/fields/_option.html.erb
91
92
  - app/views/themes/tailwind_css/fields/_options.html.erb
92
93
  - app/views/themes/tailwind_css/limits/_form.html.erb
93
94
  - app/views/themes/tailwind_css/limits/_index.html.erb
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  - !ruby/object:Gem::Version
118
119
  version: '0'
119
120
  requirements: []
120
- rubygems_version: 3.4.1
121
+ rubygems_version: 3.3.7
121
122
  signing_key:
122
123
  specification_version: 4
123
124
  summary: Bullet Train Themes Tailwind CSS Base