turbo_material 0.2.8 → 0.2.9

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: 6acc440d7f51220ea594251511c1427dc12bfdfcd3089535a6f8c5865301348e
4
- data.tar.gz: fd4bab6abf129e3bc7451a885bab1792fa9ef0bd1da1b94230926ab9a5850ff0
3
+ metadata.gz: b8d13c80c1d99c4442662e22b7c70abe40987aff35db2b561c3d5cac3c584884
4
+ data.tar.gz: 476769d57825b11071f7f8623b83d6b96daaca2cdadffa778556e28f0c2a1e12
5
5
  SHA512:
6
- metadata.gz: a8bf8d52a2d46cbf0cbd50e980b75b2895fc0dfd63f7e8f1bed6d379a3f6708ec86f411ec2f48f8f3417526aa546b768d5f7a65d49d2e3d48610d729c6339262
7
- data.tar.gz: 1460bdf2047d84584c08c870bf58570991c3142f42a726ceb3a779d4a765853eb5b1b2dafa5c22cd6f43d36920d34a23df9d2f5b11dc2b87c8274a1bbc488c1d
6
+ metadata.gz: faaa923b8cf005ac56252b62661abb77fdd986ecade89573820038da6cf84fe4b5ee0bef3d5a502a33c0dbfa855a37f4e1e6ed6a60d33ccd000ed79ba9992177
7
+ data.tar.gz: b7324433f491803e0c7f47a53ed276c7cdf39c4858479df78e48241d1b3f5c1c77be5ab221cdbea71ffa142061c75fd60e3aa1cc74238452732c1779ef959778
@@ -1,5 +1,5 @@
1
- <%# locals: (form:, custom_controller: nil, custom_css: nil, disabled: false, required: false, name:, label: nil, id:, checked: false, frame: nil, provide_hidden: false, value: nil, type: 'text', data: {}, min: nil, max: nil, helper: nil, parent: nil, style: 'filled') %>
2
- <label class="mdc-text-field rounded-none <%= style == 'filled' ? 'mdc-text-field--filled' : 'mdc-text-field--outlined' %> <%= value || form&.object&.[](name.to_sym) ? 'mdc-text-field--label-floating' : '' %> w-full <%= custom_css %>"
1
+ <%# locals: (form:, custom_controller: nil, custom_css: nil, disabled: false, required: false, name:, label: nil, id:, checked: false, frame: nil, provide_hidden: false, value: nil, type: 'text', data: {}, min: nil, max: nil, helper: nil, parent: nil, style: 'filled', leading_icon: nil, trailing_icon: nil, leading_icon_data: {}, trailing_icon_data: {}) %>
2
+ <label class="mdc-text-field rounded-none <%= style == 'filled' ? 'mdc-text-field--filled' : 'mdc-text-field--outlined' %> <%= value || form&.object&.[](name.to_sym) ? 'mdc-text-field--label-floating' : '' %> w-full <%= leading_icon ? 'mdc-text-field--with-leading-icon' : '' %> <%= trailing_icon ? 'mdc-text-field--with-trailing-icon' : '' %> <%= custom_css %>"
3
3
  data-controller="<%= custom_controller || 'material-input' %>" <% if frame %>data-frame="<%= frame %>"<% end %>>
4
4
  <%- if style == 'filled' -%>
5
5
  <span class="mdc-text-field__ripple"></span>
@@ -17,6 +17,9 @@
17
17
  <span class="mdc-notched-outline__trailing"></span>
18
18
  </span>
19
19
  <% end %>
20
+ <%- if leading_icon -%>
21
+ <i class="material-icons mdc-text-field__icon mdc-text-field__icon--leading" <%= tag.attributes((trailing_icon ? {} : {tabindex: '0', role: 'button'}).merge(data: leading_icon_data)) %>><%= leading_icon %></i>
22
+ <%- end -%>
20
23
  <%= form.text_field provide_hidden ? "#{name}_".to_sym : name.to_sym,
21
24
  class: 'mdc-text-field__input', value: value || form&.object&.[](name.to_sym),
22
25
  id: id, 'aria-labelledby' => id + '-label',
@@ -24,6 +27,9 @@
24
27
  type: type, autocomplete: "new-password", data: { frame: frame, **(data) }.compact,
25
28
  min: min, max: max
26
29
  %>
30
+ <%- if trailing_icon -%>
31
+ <i class="material-icons mdc-text-field__icon mdc-text-field__icon--trailing" <%= tag.attributes(tabindex: '0', role: 'button', data: trailing_icon_data) %>><%= trailing_icon %></i>
32
+ <%- end -%>
27
33
  <%- if style == 'filled' -%><span class="mdc-line-ripple"></span><%- end -%>
28
34
  <%- if provide_hidden -%><%= form.hidden_field name.to_sym, value: value, data: { frame: frame }.compact %><%- end -%>
29
35
  </label>
@@ -1,3 +1,3 @@
1
1
  module TurboMaterial
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_material
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Moiseev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-23 00:00:00.000000000 Z
11
+ date: 2024-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails