formatic 0.2.11 → 0.2.12

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: 24e08479caf78b6670d6992c7b57f2ee23aec26b6aa953b9db7fdfa1184550de
4
- data.tar.gz: 6cc0390bb4f70d25626ab040a83ce32bc404548bcc9fc6812c3da672f5c5af42
3
+ metadata.gz: a7e3e2484fd61fe3a436e68d059689803fc339553b243c95ccfcd6f0dd4f7a40
4
+ data.tar.gz: cd26ab984cb09ef2552a2cf2efb86edfa89d6839edc12dee8fa2c4479c7b746f
5
5
  SHA512:
6
- metadata.gz: eb198f09b149e71aed3a351893018c69ec15f294ecb18a66ed8159c1f432c7ef0e7259f78f010a01315bf159def6b55315bd0d17af1e50c8882b81913e3f0eb9
7
- data.tar.gz: 14fc1101af9bbc6eed611bfdc3672d44592771a88b0d6cb86b2770dd936846a77caf3c607b8afaca280e9425848eeee05149497111df3299304f6f71b7d4f391
6
+ metadata.gz: 9dd0bc7504620621b5bc3104fc335aba51268d495f8e143b53d9e348ed26736bd47ea02c4a683ce379583be5f9fc89e1c8715b0ecd06244ca84983357e9a3a5f
7
+ data.tar.gz: d1b8430e512ca12718da806cb9d5ab65750944d45aa03bcd5b4f9bebb8b15171c491c9f15529d6a71a54216bb7a2e3f6d2cb43cec96c7d38f11d9ea4c0e71659
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.12] 2026-07-24
4
+
5
+ - Add data attribute to every input
6
+
3
7
  ## [0.2.11] 2026-07-22
4
8
 
5
9
  - More robust vscode snippet symlinking
@@ -66,6 +66,10 @@ module Formatic
66
66
  f.object.public_send(attribute_name) if f.object.respond_to?(attribute_name)
67
67
  end
68
68
 
69
+ def data
70
+ manual_data
71
+ end
72
+
69
73
  # ---------------------------
70
74
  # ActiveModel and Rails slugs
71
75
  # ---------------------------
@@ -26,12 +26,16 @@ module Formatic
26
26
  <%- end -%>
27
27
  </div>
28
28
 
29
- <%= f.file_field attribute_name, class: "js-formatic-file__input", direct_upload:, multiple:, accept:, data: { entries: entries_json } %>
29
+ <%= f.file_field attribute_name, class: "js-formatic-file__input", direct_upload:, multiple:, accept:, data: %>
30
30
  </div>
31
31
  <% end %>
32
32
  <% end %>
33
33
  ERB
34
34
 
35
+ def data
36
+ { entries: entries_json }.merge(manual_data)
37
+ end
38
+
35
39
  private
36
40
 
37
41
  def attachments
@@ -20,6 +20,7 @@ module Formatic
20
20
  min: minimum,
21
21
  inputmode: :numeric,
22
22
  pattern: '-?[0-9]*',
23
+ data:,
23
24
  class: 'c-formatic-stepper__number js-formatic-stepper__number',
24
25
  placeholder: wrapper.placeholder,
25
26
  } %>
@@ -33,6 +33,7 @@ module Formatic
33
33
  def input_options
34
34
  result = {
35
35
  placeholder: wrapper.placeholder,
36
+ data:,
36
37
  autofocus:,
37
38
  class: css_classes
38
39
  }
@@ -24,11 +24,13 @@ module Formatic
24
24
  <%= select_tag hour_attribute_name,
25
25
  options_for_hour,
26
26
  id: hour_input_id,
27
+ data:,
27
28
  class: 'c-formatic-time__select' %>
28
29
 
29
30
  <%= select_tag minute_attribute_name,
30
31
  options_for_minute,
31
32
  id: minute_input_id,
33
+ data:,
32
34
  class: 'c-formatic-time__select' %>
33
35
  </div>
34
36
  <% end -%>
@@ -18,7 +18,7 @@ module Formatic
18
18
  <% else %>
19
19
  <%= f.label attribute_name, nil, { for: dom_id } do |builder| %>
20
20
  <%
21
- f.check_box(attribute_name, { id: dom_id, class: css_classes }) +
21
+ f.check_box(attribute_name, { id: dom_id, data:, class: css_classes }) +
22
22
  content_tag(:i) +
23
23
  content_tag(:div, human_attribute_name, class: 'c-formatic-toggle__label-caption-dummy') +
24
24
  content_tag(:div, wrap.toggle_on, class: 'is-active') +
@@ -58,6 +58,8 @@ module Formatic
58
58
  require_relative '../../app/components/formatic/stepper'
59
59
  require_relative '../../app/components/formatic/textarea'
60
60
  require_relative '../../app/components/formatic/time'
61
+ require_relative '../../app/components/formatic/file'
62
+ require_relative '../../app/components/formatic/files'
61
63
  end
62
64
  end
63
65
  end
@@ -25,17 +25,20 @@ module Formatic
25
25
  <%= select_tag day_attribute_name,
26
26
  options_for_day,
27
27
  id: day_input_id,
28
+ data:,
28
29
  class: 'c-formatic-date__select js-formatic-date__day' %>
29
30
  <% end %>
30
31
 
31
32
  <%= select_tag month_attribute_name,
32
33
  options_for_month,
33
34
  id: month_input_id,
35
+ data:,
34
36
  class: 'c-formatic-date__select js-formatic-date__month' %>
35
37
 
36
38
  <%= select_tag year_attribute_name,
37
39
  options_for_year,
38
40
  id: year_input_id,
41
+ data:,
39
42
  class: 'c-formatic-date__select js-formatic-date__year' %>
40
43
  </div>
41
44
  <% if calendar? %>
@@ -17,7 +17,7 @@ module Formatic
17
17
  </div>
18
18
  <% else %>
19
19
 
20
- <%= f.select attribute_name, choices, {}, { class: ['c-formatic-select', 'js-formatic-select', ('is-autosubmit' if async_submit)] } %>
20
+ <%= f.select attribute_name, choices, {}, { data:, class: ['c-formatic-select', 'js-formatic-select', ('is-autosubmit' if async_submit)] } %>
21
21
 
22
22
  <% end %>
23
23
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Formatic
4
- VERSION = '0.2.11'
4
+ VERSION = '0.2.12'
5
5
  end
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.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo