glib-web 3.0.0.pre.beta1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +18 -0
  3. data/app/helpers/glib/json_ui/action_builder/dialogs.rb +2 -0
  4. data/app/helpers/glib/json_ui/action_builder/popovers.rb +14 -0
  5. data/app/helpers/glib/json_ui/action_builder/snackbars.rb +1 -0
  6. data/app/helpers/glib/json_ui/action_builder/tours.rb +3 -0
  7. data/app/helpers/glib/json_ui/list_builders.rb +2 -4
  8. data/app/helpers/glib/json_ui/view_builder/fields.rb +4 -1
  9. data/app/helpers/glib/json_ui/view_builder/panels.rb +2 -0
  10. data/app/helpers/glib/json_ui/view_builder.rb +3 -0
  11. data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +1 -1
  12. data/app/views/json_ui/garage/forms/otp_field.json.jbuilder +7 -4
  13. data/app/views/json_ui/garage/forms/selects.json.jbuilder +7 -1
  14. data/app/views/json_ui/garage/forms/submit_on_change.json.jbuilder +37 -2
  15. data/app/views/json_ui/garage/lists/_autoload_section.json.jbuilder +1 -3
  16. data/app/views/json_ui/garage/lists/reordering.json.jbuilder +7 -1
  17. data/app/views/json_ui/garage/lists/templating.json.jbuilder +16 -0
  18. data/app/views/json_ui/garage/panels/_hover_views_content.json.jbuilder +4 -4
  19. data/app/views/json_ui/garage/panels/_timeline_content.json.jbuilder +0 -1
  20. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +13 -0
  21. data/app/views/json_ui/garage/panels/index.json.jbuilder +6 -6
  22. data/app/views/json_ui/garage/panels/split.json.jbuilder +1 -1
  23. data/app/views/json_ui/garage/panels/ul.json.jbuilder +6 -3
  24. data/app/views/json_ui/garage/views/controls.json.jbuilder +45 -10
  25. data/app/views/layouts/json_ui/renderer.html.erb +3 -2
  26. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36c7ef52875565dc8845937e540ad4bb859c2c1d8c2413a6eb2610e02011cc42
4
- data.tar.gz: f7bc7fedc31848d543ba0e79404d293a611cdbbcb20573a37645d28e81fba19a
3
+ metadata.gz: 1893d7f9752d6b6fa88f44c3cf3992aafff393b4b10638ca989b82859c47c716
4
+ data.tar.gz: 7c19f36849c4ff6d58f1e53657c7f639b1a6d69fb1d4810c1a3a4d71ad652f8b
5
5
  SHA512:
6
- metadata.gz: 47910b5b21257d0d2902ff536ff2c1cb13e8154ee1bc2a919f66b1dc1ade9a7aedd967a1abc1d9deef2f7286ac0720db6bda4adb33d44ea0cea2af3de94738a2
7
- data.tar.gz: 0fd5393e2bec762bd4b05d46f825ba168a31454ccc7d6100d286f706cebb2a40ef6eba9662651dbb389074375e973b9b15ae58d74d481a72a7b61e39c83df8c1
6
+ metadata.gz: 45a1be444dc544ac2957134c50cc8035ebd1a114b2eb724fbb3f2bc9d8cb845beca2f370670a6c74f46dcdd9892e4ac1b033c73ba20704a8ee2bd243733c4b94
7
+ data.tar.gz: 0f31ccbe16452d786d71c0c314753c03cd7d92476b0a392b9231d3b07110a01db1c2788a1937ddf073489656a00f2fb73c92b81e6e3f6b108c97e9c4281c08d1
@@ -36,6 +36,24 @@ module Glib::Json::Libs
36
36
  json_ui_app_device_os == 'web'
37
37
  end
38
38
 
39
+ def json_ui_etag
40
+ template = "#{controller_name}/#{action_name}"
41
+
42
+ # 1) It's necessary to pass in the template explicitly because of the switching between JSON
43
+ # and HTML rendering.
44
+ #
45
+ # 2) When a model is not provided, two pages the use the same template (e.g. `projects#show`)
46
+ # will produce the exact same ETAG, even though their content might be different. Presumably
47
+ # this is because the ETAG is calculated based on the static template as opposed to the
48
+ # generated output.
49
+ #
50
+ # However, this is not a problem because the browser will still treat these pages as
51
+ # separate because they have different URLs (e.g. `projects/1` vs `projects/2`), meaning
52
+ # that it will not accidentally use the cache from a different URL even though the ETAG
53
+ # is exactly the same.
54
+ fresh_when nil, template: template
55
+ end
56
+
39
57
  def json_ui_render(template, args = {})
40
58
  JSON.parse(render_to_string(template, locals: args))
41
59
  end
@@ -1,6 +1,7 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Dialogs
3
3
  class Alert < Action
4
+ string :title
4
5
  string :message
5
6
  action :onLoad
6
7
  action :onClose
@@ -44,6 +45,7 @@ class Glib::JsonUi::ActionBuilder
44
45
  bool :showClose
45
46
  string :fullscreen
46
47
  length :width
48
+ length :height
47
49
  end
48
50
 
49
51
  class Reload < Action
@@ -0,0 +1,14 @@
1
+ class Glib::JsonUi::ActionBuilder
2
+ module Popovers
3
+ class Open < Action
4
+ string :key
5
+ views :childViews
6
+ string :location
7
+ int :offset
8
+ end
9
+
10
+ class Close < Action
11
+ string :key
12
+ end
13
+ end
14
+ end
@@ -8,6 +8,7 @@ class Glib::JsonUi::ActionBuilder
8
8
 
9
9
  string :verticalPosition
10
10
  string :horizontalPosition
11
+ string :location
11
12
  singleton_array :styleClass, :styleClasses
12
13
  end
13
14
 
@@ -9,5 +9,8 @@ class Glib::JsonUi::ActionBuilder
9
9
  array :steps
10
10
  int :startFrom
11
11
  end
12
+
13
+ class Stop < Action
14
+ end
12
15
  end
13
16
  end
@@ -37,7 +37,7 @@ module Glib
37
37
  action :onLongPress
38
38
  icon :icon
39
39
  bool :avatar
40
- action :onReorder
40
+ # action :onReorder
41
41
  string :paramNameForFormData
42
42
  string :paramNameForNewAbsoluteIndex
43
43
  string :paramNameForNewSectionIndex
@@ -46,9 +46,7 @@ module Glib
46
46
  string :id # Deprecated
47
47
  string :paramNameForNewIndex # Deprecated
48
48
 
49
- # # NOTE: Experimental. Still deciding whether this needs to be a full blown panel or
50
- # # an array of badges (with relevant properties, e.g. text, color, etc)
51
- # views :accessoryViews
49
+ panels_builder :accessory, :header, :body, :footer
52
50
  end
53
51
 
54
52
  class Featured < Standard
@@ -76,6 +76,7 @@ class Glib::JsonUi::ViewBuilder
76
76
  class Text < AbstractField
77
77
  int :maxLength
78
78
  icon :leftIcon
79
+ icon :rightIcon
79
80
  string :leftText
80
81
  string :rightText
81
82
  action :onTypeStart
@@ -114,6 +115,7 @@ class Glib::JsonUi::ViewBuilder
114
115
  class Submit < AbstractField
115
116
  string :text
116
117
  color :color
118
+ icon :icon
117
119
  end
118
120
 
119
121
  class CheckGroup < AbstractField
@@ -301,7 +303,8 @@ class Glib::JsonUi::ViewBuilder
301
303
  end
302
304
 
303
305
  class Otp < AbstractField
304
- int :lengths
306
+ int :length
307
+ string :type
305
308
  end
306
309
 
307
310
  class Rating < AbstractField
@@ -140,6 +140,7 @@ class Glib::JsonUi::ViewBuilder
140
140
  action :onScrollToBottom
141
141
 
142
142
  int :responsiveCols
143
+ hash :dragSupport
143
144
 
144
145
  def firstSection(block)
145
146
  json.sections [1] do
@@ -242,6 +243,7 @@ class Glib::JsonUi::ViewBuilder
242
243
  string :distribution
243
244
  string :align
244
245
  action :onClick
246
+ hash :dragSupport
245
247
  end
246
248
 
247
249
  class Flow < View
@@ -44,6 +44,9 @@ module Glib
44
44
  hash :tooltip
45
45
  array :extensions
46
46
 
47
+ action :onMouseEnter
48
+ action :onMouseLeave
49
+
47
50
 
48
51
  # def initialize(json, page)
49
52
  # super(json, page)
@@ -27,7 +27,7 @@ section.rows builder: ->(template) do
27
27
  end
28
28
 
29
29
  template.thumbnail title: 'snackbars with styling', onClick: ->(action) do
30
- action.snackbars_alert message: 'This is a styled snackbar', verticalPosition: 'top', styleClass: 'success'
30
+ action.snackbars_alert message: 'This is a styled snackbar', location: 'top', styleClass: 'success'
31
31
  end
32
32
 
33
33
  end
@@ -14,21 +14,24 @@ page.form \
14
14
  form.spacer height: 6
15
15
  form.fields_otp \
16
16
  name: 'user[otp_summary1]',
17
- lengths: 7
17
+ length: 7,
18
+ type: 'text'
18
19
 
19
20
  form.spacer height: 20
20
- form.h2 text: 'OTP Custom Length'
21
+ form.h2 text: 'OTP Custom Length and input type number'
21
22
  form.spacer height: 6
22
23
  form.fields_otp \
23
24
  name: 'user[otp_summary2]',
24
- lengths: 3
25
+ length: 3,
26
+ type: 'number'
25
27
 
26
28
  form.spacer height: 20
27
29
  form.h2 text: 'OTP with Long Field'
28
30
  form.spacer height: 6
29
31
  form.fields_otp \
30
32
  name: 'user[otp_summary3]',
31
- lengths: 20
33
+ length: 20,
34
+ type: 'text'
32
35
 
33
36
  form.spacer height: 20
34
37
  form.fields_submit text: 'Submit'
@@ -15,7 +15,13 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
15
15
  'melbourne' => 'Melbourne',
16
16
  'sydney' => 'Sydney',
17
17
  }
18
- form.fields_select name: 'user[city]', width: 'matchParent', label: 'City', options: languages.map { |k, v| { value: k, text: v } }, value: 'canberra'
18
+ form.fields_select \
19
+ name: 'user[city]',
20
+ width: 'matchParent',
21
+ label: 'City1',
22
+ placeholder: 'This is a placeholder',
23
+ options: languages.map { |k, v| { value: k, text: v } },
24
+ value: 'canberra'
19
25
  form.fields_select name: 'user[cities][]', width: 'matchParent', label: 'Cities', options: languages.map { |k, v| { value: k, text: v } }, value: ['melbourne', 'sydney'], multiple: true
20
26
 
21
27
  form.spacer height: 20
@@ -17,8 +17,11 @@ page.scroll childViews: ->(scroll) do
17
17
  checkValue: '16+',
18
18
  uncheckValue: '0-16',
19
19
  label: 'I am over 16 (has default value)',
20
+ paramNameForFormData: 'message',
20
21
  onChange: ->(action) do
21
- action.forms_submit
22
+ action.dialogs_alert title: 'Submit data?', onClose: ->(subaction) do
23
+ action.forms_submit
24
+ end
22
25
  end
23
26
 
24
27
  form.fields_check \
@@ -43,7 +46,7 @@ page.scroll childViews: ->(scroll) do
43
46
  onChange: ->(action) do
44
47
  action.snackbars_select message: 'Submit data?', buttons: ->(menu) do
45
48
  menu.button text: 'Yes, submit', onClick: ->(subaction) do
46
- action.forms_submit
49
+ subaction.forms_submit
47
50
  end
48
51
  end
49
52
  end
@@ -57,6 +60,7 @@ page.scroll childViews: ->(scroll) do
57
60
  group.fields_radio value: 'senior', label: 'Senior'
58
61
  group.fields_radio value: 'junior', label: 'Junior'
59
62
  end,
63
+ paramNameForFormData: 'message',
60
64
  onChange: ->(action) do
61
65
  action.sheets_select message: 'Submit data?', buttons: ->(menu) do
62
66
  menu.button text: 'Yes, submit', onClick: ->(subaction) do
@@ -78,6 +82,20 @@ page.scroll childViews: ->(scroll) do
78
82
  end
79
83
  end
80
84
 
85
+
86
+ form.spacer height: 20
87
+ form.h2 text: 'Textarea'
88
+ form.fields_textarea \
89
+ name: 'user[bio]',
90
+ width: 'matchParent',
91
+ onChange: ->(action) do
92
+ action.sheets_select message: 'Submit data?', buttons: ->(menu) do
93
+ menu.button text: 'Yes, submit', onClick: ->(subaction) do
94
+ action.forms_submit
95
+ end
96
+ end
97
+ end
98
+
81
99
  form.spacer height: 20
82
100
  form.h2 text: 'Text (Asynchronous)'
83
101
  form.fields_text \
@@ -86,6 +104,23 @@ page.scroll childViews: ->(scroll) do
86
104
  onChange: ->(action) do
87
105
  action.http_post url: json_ui_garage_url(path: 'forms/generic_post')
88
106
  end
107
+
108
+ form.spacer height: 20
109
+ rules = { fileType: 'image', maxFileSize: 5000, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
110
+ form.fields_file \
111
+ name: 'user[photo][]',
112
+ width: 'matchParent',
113
+ label: 'Avatar',
114
+ accepts: rules,
115
+ directUploadUrl: rails_direct_uploads_url,
116
+ placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJ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PgbcDu+y0ESxQYREQEREBERAREQEREBERARfTGE4BdDGNbiaoNbYUhN3QfdbQy9penJYZMGbsONao4EmbcO3OiAHX6YbUL7uj+6rLyDq48KURpAEjj+5VQC25XHYgbfrhsWGAjWw41R4J1cOFKoMllyo5IGX6lYYCDN2HdHgkzbh2QGvv0NNqF93RWXkGjce1EaQBJ2Pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' },
117
+ onChange: ->(action) do
118
+ action.sheets_select message: 'Submit data?', buttons: ->(menu) do
119
+ menu.button text: 'Yes, submit', onClick: ->(subaction) do
120
+ action.forms_submit
121
+ end
122
+ end
123
+ end
89
124
  end
90
125
 
91
126
  end
@@ -11,9 +11,7 @@ section.rows builder: ->(row) do
11
11
  array.each do |i|
12
12
  index = page_index * batch_count + i
13
13
  if local_assigns[:reorder]
14
- row.thumbnail title: "Item #{index}", onReorder: ->(action) do
15
- action.dialogs_notification title: "Item #{index}"
16
- end, paramNameForFormData: 'message', paramNameForNewIndex: 'new_index'
14
+ row.thumbnail title: "Item #{index}"
17
15
  else
18
16
  row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
19
17
  end
@@ -30,5 +30,11 @@ else
30
30
  end
31
31
  render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reorder: true
32
32
  end
33
- ]
33
+ ], dragSupport: {
34
+ onDrop: {
35
+ action: 'dialogs/alert'
36
+ },
37
+ paramNameForFormData: 'message',
38
+ paramNameForNewIndex: 'new_index'
39
+ }
34
40
  end
@@ -11,6 +11,22 @@ json_ui_page json do |page|
11
11
  section.rows builder: ->(template) do
12
12
  template.thumbnail title: 'Click me', onClick: ->(action) do
13
13
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
14
+ end,
15
+ accessory: ->(accessory) do
16
+ accessory.header \
17
+ width: 'matchParent',
18
+ backgroundColor: '#b3bac2',
19
+ padding: { top: 10, bottom: 10, left: 10, right: 10 },
20
+ childViews: ->(bottom) do
21
+ bottom.label text: 'Custom row header'
22
+ end
23
+ accessory.footer \
24
+ width: 'matchParent',
25
+ backgroundColor: '#b3bac2',
26
+ padding: { top: 10, bottom: 10, left: 10, right: 10 },
27
+ childViews: ->(bottom) do
28
+ bottom.label text: 'Custom row footer'
29
+ end
14
30
  end
15
31
  template.thumbnail title: 'Item with icon and subtitle', subtitle: 'Item subtitle', icon: 'facebook'
16
32
  template.thumbnail title: 'Item with chips', chips: ->(menu) do
@@ -2,7 +2,7 @@ text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
2
2
  value = ''
3
3
  i.times { value += text }
4
4
 
5
- hover.panels_responsive padding: {top: 24, right: 24, bottom: 24, left: 24 }, childViews: ->(responsive) do
5
+ hover.panels_responsive padding: { top: 24, right: 24, bottom: 24, left: 24 }, childViews: ->(responsive) do
6
6
  responsive.avatar url: glib_json_image_avatar_url
7
7
 
8
8
  responsive.spacer height: 8
@@ -10,9 +10,9 @@ hover.panels_responsive padding: {top: 24, right: 24, bottom: 24, left: 24 }, ch
10
10
  responsive.spacer height: 8
11
11
 
12
12
  responsive.h2 text: 'Hover View'
13
- responsive.p text:value
13
+ responsive.p text: value
14
14
  responsive.spacer height: 24
15
- responsive.button text: 'Button', onClick:->(action) do
15
+ responsive.button text: 'Button', onClick: ->(action) do
16
16
  action.dialogs_alert message: 'Clicked'
17
17
  end
18
- end
18
+ end
@@ -1,7 +1,6 @@
1
1
  progress = params[:progress]&.to_i&.between?(0, 5) ? params[:progress].to_i : 0
2
2
 
3
3
  tview.panels_responsive \
4
- width: 400,
5
4
  childViews: ->(res) do
6
5
  res.panels_column sm: { cols: 11 }, childViews: ->(subcolumn) do
7
6
  subcolumn.panels_column sm: { cols: 2, padding: { right: 10 } }, childViews: ->(inner_column) do
@@ -127,6 +127,19 @@ json_ui_page json do |page|
127
127
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
128
128
  end
129
129
 
130
+ scroll.spacer height: 20
131
+ scroll.h1 text: 'Drag-and-drop support'
132
+ scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
133
+ panel.button id: 'button1', text: '1'
134
+ panel.button id: 'button2', text: '2'
135
+ panel.button id: 'button3', text: '3'
136
+ end, dragSupport: {
137
+ onDrop: {
138
+ action: 'dialogs/alert',
139
+ },
140
+ paramNameForFormData: 'message'
141
+ }
142
+
130
143
  scroll.label text: "\n"
131
144
  end
132
145
  end
@@ -30,9 +30,9 @@ json_ui_page json do |page|
30
30
  template.thumbnail title: 'Unordered List', subtitle: 'Bullet points similar to HTML\'s <ul> tag', onClick: ->(action) do
31
31
  action.windows_open url: json_ui_garage_url(path: 'panels/ul')
32
32
  end
33
- template.thumbnail title: 'Timeline', subtitle: 'Timeline component with responsive panel as the childviews', onClick: ->(action) do
34
- action.windows_open url: json_ui_garage_url(path: 'panels/timeline')
35
- end
33
+ # template.thumbnail title: 'Timeline', subtitle: 'Timeline component with responsive panel as the childviews', onClick: ->(action) do
34
+ # action.windows_open url: json_ui_garage_url(path: 'panels/timeline')
35
+ # end
36
36
  end
37
37
  end, ->(section) do
38
38
  section.header padding: glib_json_padding_list, childViews: ->(header) do
@@ -87,9 +87,9 @@ json_ui_page json do |page|
87
87
  template.thumbnail title: 'Column', subtitle: 'Adds control over layout inside a responsive panel', onClick: ->(action) do
88
88
  action.windows_open url: json_ui_garage_url(path: 'panels/responsive')
89
89
  end
90
- template.thumbnail title: 'Hover', subtitle: 'Popover triggered by hover', onClick: ->(action) do
91
- action.windows_open url: json_ui_garage_url(path: 'panels/hover')
92
- end
90
+ # template.thumbnail title: 'Hover', subtitle: 'Popover triggered by hover', onClick: ->(action) do
91
+ # action.windows_open url: json_ui_garage_url(path: 'panels/hover')
92
+ # end
93
93
  end
94
94
  end, ->(section) do
95
95
  section.header padding: glib_json_padding_list, childViews: ->(header) do
@@ -72,7 +72,7 @@ json_ui_page json do |page|
72
72
  left.button text: '1'
73
73
  end
74
74
  content.center childViews: ->(center) do
75
- center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
75
+ center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
76
76
  end
77
77
  content.right childViews: ->(right) do
78
78
  right.button text: '2'
@@ -26,7 +26,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
26
26
  end
27
27
 
28
28
  scroll.spacer height: 14
29
- scroll.h2 text: 'Breadcrumbs'
29
+ scroll.h2 text: 'Breadcrumbs (experimental)'
30
30
  scroll.spacer height: 6
31
31
  scroll.panels_ul \
32
32
  width: 'matchParent',
@@ -37,8 +37,11 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
37
37
  ul.button text: 'Level 1', styleClass: 'link', onClick: ->(action) do
38
38
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
39
39
  end
40
- ul.button text: 'Level 2', styleClass: 'link', onClick: ->(action) do
41
- action.windows_open url: json_ui_garage_url(path: 'home/blank')
40
+
41
+ ul.button icon: 'keyboard_arrow_down', text: 'Level 2', styleClass: 'link', childButtons: ->(menu) do
42
+ menu.button text: 'Dropdown item 1'
43
+ menu.button text: 'Dropdown item 2'
44
+ menu.button text: 'Dropdown item 3'
42
45
  end
43
46
  ul.label text: 'Level 3'
44
47
  end
@@ -27,23 +27,58 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
27
27
  end
28
28
 
29
29
  scroll.spacer height: 10
30
- scroll.button text: 'Button with dropdown', childButtons: ->(menu) do
31
- menu.button text: 'Dropdown item 1'
32
- menu.button text: 'Dropdown item 2'
33
- menu.button text: 'Dropdown item 3'
30
+ scroll.button text: 'Button with dropdown', onClick: ->(action) do
31
+ action.popovers_open \
32
+ key: 'menu',
33
+ location: 'bottom',
34
+ childViews: ->(view) do
35
+ view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
36
+ res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
37
+ saction.popovers_close key: 'menu'
38
+ end
39
+ res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
40
+ saction.popovers_close key: 'menu'
41
+ end
42
+ res.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(saction) do
43
+ saction.popovers_close key: 'menu'
44
+ end
45
+ end
46
+ end
34
47
  end
35
48
 
36
49
  scroll.spacer height: 10
37
- scroll.button text: 'Button with tooltip and dropdown', tooltip: { text: 'Tooltip text' }, childButtons: ->(menu) do
38
- menu.button text: 'Dropdown item 1'
39
- menu.button text: 'Dropdown item 2'
40
- menu.button text: 'Dropdown item 3'
41
- end
50
+ scroll.button \
51
+ text: 'Button with tooltip and dropdown',
52
+ onMouseEnter: ->(action) {
53
+ action.popovers_open \
54
+ key: 'tooltip',
55
+ location: 'top',
56
+ childViews: ->(view) { view.p styleClass: 'tooltip', text: 'Tooltip 1' }
57
+ },
58
+ onMouseLeave: ->(action) { action.popovers_close key: 'tooltip' },
59
+ onClick: ->(action) do
60
+ action.popovers_open \
61
+ key: 'menu',
62
+ location: 'right',
63
+ childViews: ->(view) do
64
+ view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
65
+ res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
66
+ saction.popovers_close key: 'menu'
67
+ end
68
+ res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
69
+ saction.popovers_close key: 'menu'
70
+ end
71
+ res.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(saction) do
72
+ saction.popovers_close key: 'menu'
73
+ end
74
+ end
75
+ end
76
+ end
42
77
 
43
78
  scroll.spacer height: 20
44
79
  scroll.button \
45
80
  icon: 'info',
46
- styleClass: 'icon',
81
+ styleClasses: ['icon', 'plain'],
47
82
  tooltip: { text: 'Disabled Icon button with tooltip text and custom tooltip position', position: 'right' },
48
83
  disabled: true
49
84
  scroll.spacer height: 20
@@ -12,10 +12,11 @@
12
12
  <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
13
13
 
14
14
  <%= vite_stylesheet_tag 'vue_renderer' %>
15
-
15
+ <%# TODO: Remove this, for dev only %>
16
+ <%# <script src="https://cdn.tailwindcss.com"></script> %>
16
17
  <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
17
18
  <%# 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
+ <%# <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" /> %>
19
20
  <%= yield :head %>
20
21
  <% if @__glib_head_code %>
21
22
  <%= @__glib_head_code.html_safe %>
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: 3.0.0.pre.beta1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -98,6 +98,7 @@ files:
98
98
  - app/helpers/glib/json_ui/action_builder/http.rb
99
99
  - app/helpers/glib/json_ui/action_builder/iap.rb
100
100
  - app/helpers/glib/json_ui/action_builder/panels.rb
101
+ - app/helpers/glib/json_ui/action_builder/popovers.rb
101
102
  - app/helpers/glib/json_ui/action_builder/sheets.rb
102
103
  - app/helpers/glib/json_ui/action_builder/snackbars.rb
103
104
  - app/helpers/glib/json_ui/action_builder/tours.rb
@@ -309,9 +310,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
310
  version: '0'
310
311
  required_rubygems_version: !ruby/object:Gem::Requirement
311
312
  requirements:
312
- - - ">"
313
+ - - ">="
313
314
  - !ruby/object:Gem::Version
314
- version: 1.3.1
315
+ version: '0'
315
316
  requirements: []
316
317
  rubygems_version: 3.1.4
317
318
  signing_key: