glib-web 0.13.0 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  4. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  5. data/app/helpers/glib/forms_helper.rb +0 -0
  6. data/app/helpers/glib/json_ui/abstract_builder.rb +31 -8
  7. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -0
  9. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  10. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  11. data/app/helpers/glib/json_ui/menu_builder.rb +2 -2
  12. data/app/helpers/glib/json_ui/response_helper.rb +1 -1
  13. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  14. data/app/helpers/glib/json_ui/view_builder.rb +10 -3
  15. data/app/helpers/glib/urls_helper.rb +0 -0
  16. data/app/models/glib/active_storage/attachment.rb +0 -0
  17. data/app/models/glib/active_storage/blob.rb +0 -0
  18. data/app/models/glib/dynamic_text_record.rb +0 -0
  19. data/app/models/glib/text.rb +0 -0
  20. data/app/validators/email_typo_validator.rb +0 -0
  21. data/app/validators/email_validator.rb +0 -0
  22. data/app/validators/url_validator.rb +0 -0
  23. data/app/views/json_ui/garage/_nav_menu.json.jbuilder +2 -4
  24. data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/actions/_panels.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/forms/full_window_form.json.jbuilder +19 -0
  35. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/forms/index.json.jbuilder +5 -0
  37. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/forms/submit_on_change.json.jbuilder +13 -1
  42. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/pages/flat_centered.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +18 -18
  51. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/pages/tab_bar.json.jbuilder +15 -2
  58. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/views/banners.json.jbuilder +2 -2
  71. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/views/controls.json.jbuilder +12 -5
  73. data/app/views/json_ui/garage/views/icons.json.jbuilder +4 -0
  74. data/app/views/json_ui/garage/views/images.json.jbuilder +7 -6
  75. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/views/map_cluster_data.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  78. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  79. data/config/routes.rb +0 -0
  80. data/lib/generators/glib/install_generator.rb +0 -0
  81. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  82. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  83. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  84. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  85. data/lib/generators/templates/database.yml +0 -0
  86. data/lib/generators/templates/dynamic_text.rb +0 -0
  87. data/lib/glib/crypt/utils.rb +0 -0
  88. data/lib/glib/crypt.rb +0 -0
  89. data/lib/glib/dynamic_text/config.rb +0 -0
  90. data/lib/glib/dynamic_text.rb +0 -0
  91. data/lib/glib/engine.rb +0 -0
  92. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  93. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  94. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +0 -0
  95. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  96. data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +0 -0
  97. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  98. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  99. data/lib/glib/json_crawler/coverage.rb +0 -0
  100. data/lib/glib/json_crawler.rb +0 -0
  101. data/lib/glib/mailer_tester.rb +0 -0
  102. data/lib/glib/value.rb +0 -0
  103. data/lib/glib/version.rb +0 -0
  104. data/lib/glib-web.rb +0 -0
  105. data/lib/tasks/db.rake +0 -0
  106. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27788c64710f7017fc98dc0f2368668204a8cf9929dc9f168a3e37b32c329c96
4
- data.tar.gz: 3cfbe8bf3d631006cb92614be8b8ee04386394bdb107b02c5e481b1a28416215
3
+ metadata.gz: 0baa732034691c909ee78b5633077586e67f5b55f8618338c5da6d057c573223
4
+ data.tar.gz: 0e64bbf1a81a5a2a65616e9c49603b2f15cf3b02fa10c407d595e0ad533aa151
5
5
  SHA512:
6
- metadata.gz: e8df903fd95b2ce26dcfb491c55f1f7c704d14e3ddf9fcf4f946f5d7752f9b723f20e57f6f52b3daf286d1f993479bf5e9a4c28d27ba2f17fc1dc7add4eb8e71
7
- data.tar.gz: 88fbe9a0bb5a5d312b68d49fcb1975b7f7a413d7b65448392f68ddeaa372b9098e3772d2f7d0272c989cbbb05d2edd014d8accc325ca4c8bc77dff456725f472
6
+ metadata.gz: 8a013f8cb0b04c3a25cbe5d24040ff1b3a15e8037c81b6ef5d10f1aec864860739a9e864482d937f12142e9917f0aea036cb3e6c4175d2367b1180736126534a
7
+ data.tar.gz: ac9da570bc331ff64d35ac2ce511f29ead17cdf1beab0b67b4cadbfc15c7c7b98e0429431ba2c4992a1b9d856bc98b575a727a3cd524bf2e4836fe04fd18e6dd
File without changes
File without changes
File without changes
@@ -129,13 +129,7 @@ module Glib
129
129
 
130
130
  def self.color(propName)
131
131
  define_method(propName) do |value|
132
- if (value = value&.to_s)
133
- if !Rails.env.production?
134
- if !value.match /^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i
135
- raise "Invalid color: #{value}"
136
- end
137
- end
138
-
132
+ if (value = to_color(value))
139
133
  json.set! propName, value
140
134
  end
141
135
  end
@@ -162,7 +156,7 @@ module Glib
162
156
 
163
157
  def self.string(propName, options = {})
164
158
  define_method(propName) do |value|
165
- str = value&.to_s
159
+ str = to_string(value)
166
160
  instance_variable_set("@#{propName}", str) if options[:cache]
167
161
  json.set! propName, str
168
162
  end
@@ -264,6 +258,15 @@ module Glib
264
258
  end
265
259
  end
266
260
 
261
+ def self.badgeable
262
+ define_method(:badge) do |value|
263
+ json.badge do
264
+ json.text to_string(value[:text])
265
+ json.backgroundColor to_color(value[:backgroundColor])
266
+ end
267
+ end
268
+ end
269
+
267
270
  def self.action(propName)
268
271
  define_method(propName) do |value|
269
272
  json.set!(propName) { value.call(page.action_builder) }
@@ -318,6 +321,26 @@ module Glib
318
321
  # To be overridden
319
322
  end
320
323
 
324
+ ### Reusable value converters
325
+
326
+ def to_string(value)
327
+ value&.to_s
328
+ end
329
+
330
+ def to_color(value)
331
+ value = value&.to_s
332
+
333
+ if value
334
+ if !Rails.env.production?
335
+ if !value.match /^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i
336
+ raise "Invalid color: #{value}"
337
+ end
338
+ end
339
+ end
340
+
341
+ value
342
+ end
343
+
321
344
  end
322
345
  end
323
346
  end
File without changes
File without changes
File without changes
File without changes
@@ -39,12 +39,12 @@ module Glib
39
39
  end
40
40
 
41
41
  class Button < MenuItem
42
+ badgeable
43
+
42
44
  string :text
43
45
  icon :icon
44
46
  action :onClick
45
47
  bool :disabled
46
- color :badgeColor
47
- string :badgeContent
48
48
  singleton_array :styleClass, :styleClasses
49
49
 
50
50
  def childButtons(block)
@@ -22,7 +22,7 @@ module Glib
22
22
  end
23
23
 
24
24
  class Response
25
- attr_reader :action_builder, :view_builder, :list_section_builder, :table_section_builder
25
+ attr_reader :action_builder, :view_builder, :list_section_builder, :table_section_builder, :current_form
26
26
 
27
27
  def initialize(json, context, with_view_builder = false)
28
28
  @json = json
File without changes
@@ -127,6 +127,8 @@ module Glib
127
127
  end
128
128
 
129
129
  class Image < View
130
+ badgeable
131
+
130
132
  string :url
131
133
  string :base64Data
132
134
  action :onClick
@@ -134,12 +136,16 @@ module Glib
134
136
  end
135
137
 
136
138
  class Avatar < View
139
+ badgeable
140
+
137
141
  int :size
138
142
  string :url
139
143
  action :onClick
140
144
  end
141
145
 
142
146
  class Icon < View
147
+ badgeable
148
+
143
149
  # TODO: Remove later. Deprecated.
144
150
  icon :spec
145
151
 
@@ -171,6 +177,8 @@ module Glib
171
177
  # end
172
178
 
173
179
  class Button < View
180
+ badgeable
181
+
174
182
  icon :icon, cache: true
175
183
  string :text, cache: true
176
184
  action :onClick
@@ -207,11 +215,10 @@ module Glib
207
215
  end
208
216
 
209
217
  class Chip < View
218
+ badgeable
219
+
210
220
  string :text
211
221
  action :onClick
212
-
213
- string :badgeContent
214
- color :badgeColor
215
222
  end
216
223
 
217
224
  class Calendar < View
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -52,13 +52,11 @@ if local_assigns[:top_nav] || json_ui_app_is_web?
52
52
  action.windows_open url: json_ui_garage_url
53
53
  end
54
54
 
55
- menu.button icon: 'refresh', text: 'Reload', onClick: ->(action) do
55
+ menu.button icon: 'refresh', text: 'Reload', badge: { text: '!' }, onClick: ->(action) do
56
56
  action.windows_reload
57
57
  end
58
58
 
59
- # Consider deprecating icon badge
60
- # menu.button icon: { name: 'zoom_in', badge: '!' }, text: 'Diagnostics', onClick: ->(action) do
61
- menu.button icon: 'zoom_in', text: 'Diagnostics', badgeContent: '!', onClick: ->(action) do
59
+ menu.button icon: { name: 'zoom_in', badge: { text: '?', backgroundColor: '#00ffff' } }, text: 'Diagnostics', onClick: ->(action) do
62
60
  action.dialogs_alert message: %{
63
61
  Bundle ID: #{json_ui_app_bundle_id || '<unknown>'}
64
62
  App Version: #{json_ui_app_build_version || '<unknown>'}
@@ -0,0 +1,19 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
6
+
7
+ # The form will be automatically injected into the window.
8
+ #page.template 'full_window_form'
9
+
10
+ # TODO: This needs to produce page-level form attributes
11
+ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
12
+ # page.scroll padding: glib_json_padding_body, childViews: ->(form) do
13
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
14
+ form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
15
+ end
16
+
17
+ page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
18
+ footer.fields_submit text: 'Submit'
19
+ end
@@ -91,6 +91,11 @@ page.list sections: [
91
91
  action.windows_open url: json_ui_garage_url(path: 'forms/styled_boxes')
92
92
  end
93
93
  end
94
+ # section.rows builder: ->(template) do
95
+ # template.thumbnail title: 'Full Window', onClick: ->(action) do
96
+ # action.windows_open url: json_ui_garage_url(path: 'forms/full_window_form')
97
+ # end
98
+ # end
94
99
  end, ->(section) do
95
100
  section.header padding: glib_json_padding_list, childViews: ->(header) do
96
101
  header.h2 text: 'Web Only'
@@ -49,7 +49,7 @@ page.scroll childViews: ->(scroll) do
49
49
  end
50
50
 
51
51
  form.spacer height: 20
52
- form.h1 text: 'Radio Group'
52
+ form.h2 text: 'Radio Group'
53
53
  form.fields_radioGroup \
54
54
  name: 'user[seniority]',
55
55
  value: 'show',
@@ -65,6 +65,18 @@ page.scroll childViews: ->(scroll) do
65
65
  end
66
66
  end
67
67
 
68
+ form.spacer height: 20
69
+ form.h2 text: 'Text'
70
+ form.fields_text \
71
+ name: 'user[video_url]',
72
+ width: 'matchParent',
73
+ onChange: ->(action) do
74
+ action.sheets_select message: 'Submit data?', buttons: ->(menu) do
75
+ menu.button text: 'Yes, submit', onClick: ->(subaction) do
76
+ action.forms_submit
77
+ end
78
+ end
79
+ end
68
80
  end
69
81
 
70
82
  end
File without changes
File without changes
File without changes
File without changes
@@ -1,29 +1,29 @@
1
1
  json.title 'Pages'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
3
+ page = json_ui_page json
5
4
 
6
- page.template 'fullWidth'
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
7
6
 
8
- page.header childViews: ->(header) do
9
- header.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
10
- vertical.h1 text: 'Header'
11
- end
12
- header.spacer height: 10
7
+ page.template 'fullWidth'
8
+
9
+ page.header childViews: ->(header) do
10
+ header.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
11
+ vertical.h1 text: 'Header'
13
12
  end
13
+ header.spacer height: 10
14
+ end
14
15
 
15
- page.footer childViews: ->(footer) do
16
- footer.spacer height: 10
17
- footer.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
18
- vertical.h1 text: 'Footer'
19
- end
16
+ page.footer childViews: ->(footer) do
17
+ footer.spacer height: 10
18
+ footer.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
19
+ vertical.h1 text: 'Footer'
20
20
  end
21
+ end
21
22
 
22
- page.body childViews: ->(scroll) do
23
- scroll.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
24
- (1..100).each do |index|
25
- vertical.label text: 'Content'
26
- end
23
+ page.body childViews: ->(scroll) do
24
+ scroll.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
25
+ (1..100).each do |index|
26
+ vertical.label text: 'Content'
27
27
  end
28
28
  end
29
29
  end
File without changes
File without changes
@@ -7,6 +7,20 @@ json_ui_page json do |page|
7
7
  scroll.panels_column lg: { cols: 8 }, childViews: ->(column) do
8
8
  column.h2 text: 'Tab Bar with Badge'
9
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
+ ]
10
24
  {
11
25
  'FIRST' => 'home',
12
26
  'SECOND' => 'schedule',
@@ -15,8 +29,7 @@ json_ui_page json do |page|
15
29
  menu.button \
16
30
  icon: icon,
17
31
  text: text,
18
- badgeContent: [nil, 8, '⭐⭐⭐'][index],
19
- badgeColor: [nil, '#272551', '#008000'][index],
32
+ badge: badges[index],
20
33
  disabled: params[:tab].to_i == index,
21
34
  onClick: ->(action) do
22
35
  action.windows_reload \
File without changes
File without changes
File without changes
@@ -19,7 +19,7 @@ json_ui_page json do |page|
19
19
  scroll.h2 text: 'With select options'
20
20
  scroll.spacer height: 6
21
21
  scroll.banners_select width: 'matchParent', icon: 'info', message: 'This is a select banner', buttons: ->(menu) do
22
- menu.button icon: 'add', text: 'Add', badgeContent: 80, onClick: ->(action) do
22
+ menu.button icon: 'add', text: 'Add', badge: { text: 80 }, onClick: ->(action) do
23
23
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
24
24
  end
25
25
  menu.button icon: 'edit', text: 'Edit', onClick: ->(action) do
@@ -33,7 +33,7 @@ json_ui_page json do |page|
33
33
  submenu.button \
34
34
  icon: 'add',
35
35
  text: 'Option1',
36
- badgeContent: 3,
36
+ badge: { text: 3 },
37
37
  onClick: ->(action) do
38
38
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
39
39
  end
@@ -11,13 +11,20 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
11
11
  action.dialogs_alert message: 'Perform action'
12
12
  end
13
13
 
14
- scroll.button text: 'Buton with build-in classes', styleClasses: ['rounded', 'outlined', 'tile', 'depressed'], onClick: ->(action) do
14
+ scroll.spacer height: 10
15
+ scroll.button text: 'Button with built-in classes', styleClasses: ['rounded', 'outlined', 'tile', 'depressed'], onClick: ->(action) do
15
16
  action.dialogs_alert message: 'Perform action'
16
17
  end
17
18
 
18
- scroll.button icon: 'info', text: 'Button with Icon and Tooltip', tooltip: { text: 'Tooltip text' }, onClick: ->(action) do
19
- action.dialogs_alert message: 'Perform action'
20
- end
19
+ scroll.spacer height: 10
20
+ scroll.button \
21
+ icon: 'info',
22
+ text: 'Button with Icon and Tooltip',
23
+ tooltip: { text: 'Tooltip text' },
24
+ badge: { text: '3' },
25
+ onClick: ->(action) do
26
+ action.dialogs_alert message: 'Perform action'
27
+ end
21
28
  scroll.spacer height: 20
22
29
 
23
30
  scroll.button \
@@ -38,7 +45,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
38
45
  action.dialogs_alert message: 'Perform action'
39
46
  end
40
47
  scroll.spacer height: 10
41
- scroll.chip text: 'With Badge', badgeContent: '99'
48
+ scroll.chip text: 'With Badge', badge: { text: '99' }
42
49
 
43
50
  scroll.spacer height: 20
44
51
  scroll.h2 text: 'Switch'
@@ -12,4 +12,8 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
12
12
  scroll.h2 text: 'Icon with color'
13
13
  scroll.icon name: 'home', color: '#9370DB'
14
14
  scroll.icon name: 'home', color: '#9370DB80'
15
+
16
+ scroll.spacer height: 20
17
+ scroll.h2 text: 'Icon with badge'
18
+ scroll.icon name: 'home', badge: { text: '22', backgroundColor: '#00ff00' }
15
19
  end
@@ -13,10 +13,11 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
13
13
  url: glib_json_image_avatar_url,
14
14
  tooltip: { text: 'This is a tooltip' }
15
15
 
16
- # scroll.spacer height: 20
17
- # scroll.h2 text: 'Icon'
18
- # scroll.spacer height: 6
19
- # scroll.icon spec: 'info'
16
+ scroll.h2 text: 'Avatar with badge'
17
+ scroll.spacer height: 6
18
+ scroll.avatar \
19
+ url: glib_json_image_avatar_url,
20
+ badge: { text: '1', backgroundColor: '#0000ff' }
20
21
 
21
22
  scroll.spacer height: 20
22
23
  scroll.h2 text: 'Image with base64 data'
@@ -46,9 +47,9 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
46
47
  scroll.image url: glib_json_image_standard_url
47
48
 
48
49
  scroll.spacer height: 20
49
- scroll.h2 text: 'Original size'
50
+ scroll.h2 text: 'Original size with badge'
50
51
  scroll.spacer height: 6
51
- scroll.image url: small_image_url
52
+ scroll.image url: small_image_url, badge: { text: '1', backgroundColor: '#0000ff' }
52
53
 
53
54
  # Reference: https://docs.imgix.com/apis/url/size/fit#clip
54
55
  scroll.spacer height: 20
File without changes
data/config/routes.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/glib/crypt.rb CHANGED
File without changes
File without changes
File without changes
data/lib/glib/engine.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/glib/value.rb CHANGED
File without changes
data/lib/glib/version.rb CHANGED
File without changes
data/lib/glib-web.rb CHANGED
File without changes
data/lib/tasks/db.rake CHANGED
File without changes
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: 0.13.0
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -153,6 +153,7 @@ files:
153
153
  - app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder
154
154
  - app/views/json_ui/garage/forms/file_upload.json.jbuilder
155
155
  - app/views/json_ui/garage/forms/floating_submit.json.jbuilder
156
+ - app/views/json_ui/garage/forms/full_window_form.json.jbuilder
156
157
  - app/views/json_ui/garage/forms/generic_post.json.jbuilder
157
158
  - app/views/json_ui/garage/forms/index.json.jbuilder
158
159
  - app/views/json_ui/garage/forms/local_request.json.jbuilder
@@ -300,7 +301,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
301
  - !ruby/object:Gem::Version
301
302
  version: '0'
302
303
  requirements: []
303
- rubygems_version: 3.1.4
304
+ rubyforge_project:
305
+ rubygems_version: 2.7.6
304
306
  signing_key:
305
307
  specification_version: 4
306
308
  summary: ''