base_editing_bootstrap 1.0.0 → 1.2.0

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: 92f7fc93b1d2aa476674d85893b5ac441887e2d5b889ce3f6520887dd8915240
4
- data.tar.gz: af0568325773e2ca156be541734afcb3bccf7a214b8de2c98942b741071e2fa1
3
+ metadata.gz: e8975be7d400651326b997d9d7650bd12c9145233c753e326ddb945c8a84816a
4
+ data.tar.gz: 97a6eaaa243d8d3320c3093fdc5a650c6d9cc5b20641680cb91f7985bf50f8fe
5
5
  SHA512:
6
- metadata.gz: dd1ad3622c616b241a780e46e18ffdb4712d4d7975584e2fb4a0b0162dee9315acfef0d70f95fdf47b8b068436808aba2bcb975edc48c7b4e2744a42186b8140
7
- data.tar.gz: c9b9bebec5692f48f2e283bdca287dc3a045787b54a7414013149c7ca3735c1b3018fbe7fae72ed4d97061c1c772626d8d1f2a821e95cb033e06cc634693adad
6
+ metadata.gz: 48733c1f94d354afb34528998fce967e9b22d1bdf2b418eb8fb4444fea4bac157d4a0a79168c365675e3ca864d23eba0b046b54bbc8babb397f42e449e69f736
7
+ data.tar.gz: 5de0164ea3ae7de687816ec721117b66bde4c309ac3806ce1e812e266eb847a61c859dd185bf0755a496bf42e76b5b820c936e76b39849321b75481d8009e3f5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## 1.2.0 - 2025-01-09
6
+ #### Features
7
+ - Add new method to get label from search field - (ace5fa0) - Marino Bonetti
8
+ #### Tests
9
+ - Add Menu for navigation in dummy - (2b2a9a6) - Marino Bonetti
10
+
11
+ - - -
12
+
13
+ ## 1.1.0 - 2025-01-03
14
+ #### Continuous Integration
15
+ - Add ruby 3.4 - (5658bb0) - Marino Bonetti
16
+ #### Features
17
+ - Boolean switch render right side label - (d448ef7) - Marino Bonetti
18
+ - Add a new layout container for form_field - (77dec9f) - Marino Bonetti
19
+ #### Tests
20
+ - Add help text example for enabled - (efd4aff) - Marino Bonetti
21
+
22
+ - - -
23
+
5
24
  ## 1.0.0 - 2024-11-26
6
25
  #### Bug Fixes
7
26
  - Remove fixed versions - (f8dc4b8) - Marino Bonetti
@@ -5,6 +5,7 @@
5
5
  <div class="card-body">
6
6
  <%= render partial: "form_field_header", local: {form:} %>
7
7
  <%= render collection: form_attributes(form.object),
8
+ layout: "form_field_container",
8
9
  partial: "form_field", locals: {form:} %>
9
10
  </div>
10
11
 
@@ -5,20 +5,25 @@
5
5
  # - form_field -> Array[String]
6
6
  %>
7
7
  <%# locals: (form:, form_field:) -%>
8
- <%= form.label(form_field, class: ["form-label", "form-#{form_field}-label"]) %>
9
-
10
8
  <%
11
- button_group_classes = ["mb-2"]
9
+ button_group_classes = ["mb-1"]
12
10
 
13
11
  content = form_print_field(form, form_field)
14
12
  unless content.match "checkbox"
15
13
  button_group_classes << "input-group"
16
14
  end
17
-
18
15
  button_group_classes << (form.object.validated? ? "has-validation" : "")
19
16
  button_group_classes << "form-#{form_field}-input-group"
20
17
 
18
+ # Non renderizziamo il contenuto del label in questa vista se siamo nello switch
19
+ if content.match "form-switch"
20
+ label_content = nil
21
+ else
22
+ label_content = form.label(form_field, class: ["form-label", "form-#{form_field}-label"])
23
+ end
24
+
21
25
  %>
26
+ <%= label_content %>
22
27
  <%= content_tag :div, class: button_group_classes.join(" ") do %>
23
28
  <%= render partial: "editing_form_measure_unit", locals: {object: form.object, field: form_field} %>
24
29
  <%= content %>
@@ -0,0 +1,3 @@
1
+ <div class="mb-3">
2
+ <%= yield %>
3
+ </div>
@@ -1,2 +1,2 @@
1
1
  <%# locals: (form:, field:) -%>
2
- <%= form.switch_box(field) %>
2
+ <%= form.switch_box(field,label: field) %>
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.2.0
@@ -64,7 +64,7 @@ module BaseEditingBootstrap::Forms
64
64
  end
65
65
 
66
66
  def switch_box(method, options = {}, checked_value = "1", unchecked_value = "0")
67
- options[:class] = (["form-switch"] + (options[:class] || "").split(" ")).join(" ")
67
+ options[:class] = (["form-check form-switch"] + (options[:class] || "").split(" ")).join(" ")
68
68
  self.check_box(method, options, checked_value, unchecked_value)
69
69
  end
70
70
 
@@ -6,6 +6,8 @@ module BaseEditingBootstrap::Searches
6
6
  class Field
7
7
  attr_reader :search_base, :name
8
8
 
9
+ # @param [BaseEditingBootstrap::Searches::Base] search_base
10
+ # @param [Symbol] name
9
11
  def initialize(search_base, name)
10
12
  @search_base = search_base
11
13
  @name = name
@@ -14,5 +16,12 @@ module BaseEditingBootstrap::Searches
14
16
  def to_partial_path
15
17
  "search_field"
16
18
  end
19
+
20
+ ##
21
+ # Helper per estrapolare la label del campo
22
+ # @return [String]
23
+ def label
24
+ @search_base.ransack_query.translate(name)
25
+ end
17
26
  end
18
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base_editing_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -317,6 +317,7 @@ files:
317
317
  - app/views/base_editing/_editing_form_measure_unit.html.erb
318
318
  - app/views/base_editing/_form.html.erb
319
319
  - app/views/base_editing/_form_field.html.erb
320
+ - app/views/base_editing/_form_field_container.html.erb
320
321
  - app/views/base_editing/_form_field_header.html.erb
321
322
  - app/views/base_editing/_form_footer.html.erb
322
323
  - app/views/base_editing/_index_body.html.erb