glib-web 0.2.1 → 0.2.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
  SHA1:
3
- metadata.gz: 16cdd34be25cdf7ddc7eed6386b812fad3344f9d
4
- data.tar.gz: 22e6e356684d59ef1eacafc4db92f1ba3b65cc3e
3
+ metadata.gz: 6172e95852bba5794a140c99ad5e82fe0c744794
4
+ data.tar.gz: 2bcf5c2e01de6e21b29a48a6cb27e8818481e244
5
5
  SHA512:
6
- metadata.gz: 760f82dd68348ebe244c5b4a9a13ab4250b39ccb4aaeb8cda728d51b936be3e5603d06021a7a78313da84eb73670052d35e133b84c2b3cc81199af5380726dfe
7
- data.tar.gz: 94fa00daca4205c602579f97c6b4ee5e1846736b301b07ac2fea10efa05b9e5800302ad2c96d04fb69bcd817325e9aaca1cb3530f039fb9f01a94dcf975ef4db
6
+ metadata.gz: 84d11ec676c1d58f85efe5d40a6b6cc001ed4243f1038ee4b4316a7df2452018d8e7797f9fcfcacb1cbbe2478305afe4ee90505b3de9c259a08c588757fd9610
7
+ data.tar.gz: db45ed05de333b5b83b254d783d00bb175202a1912682a6b2fe0e860f455af25f5771b7f851f8e1a858b63e42dc857ce650dad41e292a66fcb60768eed26dad0
@@ -7,6 +7,8 @@ module Glib
7
7
  end
8
8
 
9
9
  class AbstractTemplate < JsonUiElement
10
+ # hash :padding
11
+
10
12
  def editButtons(block)
11
13
  json.editButtons do
12
14
  block.call page.menu_builder
@@ -27,9 +29,6 @@ module Glib
27
29
  end
28
30
  end
29
31
 
30
- # class Sections < AbstractBuilder
31
- # end
32
-
33
32
  class Section < AbstractBuilder
34
33
  def initialize json, page, template
35
34
  super json, page
@@ -41,24 +40,10 @@ module Glib
41
40
  json.padding options[:padding]
42
41
  json.childViews do
43
42
  options[:childViews]&.call page.view_builder
44
- # yield page.view_builder
45
43
  end
46
44
  end
47
45
  end
48
46
 
49
- # def rows(array = nil)
50
- # template = page.list_template_builder
51
- # json.rows do
52
- # if array
53
- # array.each do |object|
54
- # yield template, object
55
- # end
56
- # else
57
- # yield template
58
- # end
59
- # end
60
- # end
61
-
62
47
  def rows(options = {})
63
48
  block = options[:builder]
64
49
  json.rows do
@@ -77,7 +62,6 @@ module Glib
77
62
  json.padding options[:padding]
78
63
  json.childViews do
79
64
  options[:childViews]&.call page.view_builder
80
- # yield page.view_builder
81
65
  end
82
66
  end
83
67
  end
@@ -0,0 +1,9 @@
1
+ module Glib
2
+ module JsonUi
3
+ module StylingHelper
4
+ def body_padding
5
+ { top: 12, left: 20, right: 20, bottom: 12 }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -47,7 +47,14 @@ class Glib::JsonUi::ViewBuilder
47
47
  class Hidden < Text
48
48
  end
49
49
 
50
+ class CheckGroup < View
51
+ string :name
52
+ views :childViews
53
+ string :uncheckValue
54
+ end
55
+
50
56
  class Check < Text
57
+ string :uncheckValue
51
58
  end
52
59
 
53
60
  # This doesn't use camel case because some terms have become single words (e.g. snackbar)
@@ -66,6 +73,7 @@ class Glib::JsonUi::ViewBuilder
66
73
  class Select < AbstractField
67
74
  array :options
68
75
  bool :readOnly
76
+ bool :multiple
69
77
  end
70
78
 
71
79
  class RadioGroup < View
@@ -14,6 +14,8 @@ module Glib
14
14
  length :height
15
15
  color :backgroundColor
16
16
  hash :padding
17
+ array :styleClasses
18
+ singleton_array :styleClass, :styleClasses
17
19
  end
18
20
 
19
21
  ### View definitions
@@ -31,7 +33,14 @@ module Glib
31
33
  string :text
32
34
  end
33
35
 
34
- class Br < View
36
+ class H4 < View
37
+ string :text
38
+ end
39
+
40
+ # class Br < View
41
+ # end
42
+
43
+ class Spacer < View
35
44
  end
36
45
 
37
46
  class Hr < View
@@ -41,8 +50,6 @@ module Glib
41
50
  icon :icon
42
51
  string :text
43
52
  action :onClick
44
- array :styleClasses
45
- singleton_array :styleClass, :styleClasses
46
53
  end
47
54
 
48
55
  class Fab < View
@@ -56,6 +63,11 @@ module Glib
56
63
  action :onClick
57
64
  end
58
65
 
66
+ class Avatar < View
67
+ string :url
68
+ action :onClick
69
+ end
70
+
59
71
  class Label < View
60
72
  string :text
61
73
  end
@@ -3,19 +3,10 @@ json.title 'Forms'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
6
+ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
7
7
  form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
8
8
  form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
9
9
 
10
- form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
11
- group.h3 text: 'Gender'
12
- group.br height: 6
13
- group.fields_radio value: 'M', label: 'Male'
14
- group.fields_radio value: 'F', label: 'Female'
15
- end
16
-
17
- form.fields_check name: 'user[employer]', value: 1, label: 'I am an employer'
18
-
19
10
  form.panels_split width: 'matchParent', rightViews: ->(split) do
20
11
  split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
21
12
  end
@@ -0,0 +1,139 @@
1
+ json.title 'Forms'
2
+
3
+ json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.panels_form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
8
+ form.spacer height: 20
9
+ form.h2 text: 'Radio Group'
10
+ form.spacer height: 6
11
+ form.h4 text: 'Gender'
12
+ form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
13
+ group.fields_radio value: 'M', label: 'Male'
14
+ group.fields_radio value: 'F', label: 'Female'
15
+ end
16
+
17
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
18
+ end
19
+
20
+ scroll.panels_form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
21
+ form.spacer height: 20
22
+ form.h2 text: 'Check Group'
23
+ form.fields_checkGroup name: 'user[skills][]', uncheckValue: 1, childViews: ->(group) do
24
+ form.fields_check value: 2, label: 'Game Development'
25
+ form.fields_check value: 3, label: 'Web Development'
26
+ form.fields_check value: 4, label: 'Mobile Development'
27
+ end
28
+ # form.fields_check name: 'user[skills][]', value: 1, label: 'Game Development'
29
+ # form.fields_check name: 'user[skills][]', value: 2, label: 'Web Development'
30
+ # form.fields_check name: 'user[skills][]', value: 3, label: 'Mobile Development'
31
+
32
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
33
+ end
34
+
35
+ scroll.panels_form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
36
+ form.spacer height: 20
37
+ form.h2 text: 'Single Check'
38
+ form.fields_check name: 'user[employer]', value: 2, uncheckValue: 1, label: 'I am an employer'
39
+
40
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
41
+ end
42
+ end
43
+
44
+
45
+ # form.spacer height: 20
46
+ # form.h2 text: 'Radio/Check'
47
+ # form.spacer height: 6
48
+ # form.h4 text: 'Gender'
49
+ # form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
50
+ # group.fields_radio value: 'M', label: 'Male'
51
+ # group.fields_radio value: 'F', label: 'Female'
52
+ # end
53
+
54
+ # page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
55
+ # # form.h2 text: 'Select'
56
+ # # form.spacer height: 6
57
+ # # languages = {
58
+ # # 'zh-HK' => 'Hong Kong',
59
+ # # 'zh-TW' => 'Taiwan',
60
+ # # 'zh-CN' => 'China',
61
+ # # 'ja-JP' => 'Japan',
62
+ # # 'ko-KR' => 'Korea',
63
+ # # 'ru-RU' => 'Russian',
64
+ # # 'en-PH' => 'Philippines'
65
+ # # }
66
+ # # form.fields_select name: 'user[primary_language]', width: 'matchParent', label: 'Primary Language', options: languages.map { |k, v| { value: k, text: v } }, value: 'ja-JP'
67
+ # # form.fields_select name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages', options: languages.map { |k, v| { value: k, text: v } }, value: ['ja-JP', 'ko-KR'], multiple: true
68
+
69
+ # # form.spacer height: 20
70
+ # # form.h2 text: 'Date/Time'
71
+ # # form.spacer height: 6
72
+ # # form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
73
+ # # form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
74
+
75
+ # # form.spacer height: 20
76
+ # # form.h2 text: 'Radio/Check'
77
+ # # form.spacer height: 6
78
+ # # form.h4 text: 'Gender'
79
+ # # form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
80
+ # # group.fields_radio value: 'M', label: 'Male'
81
+ # # group.fields_radio value: 'F', label: 'Female'
82
+ # # end
83
+ # form.fields_check name: 'user[skills][]', value: 1, label: 'Game Development'
84
+ # form.fields_check name: 'user[skills][]', value: 2, label: 'Web Development'
85
+ # form.fields_check name: 'user[skills][]', value: 3, label: 'Mobile Development'
86
+
87
+ # # form.spacer height: 20
88
+ # # form.h2 text: 'Map'
89
+ # # form.spacer height: 6
90
+ # # form.fields_latLong name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
91
+ # # latitudeField: { name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
92
+ # # longitudeField: { name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true }
93
+
94
+ # form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
95
+ # end
96
+
97
+ # page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
98
+ # # form.h2 text: 'Select'
99
+ # # form.spacer height: 6
100
+ # # languages = {
101
+ # # 'zh-HK' => 'Hong Kong',
102
+ # # 'zh-TW' => 'Taiwan',
103
+ # # 'zh-CN' => 'China',
104
+ # # 'ja-JP' => 'Japan',
105
+ # # 'ko-KR' => 'Korea',
106
+ # # 'ru-RU' => 'Russian',
107
+ # # 'en-PH' => 'Philippines'
108
+ # # }
109
+ # # form.fields_select name: 'user[primary_language]', width: 'matchParent', label: 'Primary Language', options: languages.map { |k, v| { value: k, text: v } }, value: 'ja-JP'
110
+ # # form.fields_select name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages', options: languages.map { |k, v| { value: k, text: v } }, value: ['ja-JP', 'ko-KR'], multiple: true
111
+
112
+ # # form.spacer height: 20
113
+ # # form.h2 text: 'Date/Time'
114
+ # # form.spacer height: 6
115
+ # # form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
116
+ # # form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
117
+
118
+ # # form.spacer height: 20
119
+ # # form.h2 text: 'Radio/Check'
120
+ # # form.spacer height: 6
121
+ # # form.h4 text: 'Gender'
122
+ # # form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
123
+ # # group.fields_radio value: 'M', label: 'Male'
124
+ # # group.fields_radio value: 'F', label: 'Female'
125
+ # # end
126
+ # form.fields_check name: 'user[skills][]', value: 1, label: 'Game Development'
127
+ # form.fields_check name: 'user[skills][]', value: 2, label: 'Web Development'
128
+ # form.fields_check name: 'user[skills][]', value: 3, label: 'Mobile Development'
129
+
130
+ # # form.spacer height: 20
131
+ # # form.h2 text: 'Map'
132
+ # # form.spacer height: 6
133
+ # # form.fields_latLong name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
134
+ # # latitudeField: { name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
135
+ # # longitudeField: { name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true }
136
+
137
+ # form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
138
+ # end
139
+ end
@@ -1,5 +1,3 @@
1
- sleep 0.5
2
-
3
1
  json_ui_response json do |action|
4
- action.dialogs_alert message: 'Success!'
2
+ action.dialogs_alert message: "Submitted information: #{params.require(:user).values.join(", ")}"
5
3
  end
@@ -6,7 +6,7 @@ json_ui_page json do |page|
6
6
  page.list sections: [
7
7
  ->(section) do
8
8
  section.header padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(header) do
9
- header.h3 text: 'Form Fields'
9
+ header.h2 text: 'Form Fields'
10
10
  end
11
11
 
12
12
  section.rows builder: ->(template) do
@@ -16,6 +16,9 @@ json_ui_page json do |page|
16
16
  template.thumbnail title: 'Pickers (TODO: web, ios, android)', onClick: ->(action) do
17
17
  action.windows_open url: json_ui_garage_url(path: 'forms/pickers')
18
18
  end
19
+ template.thumbnail title: 'Checkboxes', onClick: ->(action) do
20
+ action.windows_open url: json_ui_garage_url(path: 'forms/checkboxes')
21
+ end
19
22
  template.thumbnail title: 'File Upload', onClick: ->(action) do
20
23
  action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
21
24
  end
@@ -26,7 +29,7 @@ json_ui_page json do |page|
26
29
  end
27
30
  end, ->(section) do
28
31
  section.header padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(header) do
29
- header.h3 text: 'Submission Logics'
32
+ header.h2 text: 'Submission Logics'
30
33
  end
31
34
 
32
35
  section.rows builder: ->(template) do
@@ -43,7 +46,7 @@ json_ui_page json do |page|
43
46
  end
44
47
  end, ->(section) do
45
48
  section.header padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(header) do
46
- header.h3 text: 'Web Only'
49
+ header.h2 text: 'Web Only'
47
50
  end
48
51
 
49
52
  section.rows builder: ->(template) do
@@ -3,38 +3,43 @@ json.title 'Forms'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
7
- # TODO: Implement vuejs component, e.g. https://vuetifyjs.com/en/components/date-pickers#date-pickers-in-dialog-and-menu
8
- form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '1990-01-01', max: '2030-01-01', value: '2010-01-01'
6
+ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: body_padding, childViews: ->(form) do
7
+ form.h2 text: 'Select'
8
+ form.spacer height: 6
9
+ languages = {
10
+ 'zh-HK' => 'Hong Kong',
11
+ 'zh-TW' => 'Taiwan',
12
+ 'zh-CN' => 'China',
13
+ 'ja-JP' => 'Japan',
14
+ 'ko-KR' => 'Korea',
15
+ 'ru-RU' => 'Russian',
16
+ 'en-PH' => 'Philippines'
17
+ }
18
+ form.fields_select name: 'user[primary_language]', width: 'matchParent', label: 'Primary Language', options: languages.map { |k, v| { value: k, text: v } }, value: 'ja-JP'
19
+ form.fields_select name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages', options: languages.map { |k, v| { value: k, text: v } }, value: ['ja-JP', 'ko-KR'], multiple: true
20
+
21
+ form.spacer height: 20
22
+ form.h2 text: 'Date/Time'
23
+ form.spacer height: 6
24
+ form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
25
+ form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
9
26
 
10
- # TODO: Implement vuejs component, e.g. using a combination of:
11
- # - https://vuetifyjs.com/en/components/date-pickers#date-pickers-in-dialog-and-menu
12
- # - https://vuetifyjs.com/en/components/time-pickers
13
- form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-07T00:00', max: '2018-06-14T00:00', value: '2018-06-12T19:30'
27
+ # form.spacer height: 20
28
+ # form.h2 text: 'Radio/Check'
29
+ # form.spacer height: 6
30
+ # form.h4 text: 'Gender'
31
+ # form.fields_radioGroup name: 'user[gender]', childViews: ->(group) do
32
+ # group.fields_radio value: 'M', label: 'Male'
33
+ # group.fields_radio value: 'F', label: 'Female'
34
+ # end
14
35
 
36
+ form.spacer height: 20
37
+ form.h2 text: 'Map'
38
+ form.spacer height: 6
15
39
  form.fields_latLong name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
16
40
  latitudeField: { name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
17
41
  longitudeField: { name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true }
18
42
 
19
- # json.child! do
20
- # json.view 'fields/latLong-v1'
21
- # json.name 'user[address]'
22
- # json.value 'Sydney Harbour Bridge'
23
- # json.label 'Type an address'
24
- # json.latitudeField do
25
- # json.name 'user[latitude]'
26
- # json.label 'Lat'
27
- # json.value -33.8523063
28
- # json.readOnly true
29
- # end
30
- # json.longitudeField do
31
- # json.name 'user[longitude]'
32
- # json.label 'Long'
33
- # json.value 151.21078710000006
34
- # json.readOnly true
35
- # end
36
- # end
37
-
38
43
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
39
44
  end
40
45
  end
@@ -3,7 +3,8 @@ json.title 'Forms'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
6
+ page.form url: json_ui_garage_url(path: 'forms/submission_indicator_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
7
7
  form.button text: 'This button gets disabled on submit', onClick: ->(action) { action.forms_submit }
8
+ form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
8
9
  end
9
10
  end
@@ -0,0 +1,5 @@
1
+ sleep 0.5
2
+
3
+ json_ui_response json do |action|
4
+ action.dialogs_alert message: 'Success!'
5
+ end
@@ -14,7 +14,7 @@ json_ui_page json do |page|
14
14
  end
15
15
  template.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
16
16
  template.thumbnail title: 'Item with thumbnail image', subtitle: 'Item subtitle', imageUrl: @sample_image_url
17
- # template.featured title: 'Featured with featured image', subtitle: 'Item subtitle', imageUrl: @sample_image_url
17
+ template.featured title: 'Featured with featured image', subtitle: 'Item subtitle', imageUrl: @sample_image_url
18
18
  end
19
19
  end
20
20
  end
@@ -1,43 +1,5 @@
1
1
  json.title 'Pages'
2
2
 
3
- # json.header do
4
- # render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
6
- # json.padding(left: 20, right: 20, top: 5, bottom: 5)
7
- # json.backgroundColor '#b3bac2'
8
- # json.subviews do
9
- # json.child! do
10
- # json.view 'h1-v1'
11
- # json.text 'Header'
12
- # end
13
- # end
14
- # end
15
-
16
- # json.content do
17
- # json.height 'matchParent'
18
- # json.padding(top: 15, left: 20, right: 20, bottom: 15)
19
- # json.subviews do
20
- # json.child! do
21
- # json.view 'button-v1'
22
- # json.width 'matchParent'
23
- # json.height 'matchParent'
24
- # json.text 'Full Width/Height'
25
- # end
26
- # end
27
- # end
28
-
29
- # json.footer do
30
- # json.height 80
31
- # json.padding(left: 20, right: 20, top: 5, bottom: 5)
32
- # json.backgroundColor '#b3bac2'
33
- # json.subviews do
34
- # json.child! do
35
- # json.view 'h1-v1'
36
- # json.text 'Footer'
37
- # end
38
- # end
39
- # end
40
-
41
3
  json_ui_page json do |page|
42
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
43
5
 
@@ -46,16 +8,14 @@ json_ui_page json do |page|
46
8
  end
47
9
 
48
10
  page.body height: 'matchParent', padding: {top: 15, left: 20, right: 20, bottom: 15}, childViews: ->(body) do
49
- body.panels_scroll width: 'matchParent', height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
50
- scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
51
- end
11
+ body.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
12
+
13
+ # body.panels_scroll width: 'matchParent', height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
14
+ # scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
15
+ # end
52
16
  end
53
17
 
54
18
  page.footer height: 80, padding: {top: 12, left: 20, right: 20, bottom: 12}, backgroundColor: '#b3bac2', childViews: ->(footer) do
55
19
  footer.h1 text: 'Footer'
56
20
  end
57
-
58
- # page.scroll height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
59
- # scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
60
- # end
61
21
  end
@@ -3,24 +3,21 @@ json.title 'Panels'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll childViews: ->(scroll) do
7
- scroll.br height: 20
8
-
6
+ page.scroll backgroundColor: '#fafafa', padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(scroll) do
9
7
  scroll.panels_card width: 'matchParent', padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(card) do
10
- card.h1 text: 'Vertical Panel'
11
- card.panels_vertical backgroundColor: '#b3bac2', childViews: ->(panel) do
12
- # card.panels_vertical backgroundColor: '#ff0000', childViews: ->(panel) do
13
- panel.button text: 'Button1'
14
- panel.button text: 'Button2', width: 200
15
- panel.button text: 'Button3', width: 300
16
- end
8
+ card.h1 text: 'With Default Layout'
9
+ card.br height: 6
10
+ card.button text: 'Button1'
11
+ card.button text: 'Button2'
12
+ card.button text: 'Button3'
17
13
  end
18
14
 
19
15
  scroll.br height: 20
20
16
 
21
17
  scroll.panels_card width: 'matchParent', padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(card) do
22
- card.h1 text: 'Vertical Panel with equal filling'
23
- card.panels_vertical backgroundColor: '#b3bac2', height: 300, distribution: 'fillEqually', childViews: ->(panel) do
18
+ card.h1 text: 'With Child Panel'
19
+ card.br height: 6
20
+ card.panels_horizontal backgroundColor: '#b3bac2', childViews: ->(panel) do
24
21
  panel.button text: 'Button1'
25
22
  panel.button text: 'Button2'
26
23
  panel.button text: 'Button3'
@@ -6,7 +6,7 @@ image_url2 = 'https://s.abcnews.com/images/International/Guam03-gty-jrl-170809_1
6
6
  json_ui_page json do |page|
7
7
  render "#{@path_prefix}/nav_menu", json: json, page: page
8
8
 
9
- page.scroll childViews: ->(scroll) do
9
+ page.scroll padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(scroll) do
10
10
  scroll.h1 text: 'Carousel panel'
11
11
  scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
12
12
  carousel.image url: image_url1, width: 'matchParent'
@@ -3,7 +3,7 @@ json.title 'Panels'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll childViews: ->(scroll) do
6
+ page.scroll padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(scroll) do
7
7
  scroll.h1 text: 'Horizontal panel'
8
8
  scroll.panels_horizontal backgroundColor: '#b3bac2', childViews: ->(panel) do
9
9
  panel.button text: '1'
@@ -3,7 +3,7 @@ json.title 'Panels'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll childViews: ->(scroll) do
6
+ page.scroll padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(scroll) do
7
7
  scroll.h1 text: '2 columns'
8
8
  scroll.panels_split width: 'matchParent', leftViews: ->(panel) do
9
9
  panel.button text: '1'
@@ -3,30 +3,7 @@ json.title 'Panels'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll childViews: ->(scroll) do
7
- # scroll.br height: 20
8
-
9
- # scroll.panels_card width: 'matchParent', padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(card) do
10
- # card.h1 text: 'Vertical Panel'
11
- # card.panels_vertical backgroundColor: '#b3bac2', childViews: ->(panel) do
12
- # # card.panels_vertical backgroundColor: '#ff0000', childViews: ->(panel) do
13
- # panel.button text: 'Button1'
14
- # panel.button text: 'Button2', width: 200
15
- # panel.button text: 'Button3', width: 300
16
- # end
17
- # end
18
-
19
- # scroll.br height: 20
20
-
21
- # scroll.panels_card width: 'matchParent', padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(card) do
22
- # card.h1 text: 'Vertical Panel with equal filling'
23
- # card.panels_vertical backgroundColor: '#b3bac2', height: 300, distribution: 'fillEqually', childViews: ->(panel) do
24
- # panel.button text: 'Button1'
25
- # panel.button text: 'Button2'
26
- # panel.button text: 'Button3'
27
- # end
28
- # end
29
-
6
+ page.scroll padding: { top: 12, bottom: 12, left: 16, right: 16 }, childViews: ->(scroll) do
30
7
  scroll.h1 text: 'Vertical Panel'
31
8
  scroll.panels_vertical backgroundColor: '#b3bac2', childViews: ->(panel) do
32
9
  panel.button text: 'Button1'
@@ -3,14 +3,14 @@ json.title 'Views'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
7
- scroll.h1 text: 'Map'
6
+ page.scroll padding: body_padding, childViews: ->(scroll) do
7
+ scroll.h2 text: 'Map'
8
8
  scroll.br height: 6
9
9
  scroll.map width: 'matchParent', latitude: 13.4837, longitude: 144.7917, zoom: 11, height: 250, dataUrl: json_ui_garage_url(path: 'views/map_data')
10
10
 
11
11
  # TODO: Implement in vuejs
12
12
  scroll.br height: 20
13
- scroll.h1 text: 'Calendar'
13
+ scroll.h2 text: 'Calendar'
14
14
  scroll.br height: 6
15
15
  scroll.calendar width: 'matchParent', height: 500, dataUrl: json_ui_garage_url(path: 'views/calendar_data')
16
16
 
@@ -3,16 +3,24 @@ json.title 'Views'
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.scroll childViews: ->(scroll) do
7
- scroll.label text: "\n"
8
- scroll.h1 text: 'Image with URL'
6
+ page.scroll padding: body_padding, childViews: ->(scroll) do
7
+ scroll.h2 text: 'Avatar'
8
+ scroll.br height: 6
9
+ scroll.avatar url: 'https://www.wpjournalist.nl/wp-content/uploads/2019/03/avatar-jongen-voorbeeld-1.jpg'
10
+
11
+ scroll.br height: 20
12
+ scroll.h2 text: 'Image with URL'
13
+ scroll.br height: 6
9
14
  scroll.image width: 100, url: @sample_image_url
10
- scroll.label text: "\n"
11
- scroll.h1 text: 'Image with base64 data'
15
+
16
+ scroll.br height: 20
17
+ scroll.h2 text: 'Image with base64 data'
18
+ scroll.br height: 6
12
19
  scroll.image height: 100, base64Data: 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAKgALAAAAAA9AEQAAAj/AFEJHEiwoMGDCBMqXMiwocAbBww4nEhxoYkUpzJGrMixogkfGUNqlNixJEIDB0SqHGmyJSojM1bKZOmyop0gM3Oe2liTISKMOoPy7GnwY9CjIYcSRYm0aVKSLmE6nfq05QycVLPuhDrxBlCtYJUqNAq2bNWEBj6ZXRuyxZyDRtqwnXvkhACDV+euTeJm1Ki7A73qNWtFiF+/gA95Gly2CJLDhwEHMOUAAuOpLYDEgBxZ4GRTlC1fDnpkM+fOqD6DDj1aZpITp0dtGCDhr+fVuCu3zlg49ijaokTZTo27uG7Gjn2P+hI8+PDPERoUB318bWbfAJ5sUNFcuGRTYUqV/3ogfXp1rWlMc6awJjiAAd2fm4ogXjz56aypOoIde4OE5u/F9x199dlXnnGiHZWEYbGpsAEA3QXYnHwEFliKAgswgJ8LPeiUXGwedCAKABACCN+EA1pYIIYaFlcDhytd51sGAJbo3onOpajiihlO92KHGaUXGwWjUBChjSPiWJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
13
- scroll.label text: "\n"
14
- scroll.h1 text: 'QR Code as base64 image'
15
20
 
21
+ scroll.br height: 20
22
+ scroll.h2 text: 'QR Code as base64 image'
23
+ scroll.br height: 6
16
24
  if defined? RQRCode
17
25
  qr_content = { version: 1, message: 'This is a test' }
18
26
  qr = RQRCode::QRCode.new(qr_content.to_json)
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -41,6 +41,7 @@ files:
41
41
  - app/helpers/glib/json_ui/menu_builder.rb
42
42
  - app/helpers/glib/json_ui/page_helper.rb
43
43
  - app/helpers/glib/json_ui/response_helper.rb
44
+ - app/helpers/glib/json_ui/styling_helper.rb
44
45
  - app/helpers/glib/json_ui/table_builders.rb
45
46
  - app/helpers/glib/json_ui/view_builder.rb
46
47
  - app/helpers/glib/json_ui/view_builder/fields.rb
@@ -50,6 +51,7 @@ files:
50
51
  - app/views/json_ui/garage/actions/index.json.jbuilder
51
52
  - app/views/json_ui/garage/forms/basic.json.jbuilder
52
53
  - app/views/json_ui/garage/forms/basic_post.json.jbuilder
54
+ - app/views/json_ui/garage/forms/checkboxes.json.jbuilder
53
55
  - app/views/json_ui/garage/forms/file_upload.json.jbuilder
54
56
  - app/views/json_ui/garage/forms/floating_submit.json.jbuilder
55
57
  - app/views/json_ui/garage/forms/generic_post.json.jbuilder
@@ -59,6 +61,7 @@ files:
59
61
  - app/views/json_ui/garage/forms/submission_flow.json.jbuilder
60
62
  - app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder
61
63
  - app/views/json_ui/garage/forms/submission_indicator.json.jbuilder
64
+ - app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder
62
65
  - app/views/json_ui/garage/forms/text_validation.json.jbuilder
63
66
  - app/views/json_ui/garage/home/index.json.jbuilder
64
67
  - app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder