glib-web 4.10.0 → 4.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  4. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  5. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  6. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  8. data/app/helpers/glib/json_ui/view_builder/panels.rb +15 -0
  9. data/app/models/glib/active_storage/attachment.rb +0 -0
  10. data/app/models/glib/active_storage/blob.rb +0 -0
  11. data/app/models/glib/dynamic_text_record.rb +0 -0
  12. data/app/models/glib/text.rb +0 -0
  13. data/app/validators/email_typo_validator.rb +0 -0
  14. data/app/validators/email_validator.rb +0 -0
  15. data/app/validators/url_validator.rb +0 -0
  16. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  17. data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
  18. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +45 -40
  19. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/selects.json.jbuilder +7 -2
  22. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +79 -9
  23. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/flow.json.jbuilder +22 -14
  45. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/tables/panel_content.json.jbuilder +65 -25
  55. data/app/views/json_ui/garage/test_page/form.json.jbuilder +5 -5
  56. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  59. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  60. data/lib/generators/glib/install_generator.rb +0 -0
  61. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  62. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  63. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  64. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  65. data/lib/generators/templates/database.yml +0 -0
  66. data/lib/generators/templates/dynamic_text.rb +0 -0
  67. data/lib/glib/dynamic_text/config.rb +0 -0
  68. data/lib/glib/dynamic_text.rb +0 -0
  69. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  75. data/lib/glib/json_crawler/coverage.rb +0 -0
  76. data/lib/glib/json_crawler/router.rb +2 -0
  77. data/lib/glib/value.rb +0 -0
  78. data/lib/glib/version.rb +0 -0
  79. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfd1804082f7f14167a579c42e2d1bde31ad7dbd928bc764ca3de0ba0259ad99
4
- data.tar.gz: 1cde932d484baa31d4074ce52bdf5d955c51fc70008016b8bbcb6ead85746107
3
+ metadata.gz: 40fb8120f293f1162be2b6027432444a35b7b321f0db95a6efbcd8d7a52b964c
4
+ data.tar.gz: 839a67107c2a77d66fd0ad27dcc8cfb5e77f0754609f609447ec030f2357f07d
5
5
  SHA512:
6
- metadata.gz: 73d15de9c4abe80f6148b67b328ac4c4ece94231900a62c3fcddabd06db453efb462ef296659dfdd8f36674e353815c58dd4a4d337ab15f07385eaa96e2a09e0
7
- data.tar.gz: aea3aba2adb595aa2eaaef5275b2bf6b8e1b04731b910678c651d1f170ae1e2127035735955c30bf4d8e7238491fabdb236f9f9b6531239a77f639c799460599
6
+ metadata.gz: 0e2d195b6f33253b5d2ab3ec2df96cf00d62d2fd56bf08d80f25577ad09526561006391b3c2ce370e80ce2ab18510b468dfa5b0ae46c72483feee395eace6a40
7
+ data.tar.gz: 1bc81f15016ee532f0c9395d35318a487807fa5854a546796772dedeaee6edae0183881b997c9495e1a0a044bcb773103794c01b06642c202f3fe72a036a722b
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -494,6 +494,14 @@ class Glib::JsonUi::ViewBuilder
494
494
 
495
495
  class Flow < View
496
496
  hash :innerPadding, optional: [:top, :right, :bottom, :left, :x, :y]
497
+
498
+ hash :xxl, optional: [:gap, :padding]
499
+ hash :xl, optional: [:gap, :padding]
500
+ hash :lg, optional: [:gap, :padding]
501
+ hash :md, optional: [:gap, :padding]
502
+ hash :sm, optional: [:gap, :padding]
503
+ hash :xs, optional: [:gap, :padding]
504
+
497
505
  views :childViews
498
506
 
499
507
  required :innerPadding
@@ -564,6 +572,13 @@ class Glib::JsonUi::ViewBuilder
564
572
  # end
565
573
  end
566
574
 
575
+ class Pagination < View
576
+ int :length
577
+ int :value
578
+ action :onChange
579
+ string :paramNameForFieldName
580
+ end
581
+
567
582
  module ModelPanel
568
583
  attr_reader :model_name # See Panels::Form.field_name
569
584
  attr_reader :assoc_order_index
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -28,7 +28,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
28
28
  template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
29
29
 
30
30
  form.panels_responsive id: 'responsive_{{entry_index}}', childViews: ->(column) do
31
- options = [:rating, :yes_no]
31
+ options = [:rating, :yes_no, :choices]
32
32
  template.fields_select \
33
33
  width: 'matchParent',
34
34
  name: 'type',
@@ -36,56 +36,61 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
36
36
  placeholder: 'Answer Type',
37
37
  options: options.map { |o| { text: o.to_s.humanize, value: o } },
38
38
  onChangeAndLoad: ->(action) do
39
- action.logics_set targetId: 'responsive_{{entry_index}}', dataBuilder: ->(set) do
40
- set.panels_responsive accessory: ->(accessory) do
41
- accessory.footer childViews: ->(footer) do
42
- # TODO: Is there a way to only show this if the selected option is "rating".
43
- # I.e. `showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }`
44
- footer.fields_check \
45
- width: 'matchParent',
46
- id: 'check_{{entry_index}}',
47
- name: 'enabled',
48
- label: 'Enable',
49
- checkValue: true
39
+ action.runMultiple childActions: ->(multiple) do
40
+ multiple.logics_set \
41
+ cacheData: true, # This is so that the the new data is retained when the `dynamicGroup` gets re-rendered.
42
+ debug: true,
43
+ targetId: 'responsive_{{entry_index}}', dataBuilder: ->(set) do
44
+ set.panels_responsive width: 'matchParent', accessory: ->(accessory) do
45
+ accessory.footer childViews: ->(footer) do
46
+ footer.fields_check \
47
+ width: 'matchParent',
48
+ id: 'check_{{entry_index}}',
49
+ name: 'enabled',
50
+ label: 'Enable',
51
+ checkValue: true
52
+
53
+ footer.panels_split width: 'matchParent', content: ->(split) do
54
+ split.right childViews: ->(right) do
55
+ right.label text: 'This should be right-aligned'
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end, onSet: ->(subaction) do
61
+ subaction.logics_set \
62
+ targetId: 'check_{{entry_index}}',
63
+ conditionalData: {
64
+ value: {
65
+ "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'rating']
66
+ }
67
+ }
50
68
  end
51
- end
52
- end, onSet: ->(subaction) do
53
- subaction.logics_set \
54
- targetId: 'check_{{entry_index}}',
69
+
70
+ multiple.logics_set \
71
+ targetId: 'choices_panel',
72
+ debug: true,
55
73
  conditionalData: {
56
- value: {
57
- "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'rating']
74
+ displayed: {
75
+ "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'choices']
58
76
  }
59
77
  }
60
78
  end
61
-
62
- # action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
63
- # find.logics_set dataBuilder: ->(set) do
64
- # set.panels_responsive accessory: ->(accessory) do
65
- # accessory.footer childViews: ->(footer) do
66
- # # TODO: Is there a way to only show this if the selected option is "rating".
67
- # # I.e. `showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }`
68
- # footer.fields_check \
69
- # width: 'matchParent',
70
- # name: 'enabled',
71
- # label: 'Enable',
72
- # checkValue: '1'
73
- # end
74
- # end
75
- # end
76
- # end
77
79
  end
78
80
  end, accessory: ->(accessory) do
79
81
  accessory.footer childViews: ->(footer) do
82
+
80
83
  end
81
84
  end
82
85
 
83
- # template.fields_check \
84
- # width: 'matchParent',
85
- # name: 'enabled',
86
- # label: 'Enable',
87
- # checkValue: '1',
88
- # showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }
86
+ template.panels_vertical id: 'choices_panel', childViews: ->(vertical) do
87
+ (1..5).each do |i|
88
+ vertical.fields_text \
89
+ width: 'matchParent',
90
+ name: "choices[#{i}]",
91
+ label: "Choice #{i}"
92
+ end
93
+ end
89
94
 
90
95
  template.spacer height: 14
91
96
  end
@@ -17,13 +17,16 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
17
17
  }
18
18
 
19
19
  form.panels_responsive childViews: ->(column) do
20
+ options = languages.map do |k, v|
21
+ { value: k, text: v }
22
+ end
20
23
  form.fields_select \
21
24
  name: 'user[city]',
22
25
  width: 'matchParent',
23
26
  clearable: true,
24
27
  label: 'City1',
25
28
  placeholder: 'This is a placeholder',
26
- options: languages.map { |k, v| { value: k, text: v } },
29
+ options: options,
27
30
  value: 'canberra',
28
31
  onChange: ->(action) do
29
32
  action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
@@ -47,11 +50,13 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
47
50
 
48
51
  form.spacer height: 6
49
52
 
53
+ options = languages.map { |k, v| { value: k, text: v, deselect: [-1] } }
54
+ options << { value: -1, text: 'None of the above', deselect: languages.keys }
50
55
  form.fields_select \
51
56
  name: 'user[cities][]',
52
57
  width: 'matchParent',
53
58
  label: 'Cities',
54
- options: languages.map { |k, v| { value: k, text: v } },
59
+ options: options,
55
60
  value: ['melbourne', 'sydney'],
56
61
  multiple: true,
57
62
  onChange: ->(action) do
@@ -93,6 +93,72 @@ page.form \
93
93
  form.spacer height: 10
94
94
  form.label id: 'label22', text: 'Is Checked22'
95
95
 
96
+ form.spacer height: 20
97
+ form.h1 text: 'Radio inside panels'
98
+
99
+ form.fields_radioGroup \
100
+ name: 'user[radio9]',
101
+ value: 'no',
102
+ width: 'matchParent',
103
+ onChangeAndLoad: ->(action) do
104
+ action.runMultiple childActions: ->(saction) do
105
+ saction.logics_set targetId: 'radiolabel1', conditionalData: {
106
+ displayed: {
107
+ "==": [
108
+ {
109
+ "var": 'user[radio9]'
110
+ },
111
+ 'yes'
112
+ ]
113
+ }
114
+ }
115
+ saction.logics_set targetId: 'radiolabel2', conditionalData: {
116
+ displayed: {
117
+ "==": [
118
+ {
119
+ "var": 'user[radio9]'
120
+ },
121
+ 'no'
122
+ ]
123
+ }
124
+ }
125
+ end
126
+ end,
127
+ childViews: ->(group) do
128
+ group.panels_responsive width: 'matchParent', childViews: ->(res) do
129
+
130
+ res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
131
+ column.fields_radio\
132
+ width: 350,
133
+ value: 'yes', label: 'Yes', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' },
134
+ onClick: ->(action) do
135
+ action.windows_openWeb url: 'http://www.google.com'
136
+ end
137
+ end
138
+ res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
139
+ column.fields_radio\
140
+ width: 350,
141
+ value: 'no', label: 'No',
142
+ image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 },
143
+ onClick: ->(action) do
144
+ action.windows_openWeb url: 'http://www.google.com'
145
+ end
146
+ end
147
+ res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
148
+ column.fields_radio\
149
+ value: 'idk', label: 'Not Sure',
150
+ image: { template: 'thumbnail', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 24, height: 24 }
151
+ column.fields_radio value: '', label: 'Empty'
152
+ end
153
+
154
+ end
155
+ end
156
+
157
+
158
+ form.spacer height: 10
159
+ form.label id: 'radiolabel1', text: 'Yes'
160
+ form.label id: 'radiolabel2', text: 'No'
161
+
96
162
  form.spacer height: 20
97
163
  form.h1 text: 'Radio Group'
98
164
  form.fields_radioGroup \
@@ -123,15 +189,19 @@ page.form \
123
189
  end
124
190
  end,
125
191
  childViews: ->(group) do
126
- group.fields_radio\
127
- value: 'show', label: 'Show', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' }
128
- group.fields_radio\
129
- value: 'hide', label: 'Hide',
130
- image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 }
131
- group.fields_radio\
132
- value: 'no', label: 'No',
133
- image: { template: 'thumbnail', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 24, height: 24 }
134
- group.fields_radio value: '', label: 'Empty'
192
+ # TODO: Fix a bug where if the fields_radio is wrapped in panels_horizontal,
193
+ # it cannot be selected.
194
+ group.panels_horizontal childViews: ->(horizontal) do
195
+ horizontal.fields_radio\
196
+ value: 'show', label: 'Show', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' }
197
+ horizontal.fields_radio\
198
+ value: 'hide', label: 'Hide',
199
+ image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 }
200
+ horizontal.fields_radio\
201
+ value: 'no', label: 'No',
202
+ image: { template: 'thumbnail', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 24, height: 24 }
203
+ horizontal.fields_radio value: '', label: 'Empty'
204
+ end
135
205
  end
136
206
  form.spacer height: 10
137
207
  form.label id: 'label6', text: 'Chosen'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,11 +5,17 @@ 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.h1 text: 'Show/hide'
8
- scroll.panels_flow id: 'flow1', width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
9
- panel.button text: '1'
10
- panel.button text: '2'
11
- panel.button text: '3'
12
- end
8
+ scroll.panels_flow\
9
+ sm: { gap: { y: 4, x: 6 }, padding: { all: 16 } },
10
+ md: { gap: { y: 8, x: 8 }, padding: { x: 30, y: 30 } },
11
+ xs: { gap: { y: 2, x: 2 }, padding: { left: 10, bottom: 8 } },
12
+ lg: { gap: { all: 32 } },
13
+ id: 'flow1', width: 300,
14
+ innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
15
+ panel.button text: '1'
16
+ panel.button text: '2'
17
+ panel.button text: '3'
18
+ end
13
19
  scroll.button text: 'show', onClick: ->(action) do
14
20
  action.components_set targetId: 'flow1', data: { displayed: true }
15
21
  end
@@ -18,15 +24,17 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
18
24
  end
19
25
 
20
26
  scroll.h1 text: 'Basic'
21
- scroll.panels_flow width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
22
- panel.button text: '1'
23
- panel.button text: '2'
24
- panel.button text: '3'
25
- panel.button text: '4'
26
- panel.button text: '5'
27
- panel.button text: '6'
28
- panel.button text: '7'
29
- end
27
+ scroll.panels_flow\
28
+ md: { padding: { all: 8 } },
29
+ width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
30
+ panel.button text: '1'
31
+ panel.button text: '2'
32
+ panel.button text: '3'
33
+ panel.button text: '4'
34
+ panel.button text: '5'
35
+ panel.button text: '6'
36
+ panel.button text: '7'
37
+ end
30
38
 
31
39
  scroll.label text: "\n"
32
40
  scroll.h1 text: 'Spacers'
File without changes
@@ -3,34 +3,74 @@ json.title 'Tables'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.table styleClass: 'table--grid', sections: [
7
- ->(section) do
8
- section.header cellViews: ->(header) do
9
- header.label text: 'Vertical'
10
- header.label text: 'Horizontal'
11
- header.label text: 'Unordered List'
12
- end
13
-
14
- items = [1, 2, 3]
15
- section.rows objects: items, builder: ->(row, item, index) do
16
- row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
17
- cell.panels_vertical childViews: ->(vertical) do
18
- vertical.h3 text: "Title #{item}"
19
- vertical.spacer height: 4
20
- vertical.label text: "Subtitle #{item}"
6
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.panels_form childViews: ->(form) do
8
+ form.panels_table styleClass: 'table--grid', sections: [
9
+ ->(section) do
10
+ section.header cellViews: ->(header) do
11
+ header.panels_horizontal childViews: ->(horizontal) do
12
+ horizontal.fields_check name: 'check_all', checkValue: true, onChange: ->(action) do
13
+ action.runMultiple childActions: ->(multiple) do
14
+ check_ids = (0..2).map { |i| "item_#{i}" }
15
+ # action.logics_set targetIds: check_ids, conditionalData: {
16
+ # value: { 'var': 'check_all' }
17
+ # }
18
+ check_ids.each_with_index do |check_id, index|
19
+ record_id = "id_#{index}"
20
+ multiple.logics_set targetId: check_id, conditionalData: {
21
+ value: { "if": [ { 'var': 'check_all' }, record_id, nil ]}
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
27
+ header.label text: 'Vertical'
28
+ header.label text: 'Horizontal'
29
+ header.label text: 'Unordered List'
21
30
  end
22
31
 
23
- cell.panels_horizontal childViews: ->(vertical) do
24
- vertical.label text: "Left #{item}"
25
- vertical.spacer width: 10
26
- vertical.label text: "Right #{item}"
27
- end
32
+ items = [1, 2, 3]
33
+ section.rows objects: items, builder: ->(row, item, index) do
34
+ row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
35
+ cell.panels_horizontal childViews: ->(horizontal) do
36
+ horizontal.fields_check \
37
+ id: "item_#{index}",
38
+ name: 'user[items][]',
39
+ checkValue: "id_#{index}", # In the real-world, this is going to be the ID of a DB record.
40
+ onChangeAndLoad: ->(action) do
41
+ # TODO: Fix fields_check so it can support arrays
42
+ action.logics_set targetId: 'submit_button', conditionalData: {
43
+ text: {
44
+ 'printf': [
45
+ 'Submit {0} items',
46
+ { 'countNonNull': [{ 'var': 'user[items][]' }] }
47
+ ]
48
+ }
49
+ }
50
+ end
51
+ end
52
+
53
+ cell.panels_vertical childViews: ->(vertical) do
54
+ vertical.h3 text: "Title #{item}"
55
+ vertical.spacer height: 4
56
+ vertical.label text: "Subtitle #{item}"
57
+ end
28
58
 
29
- cell.panels_ul childViews: ->(ul) do
30
- ul.label text: "Item A#{item}"
31
- ul.label text: "Item B#{item}"
59
+ cell.panels_horizontal childViews: ->(vertical) do
60
+ vertical.label text: "Left #{item}"
61
+ vertical.spacer width: 10
62
+ vertical.label text: "Right #{item}"
63
+ end
64
+
65
+ cell.panels_ul childViews: ->(ul) do
66
+ ul.label text: "Item A#{item}"
67
+ ul.label text: "Item B#{item}"
68
+ end
69
+ end
32
70
  end
33
71
  end
34
- end
72
+ ]
73
+
74
+ form.fields_submit id: 'submit_button', text: 'Submit'
35
75
  end
36
- ]
76
+ end
@@ -23,9 +23,9 @@ page.body childViews: ->(body) do
23
23
  end
24
24
  end
25
25
  hori.spacer width: 4
26
- hori.button text: 'logics/set', onClick: ->(action) do
27
- action.logics_set targetId: 'date', conditionalData: { value: { "+": [{ "var": ['user[date]'] }, 60 * 60 * 24 * 3] } }
28
- end
26
+ # hori.button text: 'logics/set', onClick: ->(action) do
27
+ # action.logics_set targetId: 'date', conditionalData: { value: { "+": [{ "var": ['user[date]'] }, 60 * 60 * 24 * 3] } }
28
+ # end
29
29
  hori.spacer width: 4
30
30
  hori.button text: 'components/replace', onClick: ->(action) do
31
31
  action.runMultiple childActions: ->(saction) do
@@ -73,8 +73,8 @@ page.body childViews: ->(body) do
73
73
  validation = { required: { message: 'Required' } }
74
74
  options = ['option1', 'option2', 'option3', 'option4'].map { |option| { 'text'=> option.humanize, 'value' => option } }
75
75
 
76
- form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
77
- form.hr width: 'matchParent'
76
+ # form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
77
+ # form.hr width: 'matchParent'
78
78
  form.fields_select clearable: true, multiple: true, width: 'matchParent', name: 'user[select][]', id: 'select', options: options, value: ['option1', 'option2'], validation: validation
79
79
  form.hr width: 'matchParent'
80
80
  form.panels_flow innerPadding: { bottom: 0 }, width: 'matchParent', id: 'select1', childViews: ->(flow) do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -21,6 +21,8 @@ module Glib
21
21
  end
22
22
 
23
23
  def assert_target_ids_exist(args)
24
+ # This saves targetId so that later we can check to make sure that it indeed exists
25
+ # within the page.
24
26
  if (target_ids = args['targetIds'])
25
27
  target_ids.each do |target_id|
26
28
  @visitor.defer_action(nil, target_id)
data/lib/glib/value.rb CHANGED
File without changes
data/lib/glib/version.rb CHANGED
File without changes
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: 4.10.0
4
+ version: 4.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -388,7 +388,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
388
  - !ruby/object:Gem::Version
389
389
  version: '0'
390
390
  requirements: []
391
- rubygems_version: 3.4.6
391
+ rubyforge_project:
392
+ rubygems_version: 2.7.6
392
393
  signing_key:
393
394
  specification_version: 4
394
395
  summary: ''