formatic 0.6.0 → 0.6.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -0
- data/app/components/formatic/search.rb +6 -1
- data/config/locales/formatic.de.yml +3 -0
- data/config/locales/formatic.en.yml +3 -0
- data/lib/formatic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c770f8b2518ead02b5d2a7797068c3192ed9d264e22d59af830569eb07a6c0ef
|
|
4
|
+
data.tar.gz: ffc6912dea00ef5faf99fa815d7d3173d446fb07f312c160a80e6d29f9ec175c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaf5adeb08637ff84743f4a0c26c694533af908ee64d716340f96478fed4cc2a93004bf73a5bb3c50d8be4b647e703ab7f5d9bafb93cad4e483473c60501760c
|
|
7
|
+
data.tar.gz: af465ca562212a64012756431fd96340d2e44c5d68a11ee4ede6a912f2e8d5627b853140b0f759d57d84f90f1d6722aab752496e47a386bd5c56132f7d5d9e0f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -22,6 +22,11 @@ when its query still matches the input. An optional `with_clear` slot clears
|
|
|
22
22
|
the current selection.
|
|
23
23
|
An optional `with_add_record` slot stays hidden while searching and appears
|
|
24
24
|
after a successful response, even when there are no matches.
|
|
25
|
+
The query input uses a field-specific `placeholder:` or `helpers.placeholder`
|
|
26
|
+
translation when present. Otherwise it combines the translated label with the
|
|
27
|
+
localized search prompt. English and German prompts are included; other locales
|
|
28
|
+
fall back to the label. Search fields prevent implicit form submission on Enter
|
|
29
|
+
by default; pass `prevent_submit_on_enter: false` to disable that behavior.
|
|
25
30
|
|
|
26
31
|
```ruby
|
|
27
32
|
= render Formatic::Search.new(f:, attribute_name: :commander_id,
|
|
@@ -9,6 +9,7 @@ module Formatic
|
|
|
9
9
|
option :record_name, as: :manual_record_name, optional: true
|
|
10
10
|
option :exclude_ids, default: -> { [] }
|
|
11
11
|
option :placeholder, as: :manual_placeholder, optional: true
|
|
12
|
+
option :prevent_submit_on_enter, default: -> { true }
|
|
12
13
|
|
|
13
14
|
renders_one :selected_record
|
|
14
15
|
renders_one :add_record
|
|
@@ -24,7 +25,11 @@ module Formatic
|
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
def search_placeholder
|
|
27
|
-
manual_placeholder
|
|
28
|
+
return manual_placeholder if manual_placeholder.present?
|
|
29
|
+
return wrapper.placeholder if wrapper.placeholder.present?
|
|
30
|
+
|
|
31
|
+
translated_label = helpers.strip_tags(f.label(attribute_name))
|
|
32
|
+
::I18n.t('formatic.search.placeholder', label: translated_label, default: translated_label)
|
|
28
33
|
end
|
|
29
34
|
end
|
|
30
35
|
end
|
data/lib/formatic/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: formatic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- halo
|
|
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
249
249
|
- !ruby/object:Gem::Version
|
|
250
250
|
version: '0'
|
|
251
251
|
requirements: []
|
|
252
|
-
rubygems_version: 4.0.
|
|
252
|
+
rubygems_version: 4.0.20
|
|
253
253
|
specification_version: 4
|
|
254
254
|
summary: A set of ViewComponents for form elements
|
|
255
255
|
test_files: []
|