pg_rails 7.1.10 → 7.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 671c1939e1e9cae615f0b025c14af1b2c7e25d725782bc28aa7a0416c6b9138b
4
- data.tar.gz: 9ef68287946ee5aa453beec59bb1ffbcfd6a5acee7bac7c34b993313535b158c
3
+ metadata.gz: 0f6553a59df0df7aeb2906baac1974c3f2ef6f5b17bd83f4df1b4fbf3f7f2819
4
+ data.tar.gz: 20e9aa024c6aebb771ebea3c3b852a2e47a6d7583d043bcbc750d3ec2642e336
5
5
  SHA512:
6
- metadata.gz: 85c0900adc13bfb4955f46da877756864940b6e00e5a3a3f65b9c07d6792b068b5acb5d9baa3fc674bb51ab722f21c826e10c564644d60fae52780214c7c2493
7
- data.tar.gz: 90a1bdfb038b4c9d0c5004ff854384669aa537e1efa1895c9f4bf9756a2deef9083552a152a870db0e43bf01c48b247ad8e6b10fe051cc40ee838c3b080437dc
6
+ metadata.gz: b5b1ff627eeff7269b53d81a2b8d39184118741001cb4d36d89eba76801910315551ef563d55216f5a2e5b372b7afd3ff66ef7a4bae8428f94b20a28004c727b
7
+ data.tar.gz: c7af654f04ac7fba7d48e9c220f9396bb5ab24508350035447c792f0fd0afe213ccb529ed5360db4e1baa4f27cd5cbf387d6f3b4a71877edccf10395359fc8a6
@@ -0,0 +1,17 @@
1
+ - if helpers.show_filters?
2
+ .border-bottom#filtros
3
+ .d-flex.align-items-center.px-3.py-2
4
+ .px-2.d-none.d-sm-inline-block
5
+ span.bi.bi-funnel-fill
6
+ = helpers.search_form_for @q, url: url_for do |f|
7
+ .row.g-1
8
+ .col
9
+ .row.g-1
10
+ = @builder.filtros_html(form: f)
11
+ .col-auto.gap-1.d-flex.align-items-start
12
+ = helpers.button_tag class: 'btn btn-sm btn-primary col-auto' do
13
+ span.bi.bi-search
14
+ span.d-none.d-sm-inline
15
+ | &nbsp
16
+ span.text Buscar
17
+ = helpers.clear_filter(title: 'Limpiar', class: 'btn btn-sm btn-secondary col-auto')
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ class SearchBarComponent < ViewComponent::Base
4
+ def initialize(ransack, filtros)
5
+ @q = ransack
6
+ @builder = filtros
7
+
8
+ super
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ - if helpers.show_filters?
2
+ = link_to url_for(ocultar_filtros: 1, cancel_filter: 'true'),
3
+ class: 'btn btn-sm btn-outline-primary col-auto' do
4
+ | Ocultar filtros
5
+ - else
6
+ = link_to url_for(mostrar_filtros: 1),
7
+ class: 'btn btn-sm btn-outline-primary col-auto' do
8
+ | Filtrar
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class SearchBarTogglerComponent < ViewComponent::Base
4
+ end
@@ -3,34 +3,12 @@
3
3
  - @actions&.each do |link_args|
4
4
  = link_to(*link_args)
5
5
  - if @filtros.present?
6
- - if show_filters?
7
- = link_to namespaced_path(@clase_modelo, ocultar_filtros: 1),
8
- class: 'btn btn-sm btn-outline-primary col-auto' do
9
- | Ocultar filtros
10
- - else
11
- = link_to namespaced_path(@clase_modelo, mostrar_filtros: 1),
12
- class: 'btn btn-sm btn-outline-primary col-auto' do
13
- | Filtrar
6
+ = render SearchBarTogglerComponent.new
14
7
  .ms-1
15
8
  = @clase_modelo.new.decorate.new_link
16
9
 
17
- - if @filtros.present? && show_filters?
18
- .border-bottom#filtros
19
- .d-flex.align-items-center.px-3.py-2
20
- .px-2.d-none.d-sm-inline-block
21
- span.bi.bi-funnel-fill
22
- = search_form_for @q, url: namespaced_path(@clase_modelo) do |f|
23
- .row.g-1
24
- .col
25
- .row.g-1
26
- = @filtros.filtros_html(form: f)
27
- .col-auto.gap-1.d-flex.align-items-start
28
- = button_tag class: 'btn btn-sm btn-primary col-auto' do
29
- span.bi.bi-search
30
- span.d-none.d-sm-inline
31
- | &nbsp
32
- span.text Buscar
33
- = clear_filter(title: 'Limpiar', class: 'btn btn-sm btn-secondary col-auto')
10
+ - if @filtros.present?
11
+ = render SearchBarComponent.new(@q, @filtros)
34
12
 
35
13
  div
36
14
  - if @collection.any?
@@ -0,0 +1,3 @@
1
+ Rails.application.configure do
2
+ config.view_component.capture_compatibility_patch_enabled = true
3
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.1.10'
4
+ VERSION = '7.1.11'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.10
4
+ version: 7.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -617,6 +617,10 @@ files:
617
617
  - pg_engine/app/components/notification_component.rb
618
618
  - pg_engine/app/components/notifications_bell_component.rb
619
619
  - pg_engine/app/components/page_not_found_component.rb
620
+ - pg_engine/app/components/search_bar_component.html.slim
621
+ - pg_engine/app/components/search_bar_component.rb
622
+ - pg_engine/app/components/search_bar_toggler_component.html.slim
623
+ - pg_engine/app/components/search_bar_toggler_component.rb
620
624
  - pg_engine/app/controllers/admin/accounts_controller.rb
621
625
  - pg_engine/app/controllers/admin/email_logs_controller.rb
622
626
  - pg_engine/app/controllers/admin/emails_controller.rb
@@ -721,6 +725,7 @@ files:
721
725
  - pg_engine/config/initializers/ransack_memory.rb
722
726
  - pg_engine/config/initializers/rollbar.rb
723
727
  - pg_engine/config/initializers/simple_form_monkey_patch.rb
728
+ - pg_engine/config/initializers/view_component.rb
724
729
  - pg_engine/config/initializers/zeitwerk.rb
725
730
  - pg_engine/config/locales/devise.en.yml
726
731
  - pg_engine/config/locales/es.yml