bullet_train-themes-tailwind_css 1.0.16 → 1.0.17
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/app/views/themes/tailwind_css/attributes/_code.html.erb +22 -0
- data/app/views/themes/tailwind_css/fields/_date_and_time_field.html.erb +1 -2
- data/app/views/themes/tailwind_css/fields/_date_field.html.erb +1 -2
- data/app/views/themes/tailwind_css/fields/_field.html.erb +1 -1
- data/app/views/themes/tailwind_css/fields/_options.html.erb +68 -4
- data/lib/bullet_train/themes/tailwind_css/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: df4824a09243ac29b8377c9e8c01402c5863131cced94ea333ba1f04e93258b6
         | 
| 4 | 
            +
              data.tar.gz: 369356de00d7943e376f1c66b343ed247307d500392529f8d32f54356e7336c7
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 187f9a6fe3e32832fb25da2607daa7b756131cdbde2a20e195afb26d8511d63ce8e875dda676d7862f5c004f29fd734d5b0db2b5101bb4c7b2457b6311391ce2
         | 
| 7 | 
            +
              data.tar.gz: cfed613e0e0932759716dbeeb88d91536387edf510270b32a816cfa9ed9374a3f7cffc8968d3d18f5a4b700b7b0ff26f82ef5f3cf8ec59f8d4e1bfb1a8d04a43
         | 
| @@ -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 %>…<% 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 | 
            -
                 | 
| 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, { | 
| 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 | 
            -
             | 
| 108 | 
            +
             | 
| 109 | 
            +
                <% end %>
         | 
| 46 110 | 
             
              <% end %>
         | 
| 47 111 | 
             
            <% 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. | 
| 4 | 
            +
              version: 1.0.17
         | 
| 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- | 
| 11 | 
            +
            date: 2022-12-03 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
         |