Sha256: cefe4a7ff6a5baa5960a6f7aaf5979c2e49b4af50c84fe44ab25ed341925aed6

Contents?: true

Size: 1.04 KB

Versions: 28

Compression:

Stored size: 1.04 KB

Contents

<%= edit_field_wrapper field: @field, index: @index, form: @form, resource: @resource, displayed_in_modal: @displayed_in_modal do %>
  <% if @field.display_value %>
    <div class="text-center text-sm font-semibold w-full leading-none mb-1">
      <span class="js-progress-bar-value-<%= @field.id %>"><%= @field.value %></span><%= @field.value_suffix if @field.value_suffix.present? %>
    </div>
  <% end %>
  <%= @form.range_field @field.id,
    class: "w-full #{@field.get_html(:classes, view: view, element: :input)}",
    data: @field.get_html(:data, view: view, element: :input),
    disabled: @field.is_readonly?,
    max: @field.max,
    min: 0,
    placeholder: @field.placeholder,
    step: @field.step,
    style: @field.get_html(:style, view: view, element: :input)
  %>
<% end %>


<script>
var input = document.getElementById('project_progress');
var log = document.querySelector('.js-progress-bar-value-<%= @field.id %>');

input.addEventListener('input', updateValue);

function updateValue(e) {
  log.textContent = e.target.value;
}
</script>

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
avo-2.16.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.3 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.2 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.2.pre.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.15.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.7.polytranslations1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.6.nosprockets app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.5.nosprockets app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.4.tosqlfix app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.3.jsbundling app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.2.tailwindcss app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.3.pre.1.branding app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.2 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.2.pre.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.1.pre.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.14.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.13.6.pre.2 app/components/avo/fields/progress_bar_field/edit_component.html.erb