glib-web 0.6.15 → 0.6.16

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: 2c4ff8cc0d06eb6c81fb0a0a96374b9747e4f437fb3d2d0a8bc7a53132d49011
4
- data.tar.gz: 48212d3c11fb41cf147d7b2ab01d7ecc01d332a111bd77c05066c86da82ab242
3
+ metadata.gz: bedc221c7a3ca4698e7544b004d173a2370d24f46c39c5e9843557196592d662
4
+ data.tar.gz: 70e02a74054949fe4aaf27fc34068330fd1a4054b336b49235b01dcad180db40
5
5
  SHA512:
6
- metadata.gz: bbf2cf1722acd92649e2d71f0048ea16fc246cac6f03e9a5da61aa5bc137de2f9748e0357c20d5c43290c86a5356f40b61a6314d348cd7996dbff130230a3673
7
- data.tar.gz: cd0ff0f239eb2468b81327dd76c5e476dd4a1b6eb4b9daaf8432e9fbdba7201ddda67c6217103b923d67a86aa0bf994ddabc33a59cee6a75e581020c05a56089
6
+ metadata.gz: 29259dcdbc183ee60c7c787a4ac0a72f7237fcedde68183480f0f6eb0e74d0cd02900976959597ea5f6e42541fb075efe7de57ea2101e9b8cca2b7c18de6e82e
7
+ data.tar.gz: 17be690ac40a42483ef7e0998133e3e9b4e56e5a504f856149fc4b127a8f3e5a4e95076da2cf3a4908ae3e169e1b943ac0325d4fdec0c140f1d35b6a82426711
@@ -28,7 +28,7 @@ module Glib
28
28
  end
29
29
 
30
30
  class Standard < AbstractTemplate
31
- string :id
31
+ string :recordId
32
32
  string :title
33
33
  string :subtitle
34
34
  string :subsubtitle
@@ -43,6 +43,7 @@ module Glib
43
43
  string :paramNameForNewSectionIndex
44
44
  string :paramNameForNewSectionedRowIndex
45
45
 
46
+ string :id # Deprecated
46
47
  string :paramNameForNewIndex # Deprecated
47
48
 
48
49
  # # NOTE: Experimental. Still deciding whether this needs to be a full blown panel or
@@ -3,7 +3,7 @@ class Glib::JsonUi::ViewBuilder
3
3
  class Form < View
4
4
  action :onSubmit
5
5
  string :paramNameForFormData
6
- # boolean :local
6
+ bool :local
7
7
 
8
8
  def is_array_association?(prop)
9
9
  # # Not all model is ActiveRecord
@@ -85,7 +85,7 @@ class Glib::JsonUi::ViewBuilder
85
85
  end
86
86
  end
87
87
 
88
- @method ||= :get
88
+ @method = @method&.to_sym || :get
89
89
 
90
90
  json.url @url
91
91
  json.method @method
@@ -112,6 +112,11 @@ class Glib::JsonUi::ViewBuilder
112
112
  end
113
113
 
114
114
  class List < View
115
+ string :fieldPrefix
116
+ string :fieldTitleName
117
+ string :fieldSubtitleName
118
+ string :fieldSubsubtitleName
119
+
115
120
  hash :phoenixSocket
116
121
  hash :actionCable
117
122
 
@@ -1,9 +1,11 @@
1
- info = "Method: #{request.method}\nForm Data:\n{\n"
2
- params.require(:user).each do |k, v|
3
- value = v.is_a?(String) ? '"' + v + '"' : v
4
- info += " #{k} => #{value}\n"
5
- end
6
- info += '}'
1
+ info = "Method: #{request.method}\nForm Data:\n"
2
+ # params.require(:user).each do |k, v|
3
+ # value = v.is_a?(String) ? '"' + v + '"' : v
4
+ # info += " #{k} => #{value}\n"
5
+ # end
6
+ # info += '}'
7
+
8
+ info += JSON.pretty_generate(params.require(:user).to_unsafe_h)
7
9
 
8
10
  action.dialogs_alert message: info, onClose: ->(action) do
9
11
  action.windows_refreshState
@@ -22,6 +22,9 @@ page.list sections: [
22
22
  template.thumbnail title: 'GET Request', onClick: ->(action) do
23
23
  action.windows_open url: json_ui_garage_url(path: 'forms/get_request')
24
24
  end
25
+ template.thumbnail title: 'Synchronous Request', onClick: ->(action) do
26
+ action.windows_open url: json_ui_garage_url(path: 'forms/local_request')
27
+ end
25
28
 
26
29
  end
27
30
  end, ->(section) do
@@ -0,0 +1,27 @@
1
+ json.title 'Forms'
2
+
3
+ data = params[:user] || {}
4
+
5
+ page = json_ui_page json
6
+ render "#{@path_prefix}/nav_menu", json: json, page: page
7
+
8
+ page.form \
9
+ local: true,
10
+ url: json_ui_garage_url(path: 'forms/local_request'),
11
+ method: 'post',
12
+ padding: glib_json_padding_body,
13
+ childViews: ->(form) do
14
+ form.spacer height: 14
15
+ form.label text: "Analogous to Rails' form_with's `local: true`. The page should be reloaded upon submit. " \
16
+ 'This is rarely needed, only in cases like submitting to other websites, e.g. for Google OAuth login.'
17
+ form.spacer height: 14
18
+ form.h3 text: "Hello #{ data[:name] }"
19
+ form.spacer height: 4
20
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
21
+
22
+ form.panels_split width: 'matchParent', content: ->(split) do
23
+ split.right childViews: ->(right) do
24
+ right.fields_submit text: 'Submit'
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,38 @@
1
+ page = json_ui_page json
2
+
3
+ json.title 'Lists'
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
6
+
7
+ page.form \
8
+ width: 'matchParent',
9
+ url: json_ui_garage_url(path: 'forms/generic_post'),
10
+ method: 'post',
11
+ padding: glib_json_padding_body,
12
+ childViews: ->(form) do
13
+ form.panels_list fieldPrefix: 'user[items]', fieldTitleName: 'name', width: 'matchParent', sections: [
14
+ ->(section) do
15
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
16
+
17
+ header.panels_horizontal childViews: ->(horizontal) do
18
+ # header.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[new_name]', label: 'Item name'
19
+ statuses = [:pending, :active]
20
+ header.fields_select \
21
+ styleClass: 'outlined',
22
+ name: 'user[status]',
23
+ width: 'matchParent',
24
+ label: 'Status',
25
+ options: statuses.map { |status| { value: status, text: status.to_s.humanize } }
26
+ header.spacer width: 20
27
+ header.fields_submit text: 'Update'
28
+ end
29
+ end
30
+ section.rows builder: ->(row) do
31
+ batch_count = 20
32
+ batch_count.times do |index|
33
+ row.thumbnail title: "Item #{index}", recordId: "PK_#{index}"
34
+ end
35
+ end
36
+ end
37
+ ]
38
+ end
@@ -35,6 +35,9 @@ json_ui_page json do |page|
35
35
  template.thumbnail title: 'Reordering', onClick: ->(action) do
36
36
  action.windows_open url: json_ui_garage_url(path: 'lists/reordering')
37
37
  end
38
+ template.thumbnail title: 'Edit Mode', onClick: ->(action) do
39
+ action.windows_open url: json_ui_garage_url(path: 'lists/edit_mode')
40
+ end
38
41
  end
39
42
 
40
43
  end
@@ -9,7 +9,9 @@ small_image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGQpSWj
9
9
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
10
10
  scroll.h2 text: 'Avatar'
11
11
  scroll.spacer height: 6
12
- scroll.avatar url: glib_json_image_avatar_url
12
+ scroll.avatar \
13
+ url: glib_json_image_avatar_url,
14
+ tooltip: { text: 'This is a tooltip' }
13
15
 
14
16
  # scroll.spacer height: 20
15
17
  # scroll.h2 text: 'Icon'
@@ -19,7 +21,10 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
19
21
  scroll.spacer height: 20
20
22
  scroll.h2 text: 'Image with base64 data'
21
23
  scroll.spacer height: 6
22
- 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+vr8ZWSHpzcJM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WJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
24
+ scroll.image \
25
+ height: 100,
26
+ tooltip: { text: 'This is a tooltip' },
27
+ base64Data: 'data:image/gif;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4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
23
28
 
24
29
  scroll.spacer height: 20
25
30
  scroll.h2 text: 'QR Code as base64 image'
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.6.15
4
+ version: 0.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -151,6 +151,7 @@ files:
151
151
  - app/views/json_ui/garage/forms/generic_post.json.jbuilder
152
152
  - app/views/json_ui/garage/forms/get_request.json.jbuilder
153
153
  - app/views/json_ui/garage/forms/index.json.jbuilder
154
+ - app/views/json_ui/garage/forms/local_request.json.jbuilder
154
155
  - app/views/json_ui/garage/forms/new_rich_text.json.jbuilder
155
156
  - app/views/json_ui/garage/forms/online_participant1.json.jbuilder
156
157
  - app/views/json_ui/garage/forms/online_participant2.json.jbuilder
@@ -177,6 +178,7 @@ files:
177
178
  - app/views/json_ui/garage/lists/autoload_as_needed_responsive_columns.json.jbuilder
178
179
  - app/views/json_ui/garage/lists/chat_ui.json.jbuilder
179
180
  - app/views/json_ui/garage/lists/edit_actions.json.jbuilder
181
+ - app/views/json_ui/garage/lists/edit_mode.json.jbuilder
180
182
  - app/views/json_ui/garage/lists/fab.json.jbuilder
181
183
  - app/views/json_ui/garage/lists/index.json.jbuilder
182
184
  - app/views/json_ui/garage/lists/reordering.json.jbuilder