Sha256: 6a7c7188999f58cdfc816713a7280de30968d7598f4d37e4f8c428c659ca8dc1

Contents?: true

Size: 962 Bytes

Versions: 8

Compression:

Stored size: 962 Bytes

Contents

<%= field_wrapper **field_wrapper_args 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: disabled?,
    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

8 entries across 8 versions & 1 rubygems

Version Path
avo-2.23.2 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.23.1 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.23.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.22.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.21.3.pre.pr1489 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.21.2.pre.pr1486 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.21.1.pre.pr1484 app/components/avo/fields/progress_bar_field/edit_component.html.erb
avo-2.21.0 app/components/avo/fields/progress_bar_field/edit_component.html.erb