myg 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/views/mozaic/myg/_checkbox.html.erb +2 -1
- data/app/views/mozaic/myg/_form-field.html.erb +5 -2
- data/app/views/mozaic/myg/_input.html.erb +15 -14
- data/app/views/mozaic/myg/_label.html.erb +2 -1
- data/app/views/mozaic/myg/_radio.html.erb +24 -23
- data/app/views/mozaic/myg/_switch.html.erb +24 -23
- data/lib/myg/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: '0937cd38045815e560f8ded6c453a74e26161dbdde4691b73ffab3304efb2592'
|
4
|
+
data.tar.gz: f81786ef6b57c306c0ebd927c49d1ebd76ca68ce6227538b523693389dffd31e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d75557e81cca423422f549a8c77a406efc19389c954e031390a459a5b17ce0521786ce81ac74fde229cbf2e444c15d5d74099072a903aa89af1c5cef6507e64
|
7
|
+
data.tar.gz: 16c64180d567121ffdce95cbb207445148650350cae3d7fc19856a7ba609044b8d498e2734c6bafcba25cb3de30808ada4026eaebcd790bc0499b08a46624d04
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
<% class_name = options.delete :class_name %>
|
2
2
|
<% attribute = options.delete :attribute %>
|
3
|
+
<% identifier = options.delete :identifier %>
|
3
4
|
<% values = options.delete(:values) || [0, 1] %>
|
4
5
|
<% name = class_name ? "#{class_name.to_s.downcase}[#{attribute}]" : "#{attribute}" %>
|
5
|
-
<% id = class_name
|
6
|
+
<% id = [class_name, identifier, attribute].map { |s| s.to_s.downcase }.join('_') %>
|
6
7
|
<% wrapper_html = {
|
7
8
|
class: ['myg-checkbox mdc-checkbox', options.dig(:wrapper_html, :class), ('mdc-checkbox--disabled' if options.dig(:input_html, :disabled))].join(' ')
|
8
9
|
} %>
|
@@ -4,17 +4,20 @@
|
|
4
4
|
<% if options[:floating_label] %><% input_html = {
|
5
5
|
class_name: options[:class_name],
|
6
6
|
attribute: options[:attribute],
|
7
|
+
identifier: options[:identifier],
|
7
8
|
placeholder: options[:floating_label]
|
8
9
|
} %><% else %><% input_html = {
|
9
10
|
class_name: options[:class_name],
|
10
|
-
attribute: options[:attribute]
|
11
|
+
attribute: options[:attribute],
|
12
|
+
identifier: options[:identifier]
|
11
13
|
} %><% end %>
|
12
14
|
<% input_defaults = {
|
13
15
|
type: ('file' if options[:file])
|
14
16
|
} %>
|
15
17
|
<% label_html = {
|
16
18
|
class_name: options[:class_name],
|
17
|
-
attribute: options[:attribute]
|
19
|
+
attribute: options[:attribute],
|
20
|
+
identifier: options[:identifier]
|
18
21
|
} %>
|
19
22
|
<% label_secondary_html = label_html.merge({
|
20
23
|
class: ['myg-label--secondary', options.dig(:label_html, :class)].join(' ')
|
@@ -1,14 +1,15 @@
|
|
1
|
-
<% class_name = options.delete :class_name %>
|
2
|
-
<% attribute = options.delete :attribute %>
|
3
|
-
<%
|
4
|
-
<%
|
5
|
-
<%
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
<% class_name = options.delete :class_name %>
|
2
|
+
<% attribute = options.delete :attribute %>
|
3
|
+
<% identifier = options.delete :identifier %>
|
4
|
+
<% name = class_name ? "#{class_name.to_s.downcase}[#{attribute}]" : "#{attribute}" %>
|
5
|
+
<% id = [class_name, identifier, attribute].map { |s| s.to_s.downcase }.join('_') %>
|
6
|
+
<% html = {
|
7
|
+
class: ['myg-input', options[:class]].join(' '),
|
8
|
+
name: name,
|
9
|
+
id: id
|
10
|
+
} %>
|
11
|
+
<% defaults = {
|
12
|
+
type: (attribute.to_s == 'email' || attribute.to_s == 'password' ? attribute : 'text')
|
13
|
+
} %>
|
14
|
+
|
15
|
+
<%= tag 'input', defaults.merge(options.merge(html)) %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% class_name = options.delete :class_name %>
|
2
2
|
<% attribute = options.delete :attribute %>
|
3
|
-
<%
|
3
|
+
<% identifier = options.delete :identifier %>
|
4
|
+
<% id = [class_name, identifier, attribute].map { |s| s.to_s.downcase }.join('_') %>
|
4
5
|
<% html = {
|
5
6
|
class: ['myg-label', options[:class]].join(' '),
|
6
7
|
for: id
|
@@ -1,23 +1,24 @@
|
|
1
|
-
<% class_name = options.delete :class_name %>
|
2
|
-
<% attribute = options.delete :attribute %>
|
3
|
-
<%
|
4
|
-
<%
|
5
|
-
<%
|
6
|
-
<%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<div class="mdc-
|
22
|
-
|
23
|
-
|
1
|
+
<% class_name = options.delete :class_name %>
|
2
|
+
<% attribute = options.delete :attribute %>
|
3
|
+
<% identifier = options.delete :identifier %>
|
4
|
+
<% value = options.delete :value %>
|
5
|
+
<% name = class_name ? "#{class_name.to_s.downcase}[#{attribute}]" : "#{attribute}" %>
|
6
|
+
<% id = [class_name, identifier, attribute, value].map { |s| s.to_s.downcase }.join('_') %>
|
7
|
+
<% wrapper_html = {
|
8
|
+
class: ['myg-radio mdc-radio', options.dig(:wrapper_html, :class), ('mdc-radio--disabled' if options.dig(:input_html, :disabled))].join(' ')
|
9
|
+
} %>
|
10
|
+
<% input_html = {
|
11
|
+
type: 'radio',
|
12
|
+
class: ['mdc-radio__native-control', options.dig(:input_html, :class)].join(' '),
|
13
|
+
value: value,
|
14
|
+
name: name,
|
15
|
+
id: id
|
16
|
+
} %>
|
17
|
+
|
18
|
+
<%= content_tag 'div', (options[:wrapper_html] || {}).merge(wrapper_html) do %>
|
19
|
+
<%= tag 'input', (options[:input_html] || {}).merge(input_html) %>
|
20
|
+
<div class="mdc-radio__background">
|
21
|
+
<div class="mdc-radio__outer-circle"></div>
|
22
|
+
<div class="mdc-radio__inner-circle"></div>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
@@ -1,23 +1,24 @@
|
|
1
|
-
<% class_name = options.delete :class_name %>
|
2
|
-
<% attribute = options.delete :attribute %>
|
3
|
-
<%
|
4
|
-
<%
|
5
|
-
<%
|
6
|
-
<%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<%=
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
1
|
+
<% class_name = options.delete :class_name %>
|
2
|
+
<% attribute = options.delete :attribute %>
|
3
|
+
<% identifier = options.delete :identifier %>
|
4
|
+
<% values = options.delete(:values) || [0, 1] %>
|
5
|
+
<% name = class_name ? "#{class_name.to_s.downcase}[#{attribute}]" : "#{attribute}" %>
|
6
|
+
<% id = [class_name, identifier, attribute].map { |s| s.to_s.downcase }.join('_') %>
|
7
|
+
<% wrapper_html = {
|
8
|
+
class: ['myg-switch mdc-switch', options.dig(:wrapper_html, :class)].join(' ')
|
9
|
+
} %>
|
10
|
+
<% input_html = {
|
11
|
+
type: 'checkbox',
|
12
|
+
class: ['mdc-switch__native-control', options.dig(:input_html, :class)].join(' '),
|
13
|
+
name: name,
|
14
|
+
id: id,
|
15
|
+
value: values.last
|
16
|
+
} %>
|
17
|
+
|
18
|
+
<%= content_tag 'div', (options[:wrapper_html] || {}).merge(wrapper_html) do %>
|
19
|
+
<input value="<%= values.first %>" type="hidden" name="<%= name %>" />
|
20
|
+
<%= tag 'input', (options[:input_html] || {}).merge(input_html) %>
|
21
|
+
<div class="mdc-switch__background">
|
22
|
+
<div class="mdc-switch__knob"></div>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
data/lib/myg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|