bullet_train-themes-tailwind_css 1.0.16 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65708a84e9d1a826988f78fd208613c052f98d3e2fb13d361682f6646a7b55b9
4
- data.tar.gz: 35fa6c1277a50dde8542cc4d089cd7811cc7b28a8fd6a6b90ddce59df33768bb
3
+ metadata.gz: b98df2b9a5386e09f0aca04bcbe7010dc5c644efcf589ee826ca92ae5a63eea3
4
+ data.tar.gz: 9c2220277ae8d3129e3dbc47d0471b888fbed6f756bef905c365f74ccb85953c
5
5
  SHA512:
6
- metadata.gz: b9a8d76316a06e849697378df0970dc194d6a7f3646da5b98ea9a611d452c13ff9999374e287625438936e6ce3c241603f969161984e971ce1bb5585de3a6e9d
7
- data.tar.gz: 80b46ba2045cebd8dd5ceb001934ee95060d074eeec43d78bfed2db847b4752062cd6c3d82ef474bb3ec9967981a95f126cd670535673c86d5088bd0f5b55a9c
6
+ metadata.gz: 2d538557074892cb36ba7932795b59dd0e744522bbff78d16c3a471ece8503475db26ae79dbbdc7b3d80993a5deb176ed837332b290cba98ea5aaf97a29dafbf
7
+ data.tar.gz: b6a71a8e9c454aec0f3bd2b5146f4f21c22dfceffe7912b9fdcb90ece2213a01042e3b340d9e3cf24323487f2117be385d73d95b25302e3bfad4a8bd6a1f99a8
@@ -0,0 +1,22 @@
1
+ <% object ||= current_attributes_object %>
2
+ <% strategy ||= current_attributes_strategy || :none %>
3
+ <% source ||= nil %>
4
+ <% url ||= nil %>
5
+ <% secret ||= false %>
6
+ <% if object.send(attribute).present? %>
7
+ <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
8
+ <% if secret && source.nil? %>
9
+ <% attribute = object.send(attribute) %>
10
+ <% attribute_short = attribute[0..4] %>
11
+ <div class="flex flex-row">
12
+ <details class="group peer order-2">
13
+ <summary class="list-none text-xs text-primary-500 dark:text-darkAccent-200 hover:text-primary-600 hover:underline group-open:hidden cursor-pointer">Show</summary>
14
+ <code class="text-pink-600 font-light"><%= attribute %></code>
15
+ </details>
16
+ <code class="order-1 mr-2 peer-open:hidden text-pink-600 font-light"><%= attribute_short %><% if attribute_short.length < attribute.length %>&hellip;<% end %></code>
17
+ </div>
18
+ <% else %>
19
+ <code class="text-pink-600 font-light"><%= object.send(source || attribute) %></code>
20
+ <% end %>
21
+ <% end %>
22
+ <% end %>
@@ -15,8 +15,7 @@ other_options ||= {}
15
15
  <div class="date-input relative" data-controller="fields--date" data-fields--date-include-time-value="true" data-fields--date-default-time-zones-value="<%= "[\"#{current_user.current_team.time_zone}\",\"#{current_user.time_zone}\"]" %>">
16
16
  <%= form.text_field method, options %>
17
17
  <% unless options[:disabled] %>
18
- <button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md"
19
- style="top: 2px; right: 2px;"
18
+ <button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md top-1 md:top-0.5 right-0.5"
20
19
  data-fields--date-target="clearButton"
21
20
  data-action="fields--date#clearDate"
22
21
  >
@@ -18,8 +18,7 @@ other_options ||= {}
18
18
  <div class="date-input relative" data-controller="<%= stimulus_controller %>">
19
19
  <%= form.text_field method, options %>
20
20
  <% unless options[:disabled] %>
21
- <button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md"
22
- style="top: 2px; right: 2px;"
21
+ <button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md top-1 md:top-0.5 right-0.5"
23
22
  data-<%= stimulus_controller %>-target="clearButton"
24
23
  data-action="<%= stimulus_controller %>#clearDate"
25
24
  >
@@ -14,7 +14,7 @@ other_options[:help] = [other_options[:help], labels.help].compact.join(" ")
14
14
  errors = [method, method.to_s.gsub(/_id$/, '').to_sym].uniq.map { |attribute| form.object.errors.full_messages_for(attribute) }.flatten
15
15
  has_errors = errors.any? || content_for(:error).present? || other_options[:error].present?
16
16
 
17
- options[:class] = "#{options[:class]} block w-full rounded-md shadow-sm font-light text-sm"
17
+ options[:class] = "#{options[:class]} block w-full rounded-md shadow-sm font-light text-base md:text-sm"
18
18
 
19
19
  options[:class] += if has_errors
20
20
  " pr-10 border-red text-red-darker placeholder-red focus:outline-none focus:ring-red focus:border-red"
@@ -5,15 +5,71 @@ form ||= current_fields_form
5
5
  html_options ||= {}
6
6
  html_options[:id] ||= form.field_id(method)
7
7
  multiple ||= false
8
+ show_select_all_top ||= false
9
+ show_select_all_bottom ||= false
8
10
  use_columns ||= false
9
11
  other_options ||= {}
10
12
  options ||= options_for(form, method)
11
13
  labels = labels_for(form, method)
14
+
15
+ option_field_options ||= {}
16
+ option_field_options[:data] ||= {}
17
+ option_field_options[:data][:controller] ||= ""
18
+ option_field_options[:data][:controller] += " fields--field"
19
+
20
+ if multiple
21
+ option_field_options[:data] = option_field_options[:data].merge({
22
+ "select-all-target": 'checkbox'
23
+ })
24
+ option_field_options[:data][:action] ||= ""
25
+ option_field_options[:data][:action] += " select-all#updateToggle"
26
+ end
27
+
12
28
  %>
13
29
 
30
+ <% if multiple && (show_select_all_top || show_select_all_bottom) %>
31
+ <% select_all = capture do %>
32
+ <div class="flex">
33
+ <%= tag.div class: [
34
+ "hidden",
35
+ "inline-block dark:border-darkPrimary-600",
36
+ "border-b pb-4 mb-4": show_select_all_top && !show_select_all_bottom,
37
+ "border-t pt-4 mt-4": !show_select_all_top && show_select_all_bottom
38
+ ], data: {
39
+ "select-all-target": "wrapper"
40
+ } do %>
41
+ <label class="relative flex items-start">
42
+ <div class="flex items-center h-5">
43
+ <%= check_box_tag "#{html_options[:id]}-select_all", 'select-all', false, data: {
44
+ "select-all-target": 'toggleCheckbox',
45
+ 'action': "select-all#selectAllOrNone"
46
+ }, class: "focus:ring-blue h-4 w-4 text-blue border-gray-300 rounded" %>
47
+ </div>
48
+ <div class="ml-2.5 text-sm pr-4">
49
+ <%# TODO: should be localized %>
50
+ All
51
+ </div>
52
+ </label>
53
+ <% end %>
54
+ <% if content_for? :actions_on_multiple %>
55
+ <%= yield :actions_on_multiple %>
56
+ <% flush_content_for :actions_on_multiple %>
57
+ <% end %>
58
+ </div>
59
+ <% end %>
60
+ <% end %>
61
+
14
62
  <%= render 'shared/fields/field', form: form, method: method, options: html_options, other_options: other_options do %>
15
63
  <% content_for :field do %>
16
- <div class="pt-1.5 pb-1 sm:col-span-2">
64
+ <%= tag.div class: "pt-1.5 pb-1 sm:col-span-2", data: {
65
+ controller: "select-all",
66
+ "select-all-unavailable-class": "hidden"
67
+ } do %>
68
+
69
+ <% if multiple && show_select_all_top && !show_select_all_bottom %>
70
+ <%= select_all %>
71
+ <% end %>
72
+
17
73
  <%= tag.div class: ["max-w-lg": !use_columns, "max-w-3xl": use_columns, "columns-[var(--column-width,_15ch)_3]": use_columns] do %>
18
74
 
19
75
  <% options.each do |value, label| %>
@@ -23,9 +79,13 @@ labels = labels_for(form, method)
23
79
 
24
80
  <% if multiple %>
25
81
  <% checked_value = form.object.send(method).nil? ? nil : form.object.send(method).map(&:to_s).include?(value.to_s) %>
26
- <%= form.check_box method, {multiple: multiple, checked: checked_value, class: "focus:ring-blue h-4 w-4 text-blue border-gray-300 rounded"}, value, "" %>
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-gray-300 rounded"
86
+ }, value, "" %>
27
87
  <% else %>
28
- <%= form.radio_button method, value, {class: "focus:ring-blue h-4 w-4 text-blue border-gray-300"} %>
88
+ <%= form.radio_button method, value, {class: "focus:ring-blue h-4 w-4 text-blue border-gray-300", data: option_field_options[:data]} %>
29
89
  <% end %>
30
90
 
31
91
  </div>
@@ -40,8 +100,12 @@ labels = labels_for(form, method)
40
100
  </label>
41
101
 
42
102
  <% end %>
103
+ <% end %>
43
104
 
105
+ <% if multiple && !show_select_all_top && show_select_all_bottom %>
106
+ <%= select_all %>
44
107
  <% end %>
45
- </div>
108
+
109
+ <% end %>
46
110
  <% end %>
47
111
  <% end %>
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module TailwindCss
4
- VERSION = "1.0.16"
4
+ VERSION = "1.2.0"
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.0.16
4
+ version: 1.2.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: 2022-09-17 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -79,6 +79,7 @@ files:
79
79
  - Rakefile
80
80
  - app/assets/config/bullet_train_themes_tailwind_css_manifest.js
81
81
  - app/views/themes/tailwind_css/attributes/_attempt.html.erb
82
+ - app/views/themes/tailwind_css/attributes/_code.html.erb
82
83
  - app/views/themes/tailwind_css/attributes/_file.erb
83
84
  - app/views/themes/tailwind_css/fields/_buttons.html.erb
84
85
  - app/views/themes/tailwind_css/fields/_cloudinary_image.html.erb