polaris_view_components 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fd2fd11147a8e4f4c0c39f8e567b484dfdac837660640c9697a3d300ffed822
4
- data.tar.gz: 6f11dfdf4faac0d1c0b569491158fdc70d1adc8e5511f85f1d34affc8faa4a25
3
+ metadata.gz: 5c816d01eaed92bdee76c9de459b95efeda2e0fa0b1fa4d39148539aff992c92
4
+ data.tar.gz: 30f8addff41d9e27c1a16cc6501d6e3ef7b63e7fe2873fd4cac8bc771651894f
5
5
  SHA512:
6
- metadata.gz: 0c2ed4c3876d591180a38a3fc7c8f37d5b1cb5c64d285ddcec8aeb49bd605e393e97ace40bd837318dd3f475bc0c2494ec21059614f7a956b91a965c46154304
7
- data.tar.gz: 4bb24a5bad104edf4b32b646d95152e4661684ad5a7fad33f28aaf2328eceb89f00354c4f740fe303bdb743a72cff9e7fbab941be5f7113e5fa7286ec1dd7016
6
+ metadata.gz: 8ed315b60b6b900c39ca638582d47cbd47c0ff12d75af47f35cbeb4c707176fbba7259acc27148e2d3fdff3204205dc62b61ee40c6d9bc2ba5dc8a23346117a1
7
+ data.tar.gz: a40315f3b3b5dbe98120e616513290e043280896f6ab73b0f1747cce612d19061240e7c62aee7db24820f2430bd2eb961cb9eff3b631bae8e4f24f8c4cd93689
@@ -1,21 +1,25 @@
1
1
  <%= render Polaris::BaseComponent.new(**system_arguments) do %>
2
- <div class="Polaris-IndexTable-ScrollContainer">
3
- <table class="Polaris-IndexTable__Table">
4
- <thead>
5
- <tr>
6
- <% columns.each_with_index do |column, index| %>
7
- <th class="Polaris-IndexTable__TableHeading">
8
- <%= column.title %>
9
- </th>
10
- <% end %>
11
- </tr>
12
- </thead>
13
- <tbody>
14
- <% @data.each do |row| %>
15
- <%= render Polaris::BaseComponent.new(**row_arguments(row)) do %>
2
+ <% if @data.empty? %>
3
+ <%= empty_state %>
4
+ <% else %>
5
+ <div class="Polaris-IndexTable-ScrollContainer">
6
+ <table class="Polaris-IndexTable__Table">
7
+ <thead>
8
+ <tr>
16
9
  <% columns.each_with_index do |column, index| %>
17
- <%= render_cell(flush: column.flush, **column.system_arguments) do %>
18
- <%= column.call(row) %>
10
+ <th class="Polaris-IndexTable__TableHeading">
11
+ <%= column.title %>
12
+ </th>
13
+ <% end %>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <% @data.each do |row| %>
18
+ <%= render Polaris::BaseComponent.new(**row_arguments(row)) do %>
19
+ <% columns.each_with_index do |column, index| %>
20
+ <%= render_cell(flush: column.flush, **column.system_arguments) do %>
21
+ <%= column.call(row) %>
22
+ <% end %>
19
23
  <% end %>
20
24
  <% end %>
21
25
  <% end %>
@@ -3,6 +3,7 @@ module Polaris
3
3
  renders_many :columns, ->(title, **system_arguments, &block) do
4
4
  IndexTable::ColumnComponent.new(title, **system_arguments, &block)
5
5
  end
6
+ renders_one :empty_state
6
7
 
7
8
  def initialize(data, **system_arguments)
8
9
  @data = data
@@ -54,7 +54,7 @@ module Polaris
54
54
  if options[:error_hidden] && options[:error]
55
55
  options[:error] = !!options[:error]
56
56
  end
57
- render Polaris::TextFieldComponent.new(form: self, attribute: method, **options, &block)
57
+ render Polaris::TextFieldComponent.new(form: self, attribute: method, **options), &block
58
58
  end
59
59
 
60
60
  def polaris_select(method, **options, &block)
@@ -103,6 +103,7 @@ module Polaris
103
103
  if value.present?
104
104
  options[:selected] = value.map { |el| el.public_send(value_method) }
105
105
  end
106
+ input_options = options.delete(:input_options) || {}
106
107
 
107
108
  render Polaris::ChoiceListComponent.new(
108
109
  form: self,
@@ -113,7 +114,11 @@ module Polaris
113
114
  &block
114
115
  ) do |choice|
115
116
  collection.each do |item|
116
- choice.with_checkbox(label: item.public_send(text_method), value: item.public_send(value_method))
117
+ choice.with_checkbox(
118
+ label: item.public_send(text_method),
119
+ value: item.public_send(value_method),
120
+ input_options: input_options
121
+ )
117
122
  end
118
123
  end
119
124
  end
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "2.2.4"
3
+ VERSION = "2.2.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gamble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-23 00:00:00.000000000 Z
12
+ date: 2024-12-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails