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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ca73fcff3750115f8e0a91a412ca039bcf56479830b94b608754eecd312442e
4
- data.tar.gz: 1998f66cb94746ed96d78eb600c1b72b184c435050da5756c34803bdeee2706b
3
+ metadata.gz: b95564b61fc2a5e745ac2aaa4e7ba29cb6df63c8fa3f7c353091910757386104
4
+ data.tar.gz: 829b65c8e26568c1e713a24a697d1c91ba0e677895b744359cfc77d44ae4163c
5
5
  SHA512:
6
- metadata.gz: b6c7f1374651a94c0cc47955285fe888a01b0746f13200c0c406e0f8959ef76011e3182818aae44df446bb2569aa12bf636a8a62e86f8480fac5ef233ead5269
7
- data.tar.gz: 284f42dd770dc570c73e0643575373305c28cef8cfd46661f5099485f70ed39e3b6531a355e10f58078275cd5f36d208f40042e071c26590fa308e4f90df2c6f
6
+ metadata.gz: 35edb7ecdcd272849988e763b6d366ebe91958338d84427d82e1f03d87990cd1875e9ea298d3c1c6055108f6fad0170907b518a6392453466eeb8eeaa73d62f6
7
+ data.tar.gz: 37684fa4aad5ce4281b4aa4e52cadb56feedddd32fa7c5ca8c6eeaa5a7576e3ada0b2a555e436ba5d1ed8dcbc60b59b13e0d9a87f202f4314c5ca1b7b46f4f9a
@@ -4,6 +4,12 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 2.5.2 - 2018/03/05
8
+
9
+ * bugfixes
10
+ * fixed `tabs` generator
11
+ * fixed `tabs` component
12
+
7
13
  ### 2.5.1 - 2018/03/01
8
14
 
9
15
  * bugfixes
@@ -1,45 +1,43 @@
1
- <% nav_html = {
2
- class: ['myg-tabs mdc-tab-bar', options.dig(:nav_html, :class)].join(' '),
3
- update: {
4
- history: options[:update_history]
5
- }
6
- } %>
7
- <% wrapper_html = {
8
- class: ['myg-tabs--panels', options.dig(:wrapper_html, :class)].join(' ')
9
- } %>
10
-
11
- <%= content_tag 'nav', (options[:nav_html] || {}).merge(nav_html) do %>
12
- <% options[:tabs]&.each do |tab| %>
13
- <% tab_html = {
14
- class: ['mdc-tab', options.dig(:tab_html, :class), ('mdc-tab--active' if tab[:active])].join(' '),
15
- aria: {
16
- controls: tab[:id]
17
- },
18
- role: 'tab'
19
- } %>
20
- <%= link_to tab[:name], tab[:href] || "##{tab[:id]}", (options[:tab_html] || {}).merge(tab_html) %>
21
- <% end %>
22
- <span class="mdc-tab-bar__indicator"></span>
23
- <% end %>
24
- <%= content_tag 'div', (options[:wrapper_html] || {}).merge(wrapper_html) do %>
25
- <% if options[:async] %>
26
- <div class="myg-tabs--loader">
27
- <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&gt;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&gt;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>
28
- </div>
29
- <div class="myg-tabs--panel" id="myg-tabs--panel-success" role="tabpanel" aria-hidden="true"></div>
30
- <div class="myg-tabs--panel" id="myg-tabs--panel-error" role="tabpanel" aria-hidden="true"></div>
31
- <% end %>
32
- <% options[:tabs]&.each do |tab| %>
33
- <% panel_html = {
34
- class: ['myg-tabs--panel', options.dig(:panel_html, :class), ('myg-tabs--shown' if tab[:active])].join(' '),
35
- id: tab[:id],
36
- role: 'tabpanel',
37
- aria: {
38
- hidden: (tab[:active] ? false : true)
39
- }
40
- } %>
41
- <%= content_tag 'div', (options[:panel_html] || {}).merge(panel_html) do %>
42
- <%= tab[:content] || render(partial: tab[:partial], locals: tab[:partial_locales]) %>
43
- <% end %>
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&gt;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&gt;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', update_history: true, tabs: <%= options[:method_names]&.map! { |t| { name: t.titleize, id: t, partial: t } } %> %>
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 } %>
@@ -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, update_history: 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
@@ -1,5 +1,5 @@
1
1
  module Myg
2
2
 
3
- VERSION = '2.5.1'
3
+ VERSION = '2.5.2'
4
4
 
5
5
  end
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.1
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-01 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties