glib-web 4.15.0 → 4.15.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: 873643856c8f5b10c09c843e46207ecac1c053adf7cf0e00663302a112f2e4c7
4
- data.tar.gz: 6e052b16d934acfeca10e8cd0ad621100a8f0ea9bbce7964a73cf4b38848ca26
3
+ metadata.gz: a6f547d313a7f227c25bc8963fe4d3973e5c6f7325d182831235c60fc3a8047a
4
+ data.tar.gz: 7eed8148a19acdd58ad0f4a54e53ca5f874f05ca7ee0fee70285a9796eb028f7
5
5
  SHA512:
6
- metadata.gz: 1698cac156bda8914494aa76ed90c0bdf82411c57dc2ab6262aa85b8a819db1be2b8567ecc3ff72d84ca217132f5bc16b5eb2f1eca902aaf2a7fcee2d23778fa
7
- data.tar.gz: e1d9a080b6c5eed0a66a53aea657a54b2e66a9b0dfd973d127456fc29a426d6632cdcc836a7285fb66d5dbf01e78f9e1cb2132e3c964596a9ac7a220db8414b6
6
+ metadata.gz: da89b88c3587011bf3c231f350d04a0620dc20de179bf4dae476f072c2e370cf2e13a22cc1bf5a3f4a60f9af740255fbb9d193b984b9b089d1939d74d0a209cb
7
+ data.tar.gz: 78d834f7ecc771d9d953b0fcafb4ec586fb3954853ece64ef7804afaef292dc887aff4dd6dd505be50452b91f641a7047cd190768ee0b604c133c2bd24432992
@@ -289,7 +289,7 @@ module Glib
289
289
  optional = options[:optional] || []
290
290
 
291
291
  required.each do |req|
292
- raise ArgumentError, "Hash property: '#{req}' is required" if value[req.to_s].blank?
292
+ raise ArgumentError, "Hash property: '#{req}' is required" if value[req.to_s].nil?
293
293
  end
294
294
 
295
295
  if optional.present?
@@ -10,8 +10,8 @@ class Glib::JsonUi::ActionBuilder
10
10
  int :offset
11
11
  int :width
12
12
  bool :persistent
13
- bool :overlay
14
- # singleton_array :styleClass, :styleClasses
13
+ hash :overlay, required: [:closeOnFocus]
14
+ singleton_array :styleClass, :styleClasses
15
15
  end
16
16
 
17
17
  class Close < Action
@@ -126,19 +126,19 @@ page.form \
126
126
  end,
127
127
  childViews: ->(group) do
128
128
  group.panels_responsive width: 'matchParent', childViews: ->(res) do
129
-
130
- res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
129
+ res.panels_column width: 'matchParent', height: 'matchParent', lg: { cols: 4, padding: { x: 10 } }, childViews: ->(column) do
131
130
  column.fields_radio\
132
131
  width: 'matchParent',
132
+ height: 'matchParent',
133
133
  value: 'yes', label: 'Yes', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' },
134
134
  onClick: ->(action) do
135
135
  action.windows_openWeb url: 'http://www.google.com'
136
136
  end
137
137
  end
138
- res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
138
+ res.panels_column width: 'matchParent', lg: { cols: 4, padding: { x: 10 } }, childViews: ->(column) do
139
139
  column.fields_radio\
140
140
  width: 'matchParent',
141
- value: 'no', label: 'No',
141
+ value: 'no', label: 'No (very very very very very very very very very very very long description)',
142
142
  image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 },
143
143
  onClick: ->(action) do
144
144
  action.windows_openWeb url: 'http://www.google.com'
@@ -4,7 +4,7 @@ page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
- scroll.h2 text: 'Button'
7
+ scroll.h2 text: 'Button', id: 'button'
8
8
  scroll.spacer height: 20
9
9
 
10
10
  scroll.button text: 'Button', onClick: ->(action) do
@@ -34,10 +34,13 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
34
34
 
35
35
  action.popovers_show \
36
36
  key: 'menu',
37
- overlay: true,
37
+ targetId: '_self',
38
+ overlay: { closeOnFocus: false },
38
39
  placement: 'left',
40
+ styleClass: 'popover-container',
41
+ offset: 24,
39
42
  content: ->(dialog) do
40
- dialog.body padding: glib_json_padding_body, childViews: ->(view) do
43
+ dialog.body childViews: ->(view) do
41
44
  view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
42
45
  res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
43
46
  saction.windows_open url: json_ui_garage_url(path: 'pages/index')
@@ -45,7 +48,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
45
48
  res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
46
49
  saction.windows_open url: json_ui_garage_url(path: 'home/blank')
47
50
  end
48
- res.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(saction) do
51
+ res.label text: 'close', styleClass: 'popover-menu-item', onClick: ->(saction) do
49
52
  saction.popovers_close key: 'menu'
50
53
  end
51
54
  end
@@ -59,20 +62,19 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
59
62
  tooltip: { text: 'Tooltip 1' },
60
63
  onClick: ->(action) do
61
64
  action.popovers_show \
62
- key: 'menu',
65
+ key: 'menu2',
63
66
  placement: 'bottom-start',
64
- overlay: true,
65
67
  width: 200,
66
68
  content: ->(dialog) do
67
69
  dialog.body styleClass: 'popover-menu', padding: glib_json_padding_body, childViews: ->(res) do
68
70
  res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
69
- saction.popovers_close key: 'menu'
71
+ saction.popovers_close key: 'menu2'
70
72
  end
71
73
  res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
72
- saction.popovers_close key: 'menu'
74
+ saction.popovers_close key: 'menu2'
73
75
  end
74
76
  res.label text: 'Item 3 with very very very very very long name', styleClass: 'popover-menu-item', onClick: ->(saction) do
75
- saction.popovers_close key: 'menu'
77
+ saction.popovers_close key: 'menu2'
76
78
  end
77
79
  end
78
80
  end
@@ -127,5 +129,21 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
127
129
  onDisabled: ->(action) do
128
130
  action.dialogs_alert message: 'Disabled'
129
131
  end
132
+ scroll.spacer height: 20
133
+
134
+ scroll.h2 text: 'Highlight'
135
+ scroll.button text: 'Highlight', onClick: ->(action) do
136
+ action.popovers_show \
137
+ targetId: 'button',
138
+ key: 'menu',
139
+ placement: 'right',
140
+ offset: 24,
141
+ overlay: { closeOnFocus: true },
142
+ content: ->(dialog) do
143
+ dialog.body padding: glib_json_padding_body, styleClass: 'popover-menu', childViews: ->(res) do
144
+ res.label text: 'Hello world'
145
+ end
146
+ end
147
+ end
130
148
 
131
149
  end
@@ -8,13 +8,14 @@
8
8
  <title><%= yield(:title) || 'App'%></title>
9
9
  <%= csrf_meta_tags %>
10
10
 
11
- <%= vite_javascript_tag 'vue_renderer', defer: true %>
11
+
12
12
  <%# TODO: Remove this, for dev only %>
13
13
  <%# <script src="https://cdn.tailwindcss.com"></script> %>
14
14
  <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
15
15
  <%# Without this, checkboxes and radio buttons will not display. %>
16
16
  <%# <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" /> %>
17
17
  <%= yield :head %>
18
+ <%= vite_javascript_tag 'vue_renderer', defer: true %>
18
19
  <% if @__glib_head_code %>
19
20
  <%= @__glib_head_code.html_safe %>
20
21
  <% end %>
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: 4.15.0
4
+ version: 4.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''