Sha256: f923b13a52f328b066d505d3a3d65d5d9b6da88912373e0b60f353afc7980d38

Contents?: true

Size: 1.8 KB

Versions: 106

Compression:

Stored size: 1.8 KB

Contents

<div class="w-full shadow-lg rounded-lg overflow-hidden"
  data-controller="key-value"
  data-key-value-target="controller"
  data-options="<%= @field.options.to_json %>"
  data-input-classes="<%= input_classes %>"
  data-editable="<%= @view.in?([:edit, :create]) %>"
>
  <div class="w-full flex flex-col">
    <div class="flex w-full">
      <div class="flex w-full bg-gray-800 shadow overflow-hidden">
        <div class="w-1/2 py-3 px-3 uppercase font-semibold text-xs text-white border-gray-600 border-r">
          <%= @field.key_label %>
        </div>
        <div class="w-1/2 py-3 px-3 uppercase font-semibold text-xs text-white">
          <%= @field.value_label %>
        </div>
        <% if @view.in?([:edit, :create]) %>
          <div class="flex items-center justify-center p-2 px-3 border-l border-gray-600">
            <a href="javascript:void(0);"
              title="<%= @field.action_text %>"
              data-tippy="tooltip"
              data-button="add-row"
              data-action="click->key-value#addRow"
              <% if @field.disable_adding_rows %>
                class="cursor-not-allowed"
              <% end %>
            >
              <%= svg 'plus-circle', class: 'text-gray-400 h-5 hover:text-gray-500' %>
            </a>
          </div>
        <% end %>
      </div>
    </div>
    <div data-key-value-target="rows"></div>
  </div>
  <% if @form.present? %>
    <%= @form.text_area @field.id,
      value: @field.parsed_value,
      class: 'hidden',
      placeholder: @field.placeholder,
      'data-key-value-target': 'input',
      'data-view': :edit
    %>
  <% else %>
    <%= text_area_tag @field.id,
      @field.parsed_value,
      class: 'hidden',
      placeholder: @field.placeholder,
      'data-key-value-target': 'input',
      'data-view': :edit
    %>
  <% end %>
</div>

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
avo-1.25.2 app/components/avo/fields/common/key_value_component.html.erb
avo-1.25.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.25.0 app/components/avo/fields/common/key_value_component.html.erb
avo-1.24.2 app/components/avo/fields/common/key_value_component.html.erb
avo-1.24.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.24.0 app/components/avo/fields/common/key_value_component.html.erb
avo-1.23.0 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.4 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.3 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.2 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.1.pre.2 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.1.pre.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.0 app/components/avo/fields/common/key_value_component.html.erb
avo-1.22.0.pre.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.21.1.pre.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.21.0 app/components/avo/fields/common/key_value_component.html.erb
avo-1.20.2.pre.2 app/components/avo/fields/common/key_value_component.html.erb
avo-1.20.2.pre.1 app/components/avo/fields/common/key_value_component.html.erb
avo-1.21.0.pre.1 app/components/avo/fields/common/key_value_component.html.erb