glib-web 0.5.94 → 0.5.98

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: bf0645de0de3f3b975e5d4ac6d7334e7f04343af59f24197e2b5c25abff24d64
4
- data.tar.gz: eca8bf174b02e480ff616e7da1918225097e06f54985e28c8051005faf7911d2
3
+ metadata.gz: decf4496d340cc29dd6cee1f14a0ecbaf338f7920d0f31791ccfaf5802c60384
4
+ data.tar.gz: a6d3d4b27c1b8fecb0f5a8d4c63c94fbd051530269512245c9703c1006cf5af9
5
5
  SHA512:
6
- metadata.gz: 31cc51adb4a0f77c58c0d37713f7f286ca8ff69410c1ecf4a18040c1ea58ad193be72c557ae4e32a73b2a47e45f57e214627a15115b97fd5d35d74fb3530f50f
7
- data.tar.gz: f42f4173e1faa5eddb83332bdeef89e97d51f38462f8f4db64fa2ec95d3b49434f5a9d4aa4327b8a94b7ef30021e969fbac262e1f9d9e9508e37f42fa59360ed
6
+ metadata.gz: cbf836972c2a59a36484d4f70f631caf7198c1f75eed27d25485aafe34e48c56c1dabde58a1695e7aebdbbda0f42ca2910ba0a593abfebe648a92ef90d6ce60c
7
+ data.tar.gz: 1c366b37263aa59cf2010505297577d0c36cc9e0527779c7fd2b1d9d41fda0dc3652f72734b6ba3f9e172be668272f36fc4c7661eabdf7c82b078697477f2887
@@ -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
@@ -122,6 +122,9 @@ class Glib::JsonUi::ViewBuilder
122
122
  class Check < Text
123
123
  any :uncheckValue
124
124
  any :checkValue
125
+ string :onIcon
126
+ string :offIcon
127
+ string :onLabel
125
128
 
126
129
 
127
130
  def value(value)
@@ -242,7 +245,7 @@ class Glib::JsonUi::ViewBuilder
242
245
  date :min
243
246
  date :max
244
247
  string :type
245
-
248
+
246
249
  # Override
247
250
  def value(value)
248
251
  value = "#{value}-01" if value.is_a?(String) && value&.length == 7 # yyyy-mm
@@ -33,6 +33,7 @@ module Glib
33
33
  hash :showIf
34
34
  hash :valueIf
35
35
  hash :analytics
36
+ hash :tooltip
36
37
 
37
38
  # def initialize(json, page)
38
39
  # super(json, page)
@@ -164,6 +165,7 @@ module Glib
164
165
  string :text, cache: true
165
166
  action :onClick
166
167
  color :color
168
+ bool :disabled
167
169
  end
168
170
 
169
171
  class Fab < View
@@ -220,6 +222,9 @@ module Glib
220
222
  class AppBar < View
221
223
  color :color
222
224
  panels_builder :content, :logo
225
+ string :imageUrl
226
+ action :onCLick
227
+ bool :showTitle
223
228
 
224
229
  # def leftButtons(block)
225
230
  # 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
@@ -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
@@ -5,25 +5,46 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
7
  scroll.h2 text: 'Button'
8
- scroll.spacer height: 6
9
- scroll.button text: 'Click me', onClick: ->(action) do
8
+ scroll.spacer height: 20
9
+
10
+ scroll.button text: 'Button', onClick: ->(action) do
11
+ action.dialogs_alert message: 'Perform action'
12
+ end
13
+ scroll.spacer height: 20
14
+
15
+ scroll.button text: 'Buton with build-in classes', styleClasses: ['rounded', 'outlined', 'tile', 'depressed'], onClick: ->(action) do
10
16
  action.dialogs_alert message: 'Perform action'
11
17
  end
18
+ scroll.spacer height: 20
19
+
20
+ scroll.button icon: 'info', text: 'Button with Icon and Tooltip', tooltip: { text: 'Tooltip text'}, onClick: ->(action) do
21
+ action.dialogs_alert message: 'Perform action'
22
+ end
23
+ scroll.spacer height: 20
24
+
25
+ scroll.button \
26
+ icon: 'info',
27
+ styleClass: 'icon',
28
+ tooltip: { text: 'Disabled Icon button with tooltip text and custom tooltip position', position: 'right'},
29
+ disabled: true
30
+ scroll.spacer height: 20
31
+
32
+
12
33
 
13
34
  scroll.spacer height: 20
14
35
  scroll.h2 text: 'Chip'
15
- scroll.spacer height: 6
36
+ scroll.spacer height: 10
16
37
  scroll.chip styleClass: 'success', text: 'Success'
17
- scroll.spacer height: 6
38
+ scroll.spacer height: 10
18
39
  scroll.chip text: 'With Action', onClick: ->(action) do
19
40
  action.dialogs_alert message: 'Perform action'
20
41
  end
21
- scroll.spacer height: 6
42
+ scroll.spacer height: 10
22
43
  scroll.chip text: 'With Badge', badgeContent: '99'
23
44
 
24
45
  scroll.spacer height: 20
25
46
  scroll.h2 text: 'Switch'
26
- scroll.spacer height: 6
47
+ scroll.spacer height: 10
27
48
  scroll.switch \
28
49
  text: 'Email notification',
29
50
  onEnabled: ->(action) do
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.94
4
+ version: 0.5.98
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