glib-web 2.4.0 → 2.6.0

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: 416ab4888b4ca5e16220519fb9f1dc56999d91be403a2f14c464386f4b586604
4
- data.tar.gz: b6e8f65a85f9542b9a3a8e865d52a36860d7acb95cdc930918e379b290ba0e66
3
+ metadata.gz: f0d389754a1133b159974aeaa56aa3e4accfc8307b6b97cefbb2497fea7bfb8c
4
+ data.tar.gz: 13c62150593ffdfb6ff2777024e1bc87388084a4e44de0639de3ab8d88879f1e
5
5
  SHA512:
6
- metadata.gz: d2705c8939f81dcd503c8d7c77c5f70d157df9645123b4ca1f56fefe351bbafdeee4485cfaa31838a2e001f18cd05ae8776c44a7569b8c1c892838f17eace3ed
7
- data.tar.gz: 1dcb659e7c9587137eef9aebfa1743e62edf6c427855a653fd6b12d71c827d5a32fb2e6131011cd80914f505bd6d140c07f61aaa9c4b60d301cb7f729772a1f5
6
+ metadata.gz: 2311300ae71398f14829508dc7ec1d99cc8de4d6747f11157dbbfcb92b81468212b5eeded5efa16c8956f40332366f3584fec2977ee8834872356c6de0c4b2ef
7
+ data.tar.gz: 5390d92bcb6e076141e17fca981a250a304f6fa9582e3bb6aab492a05d46027125c2a0bea8cc15a496cabbc8beb80dc60e1bb17f209c0bb92b84fd254ccdf57d
@@ -37,7 +37,7 @@ module Glib
37
37
  action :onLongPress
38
38
  icon :icon
39
39
  bool :avatar
40
- action :onReorder
40
+ # action :onReorder
41
41
  string :paramNameForFormData
42
42
  string :paramNameForNewAbsoluteIndex
43
43
  string :paramNameForNewSectionIndex
@@ -46,9 +46,7 @@ module Glib
46
46
  string :id # Deprecated
47
47
  string :paramNameForNewIndex # Deprecated
48
48
 
49
- # # NOTE: Experimental. Still deciding whether this needs to be a full blown panel or
50
- # # an array of badges (with relevant properties, e.g. text, color, etc)
51
- # views :accessoryViews
49
+ panels_builder :accessory, :header, :body, :footer
52
50
  end
53
51
 
54
52
  class Featured < Standard
@@ -76,6 +76,7 @@ class Glib::JsonUi::ViewBuilder
76
76
  class Text < AbstractField
77
77
  int :maxLength
78
78
  icon :leftIcon
79
+ icon :rightIcon
79
80
  string :leftText
80
81
  string :rightText
81
82
  action :onTypeStart
@@ -114,6 +115,7 @@ class Glib::JsonUi::ViewBuilder
114
115
  class Submit < AbstractField
115
116
  string :text
116
117
  color :color
118
+ icon :icon
117
119
  end
118
120
 
119
121
  class CheckGroup < AbstractField
@@ -300,6 +302,10 @@ class Glib::JsonUi::ViewBuilder
300
302
  string :publicKey
301
303
  end
302
304
 
305
+ class Otp < AbstractField
306
+ int :lengths
307
+ end
308
+
303
309
  class Rating < AbstractField
304
310
  bool :halfIncrements
305
311
  string :color
@@ -140,6 +140,7 @@ class Glib::JsonUi::ViewBuilder
140
140
  action :onScrollToBottom
141
141
 
142
142
  int :responsiveCols
143
+ hash :dragSupport
143
144
 
144
145
  def firstSection(block)
145
146
  json.sections [1] do
@@ -242,6 +243,7 @@ class Glib::JsonUi::ViewBuilder
242
243
  string :distribution
243
244
  string :align
244
245
  action :onClick
246
+ hash :dragSupport
245
247
  end
246
248
 
247
249
  class Flow < View
@@ -226,6 +226,8 @@ module Glib
226
226
  int :zoom
227
227
  string :dataUrl
228
228
  bool :cluster
229
+ bool :direction
230
+ array :locations
229
231
  end
230
232
 
231
233
  class Chip < View
@@ -83,6 +83,9 @@ page.list sections: [
83
83
  template.thumbnail title: 'Payments', onClick: ->(action) do
84
84
  action.windows_open url: json_ui_garage_url(path: 'forms/payments')
85
85
  end
86
+ template.thumbnail title: 'OTP Field', onClick: ->(action) do
87
+ action.windows_open url: json_ui_garage_url(path: 'forms/otp_field')
88
+ end
86
89
  end
87
90
  end, ->(section) do
88
91
  section.header padding: glib_json_padding_list, childViews: ->(header) do
@@ -0,0 +1,35 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
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
+
12
+ form.spacer height: 20
13
+ form.h2 text: 'OTP Input Field'
14
+ form.spacer height: 6
15
+ form.fields_otp \
16
+ name: 'user[otp_summary1]',
17
+ lengths: 7
18
+
19
+ form.spacer height: 20
20
+ form.h2 text: 'OTP Custom Length'
21
+ form.spacer height: 6
22
+ form.fields_otp \
23
+ name: 'user[otp_summary2]',
24
+ lengths: 3
25
+
26
+ form.spacer height: 20
27
+ form.h2 text: 'OTP with Long Field'
28
+ form.spacer height: 6
29
+ form.fields_otp \
30
+ name: 'user[otp_summary3]',
31
+ lengths: 20
32
+
33
+ form.spacer height: 20
34
+ form.fields_submit text: 'Submit'
35
+ end
@@ -15,7 +15,13 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
15
15
  'melbourne' => 'Melbourne',
16
16
  'sydney' => 'Sydney',
17
17
  }
18
- form.fields_select name: 'user[city]', width: 'matchParent', label: 'City', options: languages.map { |k, v| { value: k, text: v } }, value: 'canberra'
18
+ form.fields_select \
19
+ name: 'user[city]',
20
+ width: 'matchParent',
21
+ label: 'City1',
22
+ placeholder: 'This is a placeholder',
23
+ options: languages.map { |k, v| { value: k, text: v } },
24
+ value: 'canberra'
19
25
  form.fields_select name: 'user[cities][]', width: 'matchParent', label: 'Cities', options: languages.map { |k, v| { value: k, text: v } }, value: ['melbourne', 'sydney'], multiple: true
20
26
 
21
27
  form.spacer height: 20
@@ -11,9 +11,7 @@ section.rows builder: ->(row) do
11
11
  array.each do |i|
12
12
  index = page_index * batch_count + i
13
13
  if local_assigns[:reorder]
14
- row.thumbnail title: "Item #{index}", onReorder: ->(action) do
15
- action.dialogs_notification title: "Item #{index}"
16
- end, paramNameForFormData: 'message', paramNameForNewIndex: 'new_index'
14
+ row.thumbnail title: "Item #{index}"
17
15
  else
18
16
  row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
19
17
  end
@@ -30,5 +30,11 @@ else
30
30
  end
31
31
  render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reorder: true
32
32
  end
33
- ]
33
+ ], dragSupport: {
34
+ onDrop: {
35
+ action: 'dialogs/alert'
36
+ },
37
+ paramNameForFormData: 'message',
38
+ paramNameForNewIndex: 'new_index'
39
+ }
34
40
  end
@@ -11,6 +11,22 @@ json_ui_page json do |page|
11
11
  section.rows builder: ->(template) do
12
12
  template.thumbnail title: 'Click me', onClick: ->(action) do
13
13
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
14
+ end,
15
+ accessory: ->(accessory) do
16
+ accessory.header \
17
+ width: 'matchParent',
18
+ backgroundColor: '#b3bac2',
19
+ padding: { top: 10, bottom: 10, left: 10, right: 10 },
20
+ childViews: ->(bottom) do
21
+ bottom.label text: 'Custom row header'
22
+ end
23
+ accessory.footer \
24
+ width: 'matchParent',
25
+ backgroundColor: '#b3bac2',
26
+ padding: { top: 10, bottom: 10, left: 10, right: 10 },
27
+ childViews: ->(bottom) do
28
+ bottom.label text: 'Custom row footer'
29
+ end
14
30
  end
15
31
  template.thumbnail title: 'Item with icon and subtitle', subtitle: 'Item subtitle', icon: 'facebook'
16
32
  template.thumbnail title: 'Item with chips', chips: ->(menu) do
@@ -1,7 +1,6 @@
1
1
  progress = params[:progress]&.to_i&.between?(0, 5) ? params[:progress].to_i : 0
2
2
 
3
3
  tview.panels_responsive \
4
- width: 400,
5
4
  childViews: ->(res) do
6
5
  res.panels_column sm: { cols: 11 }, childViews: ->(subcolumn) do
7
6
  subcolumn.panels_column sm: { cols: 2, padding: { right: 10 } }, childViews: ->(inner_column) do
@@ -127,6 +127,19 @@ json_ui_page json do |page|
127
127
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
128
128
  end
129
129
 
130
+ scroll.spacer height: 20
131
+ scroll.h1 text: 'Drag-and-drop support'
132
+ scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
133
+ panel.button id: 'button1', text: '1'
134
+ panel.button id: 'button2', text: '2'
135
+ panel.button id: 'button3', text: '3'
136
+ end, dragSupport: {
137
+ onDrop: {
138
+ action: 'dialogs/alert',
139
+ },
140
+ paramNameForFormData: 'message'
141
+ }
142
+
130
143
  scroll.label text: "\n"
131
144
  end
132
145
  end
@@ -72,7 +72,7 @@ json_ui_page json do |page|
72
72
  left.button text: '1'
73
73
  end
74
74
  content.center childViews: ->(center) do
75
- center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
75
+ center.label text: 'a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long text'
76
76
  end
77
77
  content.right childViews: ->(right) do
78
78
  right.button text: '2'
@@ -26,7 +26,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
26
26
  end
27
27
 
28
28
  scroll.spacer height: 14
29
- scroll.h2 text: 'Breadcrumbs'
29
+ scroll.h2 text: 'Breadcrumbs (experimental)'
30
30
  scroll.spacer height: 6
31
31
  scroll.panels_ul \
32
32
  width: 'matchParent',
@@ -37,29 +37,12 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
37
37
  ul.button text: 'Level 1', styleClass: 'link', onClick: ->(action) do
38
38
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
39
39
  end
40
- # ul.button text: 'Level 2', styleClass: 'link', childButtons: ->(menu) do
41
- # menu.button text: 'Dropdown item 1'
42
- # menu.button text: 'Dropdown item 2'
43
- # menu.button text: 'Dropdown item 3'
44
- # end
45
40
 
46
41
  ul.button icon: 'keyboard_arrow_down', text: 'Level 2', styleClass: 'link', childButtons: ->(menu) do
47
42
  menu.button text: 'Dropdown item 1'
48
43
  menu.button text: 'Dropdown item 2'
49
44
  menu.button text: 'Dropdown item 3'
50
45
  end
51
- # , onClick: ->(action) do
52
- # action.windows_open url: json_ui_garage_url(path: 'home/blank')
53
- # end
54
46
  ul.label text: 'Level 3'
55
47
  end
56
-
57
- scroll.button icon: 'keyboard_arrow_down', text: 'Sign in', styleClasses: ['link'], onClick: ->(action) do
58
- action.windows_open url: json_ui_garage_url(path: 'home/blank')
59
- end
60
- scroll.button icon: 'keyboard_arrow_down', text: 'Sign in', styleClass: 'link', childButtons: ->(menu) do
61
- menu.button text: 'Dropdown item 1'
62
- menu.button text: 'Dropdown item 2'
63
- menu.button text: 'Dropdown item 3'
64
- end
65
48
  end
@@ -26,7 +26,7 @@ json.pins do
26
26
  { lat: -43.999792, lng: 170.463352 },
27
27
  { lat: 49.003109, lng: 108.490479, size: 3500000 },
28
28
  { lat: -6.611423, lng: 141.922091, size: 3700 },
29
- ];
29
+ ]
30
30
 
31
31
  locations.each do |location|
32
32
  json.child! do
@@ -0,0 +1,61 @@
1
+
2
+ # page = json_ui_page json
3
+
4
+ json.pins do
5
+
6
+ locations = [
7
+ [
8
+ { lat: -31.56391, lng: 147.154312 },
9
+ { lat: -33.718234, lng: 150.363181 },
10
+ { lat: -33.727111, lng: 150.371124 },
11
+ { lat: -33.848588, lng: 151.209834 },
12
+ { lat: -33.851702, lng: 151.216968 },
13
+ ],
14
+ [
15
+ { lat: -33.80664156068477, lng: 145.62789926321355 },
16
+ { lat: -34.282842261683825, lng: 146.0436968577822 },
17
+ { lat: -34.542028425407175, lng: 146.39268392820802 }
18
+ ]
19
+ ]
20
+
21
+ # locations = [
22
+ # { lat: -31.56391, lng: 147.154312 },
23
+ # { lat: -33.718234, lng: 150.363181 },
24
+ # { lat: -33.727111, lng: 150.371124 },
25
+ # { lat: -33.848588, lng: 151.209834 },
26
+ # { lat: -33.851702, lng: 151.216968 },
27
+ # ]
28
+
29
+ locations.each_with_index do |loc, i|
30
+ loc.each_with_index do |location, index|
31
+ json.child! do
32
+ json.latitude location[:lat]
33
+ json.longitude location[:lng]
34
+ json.markerNumber index + 1
35
+ json.markerColor i == 0 ? '#537FE7' : '#362FD9'
36
+ json.infoWindow do
37
+ json.title "Place #{index}"
38
+ json.subtitle 'Big shopping mall'
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ # json.child! do
45
+ # json.latitude 13.473001
46
+ # json.longitude 144.771303
47
+ # json.infoWindow do
48
+ # json.title 'Place 2'
49
+ # json.subtitle 'High class restaurant'
50
+ # end
51
+ # end
52
+
53
+ # json.child! do
54
+ # json.latitude 13.375903 + rand(0..0.1)
55
+ # json.longitude 144.749791 + rand(0..0.1)
56
+ # json.infoWindow do
57
+ # json.title 'Place 3'
58
+ # json.subtitle 'Random location'
59
+ # end
60
+ # end
61
+ end
@@ -27,5 +27,34 @@ json_ui_page json do |page|
27
27
  cluster: true,
28
28
  dataUrl: json_ui_garage_url(path: 'views/map_cluster_data')
29
29
 
30
+
31
+ locations = [
32
+ [
33
+ { lat: -31.56391, lng: 147.154312 },
34
+ { lat: -33.718234, lng: 150.363181 },
35
+ { lat: -33.727111, lng: 150.371124 },
36
+ { lat: -33.848588, lng: 151.209834 },
37
+ { lat: -33.851702, lng: 151.216968 },
38
+ ],
39
+ [
40
+ { lat: -33.80664156068477, lng: 145.62789926321355 },
41
+ { lat: -34.282842261683825, lng: 146.0436968577822 },
42
+ { lat: -34.542028425407175, lng: 146.39268392820802 }
43
+ ]
44
+ ]
45
+
46
+ scroll.spacer height: 20
47
+ scroll.h2 text: 'Map with Direction'
48
+ scroll.spacer height: 6
49
+ scroll.map \
50
+ width: 'matchParent',
51
+ latitude: -31.56391,
52
+ longitude: 147.154312,
53
+ direction: true,
54
+ locations: locations,
55
+ zoom: 9,
56
+ height: 480,
57
+ dataUrl: json_ui_garage_url(path: 'views/map_direction_data')
58
+
30
59
  end
31
60
  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: 2.4.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -165,6 +165,7 @@ files:
165
165
  - app/views/json_ui/garage/forms/new_rich_text.json.jbuilder
166
166
  - app/views/json_ui/garage/forms/online_participant1.json.jbuilder
167
167
  - app/views/json_ui/garage/forms/online_participant2.json.jbuilder
168
+ - app/views/json_ui/garage/forms/otp_field.json.jbuilder
168
169
  - app/views/json_ui/garage/forms/page_update_on_response.json.jbuilder
169
170
  - app/views/json_ui/garage/forms/partial_update.json.jbuilder
170
171
  - app/views/json_ui/garage/forms/partial_update_response.json.jbuilder
@@ -254,6 +255,7 @@ files:
254
255
  - app/views/json_ui/garage/views/links.json.jbuilder
255
256
  - app/views/json_ui/garage/views/map_cluster_data.json.jbuilder
256
257
  - app/views/json_ui/garage/views/map_data.json.jbuilder
258
+ - app/views/json_ui/garage/views/map_direction_data.json.jbuilder
257
259
  - app/views/json_ui/garage/views/maps.json.jbuilder
258
260
  - app/views/json_ui/garage/views/markdowns.json.jbuilder
259
261
  - app/views/json_ui/garage/views/misc.json.jbuilder