myg 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/app/views/mozaic/myg/_tabs.html.erb +43 -45
- data/lib/generators/templates/tabs/_tabs.html.erb +3 -1
- data/lib/generators/templates/tabs/tab.html.erb +1 -1
- data/lib/myg/railtie.rb +1 -1
- 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: b95564b61fc2a5e745ac2aaa4e7ba29cb6df63c8fa3f7c353091910757386104
|
4
|
+
data.tar.gz: 829b65c8e26568c1e713a24a697d1c91ba0e677895b744359cfc77d44ae4163c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35edb7ecdcd272849988e763b6d366ebe91958338d84427d82e1f03d87990cd1875e9ea298d3c1c6055108f6fad0170907b518a6392453466eeb8eeaa73d62f6
|
7
|
+
data.tar.gz: 37684fa4aad5ce4281b4aa4e52cadb56feedddd32fa7c5ca8c6eeaa5a7576e3ada0b2a555e436ba5d1ed8dcbc60b59b13e0d9a87f202f4314c5ca1b7b46f4f9a
|
data/CHANGELOG.md
CHANGED
@@ -1,45 +1,43 @@
|
|
1
|
-
<% nav_html = {
|
2
|
-
class: ['myg-tabs mdc-tab-bar', options.dig(:nav_html, :class)].join(' ')
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
} %>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<div class="myg-tabs--
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
<% end %>
|
45
|
-
<% end %>
|
1
|
+
<% nav_html = {
|
2
|
+
class: ['myg-tabs mdc-tab-bar', options.dig(:nav_html, :class)].join(' ')
|
3
|
+
} %>
|
4
|
+
<% wrapper_html = {
|
5
|
+
class: ['myg-tabs--panels', options.dig(:wrapper_html, :class)].join(' ')
|
6
|
+
} %>
|
7
|
+
|
8
|
+
<%= content_tag 'nav', (options[:nav_html] || {}).merge(nav_html) do %>
|
9
|
+
<% options[:tabs]&.each do |tab| %>
|
10
|
+
<% tab_html = {
|
11
|
+
class: ['mdc-tab', options.dig(:tab_html, :class), ('mdc-tab--active' if tab[:active])].join(' '),
|
12
|
+
aria: {
|
13
|
+
controls: tab[:id]
|
14
|
+
},
|
15
|
+
role: 'tab'
|
16
|
+
} %>
|
17
|
+
<%= link_to tab[:name], tab[:href] || "##{tab[:id]}", (options[:tab_html] || {}).merge(tab_html) %>
|
18
|
+
<% end %>
|
19
|
+
<span class="mdc-tab-bar__indicator"></span>
|
20
|
+
<% end %>
|
21
|
+
<%= content_tag 'div', (options[:wrapper_html] || {}).merge(wrapper_html) do %>
|
22
|
+
<% if options[:async] %>
|
23
|
+
<div class="myg-tabs--loader">
|
24
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24"><g transform="translate(0, 0)"><g class="nc-loop_bars-rotate-24" transform="rotate(270 12 12)"> <rect x="11" fill="#444444" width="2" height="6"></rect> <rect x="17.3639603" y="2.636039" transform="matrix(0.7071068 0.7071068 -0.7071068 0.7071068 9.3639612 -11.3345242)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="18" y="11" fill="#444444" width="6" height="2" style="opacity: 0.4;"></rect> <rect x="17.3639603" y="15.3639612" transform="matrix(-0.7071068 0.7071068 -0.7071068 -0.7071068 44.3345222 18.3639603)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="11" y="18" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="4.6360388" y="15.3639612" transform="matrix(-0.7071068 -0.7071068 0.7071068 -0.7071068 -3.363961 35.3345222)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="0" y="11" fill="#444444" width="6" height="2" style="opacity: 0.5;"></rect> <rect x="4.6360388" y="2.636039" transform="matrix(0.7071068 -0.7071068 0.7071068 0.7071068 -2.3345237 5.6360388)" fill="#444444" width="2" height="6" style="opacity: 0.8;"></rect> </g> <script>!function(){function t(t){this.element=t,this.animationId,this.start=null,this.init()}if(!window.requestAnimationFrame){var i=null;window.requestAnimationFrame=function(t,n){var e=(new Date).getTime();i||(i=e);var a=Math.max(0,16-(e-i)),o=window.setTimeout(function(){t(e+a)},a);return i=e+a,o}}t.prototype.init=function(){var t=this;this.animationId=window.requestAnimationFrame(t.triggerAnimation.bind(t))},t.prototype.reset=function(){var t=this;window.cancelAnimationFrame(t.animationId)},t.prototype.triggerAnimation=function(t){var i=this;this.start||(this.start=t);var n=t-this.start;800>n||(this.start=this.start+800),this.element.setAttribute("transform","rotate("+parseInt(Math.min(n/100,8))%8*45+" 12 12)");if(document.documentElement.contains(this.element))window.requestAnimationFrame(i.triggerAnimation.bind(i))};var n=document.getElementsByClassName("nc-loop_bars-rotate-24"),e=[];if(n)for(var a=0;n.length>a;a++)!function(i){e.push(new t(n[i]))}(a);document.addEventListener("visibilitychange",function(){"hidden"==document.visibilityState?e.forEach(function(t){t.reset()}):e.forEach(function(t){t.init()})})}();</script></g></svg>
|
25
|
+
</div>
|
26
|
+
<div class="myg-tabs--panel" id="myg-tabs--panel-success" role="tabpanel" aria-hidden="true"><%= options.dig(:success, :content) || render(partial: options.dig(:success, :partial), locals: options.dig(:success, :partial_locals)) %></div>
|
27
|
+
<div class="myg-tabs--panel" id="myg-tabs--panel-error" role="tabpanel" aria-hidden="true"><%= block %></div>
|
28
|
+
<% else %>
|
29
|
+
<% options[:tabs]&.each do |tab| %>
|
30
|
+
<% panel_html = {
|
31
|
+
class: ['myg-tabs--panel', options.dig(:panel_html, :class), ('myg-tabs--shown' if tab[:active])].join(' '),
|
32
|
+
id: tab[:id],
|
33
|
+
role: 'tabpanel',
|
34
|
+
aria: {
|
35
|
+
hidden: (tab[:active] ? false : true)
|
36
|
+
}
|
37
|
+
} %>
|
38
|
+
<%= content_tag 'div', (options[:panel_html] || {}).merge(panel_html) do %>
|
39
|
+
<%= tab[:content] || render(partial: tab[:partial], locals: tab[:partial_locals]) %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
@@ -1,3 +1,5 @@
|
|
1
1
|
<h1>Title</h1>
|
2
2
|
|
3
|
-
<%%= component 'myg/tabs',
|
3
|
+
<%%= component 'myg/tabs', async: true, success: local_assigns[:success], tabs: <%= options[:method_names]&.map! { |t| { name: t.titleize, href: root_url } } %> do %>
|
4
|
+
<p>An error occured</p>
|
5
|
+
<%% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%%= render 'tabs' %>
|
1
|
+
<%%= render 'tabs', tab: @name.titleize, success: { partial: @name } %>
|
data/lib/myg/railtie.rb
CHANGED
@@ -14,7 +14,7 @@ module Myg
|
|
14
14
|
config.define_component 'myg/radio'
|
15
15
|
config.define_component 'myg/slider', discrete: false, disabled: false, value: 0, min: 0, max: 50, label: 'Select value'
|
16
16
|
config.define_component 'myg/switch'
|
17
|
-
config.define_component 'myg/tabs', async: false
|
17
|
+
config.define_component 'myg/tabs', async: false
|
18
18
|
config.define_component 'myg/toast'
|
19
19
|
config.define_component 'myg/toolbar'
|
20
20
|
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.5.
|
4
|
+
version: 2.5.2
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|