glib-web 0.5.96 → 0.6.0

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: c6280ab10a1f43cdb03ae99561d48ba3278923986f18a4296e82f2a55af3286b
4
- data.tar.gz: 3bc0acf43eb7552755d2b98832dd1d0b66195b418da21e298d55c1221f93db0d
3
+ metadata.gz: c82637d3abaeed47ee4c35ce7a08b674fba4705abc53beabee9ebe5d5e1f4ee4
4
+ data.tar.gz: 47c7ac6b522c040355073fc0a8ca768e8ac9b534bbc1b54e0036bd63f28235d4
5
5
  SHA512:
6
- metadata.gz: 67134c2e87f53a0337dfd7194a38c323a62bbe2e6fa8c464fba04d9cf1bf14315a9f5500a1e693c160688b9eb619773c4152918c2490517d73c15cf06b17632b
7
- data.tar.gz: 6627e67eb5b7fb9d31c62245412b646acd0476c7555f14e38eb8d64db1e82425f5e7b9f8e37d6cd37cf6b508acbec485e6f11f66f00c27a954066d145dd03cc4
6
+ metadata.gz: ed3ea72a5e265d3be419675c4261f0034eff04453e609bb13a9ad2a96807cb6322489cc435f1d570a67b3bf811dc6d75d7aae0758b4309ad81efe470bc051ce6
7
+ data.tar.gz: f6c45e4a2aa25a77344a87614b216eb5a6c0c6e69dd3bbcb8e16cfa9f5644d4eccf413c5a76dd60a8ec418997e55e1c9826cdf2da02b9224dee3a75e2238ee93
@@ -4,7 +4,7 @@ class Glib::JsonUi::ViewBuilder
4
4
  class AbstractField < View
5
5
  bool :readOnly
6
6
  hash :validation
7
- # string :label
7
+ bool :submitOnChange
8
8
 
9
9
  def label(label)
10
10
  @label = label
@@ -245,7 +245,7 @@ class Glib::JsonUi::ViewBuilder
245
245
  date :min
246
246
  date :max
247
247
  string :type
248
-
248
+
249
249
  # Override
250
250
  def value(value)
251
251
  value = "#{value}-01" if value.is_a?(String) && value&.length == 7 # yyyy-mm
@@ -83,21 +83,27 @@ module Glib
83
83
  end
84
84
 
85
85
  class H1 < AbstractText
86
+ action :onClick
86
87
  end
87
88
 
88
89
  class H2 < AbstractText
90
+ action :onClick
89
91
  end
90
92
 
91
93
  class H3 < AbstractText
94
+ action :onClick
92
95
  end
93
96
 
94
97
  class H4 < AbstractText
98
+ action :onClick
95
99
  end
96
100
 
97
101
  class H5 < AbstractText
102
+ action :onClick
98
103
  end
99
104
 
100
105
  class H6 < AbstractText
106
+ action :onClick
101
107
  end
102
108
 
103
109
  class P < AbstractText
@@ -222,6 +228,9 @@ module Glib
222
228
  class AppBar < View
223
229
  color :color
224
230
  panels_builder :content, :logo
231
+ string :imageUrl
232
+ action :onCLick
233
+ bool :showTitle
225
234
 
226
235
  # def leftButtons(block)
227
236
  # json.leftButtons do
@@ -20,40 +20,6 @@ page.scroll childViews: ->(scroll) do
20
20
  group.fields_check checkValue: 4, label: 'Mobile Development'
21
21
  end
22
22
 
23
- form.spacer height: 20
24
- form.h2 text: 'Rating'
25
- form.spacer height: 6
26
- form.fields_radioGroup \
27
- name: 'user[rating1][]',
28
- iconOfSelected: 'star',
29
- iconOfBeforeSelected: 'star',
30
- iconOfAfterSelected: 'star_border',
31
- childViews: ->(panel) do
32
- panel.panels_horizontal childViews: ->(horizontal) do
33
- horizontal.fields_radio value: 1
34
- horizontal.fields_radio value: 2
35
- horizontal.fields_radio value: 3
36
- horizontal.fields_radio value: 4
37
- horizontal.fields_radio value: 5
38
- end
39
- end
40
-
41
- form.fields_radioGroup \
42
- name: 'user[rating2][]',
43
- iconOfSelected: 'star',
44
- iconOfBeforeSelected: 'star',
45
- iconOfAfterSelected: 'star_border',
46
- value: 1,
47
- childViews: ->(panel) do
48
- panel.panels_horizontal childViews: ->(horizontal) do
49
- horizontal.fields_radio value: 1
50
- horizontal.fields_radio value: 2
51
- horizontal.fields_radio value: 3
52
- horizontal.fields_radio value: 4
53
- horizontal.fields_radio value: 5
54
- end
55
- end
56
-
57
23
  form.spacer height: 20
58
24
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
59
25
  end
@@ -6,6 +6,7 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
  page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
7
  form.spacer height: 20
8
8
  form.h2 text: 'Date'
9
+ form.label text: 'End date will be adjusted automatically when start date changes'
9
10
  form.spacer height: 6
10
11
  form.fields_date name: 'user[date_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
11
12
  form.fields_date name: 'user[date_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01', valueIf: {
@@ -19,6 +20,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
19
20
 
20
21
  form.spacer height: 20
21
22
  form.h2 text: 'Date/Time'
23
+ form.label text: 'End date/time will be adjusted automatically when start date/time changes'
22
24
  form.spacer height: 6
23
25
  form.fields_datetime name: 'user[datetime_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01T01:00'
24
26
  form.fields_datetime name: 'user[datetime_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01', valueIf: {
@@ -39,6 +39,10 @@ page.list sections: [
39
39
  template.thumbnail title: 'Conditional Value', onClick: ->(action) do
40
40
  action.windows_open url: json_ui_garage_url(path: 'forms/conditional_value')
41
41
  end
42
+ template.thumbnail title: 'Submit on Change', onClick: ->(action) do
43
+ action.windows_open url: json_ui_garage_url(path: 'forms/submit_on_change')
44
+ end
45
+
42
46
 
43
47
  end
44
48
  end, ->(section) do
@@ -37,7 +37,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
37
37
 
38
38
  form.spacer height: 20
39
39
  form.h1 text: 'Check'
40
- form.fields_check name: 'user[check1]', checkValue: 'on', label: 'Show text'
40
+ form.fields_check name: 'user[check1]', checkValue: 'on', label: 'Show text', value: 'on'
41
41
  form.spacer height: 10
42
42
  form.label text: 'Checked', showIf: {
43
43
  "==": [
@@ -70,7 +70,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
70
70
 
71
71
  form.spacer height: 20
72
72
  form.h1 text: 'Radio Group'
73
- form.fields_radioGroup name: 'user[radio1]', value: 'F', childViews: ->(group) do
73
+ form.fields_radioGroup name: 'user[radio1]', value: 'show', childViews: ->(group) do
74
74
  group.fields_radio value: 'show', label: 'Show'
75
75
  group.fields_radio value: 'hide', label: 'Hide'
76
76
  group.fields_radio value: '', label: 'Empty'
@@ -0,0 +1,28 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.panels_form \
8
+ url: json_ui_garage_url(path: 'forms/generic_post'),
9
+ method: 'post',
10
+ padding: glib_json_padding_body,
11
+ childViews: ->(form) do
12
+ form.spacer height: 20
13
+ form.h2 text: 'Single Checkbox'
14
+ form.fields_check \
15
+ name: 'user[age_range]',
16
+ value: '16+',
17
+ checkValue: '16+',
18
+ uncheckValue: '0-16',
19
+ label: 'I am over 16 (has default value)',
20
+ submitOnChange: true
21
+ form.fields_check \
22
+ name: 'user[employer]',
23
+ checkValue: 1,
24
+ label: 'I am an employer (no default value)',
25
+ submitOnChange: true
26
+ end
27
+
28
+ end
@@ -4,7 +4,7 @@ page = json_ui_page json
4
4
 
5
5
  render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
 
7
- page.navBar backgroundColor: '#a8c4e3', color: '#ffffff', rightButtons: ->(menu) do
7
+ page.navBar backgroundColor: '#a8c4e3', color: '#ffffff', showTitle: true, rightButtons: ->(menu) do
8
8
  menu.button icon: 'search', text: 'Search', onClick: ->(action) do
9
9
  action.dialogs_alert message: 'Perform some action'
10
10
  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: 0.5.96
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -162,6 +162,7 @@ files:
162
162
  - app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder
163
163
  - app/views/json_ui/garage/forms/submission_indicator.json.jbuilder
164
164
  - app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder
165
+ - app/views/json_ui/garage/forms/submit_on_change.json.jbuilder
165
166
  - app/views/json_ui/garage/forms/text_validation.json.jbuilder
166
167
  - app/views/json_ui/garage/forms/timers.json.jbuilder
167
168
  - app/views/json_ui/garage/home/blank.json.jbuilder