Sha256: 9c159a8e751429d807a395fa336492dbf9eb3fa72e9ce546c03c855a84719955

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] ||= form.field_id(method)
options[:class] = "form-control single-daterange w-full border-gray-300 dark:bg-darkPrimary-800 dark:border-darkPrimary-900 #{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 top-1 md:top-0.5 right-0.5"
        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.2.10 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.9 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.8 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.7 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.6 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.5 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.4 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.3 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.2 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.1 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.2.0 app/views/themes/tailwind_css/fields/_date_field.html.erb
bullet_train-themes-tailwind_css-1.0.17 app/views/themes/tailwind_css/fields/_date_field.html.erb