Sha256: 1c18019604edb08d2a0cd513a60612b5cfdf01c64f847d3fef273e7332f6f743

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

<% yield %>

<%
stimulus_controller = 'fields--date'

form ||= current_fields_form
options ||= {}
options[:id] ||= id_for(form, method)
options[:class] = "form-control single-daterange w-full border-gray-300 dark:bg-sealBlue-300 dark:border-sealBlue-100 #{options[:class]}".strip
options[:value] = form.object.send(method)&.strftime(t('global.formats.date'))
options = options.merge({ data: {"#{stimulus_controller}-target": 'field' }})
other_options ||= {}

%>

<%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
  <% content_for :field do %>
    <div class="date-input relative" data-controller="<%= stimulus_controller %>">
      <%= form.text_field method, options %>
      <% unless options[:disabled] %>
      <button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md"
        style="top: 2px; right: 2px;"
        data-<%= stimulus_controller %>-target="clearButton"
        data-action="<%= stimulus_controller %>#clearDate"
      >
        <i class="leading-4 text-lg ti ti-trash dark:text-blue-500"></i>
      </button>
      <% end %>
    </div>
  <% end %>
<% end %>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bullet_train-themes-tailwind_css-1.0.11 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.10 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.9 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.8 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.7 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.6 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.5 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.4 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.3 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.2 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.1 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.0 app/views/themes/tailwind_css/fields/_date_field.html.erb