glib-web 2.5.0 → 3.0.0.pre.beta1

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: deb5d59ee387f197f53b7f3fa024db36aabb41cf5e81a0f477a7a5a867d1a679
4
- data.tar.gz: 910dece1f77237f42ca6fee5e9029f6f67aba38dc5a63383d8d1a29fa822d5b3
3
+ metadata.gz: 36c7ef52875565dc8845937e540ad4bb859c2c1d8c2413a6eb2610e02011cc42
4
+ data.tar.gz: f7bc7fedc31848d543ba0e79404d293a611cdbbcb20573a37645d28e81fba19a
5
5
  SHA512:
6
- metadata.gz: 195c5ec7f7835027d85b5f5fb90c8b78c1ebd92d450d6cb9559693fe428bbb17e47dd986bd77f8615857f9c89bf52b0c7e6c5848bb318c085c665a138184a7e0
7
- data.tar.gz: 8fc172c8e683c59858d6f3d2484576ea62282475b504bb05eb17fcca07eeadf993c7f7bc6de40ee45771555be6fa10d22aa08864c052b2593dc06c7dc373a050
6
+ metadata.gz: 47910b5b21257d0d2902ff536ff2c1cb13e8154ee1bc2a919f66b1dc1ade9a7aedd967a1abc1d9deef2f7286ac0720db6bda4adb33d44ea0cea2af3de94738a2
7
+ data.tar.gz: 0fd5393e2bec762bd4b05d46f825ba168a31454ccc7d6100d286f706cebb2a40ef6eba9662651dbb389074375e973b9b15ae58d74d481a72a7b61e39c83df8c1
@@ -243,6 +243,7 @@ module Glib
243
243
 
244
244
  class TabBar < View
245
245
  int :height
246
+ int :activeIndex
246
247
  color :color
247
248
 
248
249
  def buttons(block)
@@ -6,42 +6,44 @@ json_ui_page json do |page|
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
7
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
8
8
  column.h2 text: 'Tab Bar with Badge'
9
- column.tabBar buttons: ->(menu) do
10
- badges = [
11
- {
12
- text: nil,
13
- backgroundColor: nil
14
- },
15
- {
16
- text: 8,
17
- backgroundColor: '#272551'
18
- },
19
- {
20
- text: '⭐⭐⭐',
21
- backgroundColor: '#008000'
22
- }
23
- ]
24
- {
25
- 'FIRST' => 'home',
26
- 'SECOND' => 'schedule',
27
- 'THIRD' => 'analytics'
28
- }.each_with_index do |(text, icon), index|
29
- menu.button \
30
- icon: icon,
31
- text: text,
32
- badge: badges[index],
33
- disabled: params[:tab].to_i == index,
34
- onClick: ->(action) do
35
- action.windows_reload \
36
- url: json_ui_garage_url(
37
- path: 'pages/tab_bar',
38
- tab: index,
39
- tab_2: params[:tab_2],
40
- tab_3: params[:tab_3]
41
- )
9
+ column.tabBar \
10
+ activeIndex: params[:tab].to_i,
11
+ buttons: ->(menu) do
12
+ badges = [
13
+ {
14
+ text: nil,
15
+ backgroundColor: nil
16
+ },
17
+ {
18
+ text: 8,
19
+ backgroundColor: '#272551'
20
+ },
21
+ {
22
+ text: '⭐⭐⭐',
23
+ backgroundColor: '#008000'
24
+ }
25
+ ]
26
+ {
27
+ 'FIRST' => 'home',
28
+ 'SECOND' => 'schedule',
29
+ 'THIRD' => 'analytics'
30
+ }.each_with_index do |(text, icon), index|
31
+ menu.button \
32
+ icon: icon,
33
+ text: text,
34
+ badge: badges[index],
35
+ disabled: params[:tab].to_i == index,
36
+ onClick: ->(action) do
37
+ action.windows_reload \
38
+ url: json_ui_garage_url(
39
+ path: 'pages/tab_bar',
40
+ tab: index,
41
+ tab_2: params[:tab_2],
42
+ tab_3: params[:tab_3]
43
+ )
44
+ end
42
45
  end
43
- end
44
- end
46
+ end
45
47
  column.spacer height: 10
46
48
 
47
49
  column.label text: "Tab index #{params[:tab].to_i} selected"
@@ -55,22 +57,25 @@ json_ui_page json do |page|
55
57
 
56
58
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
57
59
  column.h2 text: "Tab Bar with 'full-width-divider'"
58
- column.tabBar styleClass: 'full-width-divider', buttons: ->(menu) do
59
- 5.times do |index|
60
- menu.button \
61
- text: "Tab #{index}",
62
- disabled: params[:tab_2].to_i == index,
63
- onClick: ->(action) do
64
- action.windows_reload \
65
- url: json_ui_garage_url(
66
- path: 'pages/tab_bar',
67
- tab: params[:tab],
68
- tab_2: index,
69
- tab_3: params[:tab_3]
70
- )
60
+ column.tabBar \
61
+ activeIndex: params[:tab_2].to_i,
62
+ styleClass: 'full-width-divider',
63
+ buttons: ->(menu) do
64
+ 5.times do |index|
65
+ menu.button \
66
+ text: "Tab #{index}",
67
+ disabled: params[:tab_2].to_i == index,
68
+ onClick: ->(action) do
69
+ action.windows_reload \
70
+ url: json_ui_garage_url(
71
+ path: 'pages/tab_bar',
72
+ tab: params[:tab],
73
+ tab_2: index,
74
+ tab_3: params[:tab_3]
75
+ )
76
+ end
71
77
  end
72
78
  end
73
- end
74
79
  column.spacer height: 10
75
80
 
76
81
  column.label text: "Tab-2 index #{params[:tab_2].to_i} selected"
@@ -79,22 +84,25 @@ json_ui_page json do |page|
79
84
 
80
85
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
81
86
  column.h2 text: "Tab Bar 'with no-grow'"
82
- column.tabBar styleClass: 'no-grow', buttons: ->(menu) do
83
- 5.times do |index|
84
- menu.button \
85
- text: "Tab #{index}",
86
- disabled: params[:tab_3].to_i == index,
87
- onClick: ->(action) do
88
- action.windows_reload \
89
- url: json_ui_garage_url(
90
- path: 'pages/tab_bar',
91
- tab: params[:tab],
92
- tab_2: params[:tab_2],
93
- tab_3: index
94
- )
87
+ column.tabBar \
88
+ activeIndex: params[:tab_3].to_i,
89
+ styleClass: 'no-grow',
90
+ buttons: ->(menu) do
91
+ 5.times do |index|
92
+ menu.button \
93
+ text: "Tab #{index}",
94
+ disabled: params[:tab_3].to_i == index,
95
+ onClick: ->(action) do
96
+ action.windows_reload \
97
+ url: json_ui_garage_url(
98
+ path: 'pages/tab_bar',
99
+ tab: params[:tab],
100
+ tab_2: params[:tab_2],
101
+ tab_3: index
102
+ )
103
+ end
95
104
  end
96
105
  end
97
- end
98
106
  column.spacer height: 10
99
107
 
100
108
  column.label text: "Tab-3 index #{params[:tab_3].to_i} selected"
@@ -8,34 +8,26 @@
8
8
  <title>App</title>
9
9
  <%= csrf_meta_tags %>
10
10
 
11
- <%= javascript_pack_tag 'vue_renderer', defer: true %>
11
+ <%= vite_javascript_tag 'vue_renderer', defer: true %>
12
12
  <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
13
13
 
14
- <%= stylesheet_pack_tag 'vue_renderer' %>
14
+ <%= vite_stylesheet_tag 'vue_renderer' %>
15
15
 
16
16
  <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
17
-
18
- <%# Without this, checkboxes and radio buttons will not display. %>
19
- <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" />
20
-
21
- <%= yield :head %>
22
-
23
- <% if @__glib_head_code %>
24
- <%= @__glib_head_code.html_safe %>
25
- <% end %>
17
+ <%# Without this, checkboxes and radio buttons will not display. %>
18
+ <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" />
19
+ <%= yield :head %>
20
+ <% if @__glib_head_code %>
21
+ <%= @__glib_head_code.html_safe %>
22
+ <% end %>
26
23
  </head>
27
-
28
24
  <body>
29
25
  <%= yield :header %>
30
-
31
26
  <noscript>Please enable JavaScript to view this web site.</noscript>
32
27
  <div id="app"></div>
33
-
34
28
  <script>
35
29
  var __page = <%= raw @__json_ui_orig_page%>;
36
30
  </script>
37
-
38
31
  <%= yield :footer %>
39
32
  </body>
40
-
41
33
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0.pre.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -309,11 +309,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
309
  version: '0'
310
310
  required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  requirements:
312
- - - ">="
312
+ - - ">"
313
313
  - !ruby/object:Gem::Version
314
- version: '0'
314
+ version: 1.3.1
315
315
  requirements: []
316
- rubygems_version: 3.1.6
316
+ rubygems_version: 3.1.4
317
317
  signing_key:
318
318
  specification_version: 4
319
319
  summary: ''