glib-web 0.5.43 → 0.5.48

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: 0b8d44468bb10a4b5bd570d12d233ea3a0057be5e666466575204e7e445de360
4
- data.tar.gz: 3f9d79903871a7a8f59a786c637d42f7e33bba1dfccc8c652544201e9df77ae9
3
+ metadata.gz: '096278d9b11151bcb169ba83f5c62c080471bb076f8ea3d34913e898a9537382'
4
+ data.tar.gz: bb831b31d185198292f251cbc3e9ab4536b1c4f3e3a28ceb32a5c7b76c25cba6
5
5
  SHA512:
6
- metadata.gz: 5dbedf4e29bc182bce5af77d0c9b392100e030a21fd8ed03dcd56bf1bb2c1c70f3f5d72cda358454e0058a88df16e1a2e83017bf983f42083c57da0f9187f1db
7
- data.tar.gz: 1d80db9408c05b6ce3a2a9356e0aa01aa3f6489276424543996f0f248afe2366b687fc3127c4eda8f3e336d92b3479c88225f619d69df7ed1c9b2c52e1f921db
6
+ metadata.gz: fcbb3bded93e840d4db717c74a78bd16537e405bdc2262343274604f9940d0b768256e6df5e01225d9f699d422693f5030e0156e5b9a596a4b685575355e8347
7
+ data.tar.gz: 99c46875985b061cea7e7932bb2a86c7b1d0f613c205ec15207cf212f1703df44eb6a03bffd81a5dfbd64e5b5a89b09d5f18ca830d48b2d95b6e8260bca065e0
@@ -95,10 +95,18 @@ module Glib
95
95
  end
96
96
  end
97
97
 
98
+ module Cables
99
+ class Push < Action
100
+ string :channel
101
+ string :event
102
+ end
103
+ end
104
+
98
105
  module Timeouts
99
106
  class Set < Action
100
107
  int :interval # Milliseconds
101
108
  action :onTimeout
109
+ bool :repeat
102
110
  end
103
111
 
104
112
  # FUTURE
@@ -11,6 +11,7 @@ module Glib
11
11
  menu :rightButtons
12
12
  menu :editButtons
13
13
  menu :chips
14
+ singleton_array :styleClass, :styleClasses
14
15
 
15
16
  # def editButtons(block)
16
17
  # json.editButtons do
@@ -201,9 +201,17 @@ module Glib
201
201
  raise "Invalid properties: #{options.keys}" if options.size > 0
202
202
  end
203
203
 
204
- def onLoad(options = {})
205
- json.onLoad do
206
- yield @action_builder
204
+ # def onLoad(options = {})
205
+ # json.onLoad do
206
+ # yield @action_builder
207
+ # end
208
+ # end
209
+
210
+ def on(options = {})
211
+ if (on_load = options[:load])
212
+ json.onLoad do
213
+ on_load.call @action_builder
214
+ end
207
215
  end
208
216
  end
209
217
 
@@ -73,6 +73,9 @@ class Glib::JsonUi::ViewBuilder
73
73
 
74
74
  class Text < AbstractField
75
75
  int :maxLength
76
+ icon :leftIcon
77
+ string :leftText
78
+ string :rightText
76
79
  end
77
80
 
78
81
  class Number < Text
@@ -1,56 +1,39 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- form.h2 text: 'Dynamic Group'
8
- form.spacer height: 6
6
+ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
+ form.h2 text: 'Dynamic Group'
8
+ form.spacer height: 6
9
9
 
10
- # value = [
11
- # {
12
- # 'question': 'Punctuality',
13
- # 'type': 'rating'
14
- # },
15
- # {
16
- # 'question': 'Quality of work',
17
- # 'type': 'rating',
18
- # 'enabled': '1'
19
- # },
20
- # {
21
- # 'question': 'Satisfied?',
22
- # 'type': 'yes_no'
23
- # }
24
- # ]
25
-
26
- properties = [
27
- [
28
- { name: 'question', value: 'Punctuality' },
29
- { name: 'type', value: 'rating' },
30
- ],
31
- [
32
- { name: 'question', value: 'Quality of work' },
33
- { name: 'type', value: 'rating' },
34
- { name: 'enabled', value: '1', styleClasses: ['success'] },
35
- ],
36
- [
37
- { name: 'question', value: 'Satisfied?' },
38
- { name: 'type', value: 'yes_no' },
39
- ]
10
+ properties = [
11
+ [
12
+ { name: 'question', value: 'Punctuality' },
13
+ { name: 'type', value: 'rating' },
14
+ ],
15
+ [
16
+ { name: 'question', value: 'Quality of work' },
17
+ { name: 'type', value: 'rating' },
18
+ { name: 'enabled', value: '1', styleClasses: ['success'] },
19
+ ],
20
+ [
21
+ { name: 'question', value: 'Satisfied?' },
22
+ { name: 'type', value: 'yes_no' },
40
23
  ]
41
- form.fields_dynamicGroup width: 'matchParent', name: 'user[evaluation]', groupFieldProperties: properties, titlePrefix: 'Entry', content: ->(group) do
42
- group.template padding: { left: 32 }, childViews: ->(template) do
43
- template.spacer height: 10
44
- template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
45
- options = [ :rating, :yes_no ]
46
- template.fields_select width: 'matchParent', name: 'type', label: 'Answer Type', placeholder: 'Answer Type', options: options.map { |o| { text: o.to_s.humanize, value: o } }
47
- template.fields_check width: 'matchParent', name: 'enabled', label: 'Enable', checkValue: '1'
24
+ ]
25
+ form.fields_dynamicGroup width: 'matchParent', name: 'user[evaluation]', groupFieldProperties: properties, titlePrefix: 'Entry', content: ->(group) do
26
+ group.template padding: { left: 32 }, childViews: ->(template) do
27
+ template.spacer height: 10
28
+ template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
29
+ options = [ :rating, :yes_no ]
30
+ template.fields_select width: 'matchParent', name: 'type', label: 'Answer Type', placeholder: 'Answer Type', options: options.map { |o| { text: o.to_s.humanize, value: o } }
31
+ template.fields_check width: 'matchParent', name: 'enabled', label: 'Enable', checkValue: '1'
48
32
 
49
- template.spacer height: 14
50
- end
33
+ template.spacer height: 14
51
34
  end
52
-
53
- form.spacer height: 20
54
- form.fields_submit text: 'Submit'
55
35
  end
36
+
37
+ form.spacer height: 20
38
+ form.fields_submit text: 'Submit'
56
39
  end
@@ -1,25 +1,22 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- form.h2 text: 'Dynamic Select'
8
- form.spacer height: 6
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
9
5
 
10
- form.fields_dynamicSelect name: 'user[primary_language]', width: 'matchParent', label: 'Primary Language',
11
- # value: 'id3',
12
- selectedOptions: [ { value: 'id3', text: 'Item 3' } ],
13
- url: json_ui_garage_url(path: 'forms/dynamic_select_data')
6
+ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
+ form.h2 text: 'Dynamic Select'
8
+ form.spacer height: 6
14
9
 
15
- form.spacer height: 14
16
- form.fields_dynamicSelect name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages',
17
- # value: ['id3', 'id5'], multiple: true,
18
- selectedOptions: [ { value: 'id3', text: 'Item 3' }, { value: 'id5', text: 'Item 5' } ],
19
- url: json_ui_garage_url(path: 'forms/dynamic_select_data'),
20
- multiple: true
10
+ form.fields_dynamicSelect name: 'user[primary_language]', width: 'matchParent', label: 'Primary Language',
11
+ selectedOptions: [ { value: 'id3', text: 'Item 3' } ],
12
+ url: json_ui_garage_url(path: 'forms/dynamic_select_data')
21
13
 
22
- form.spacer height: 14
23
- form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
24
- end
14
+ form.spacer height: 14
15
+ form.fields_dynamicSelect name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages',
16
+ selectedOptions: [ { value: 'id3', text: 'Item 3' }, { value: 'id5', text: 'Item 5' } ],
17
+ url: json_ui_garage_url(path: 'forms/dynamic_select_data'),
18
+ multiple: true
19
+
20
+ form.spacer height: 14
21
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
25
22
  end
@@ -6,60 +6,27 @@ options = {
6
6
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
7
7
  }
8
8
 
9
- json_ui_page json do |page|
10
- render "#{@path_prefix}/nav_menu", json: json, page: page
11
-
12
- page.form options.merge(childViews: ->(form) do
13
- rules = { fileType: 'image/*', maxFileSize: 5000 }
14
- form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Landscape Photo', accepts: rules, directUploadUrl: rails_direct_uploads_url,
15
- value: 'eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4',
16
- fileUrl: 'https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100',
17
- fileTitle: '1 month ago',
18
- placeholderView: { type: 'image', width: 100, height: 75, url: 'https://www.atms.com.au/wp-content/uploads/2019/10/placeholder-1-1024x683.png?x93630' }
19
-
20
- rules = { fileType: 'image/*', maxFileSize: 1, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
21
- form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Avatar', accepts: rules, directUploadUrl: rails_direct_uploads_url,
22
- placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJBUWFxgZEHE6FCUnKxwdEUI2LwM4KSskNzg6LC4WOz8f/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMB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25XHYgbfrhsWGAjWw41R4J1cOFKoMllyo5IGX6lYYCDN2HdHgkzbh2QGvv0NNqF93RWXkGjce1EaQBJ2Pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' }
23
-
24
- rules = { fileType: 'pdf', maxFileSize: 5000 }
25
- form.fields_file name: 'user[pdf1][]', width: 'matchParent', label: 'PDF Document', accepts: rules, directUploadUrl: rails_direct_uploads_url,
26
- placeholderView: { type: 'image', width: 100, height: 100, url: 'data:image/webp;base64,UklGRqQVAABXRUJQVlA4TJcVAAAv/8F/ELWK4rZtHGn/tVOv/CNiAvik1tymPAJg9nKbNQXcCFtqZ1Ar3sntGrnYYN0uaOb43j6AANd0YatNWaE3TK6UM74oQdq2qnXSHXRR7H9RiRCFT/y/3nRkci5YOb1I6QTGCQFJ0v/NQoraRnK0veoO0PH/D4ADI8mNJEeSouHntRarrA3zAIvWtqeNJL1KS7ZT0LjMzMx4/9c1UykZJOv/tVhd7iR/YxpqZjdDFQbStol/zf8qgQIA0omebduuZdu2bdu2XYdqC0M2z7ZWt27L7uxcw/+LEhtJjiQps23lifLIbLk2U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OSOhsuAYPMmL3hse5wxU1QzPAD6iPXA2zIxkHKbPiF8tej9obPusOfPK93KChmOIXT2PUAJeww+TZNtlvchSdoxu0Nr3WH150KSTG7bRWNXw/wIgHPAU6eLbToZEFk7D7wW3d4/bvnDn2QlMNuaYz+7PknWA8IIsG55Z1Pl+PT4Mm6gs8PMn4feK47vH7Wxgu0qCyLh/PkJlmPXz3vea6txuCFcz4+BwjOm0bbWT4/fsEp9gFedwjIAno0Ai8puwOO4TfVeoAGWojGdTzDn6E5cIjX6EQ8DO7FONE+wOsOMVnAjxSM4S0WLqaz4GECzMcff/DRu0tzqliARsKkawQWQOBsKDk6Q8G94EnwOkCH0M5LPMRtjOAmypAEd6iBfcJ9APjlMwks/xkR0O6QKBaw7pCxoXWHfA2vO6RrI+kOiWEZTXdIC8t4ukNWWEbUHZLCMqbukBOWcXWHhLAAd4ccDbo7ZGhj7A6JZinMfPs4z9Edzv53h7P/3WGNMdZEL8uQhVprSPSyDNkWQtgSvSwDVtpxHK3wy9K/OyyP1lpXQDPN8pIMCHnfd01AE81yGq6cOWddQDPNYriX22PRHlSzFO0jmFIyfSipZlkAAA==' }
27
-
28
- rules = { fileType: 'pdf', maxFileSize: 5000 }
29
- form.fields_file name: 'user[pdf2][]', width: 'matchParent', label: 'PDF Document', accepts: rules, directUploadUrl: rails_direct_uploads_url
30
-
31
- form.fields_submit text: 'Submit'
32
- # form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
33
- end)
34
- end
35
-
36
-
37
- # json_body_with_form json, nil, nil, options do
38
- # json.child! do
39
- # json.view 'fields/file-v1'
40
- # json.name 'user[photo]'
41
- # json.width 'matchParent'
42
- # json.label 'Photo'
43
-
44
- # json.value 'VALUE_OF_THE_PREVIOUS_IMAGE_WHICH_IS_USEFUL_WHEN_UPDATING_EXISTING_MODEL'
45
-
46
- # json.accepts "image/*"
47
- # # json.s3_bucket 'BUCKET_NAME'
48
- # # json.s3_path_prefix 'uploads/images'
49
- # json.s3_direct_upload_url rails_direct_uploads_path
50
-
51
- # # This is for security so we don't have to reveal key/secret in the json api
52
- # # json.s3_signature_url 'URL_TO_OUR_SERVER_TO_GET_GENERATED_SIGNATURE'
53
-
54
- # json.file_size_limit 5000 # 5 MB
55
- # json.file_size_limit_alert_text 'Too big!'
56
- # end
57
-
58
- # json.child! do
59
- # json.view 'button-v1'
60
- # json.text 'Submit'
61
- # json.onClick do
62
- # json.action 'forms/submit-v1'
63
- # end
64
- # end
65
- # end
9
+ page = json_ui_page json
10
+ render "#{@path_prefix}/nav_menu", json: json, page: page
11
+
12
+ page.form options.merge(childViews: ->(form) do
13
+ rules = { fileType: 'image/*', maxFileSize: 5000 }
14
+ form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Landscape Photo', accepts: rules, directUploadUrl: rails_direct_uploads_url,
15
+ value: 'eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4',
16
+ fileUrl: 'https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100',
17
+ fileTitle: '1 month ago',
18
+ placeholderView: { type: 'image', width: 100, height: 75, url: 'https://www.atms.com.au/wp-content/uploads/2019/10/placeholder-1-1024x683.png?x93630' }
19
+
20
+ rules = { fileType: 'image/*', maxFileSize: 1, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
21
+ form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Avatar', accepts: rules, directUploadUrl: rails_direct_uploads_url,
22
+ placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysr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MEtYSGwbByCOBnTV9ONEAOv0w2oX3KY7Vl8jqY8KURhA1seNaIMB9+mG1C+5o4rLyDq48KIwgCTseNUAsuVx2IGXtJYYCNbDjWqOBJm3Dsg+mRL1CFoiwZcv3itzyDq48KUWWOAEjj+5IONF0PgbcDu+y0ESxQYREQEREBERAREQEREBERARfTGE4BdDGNbiaoNbYUhN3QfdbQy9penJYZMGbsONao4EmbcO3OiAHX6YbUL7uj+6rLyDq48KURpAEjj+5VQC25XHYgbfrhsWGAjWw41R4J1cOFKoMllyo5IGX6lYYCDN2HdHgkzbh2QGvv0NNqF93RWXkGjce1EaQBJ2Pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' }
23
+
24
+ rules = { fileType: 'pdf', maxFileSize: 5000 }
25
+ form.fields_file name: 'user[pdf1][]', width: 'matchParent', label: 'PDF Document', accepts: rules, directUploadUrl: rails_direct_uploads_url,
26
+ placeholderView: { type: 'image', width: 100, height: 100, url: 'data:image/webp;base64,UklGRqQVAABXRUJQVlA4TJcVAAAv/8F/ELWK4rZtHGn/tVOv/CNiAvik1tymPAJg9nKbNQXcC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PjcG1/2KQYDHnvFgHpJBcbQXEzPnx+UEG1/63z+nUHLPNCygYB+Gp7lBCDrvQ9tcnPbz2MMFennnxC67D9oavukMRWZYA+62JDK89mNByzDAvkOAchre6QxlZds47sIyoPXSAyS0vtmB1NRBvdYdCcjC8fjei9qBEDH7nlBfHyALtUPzVHUqJGd6Bfcx6gA0NzkUueUHcg3fw3vBXd4guMTEDBjyj1uMrk26DevgcsgEAAhLD94bHukNUyYkZNiA+bj2+nGLjhnOSOhsuAYPMmL3hse5wxU1QzPAD6iPXA2zIxkHKbPiF8tej9obPusOfPK93KChmOIXT2PUAJeww+TZNtlvchSdoxu0Nr3WH150KSTG7bRWNXw/wIgHPAU6eLbToZEFk7D7wW3d4/bvnDn2QlMNuaYz+7PknWA8IIsG55Z1Pl+PT4Mm6gs8PMn4feK47vH7Wxgu0qCyLh/PkJlmPXz3vea6txuCFcz4+BwjOm0bbWT4/fsEp9gFedwjIAno0Ai8puwOO4TfVeoAGWojGdTzDn6E5cIjX6EQ8DO7FONE+wOsOMVnAjxSM4S0WLqaz4GECzMcff/DRu0tzqliARsKkawQWQOBsKDk6Q8G94EnwOkCH0M5LPMRtjOAmypAEd6iBfcJ9APjlMwks/xkR0O6QKBaw7pCxoXWHfA2vO6RrI+kOiWEZTXdIC8t4ukNWWEbUHZLCMqbukBOWcXWHhLAAd4ccDbo7ZGhj7A6JZinMfPs4z9Edzv53h7P/3WGNMdZEL8uQhVprSPSyDNkWQtgSvSwDVtpxHK3wy9K/OyyP1lpXQDPN8pIMCHnfd01AE81yGq6cOWddQDPNYriX22PRHlSzFO0jmFIyfSipZlkAAA==' }
27
+
28
+ rules = { fileType: 'pdf', maxFileSize: 5000 }
29
+ form.fields_file name: 'user[pdf2][]', width: 'matchParent', label: 'PDF Document', accepts: rules, directUploadUrl: rails_direct_uploads_url
30
+
31
+ form.fields_submit text: 'Submit'
32
+ end)
@@ -1,31 +1,19 @@
1
1
  json.title 'Forms'
2
2
 
3
- # footer = Jbuilder.new do |json|
4
- # json.padding(top: 12, left: 20, right: 80, bottom: 12)
5
- # json.backgroundColor '#b3bac2'
6
- # json.subviews do
7
- # json.child! do
8
- # json.view 'label-v1'
9
- # json.text 'Demonstrates the use Floating Action Button on a form with footer'
10
- # end
11
- # end
12
- # end
13
-
14
3
  options = {
15
4
  url: json_ui_garage_url(path: 'forms/generic_post'),
16
5
  method: 'post',
17
6
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
18
7
  }
19
8
 
20
- json_ui_page json do |page|
21
- render "#{@path_prefix}/nav_menu", json: json, page: page
22
-
23
- page.form options.merge(childViews: ->(form) do
24
- form.label text: 'Demonstrates the use Floating Action Button on a form with footer'
25
- 30.times do |i|
26
- form.fields_text name: "user[field#{i}]", width: 'matchParent', label: "Field#{i}"
27
- end
28
- form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
29
- form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
30
- end)
31
- end
9
+ page = json_ui_page json
10
+ render "#{@path_prefix}/nav_menu", json: json, page: page
11
+
12
+ page.form options.merge(childViews: ->(form) do
13
+ form.label text: 'Demonstrates the use Floating Action Button on a form with footer'
14
+ 30.times do |i|
15
+ form.fields_text name: "user[field#{i}]", width: 'matchParent', label: "Field#{i}"
16
+ end
17
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
18
+ form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
19
+ end)
@@ -2,27 +2,26 @@ json.title 'Forms'
2
2
 
3
3
  data = params[:user] || {}
4
4
 
5
- json_ui_page json do |page|
6
- render "#{@path_prefix}/nav_menu", json: json, page: page
7
-
8
- page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', padding: glib_json_padding_body, childViews: ->(form) do
9
- # TODO: Potential improvement:
10
- # Use `reload` behaviour instead of `open` (i.e. don't keep adding URL to history).
11
- # Probably introduce a flag to panels_form so developer can enable/disable this behaviour.
12
- form.h3 text: "Hello #{ data[:name] }"
13
- form.spacer height: 6
14
- form.label text: 'On the web, upon submit, URL needs to change on the browser'
15
- form.spacer height: 10
16
- form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
17
-
18
- # form.panels_split width: 'matchParent', rightViews: ->(split) do
19
- # split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
20
- # end
21
-
22
- form.panels_split width: 'matchParent', content: ->(split) do
23
- split.right childViews: ->(right) do
24
- right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
25
- end
5
+ page = json_ui_page json
6
+ render "#{@path_prefix}/nav_menu", json: json, page: page
7
+
8
+ page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', padding: glib_json_padding_body, childViews: ->(form) do
9
+ # TODO: Potential improvement:
10
+ # Use `reload` behaviour instead of `open` (i.e. don't keep adding URL to history).
11
+ # Probably introduce a flag to panels_form so developer can enable/disable this behaviour.
12
+ form.h3 text: "Hello #{ data[:name] }"
13
+ form.spacer height: 6
14
+ form.label text: 'On the web, upon submit, URL needs to change on the browser'
15
+ form.spacer height: 10
16
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
17
+
18
+ # form.panels_split width: 'matchParent', rightViews: ->(split) do
19
+ # split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
20
+ # end
21
+
22
+ form.panels_split width: 'matchParent', content: ->(split) do
23
+ split.right childViews: ->(right) do
24
+ right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
26
25
  end
27
26
  end
28
27
  end
@@ -1,110 +1,108 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
5
5
 
6
- page.list sections: [
7
- ->(section) do
8
- section.header padding: glib_json_padding_list, childViews: ->(header) do
9
- header.h2 text: 'Submission Logics'
10
- end
11
-
12
- section.rows builder: ->(template) do
13
- template.thumbnail title: 'Basic Logic', onClick: ->(action) do
14
- action.windows_open url: json_ui_garage_url(path: 'forms/basic')
15
- end
16
- template.thumbnail title: "Submission Flow (timestamp: #{DateTime.current.to_i})", onClick: ->(action) do
17
- action.windows_open url: json_ui_garage_url(path: 'forms/submission_flow')
18
- end
19
- template.thumbnail title: "Submission Indicator", onClick: ->(action) do
20
- action.windows_open url: json_ui_garage_url(path: 'forms/submission_indicator')
21
- end
22
- template.thumbnail title: 'GET Request', onClick: ->(action) do
23
- action.windows_open url: json_ui_garage_url(path: 'forms/get_request')
24
- end
6
+ page.list sections: [
7
+ ->(section) do
8
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
9
+ header.h2 text: 'Submission Logics'
10
+ end
25
11
 
12
+ section.rows builder: ->(template) do
13
+ template.thumbnail title: 'Basic Logic', onClick: ->(action) do
14
+ action.windows_open url: json_ui_garage_url(path: 'forms/basic')
26
15
  end
27
- end, ->(section) do
28
- section.header padding: glib_json_padding_list, childViews: ->(header) do
29
- header.h2 text: 'Form Logics'
16
+ template.thumbnail title: "Submission Flow (timestamp: #{DateTime.current.to_i})", onClick: ->(action) do
17
+ action.windows_open url: json_ui_garage_url(path: 'forms/submission_flow')
18
+ end
19
+ template.thumbnail title: "Submission Indicator", onClick: ->(action) do
20
+ action.windows_open url: json_ui_garage_url(path: 'forms/submission_indicator')
21
+ end
22
+ template.thumbnail title: 'GET Request', onClick: ->(action) do
23
+ action.windows_open url: json_ui_garage_url(path: 'forms/get_request')
30
24
  end
31
25
 
32
- section.rows builder: ->(template) do
33
- template.thumbnail title: 'Text Validation', onClick: ->(action) do
34
- action.windows_open url: json_ui_garage_url(path: 'forms/text_validation')
35
- end
36
- template.thumbnail title: 'Show/Hide', onClick: ->(action) do
37
- action.windows_open url: json_ui_garage_url(path: 'forms/show_hide')
38
- end
39
- template.thumbnail title: 'Conditional Value', onClick: ->(action) do
40
- action.windows_open url: json_ui_garage_url(path: 'forms/conditional_value')
41
- end
26
+ end
27
+ end, ->(section) do
28
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
29
+ header.h2 text: 'Form Logics'
30
+ end
42
31
 
32
+ section.rows builder: ->(template) do
33
+ template.thumbnail title: 'Text Validation', onClick: ->(action) do
34
+ action.windows_open url: json_ui_garage_url(path: 'forms/text_validation')
35
+ end
36
+ template.thumbnail title: 'Show/Hide', onClick: ->(action) do
37
+ action.windows_open url: json_ui_garage_url(path: 'forms/show_hide')
43
38
  end
44
- end, ->(section) do
45
- section.header padding: glib_json_padding_list, childViews: ->(header) do
46
- header.h2 text: 'Form Fields'
39
+ template.thumbnail title: 'Conditional Value', onClick: ->(action) do
40
+ action.windows_open url: json_ui_garage_url(path: 'forms/conditional_value')
47
41
  end
48
42
 
49
- section.rows builder: ->(template) do
50
- template.thumbnail title: 'Pickers', onClick: ->(action) do
51
- action.windows_open url: json_ui_garage_url(path: 'forms/pickers')
52
- end
53
- template.thumbnail title: 'Select Fields', onClick: ->(action) do
54
- action.windows_open url: json_ui_garage_url(path: 'forms/selects')
55
- end
56
- template.thumbnail title: 'File Upload', onClick: ->(action) do
57
- action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
58
- end
59
- template.thumbnail title: 'Floating Submit', onClick: ->(action) do
60
- action.windows_open url: json_ui_garage_url(path: 'forms/floating_submit')
61
- end
43
+ end
44
+ end, ->(section) do
45
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
46
+ header.h2 text: 'Form Fields'
47
+ end
62
48
 
49
+ section.rows builder: ->(template) do
50
+ template.thumbnail title: 'Pickers', onClick: ->(action) do
51
+ action.windows_open url: json_ui_garage_url(path: 'forms/pickers')
63
52
  end
64
- end, ->(section) do
65
- section.header padding: glib_json_padding_list, childViews: ->(header) do
66
- header.h2 text: 'Styling'
53
+ template.thumbnail title: 'Select Fields', onClick: ->(action) do
54
+ action.windows_open url: json_ui_garage_url(path: 'forms/selects')
67
55
  end
68
- section.rows builder: ->(template) do
69
- template.thumbnail title: 'Text Boxes', onClick: ->(action) do
70
- action.windows_open url: json_ui_garage_url(path: 'forms/styled_boxes')
71
- end
56
+ template.thumbnail title: 'File Upload', onClick: ->(action) do
57
+ action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
72
58
  end
73
- end, ->(section) do
74
- section.header padding: glib_json_padding_list, childViews: ->(header) do
75
- header.h2 text: 'Web Only'
59
+ template.thumbnail title: 'Floating Submit', onClick: ->(action) do
60
+ action.windows_open url: json_ui_garage_url(path: 'forms/floating_submit')
76
61
  end
77
62
 
78
- section.rows builder: ->(template) do
79
- template.thumbnail title: 'Rich Text Editor', onClick: ->(action) do
80
- action.windows_open url: json_ui_garage_url(path: 'forms/rich_text')
81
- end
63
+ end
64
+ end, ->(section) do
65
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
66
+ header.h2 text: 'Styling'
67
+ end
68
+ section.rows builder: ->(template) do
69
+ template.thumbnail title: 'Text Boxes', onClick: ->(action) do
70
+ action.windows_open url: json_ui_garage_url(path: 'forms/styled_boxes')
82
71
  end
72
+ end
73
+ end, ->(section) do
74
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
75
+ header.h2 text: 'Web Only'
76
+ end
83
77
 
84
- section.rows builder: ->(template) do
85
- template.thumbnail title: 'New Rich Text Editor', onClick: ->(action) do
86
- action.windows_open url: json_ui_garage_url(path: 'forms/new_rich_text')
87
- end
88
-
78
+ section.rows builder: ->(template) do
79
+ template.thumbnail title: 'Rich Text Editor', onClick: ->(action) do
80
+ action.windows_open url: json_ui_garage_url(path: 'forms/rich_text')
89
81
  end
90
- end, ->(section) do
91
- section.header padding: glib_json_padding_list, childViews: ->(header) do
92
- header.h2 text: 'Experimental (not required yet)'
82
+ end
83
+
84
+ section.rows builder: ->(template) do
85
+ template.thumbnail title: 'New Rich Text Editor', onClick: ->(action) do
86
+ action.windows_open url: json_ui_garage_url(path: 'forms/new_rich_text')
93
87
  end
94
88
 
95
- section.rows builder: ->(template) do
96
- template.thumbnail title: 'Dynamic Group', onClick: ->(action) do
97
- action.windows_open url: json_ui_garage_url(path: 'forms/dynamic_group')
98
- end
99
- template.thumbnail title: 'Dynamic Select', onClick: ->(action) do
100
- action.windows_open url: json_ui_garage_url(path: 'forms/dynamic_select')
101
- end
102
- template.thumbnail title: 'Checkboxes', onClick: ->(action) do
103
- action.windows_open url: json_ui_garage_url(path: 'forms/checkboxes')
104
- end
89
+ end
90
+ end, ->(section) do
91
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
92
+ header.h2 text: 'Experimental (not required yet)'
93
+ end
105
94
 
95
+ section.rows builder: ->(template) do
96
+ template.thumbnail title: 'Dynamic Group', onClick: ->(action) do
97
+ action.windows_open url: json_ui_garage_url(path: 'forms/dynamic_group')
98
+ end
99
+ template.thumbnail title: 'Dynamic Select', onClick: ->(action) do
100
+ action.windows_open url: json_ui_garage_url(path: 'forms/dynamic_select')
101
+ end
102
+ template.thumbnail title: 'Checkboxes', onClick: ->(action) do
103
+ action.windows_open url: json_ui_garage_url(path: 'forms/checkboxes')
106
104
  end
107
- end
108
- ]
109
105
 
110
- end
106
+ end
107
+ end
108
+ ]
@@ -1,40 +1,39 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
7
- form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
6
+ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
7
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
8
8
 
9
- # images = [
10
- # {
11
- # value: "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4",
12
- # fileUrl: "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
13
- # }
14
- # ]
15
- # form.fields_richText name: 'user[bio]', width: 'matchParent', label: 'Content', images: images, value: '<p>Test {{image1}}</p>'
9
+ # images = [
10
+ # {
11
+ # value: "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4",
12
+ # fileUrl: "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
13
+ # }
14
+ # ]
15
+ # form.fields_richText name: 'user[bio]', width: 'matchParent', label: 'Content', images: images, value: '<p>Test {{image1}}</p>'
16
16
 
17
- json.child! do
18
- json.view 'fields/newRichText-v1'
19
- json.width 'matchParent'
20
- json.label 'Content'
21
- json.name 'user[bio]'
22
- json.value '<p>Test {{image1}}</p>'
17
+ json.child! do
18
+ json.view 'fields/newRichText-v1'
19
+ json.width 'matchParent'
20
+ json.label 'Content'
21
+ json.name 'user[bio]'
22
+ json.value '<p>Test {{image1}}</p>'
23
23
 
24
- json.images do
25
- json.child! do
26
- json.value "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4"
27
- # json.fileTitle "hita i hanom hg.jpg"
28
- json.fileUrl "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
29
- end
30
- end
31
-
32
- json.imageUploader do
33
- json.accepts(fileType: "image/*", maxFileSize: 5000)
34
- json.directUploadUrl rails_direct_uploads_url
24
+ json.images do
25
+ json.child! do
26
+ json.value "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4"
27
+ # json.fileTitle "hita i hanom hg.jpg"
28
+ json.fileUrl "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
35
29
  end
36
30
  end
37
31
 
38
- form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
32
+ json.imageUploader do
33
+ json.accepts(fileType: "image/*", maxFileSize: 5000)
34
+ json.directUploadUrl rails_direct_uploads_url
35
+ end
39
36
  end
37
+
38
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
40
39
  end
@@ -1,48 +1,46 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- form.h2 text: 'Radio Group'
8
- form.spacer height: 6
9
- form.h4 text: 'Gender'
10
- form.fields_radioGroup name: 'user[gender]', value: 'F', childViews: ->(group) do
11
- group.fields_radio value: '', label: 'Unknown'
12
- group.fields_radio value: 'M', label: 'Male'
13
- group.fields_radio value: 'F', label: 'Female'
14
- end
15
-
16
- form.spacer height: 20
17
- form.h2 text: 'Single Checkbox'
18
- form.fields_check name: 'user[age_range]', value: '16+', checkValue: '16+', uncheckValue: '0-16', label: 'I am over 16 (has default value)'
19
- form.fields_check name: 'user[employer]', checkValue: 1, label: 'I am an employer (no default value)'
20
- form.fields_check name: 'user[enabled]', checkValue: true, label: 'Enable', styleClass: 'switch', value: 'true'
21
-
22
- form.spacer height: 20
23
- form.h2 text: 'Date/Time'
24
- form.spacer height: 6
25
- form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
26
- form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
27
-
28
- form.spacer height: 20
29
- form.h2 text: 'Country'
30
- form.spacer height: 6
31
- region_field = { name: 'user[city]', label: 'City' }
32
- form.fields_country name: 'user[country]', width: 'matchParent', label: 'Country', region: region_field
33
-
34
- form.spacer height: 20
35
- form.h2 text: 'Map'
36
- form.spacer height: 6
37
- form.fields_location name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
38
- autocompleteOptions: { componentRestrictions: { country: 'au' }, types: ['(cities)'] },
39
- latitudeField: { view: 'fields/text', name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
40
- longitudeField: { view: 'fields/text', name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true },
41
- zoomField: { view: 'fields/text', name: 'user[zoom]', label: 'Zoom' }
42
-
43
- form.spacer height: 20
44
- form.fields_submit text: 'Submit'
45
-
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
+ form.h2 text: 'Radio Group'
8
+ form.spacer height: 6
9
+ form.h4 text: 'Gender'
10
+ form.fields_radioGroup name: 'user[gender]', value: 'F', childViews: ->(group) do
11
+ group.fields_radio value: '', label: 'Unknown'
12
+ group.fields_radio value: 'M', label: 'Male'
13
+ group.fields_radio value: 'F', label: 'Female'
46
14
  end
47
15
 
16
+ form.spacer height: 20
17
+ form.h2 text: 'Single Checkbox'
18
+ form.fields_check name: 'user[age_range]', value: '16+', checkValue: '16+', uncheckValue: '0-16', label: 'I am over 16 (has default value)'
19
+ form.fields_check name: 'user[employer]', checkValue: 1, label: 'I am an employer (no default value)'
20
+ form.fields_check name: 'user[enabled]', checkValue: true, label: 'Enable', styleClass: 'switch', value: 'true'
21
+
22
+ form.spacer height: 20
23
+ form.h2 text: 'Date/Time'
24
+ form.spacer height: 6
25
+ form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
26
+ form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
27
+
28
+ form.spacer height: 20
29
+ form.h2 text: 'Country'
30
+ form.spacer height: 6
31
+ region_field = { name: 'user[city]', label: 'City' }
32
+ form.fields_country name: 'user[country]', width: 'matchParent', label: 'Country', region: region_field
33
+
34
+ form.spacer height: 20
35
+ form.h2 text: 'Map'
36
+ form.spacer height: 6
37
+ form.fields_location name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
38
+ autocompleteOptions: { componentRestrictions: { country: 'au' }, types: ['(cities)'] },
39
+ latitudeField: { view: 'fields/text', name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
40
+ longitudeField: { view: 'fields/text', name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true },
41
+ zoomField: { view: 'fields/text', name: 'user[zoom]', label: 'Zoom' }
42
+
43
+ form.spacer height: 20
44
+ form.fields_submit text: 'Submit'
45
+
48
46
  end
@@ -1,22 +1,59 @@
1
1
  json.title 'Forms'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- form.fields_email name: 'user[email]', width: 'matchParent', label: 'Email'
8
- form.fields_url name: 'user[url]', width: 'matchParent', label: 'URL'
9
- form.fields_number name: 'user[number]', width: 'matchParent', label: 'Number', validation: { required: { message: 'Required' } }
10
- form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password', hint: 'Should contain at least 6 characters'
11
- form.fields_textarea name: 'user[textarea]', width: 'matchParent', label: 'Textarea with maxLength', maxLength: 50, validation: { required: { message: 'Required' } }
6
+ page.form \
7
+ url: json_ui_garage_url(path: 'forms/generic_post'),
8
+ method: 'post',
9
+ padding: glib_json_padding_body,
10
+ childViews: ->(form) do
11
+ form.fields_email \
12
+ name: 'user[email]',
13
+ width: 'matchParent',
14
+ label: 'Email'
15
+
16
+ form.fields_url \
17
+ name: 'user[url]',
18
+ width: 'matchParent',
19
+ label: 'URL'
20
+
21
+ form.fields_number \
22
+ name: 'user[number]',
23
+ width: 'matchParent',
24
+ label: 'Number',
25
+ validation: { required: { message: 'Required' } },
26
+ leftText: 'USD',
27
+ rightText: '.00'
28
+
29
+ form.fields_password \
30
+ name: 'user[password]',
31
+ width: 'matchParent',
32
+ label: 'Password',
33
+ hint: 'Should contain at least 6 characters',
34
+ leftIcon: 'lock'
35
+
36
+ form.fields_textarea \
37
+ name: 'user[textarea]',
38
+ width: 'matchParent',
39
+ label: 'Textarea with maxLength',
40
+ maxLength: 50,
41
+ validation: { required: { message: 'Required' } }
12
42
 
13
43
  options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
14
- form.fields_select name: 'user[gender]', width: 'matchParent', label: 'Gender', validation: { required: { message: 'Required' } }, options: options
44
+ form.fields_select \
45
+ name: 'user[gender]',
46
+ width: 'matchParent',
47
+ label: 'Gender',
48
+ validation: { required: { message: 'Required' } },
49
+ options: options
15
50
 
16
51
  form.spacer height: 20
17
- form.fields_stripeToken name: 'user[stripe_token]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx'
52
+ form.fields_stripeToken \
53
+ name: 'user[stripe_token]',
54
+ width: 'matchParent',
55
+ publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx'
18
56
 
19
57
  form.spacer height: 30
20
58
  form.fields_submit text: 'Submit'
21
59
  end
22
- end
@@ -0,0 +1,26 @@
1
+ page = json_ui_page json
2
+
3
+ # Implement a page that shows how ActionCable works in json_ui
4
+
5
+ # 1. Example for list
6
+ # column.panels_list actionCable: socket_config, width: 'matchParent', firstSection: ->(section) do
7
+ # section.rows objects: @messages, builder: -> (row, message, index) do
8
+ # render 'conversations/message', row: row, message: message, user: current_user
9
+ # end
10
+ # end
11
+
12
+ # 2. Example for textarea
13
+ # - TODO: Put onKeyUp in Textarea class in app/helpers/glib/json_ui/view_builder/fields.rb
14
+ # - TODO: Implement onKeyUp in glib-web-npm
15
+ # - TODO: Implement cables_push in glib-web-npm
16
+ # form.fields_textarea prop: :content, width: 'matchParent', label: 'Message', onKeyUp: ->(action) do
17
+ # action.cables_push channel: 'message', event: 'typing'
18
+ # end
19
+
20
+ # 3. Example for online status
21
+ # - TODO: Implement "repeat: true" in glib-web-npm
22
+ # page.on load: ->(action) do
23
+ # action.timeouts_set interval: 10000, repeat: true, onTimeout: ->(subaction) do
24
+ # subaction.cables_push channel: 'message', event: 'online'
25
+ # end
26
+ # end
@@ -25,8 +25,12 @@ page.list firstSection: ->(section) do
25
25
  end
26
26
  end
27
27
 
28
- template.thumbnail title: 'WebSocket Real-time Update', onClick: ->(action) do
28
+ template.thumbnail title: 'Phoenix WebSocket Real-time Update', onClick: ->(action) do
29
29
  action.windows_open url: json_ui_garage_url(path: 'notifications/web_socket')
30
30
  end
31
+
32
+ template.thumbnail title: 'ActionCable Real-time Update', onClick: ->(action) do
33
+ action.windows_open url: json_ui_garage_url(path: 'notifications/action_cable')
34
+ end
31
35
  end
32
36
  end
@@ -1,41 +1,44 @@
1
1
  json.title 'Views'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
6
- page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
- scroll.h1 text: 'Heading 1'
8
-
9
- scroll.spacer height: 10
10
- scroll.h2 text: 'Heading 2'
11
-
12
- scroll.spacer height: 10
13
- scroll.h3 text: 'Heading 3'
14
-
15
- scroll.spacer height: 10
16
- scroll.h4 text: 'Heading 4'
17
-
18
- scroll.spacer height: 10
19
- scroll.label text: 'Label'
20
-
21
- scroll.spacer height: 20
22
- scroll.hr width: 'matchParent'
23
-
24
- scroll.spacer height: 20
25
- scroll.h2 text: 'Paragraph'
26
- scroll.spacer height: 6
27
- scroll.p text: 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC,'\
28
- ' making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,'\
29
- ' consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.'\
30
- ' Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.'\
31
- ' This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..",'\
32
- ' comes from a line in section 1.10.32.' + "\n\n" +
33
- 'The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum"'\
34
- ' by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.'
35
-
36
- scroll.spacer height: 20
37
- scroll.h2 text: 'Chip'
38
- scroll.spacer height: 6
39
- scroll.chip text: 'pending'
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.h1 text: 'Heading 1'
8
+
9
+ scroll.spacer height: 10
10
+ scroll.h2 text: 'Heading 2'
11
+
12
+ scroll.spacer height: 10
13
+ scroll.h3 text: 'Heading 3'
14
+
15
+ scroll.spacer height: 10
16
+ scroll.h4 text: 'Heading 4'
17
+
18
+ scroll.spacer height: 10
19
+ scroll.label text: 'Label'
20
+
21
+ scroll.spacer height: 20
22
+ scroll.hr width: 'matchParent'
23
+
24
+ scroll.spacer height: 20
25
+ scroll.h2 text: 'Paragraph'
26
+ scroll.spacer height: 6
27
+ scroll.p text: 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC,'\
28
+ ' making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,'\
29
+ ' consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.'\
30
+ ' Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.'\
31
+ ' This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..",'\
32
+ ' comes from a line in section 1.10.32.' + "\n\n" +
33
+ 'The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum"'\
34
+ ' by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.'
35
+
36
+ scroll.spacer height: 20
37
+ scroll.h2 text: 'Chip'
38
+ scroll.spacer height: 6
39
+ scroll.chip styleClass: 'success', text: 'pending'
40
+ scroll.spacer height: 6
41
+ scroll.chip text: 'Skills', onClick: ->(action) do
42
+ action.dialogs_alert message: 'Perform action'
40
43
  end
41
44
  end
@@ -34,6 +34,8 @@ module Glib
34
34
  process_action(http, on_click)
35
35
  end
36
36
  end
37
+
38
+ @read_only_actions.replace(@read_only_actions.sort_by { |e| e[1].to_s })
37
39
  end
38
40
 
39
41
  def process_action(http, spec)
@@ -13,7 +13,10 @@ module Glib
13
13
 
14
14
  def __log_dir
15
15
  if @__log_dir.nil?
16
- @__log_dir = File.expand_path("#{Rails.root}/test/controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
16
+ @__log_dir = File.expand_path(
17
+ "#{Rails.root}/test/controllers/#{self.class.to_s.underscore}_results",
18
+ File.dirname(__FILE__)
19
+ )
17
20
  unless File.directory?(@__log_dir)
18
21
  FileUtils.mkdir_p(@__log_dir)
19
22
  end
@@ -26,15 +29,24 @@ module Glib
26
29
  end
27
30
 
28
31
  def __log(json)
29
- File.open("#{File.join(__log_dir, __log_file)}", 'w') do |f|
32
+ file = File.open("#{File.join(__log_dir, __log_file)}", 'w') do |f|
30
33
  f << JSON.pretty_generate(JSON.parse(json))
31
34
  end
35
+ file.close
32
36
  json
33
37
  end
34
38
 
35
39
  def __get_previous_result_from_git
36
- `git checkout -- "#{File.join(__log_dir, __log_file)}" > /dev/null 2>&1` if __git_is_available?
37
- File.exist?(File.join(__log_dir, __log_file)) ? File.open(File.join(__log_dir, __log_file)).read : "\{\}"
40
+ if __git_is_available?
41
+ `git checkout -- "#{File.join(__log_dir, __log_file)}" > /dev/null 2>&1`
42
+ end
43
+ if File.exist?(
44
+ File.join(__log_dir, __log_file)
45
+ )
46
+ File.read(File.join(__log_dir, __log_file))
47
+ else
48
+ "\{\}"
49
+ end
38
50
  end
39
51
  end
40
52
  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.43
4
+ version: 0.5.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -157,6 +157,7 @@ files:
157
157
  - app/views/json_ui/garage/lists/index.json.jbuilder
158
158
  - app/views/json_ui/garage/lists/reordering.json.jbuilder
159
159
  - app/views/json_ui/garage/lists/templating.json.jbuilder
160
+ - app/views/json_ui/garage/notifications/action_cable.json.jbuilder
160
161
  - app/views/json_ui/garage/notifications/android_post.json.jbuilder
161
162
  - app/views/json_ui/garage/notifications/index.json.jbuilder
162
163
  - app/views/json_ui/garage/notifications/web_socket.json.jbuilder