tybo 0.0.31 → 0.0.32

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: 6ac439377b1ab67c01d268ccf0f990c2a14346ec8ff76d6bdc5edd0aab15f60c
4
- data.tar.gz: f64462c5493126d3eec82f0b3644d1ffa7462d29fdc30ef56098df2622976749
3
+ metadata.gz: 820a3568bdf02ff7722f5d5b7e31a76dbc2da30de5ef47002f84a93e0a9d11f0
4
+ data.tar.gz: 3c0aacd3db2708b759960999d2c6f05edae6116cea7283e049a96a4cadcff048
5
5
  SHA512:
6
- metadata.gz: 8dbddf0cf8650483c3d19e1dcd0259545b8fc3e265455c440ad5f02be4649db7a74e6e51df6007e40c0376aed1ed01aa2d2cbdd834c84d7b88931538a3f578f8
7
- data.tar.gz: fae3b6eaf3afd0e1fd56fa55f83c905f7e18ea458ade1892ba8f351426fc2d2de61bb6267ca1d847e0ac905ed114a14aa5108ec1883177e36f2a368b4708b3bf
6
+ metadata.gz: c48320ea3af74d67e8e059c3bda0ca72de0830f9ab370b662c9036d118b817a15a3c7f83950f23157a522ec8bcd8396cac9a54dd5b13d54d36437d9f61fab36b
7
+ data.tar.gz: 4428949fbe3ce2f526d10ca3f2601ff9d59bd74316a25666a557b29a6f63e0c02065c0ef323d3727a690681bfea398c5e30686927bbd95a322035a8d0c8d9794
@@ -0,0 +1,8 @@
1
+ <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
2
+ <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
3
+ <%= @label %>
4
+ </label>
5
+ <div class="mt-1 sm:col-span-2 sm:mt-0">
6
+ <%= content %>
7
+ </div>
8
+ </div>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Forms
3
+ class SearchInputComponent < ViewComponent::Base
4
+ def initialize(label:)
5
+ @label = label
6
+ end
7
+ end
8
+ end
@@ -14,23 +14,13 @@
14
14
  <%- type.second.sort_by(&:type).each do |col| -%>
15
15
  <%- next if bo_model.reflect_on_all_associations.map(&:foreign_key).include?(col.name) -%>
16
16
  <%- if col.type == :string || col.type == :text -%>
17
- <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
18
- <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
19
- <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
20
- </label>
21
- <div class="mt-1 sm:col-span-2 sm:mt-0">
22
- <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
23
- </div>
24
- </div>
17
+ <%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
18
+ <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
19
+ <%% end %>
25
20
  <%- elsif col.type ==:integer -%>
26
- <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
27
- <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
28
- <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
29
- </label>
30
- <div class="mt-1 sm:col-span-2 sm:mt-0">
31
- <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
32
- </div>
33
- </div>
21
+ <%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
22
+ <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
23
+ <%% end %>
34
24
  <%- elsif col.type == :boolean -%>
35
25
  <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
36
26
  <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = '0.0.31'
2
+ VERSION = '0.0.32'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tybo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Delpierre
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '7.0'
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 7.0.4.1
23
+ version: 7.0.4.3
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '7.0'
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 7.0.4.1
33
+ version: 7.0.4.3
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: puma
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -153,6 +153,8 @@ files:
153
153
  - app/components/forms/has_many_form_component.rb
154
154
  - app/components/forms/has_one_form_component.html.erb
155
155
  - app/components/forms/has_one_form_component.rb
156
+ - app/components/forms/search_input_component.html.erb
157
+ - app/components/forms/search_input_component.rb
156
158
  - app/components/forms/submit_button_component.html.erb
157
159
  - app/components/forms/submit_button_component.rb
158
160
  - app/components/forms/subtitle_component.html.erb