glib-web 0.11.1 → 0.11.10

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: a0ad96fd8e7f59b3203f94cc7e183479f70203ace059a962df88e6b659e75427
4
- data.tar.gz: e4f06add5a2eb5bc62d0654409519aca7d177a018edbddd0fbac8fea086d303b
3
+ metadata.gz: 9d4968b1b18a9b99cc1451f33acaff156293cf8e90eea4f51f8db2a71d0606eb
4
+ data.tar.gz: 2c93eb68a4d5ab07a0df6ae61ad83746b9f8ed851350b45a0d36a61b929873ef
5
5
  SHA512:
6
- metadata.gz: 7d0293ad9ce0952aba5bf741eae32c23c536f21ea1e73315fbfe556dd80bb7094f112b42a926a98106fc4bb1c3c849f0b66a413ce9a8766d959f8d30041e0c05
7
- data.tar.gz: 836c1e141247c1073e9528dbb09e63d47c0198f910845ad9f03a0b50823aaf6b02b6ee4fdc0b3b17820f1cedd72ad4252d3a4316a6ff48077c560f1a1f4a15f2
6
+ metadata.gz: 5da158f07169d49350f0ec3bf800c1eda26a5b294c3e488f9e0716a8c73ceae9ce25910e4e5c3e960f1ea630295029f1eecfdd87b1fd65c789fa462eb40f81d5
7
+ data.tar.gz: 9cc6fa9b6dea847e117f1829354f9728541136dca16adcb4ed1be581ccd237f01712f799ce1cef9377a1d73d9d7d197295f89b9f84223d62ee8f54f4761f475c
@@ -6,11 +6,11 @@ class Glib::JsonUi::ActionBuilder
6
6
  action :onClose
7
7
  end
8
8
 
9
- class Show < Action
10
- string :body
11
- action :onLoad
12
- action :onClose
13
- end
9
+ # class Show < Action
10
+ # string :body
11
+ # action :onLoad
12
+ # action :onClose
13
+ # end
14
14
 
15
15
  # Deprecated in favour of `sheets/select`
16
16
  class Options < Action
@@ -25,6 +25,7 @@ class Glib::JsonUi::ActionBuilder
25
25
 
26
26
  class Show < Action
27
27
  panels_builder :content, :body
28
+ bool :showClose
28
29
 
29
30
  # Future plan
30
31
  # panels_builder :content, :body, :footer
@@ -35,6 +36,11 @@ class Glib::JsonUi::ActionBuilder
35
36
  bool :showClose
36
37
  end
37
38
 
39
+ class Reload < Action
40
+ string :url, cache: true
41
+ bool :showClose
42
+ end
43
+
38
44
  class Close < Action
39
45
  action :onClose
40
46
  end
@@ -4,8 +4,9 @@ class Glib::JsonUi::ViewBuilder
4
4
  class AbstractField < View
5
5
  bool :readOnly
6
6
  hash :validation
7
- bool :submitOnChange
7
+ # bool :submitOnChange
8
8
  bool :disableDirtyCheck
9
+ action :onChange
9
10
 
10
11
  def label(label)
11
12
  @label = label
@@ -127,7 +128,6 @@ class Glib::JsonUi::ViewBuilder
127
128
  string :offIcon
128
129
  string :onLabel
129
130
 
130
-
131
131
  def value(value)
132
132
  @value = value if value != Glib::Value::DEFAULT
133
133
  end
@@ -61,13 +61,23 @@ section.rows builder: ->(template) do
61
61
  "\n" +
62
62
  '~~Strikethrough~~' + "\n"
63
63
  template.thumbnail title: 'dialogs/show', onClick: ->(action) do
64
- action.dialogs_show content: ->(dialog) do
64
+ action.dialogs_show showClose: true, content: ->(dialog) do
65
65
  dialog.body padding: glib_json_padding_body, childViews: ->(body) do
66
66
  body.markdown text: markdown
67
67
 
68
68
  body.panels_split width: 'matchParent', content: ->(split) do
69
+ split.left childViews: ->(left) do
70
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
71
+ horizontal.label text: 'Open current', onClick: ->(subaction) do
72
+ subaction.dialogs_reload url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
73
+ end
74
+ end
75
+ end
76
+
69
77
  split.right childViews: ->(right) do
70
- right.button text: 'OK', onClick: ->(subaction) { subaction.dialogs_close }
78
+ right.button text: 'Open New', onClick: ->(subaction) do
79
+ subaction.dialogs_open url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
80
+ end
71
81
  end
72
82
  end
73
83
  end
@@ -9,8 +9,10 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
9
9
 
10
10
  form.panels_split width: 'matchParent', content: ->(split) do
11
11
  split.left childViews: ->(left) do
12
- if params[:mode] == 'dialog'
13
- left.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
12
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
13
+ if params[:mode] == 'dialog'
14
+ horizontal.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
15
+ end
14
16
  end
15
17
  end
16
18
  split.right childViews: ->(right) do
@@ -13,7 +13,7 @@ page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', pad
13
13
  form.spacer height: 6
14
14
  form.label text: 'On the web, upon submit, URL needs to change on the browser'
15
15
  form.spacer height: 10
16
- form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
16
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name', disableDirtyCheck: true
17
17
 
18
18
  # form.panels_split width: 'matchParent', rightViews: ->(split) do
19
19
  # split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
@@ -17,12 +17,54 @@ 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
- submitOnChange: true
20
+ onChange: ->(action) do
21
+ action.forms_submit
22
+ end
23
+
21
24
  form.fields_check \
22
25
  name: 'user[employer]',
23
26
  checkValue: 1,
24
27
  label: 'I am an employer (no default value)',
25
- submitOnChange: true
28
+ onChange: ->(action) do
29
+ action.dialogs_alert message: 'The form will be submitted when the dialog is closed', onClose: ->(subaction) do
30
+ action.forms_submit
31
+ end
32
+ end
33
+
34
+ form.spacer height: 20
35
+ form.h2 text: 'Select Field'
36
+ options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
37
+ form.fields_select \
38
+ name: 'user[gender]',
39
+ width: 'matchParent',
40
+ label: 'Gender',
41
+ validation: { required: { message: 'Required' } },
42
+ options: options,
43
+ onChange: ->(action) do
44
+ action.snackbars_select message: 'Submit data?', buttons: ->(menu) do
45
+ menu.button text: 'Yes, submit', onClick: ->(subaction) do
46
+ action.forms_submit
47
+ end
48
+ end
49
+ end
50
+
51
+ form.spacer height: 20
52
+ form.h1 text: 'Radio Group'
53
+ form.fields_radioGroup \
54
+ name: 'user[seniority]',
55
+ value: 'show',
56
+ childViews: ->(group) do
57
+ group.fields_radio value: 'senior', label: 'Senior'
58
+ group.fields_radio value: 'junior', label: 'Junior'
59
+ end,
60
+ onChange: ->(action) do
61
+ action.sheets_select message: 'Submit data?', buttons: ->(menu) do
62
+ menu.button text: 'Yes, submit', onClick: ->(subaction) do
63
+ action.forms_submit
64
+ end
65
+ end
66
+ end
67
+
26
68
  end
27
69
 
28
70
  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.11.1
4
+ version: 0.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''