glib-web 3.0.1 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) 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/forms_helper.rb +0 -0
  6. data/app/helpers/glib/json_ui/action_builder/dialogs.rb +1 -0
  7. data/app/helpers/glib/json_ui/action_builder/popovers.rb +3 -1
  8. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  9. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  10. data/app/helpers/glib/json_ui/builder/mouse_events.rb +29 -0
  11. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  12. data/app/helpers/glib/json_ui/list_builders.rb +3 -1
  13. data/app/helpers/glib/json_ui/menu_builder.rb +3 -30
  14. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  15. data/app/helpers/glib/json_ui/view_builder/banners.rb +2 -0
  16. data/app/helpers/glib/json_ui/view_builder/charts.rb +21 -21
  17. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -0
  18. data/app/helpers/glib/json_ui/view_builder.rb +3 -4
  19. data/app/helpers/glib/urls_helper.rb +0 -0
  20. data/app/models/glib/active_storage/attachment.rb +0 -0
  21. data/app/models/glib/active_storage/blob.rb +0 -0
  22. data/app/models/glib/dynamic_text_record.rb +0 -0
  23. data/app/models/glib/text.rb +0 -0
  24. data/app/validators/email_typo_validator.rb +0 -0
  25. data/app/validators/email_validator.rb +0 -0
  26. data/app/validators/url_validator.rb +0 -0
  27. data/app/views/json_ui/garage/actions/_list.json.jbuilder +23 -0
  28. data/app/views/json_ui/garage/actions/_panels.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +5 -0
  30. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/actions/index.json.jbuilder +3 -23
  33. data/app/views/json_ui/garage/actions/partial_update.json.jbuilder +5 -0
  34. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/forms/styled_boxes.json.jbuilder +40 -27
  39. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/_autoload_section.json.jbuilder +1 -1
  46. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/lists/edit_actions.json.jbuilder +19 -12
  50. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/lists/reordering.json.jbuilder +1 -1
  52. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +15 -10
  66. data/app/views/json_ui/garage/panels/index.json.jbuilder +3 -3
  67. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/panels/timeline.json.jbuilder +2 -2
  69. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  75. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/views/banners.json.jbuilder +42 -22
  78. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  79. data/app/views/json_ui/garage/views/charts.json.jbuilder +25 -15
  80. data/app/views/json_ui/garage/views/controls.json.jbuilder +36 -27
  81. data/app/views/json_ui/garage/views/index.json.jbuilder +2 -1
  82. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  83. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  84. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  85. data/app/views/json_ui/garage/views/shareButton.json.jbuilder +10 -0
  86. data/app/views/json_ui/garage/views/steppers.json.jbuilder +40 -0
  87. data/config/routes.rb +0 -0
  88. data/lib/generators/glib/install_generator.rb +0 -0
  89. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  90. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  91. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  92. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  93. data/lib/generators/templates/database.yml +0 -0
  94. data/lib/generators/templates/dynamic_text.rb +0 -0
  95. data/lib/glib/crypt/utils.rb +0 -0
  96. data/lib/glib/crypt.rb +0 -0
  97. data/lib/glib/dynamic_text/config.rb +0 -0
  98. data/lib/glib/dynamic_text.rb +0 -0
  99. data/lib/glib/engine.rb +0 -0
  100. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  101. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  102. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  103. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +0 -0
  104. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  105. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  106. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  107. data/lib/glib/json_crawler/coverage.rb +0 -0
  108. data/lib/glib/json_crawler.rb +0 -0
  109. data/lib/glib/mailer_tester.rb +0 -0
  110. data/lib/glib/value.rb +0 -0
  111. data/lib/glib/version.rb +0 -0
  112. data/lib/glib-web.rb +0 -0
  113. data/lib/tasks/db.rake +0 -0
  114. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72eecba2c1fe97bbb3ef6f0be03e4d0f79a23a4dcca8c7f16bf3d1be9083a5b7
4
- data.tar.gz: 526316d03db695e57c5a2a7e81110cb52f14d73ab5524ca7866c73a6e9230ffc
3
+ metadata.gz: 7420379e631fafe18169bae65ecf81be22f06c856ac916e2c2ca41c55a4bfa08
4
+ data.tar.gz: '011939313dda8a3ab48b13e952dc54d5b21dd5e219e0325acde5fc2fc584e271'
5
5
  SHA512:
6
- metadata.gz: fc68d49b58d90e62fa5c4f2cd82bbf2bde03123a63ecc3f3fe09875d8a886db320f0151c53c31cfc417d2cc88993f66b10350f2d9f00f8c70dda54bdccef1075
7
- data.tar.gz: e4faf34c6746d568277406474f5c75ce05f52c0ce262102879adf13ac595e8f03102a169047d9a9993f952d6d3978de6f22677b9068796d14cb1b3fba3b6d878
6
+ metadata.gz: 1c4af7e316304a28f56dcf0b027a7028df029bd70c022523d4ab58c80472532616ff9c931a1c018502786b4940e2065d3f6b5922927f069fdbc46c43e09b9c26
7
+ data.tar.gz: 8e8df0ebbd89629378fcf9b051a47f718bb4beb8cd3a5c1fcce5603af4f0d284c7ad95ce8e7ab0884241d9531536f6699814c12636cd4ce7ec4128c24d59c63b
File without changes
File without changes
File without changes
@@ -47,6 +47,7 @@ class Glib::JsonUi::ActionBuilder
47
47
  string :fullscreen
48
48
  length :width
49
49
  length :height
50
+ bool :closeOnBlur
50
51
  end
51
52
 
52
53
  class Reload < Action
@@ -3,8 +3,10 @@ class Glib::JsonUi::ActionBuilder
3
3
  class Open < Action
4
4
  string :key
5
5
  views :childViews
6
- string :location
6
+ string :placement
7
7
  int :offset
8
+ int :width
9
+ singleton_array :styleClass, :styleClasses
8
10
  end
9
11
 
10
12
  class Close < Action
File without changes
File without changes
@@ -0,0 +1,29 @@
1
+ module Glib
2
+ module JsonUi
3
+ module Builder::MouseEvents
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ action :onMouseEnter
8
+ action :onMouseLeave
9
+ end
10
+
11
+ def tooltip(options)
12
+ key = "tooltip_#{SecureRandom.uuid}"
13
+ onMouseEnter ->(action) do
14
+ action.popovers_open(
15
+ key: key,
16
+ placement: options[:placement] || 'top',
17
+ childViews: ->(view) {
18
+ view.p styleClass: 'tooltip', text: options[:text]
19
+ }
20
+ )
21
+ end
22
+
23
+ onMouseLeave ->(action) do
24
+ action.popovers_close key: key
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
File without changes
@@ -53,8 +53,10 @@ module Glib
53
53
  end
54
54
 
55
55
  class Thumbnail < Standard
56
- menu :leftOuterButtons
56
+ # menu :leftOuterButtons
57
57
  int :imageSize
58
+
59
+ panels_builder :content, :header, :footer, :right
58
60
  end
59
61
 
60
62
  class CommentOutgoing < Standard
@@ -6,36 +6,9 @@ module Glib
6
6
  end
7
7
 
8
8
  class MenuItem < JsonUiElement
9
- hash :analytics
10
-
11
- # def initialize(json, page)
12
- # super(json, page)
13
-
14
- # # Can be improved by making it configurable site-wide.
15
- # @analyticsEnabled = true
16
- # end
9
+ include Builder::MouseEvents
17
10
 
18
- # def analytics(value)
19
- # if value.is_a?(Hash)
20
- # @analyticsEnabled = true
21
- # @analyticsId = value
22
- # else
23
- # @analyticsEnabled = value == true
24
- # end
25
- # end
26
-
27
- # # Override
28
- # def created
29
- # json.analytics do
30
- # if @analyticsEnabled
31
- # if @analyticsId
32
- # json.placement @analyticsId
33
- # end
34
- # else
35
- # json.disabled true
36
- # end
37
- # end
38
- # end
11
+ hash :analytics
39
12
  end
40
13
 
41
14
  class Button < MenuItem
@@ -45,7 +18,7 @@ module Glib
45
18
  icon :icon
46
19
  action :onClick
47
20
  bool :disabled
48
- hash :tooltip
21
+ # hash :tooltip
49
22
  singleton_array :styleClass, :styleClasses
50
23
 
51
24
  def childButtons(block)
File without changes
@@ -3,6 +3,7 @@ class Glib::JsonUi::ViewBuilder
3
3
 
4
4
  class Alert < View
5
5
  icon :icon
6
+ string :title
6
7
  string :message
7
8
  # string :message_format
8
9
  singleton_array :styleClass, :styleClasses
@@ -11,6 +12,7 @@ class Glib::JsonUi::ViewBuilder
11
12
  class Select < View
12
13
  string :id
13
14
  icon :icon
15
+ string :title
14
16
  string :message
15
17
  singleton_array :styleClass, :styleClasses
16
18
  color :color
@@ -12,11 +12,7 @@ class Glib::JsonUi::ViewBuilder
12
12
  end
13
13
  end
14
14
 
15
- class Line < View
16
- include ReleaseDateIndicator
17
-
18
- hash :nextPage
19
-
15
+ module Series
20
16
  def dataSeries(blocks)
21
17
  json.dataSeries do
22
18
  blocks.each do |block|
@@ -27,13 +23,6 @@ class Glib::JsonUi::ViewBuilder
27
23
  end
28
24
  end
29
25
 
30
- end
31
-
32
- class Column < View
33
- include ReleaseDateIndicator
34
-
35
- bool :stacked
36
-
37
26
  def dataGroups(blocks)
38
27
  json.dataGroups do
39
28
  blocks.each do |block|
@@ -45,16 +34,27 @@ class Glib::JsonUi::ViewBuilder
45
34
  end
46
35
  end
47
36
 
37
+ class Line < View
38
+ include Series
39
+
40
+ # idea for the future
41
+ # hash :nextPage
42
+ end
43
+
44
+ class Column < View
45
+ include Series
46
+
47
+ bool :stacked
48
+ end
49
+
48
50
  class Pie < View
49
- def dataSeries(blocks)
50
- json.dataSeries do
51
- blocks.each do |block|
52
- json.child! do
53
- block.call
54
- end
55
- end
56
- end
57
- end
51
+ include Series
52
+
58
53
  end
54
+
55
+ class Area < View
56
+ include Series
57
+ end
58
+
59
59
  end
60
60
  end
@@ -163,6 +163,7 @@ class Glib::JsonUi::ViewBuilder
163
163
  singleton_array :styleClass, :styleClasses
164
164
  array :events
165
165
  views :childViews
166
+ string :truncateLine
166
167
  end
167
168
 
168
169
  class Table < View
@@ -32,6 +32,8 @@ module Glib
32
32
  end
33
33
 
34
34
  class View < JsonUiElement
35
+ include Builder::MouseEvents
36
+
35
37
  string :id
36
38
  length :width
37
39
  length :height
@@ -41,12 +43,9 @@ module Glib
41
43
  hash :showIf
42
44
  hash :valueIf
43
45
  hash :analytics
44
- hash :tooltip
46
+ # hash :tooltip
45
47
  array :extensions
46
48
 
47
- action :onMouseEnter
48
- action :onMouseLeave
49
-
50
49
 
51
50
  # def initialize(json, page)
52
51
  # super(json, page)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,23 @@
1
+ panel.panels_list id: 'action_list', sections: [
2
+ ->(section) do
3
+ render "#{@path_prefix}/actions/reload", section: section
4
+ end, ->(section) do
5
+ render "#{@path_prefix}/actions/panels", section: section
6
+ end, ->(section) do
7
+ render "#{@path_prefix}/actions/dialogs", section: section
8
+ end, ->(section) do
9
+ render "#{@path_prefix}/actions/snackbars", section: section
10
+ end, ->(section) do
11
+ render "#{@path_prefix}/actions/sheets", section: section
12
+ end, ->(section) do
13
+ render "#{@path_prefix}/actions/windows", section: section
14
+ end, ->(section) do
15
+ render "#{@path_prefix}/actions/timeouts", section: section
16
+ end, ->(section) do
17
+ render "#{@path_prefix}/actions/http", section: section
18
+ end, ->(section) do
19
+ render "#{@path_prefix}/actions/commands", section: section
20
+ end, ->(section) do
21
+ render "#{@path_prefix}/actions/tours", section: section
22
+ end
23
+ ]
@@ -11,7 +11,12 @@ section.rows builder: ->(template) do
11
11
 
12
12
  reload_counter = params[:reload_counter].to_i
13
13
  reload_counter = 0 if reload_counter > 5
14
+
14
15
  template.thumbnail title: "windows/reload with URL (counter: #{reload_counter})", onClick: ->(action) do
15
16
  action.windows_reload url: json_ui_garage_url(path: 'actions/index', reload_counter: reload_counter + 1)
16
17
  end
18
+
19
+ template.thumbnail title: "components/update (counter: #{reload_counter})", onClick: ->(action) do
20
+ action.http_get url: json_ui_garage_url(path: 'actions/partial_update', reload_counter: reload_counter + 1)
21
+ end
17
22
  end
@@ -3,26 +3,6 @@ json.title 'Actions'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
5
5
 
6
- page.list sections: [
7
- ->(section) do
8
- render "#{@path_prefix}/actions/reload", section: section
9
- end, ->(section) do
10
- render "#{@path_prefix}/actions/panels", section: section
11
- end, ->(section) do
12
- render "#{@path_prefix}/actions/dialogs", section: section
13
- end, ->(section) do
14
- render "#{@path_prefix}/actions/snackbars", section: section
15
- end, ->(section) do
16
- render "#{@path_prefix}/actions/sheets", section: section
17
- end, ->(section) do
18
- render "#{@path_prefix}/actions/windows", section: section
19
- end, ->(section) do
20
- render "#{@path_prefix}/actions/timeouts", section: section
21
- end, ->(section) do
22
- render "#{@path_prefix}/actions/http", section: section
23
- end, ->(section) do
24
- render "#{@path_prefix}/actions/commands", section: section
25
- end, ->(section) do
26
- render "#{@path_prefix}/actions/tours", section: section
27
- end
28
- ]
6
+ page.scroll childViews: ->(scroll) do
7
+ render "#{@path_prefix}/actions/list", panel: scroll
8
+ end
@@ -0,0 +1,5 @@
1
+ json_ui_response_with_view json do |action|
2
+ action.components_update targetId: 'action_list', views: ->(update) do
3
+ render "#{@path_prefix}/actions/list", panel: update
4
+ end
5
+ end
@@ -4,32 +4,45 @@ page = json_ui_page json
4
4
 
5
5
  render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
 
7
- page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
8
- form.fields_text name: 'user[name]', width: 'matchParent', label: 'Search', placeholder: 'Enter a keyword', styleClasses: ['outlined', 'rounded']
9
-
10
- form.spacer height: 14
11
- form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password', placeholder: 'Type your password', styleClass: 'outlined'
12
-
13
- form.spacer height: 14
14
- form.fields_textarea name: 'user[bio]', width: 'matchParent', label: 'Bio', placeholder: 'Enter your bio', styleClasses: ['outlined']
15
-
16
- # form.spacer height: 14
17
- # form.fields_stripeToken name: 'user[stripe_token_outlined]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'outlined'
18
-
19
- # form.spacer height: 14
20
- # form.fields_stripeToken name: 'user[stripe_token_individual]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'individual'
21
-
22
- form.spacer height: 14
23
- form.fields_creditCard name: 'user[stripe_token_outlined]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'outlined'
24
-
25
- form.spacer height: 14
26
- form.fields_creditCard name: 'user[stripe_token_individual]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'individual'
27
-
28
- form.spacer height: 14
29
- form.panels_split width: 'matchParent', content: ->(split) do
30
- split.right childViews: ->(right) do
31
- right.fields_submit text: 'Submit'
7
+ page.form \
8
+ url: json_ui_garage_url(path: 'forms/basic_post'),
9
+ method: 'post',
10
+ padding: glib_json_padding_body,
11
+ childViews: ->(form) do
12
+ form.fields_text \
13
+ name: 'user[name]',
14
+ width: 'matchParent',
15
+ label: 'Search',
16
+ placeholder: 'Enter a keyword',
17
+ styleClasses: ['outlined', 'rounded']
18
+
19
+ form.spacer height: 14
20
+ form.fields_password \
21
+ name: 'user[password]',
22
+ width: 'matchParent',
23
+ label: 'Password',
24
+ placeholder: 'Type your password',
25
+ styleClasses: ['outlined', 'compact']
26
+
27
+ form.spacer height: 14
28
+ form.fields_textarea name: 'user[bio]', width: 'matchParent', label: 'Bio', placeholder: 'Enter your bio', styleClasses: ['outlined']
29
+
30
+ # form.spacer height: 14
31
+ # form.fields_stripeToken name: 'user[stripe_token_outlined]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'outlined'
32
+
33
+ # form.spacer height: 14
34
+ # form.fields_stripeToken name: 'user[stripe_token_individual]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'individual'
35
+
36
+ form.spacer height: 14
37
+ form.fields_creditCard name: 'user[stripe_token_outlined]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'outlined'
38
+
39
+ form.spacer height: 14
40
+ form.fields_creditCard name: 'user[stripe_token_individual]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'individual'
41
+
42
+ form.spacer height: 14
43
+ form.panels_split width: 'matchParent', content: ->(split) do
44
+ split.right childViews: ->(right) do
45
+ right.fields_submit text: 'Submit'
46
+ end
32
47
  end
33
48
  end
34
-
35
- end
File without changes
File without changes
@@ -11,7 +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}"
14
+ row.thumbnail title: "Item #{index}", id: "item_#{index}"
15
15
  else
16
16
  row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
17
17
  end
File without changes
@@ -2,7 +2,7 @@ json.title 'Lists'
2
2
 
3
3
  page_index = params[:page].to_i
4
4
  if page_index > 2
5
- page_index = 2
5
+ page_index = 0
6
6
  end
7
7
  page = json_ui_page json
8
8
  render "#{@path_prefix}/nav_menu", json: json, page: page
@@ -13,26 +13,33 @@ page.list firstSection: ->(section) do
13
13
  title: 'Click menu (web) or swipe left (Android/iOS)',
14
14
  subtitle: "Page index: #{page_index}",
15
15
  leftButtons: ->(menu) do
16
- menu.button styleClass: 'icon', icon: 'check_box', onClick: ->(subaction) do
17
- subaction.dialogs_alert message: 'Tick/untick'
18
- end
16
+ menu.button \
17
+ styleClasses: ['icon', 'text', 'x-small'],
18
+ icon: 'check_box',
19
+ onClick: ->(subaction) do
20
+ subaction.dialogs_alert message: 'Tick/untick'
21
+ end
19
22
  end, rightButtons: ->(menu) do
20
23
  menu.button \
21
- styleClass: 'icon',
24
+ styleClasses: ['icon', 'text', 'x-small'],
22
25
  icon: 'share',
23
- tooltip: { text: 'Share' },
24
- childButtons: ->(submenu) do
25
- submenu.button text: 'Dropdown item 1'
26
- submenu.button text: 'Dropdown item 2'
27
- submenu.button text: 'Dropdown item 3'
28
- end
26
+ tooltip: { text: 'Share', location: 'left' }
27
+
28
+ # TODO: Use popoever
29
+ # childButtons: ->(submenu) do
30
+ # submenu.button text: 'Dropdown item 1'
31
+ # submenu.button text: 'Dropdown item 2'
32
+ # submenu.button text: 'Dropdown item 3'
33
+ # end
34
+
29
35
  menu.button \
30
- styleClass: 'icon',
36
+ styleClasses: ['icon', 'text', 'x-small'],
31
37
  icon: 'open_in_new',
32
38
  tooltip: { text: 'Open in new window' },
33
39
  onClick: ->(subaction) do
34
40
  subaction.dialogs_alert message: 'Open'
35
41
  end
42
+
36
43
  end, editButtons: ->(menu) do
37
44
  menu.button text: "Edit (ID: #{page_index})", onClick: ->(action) do
38
45
  action.dialogs_alert message: 'Perform Edit action'
File without changes
@@ -18,7 +18,7 @@ else
18
18
 
19
19
  render "#{@path_prefix}/nav_menu", json: json, page: page
20
20
 
21
- page.list nextPage: next_page, sections: [
21
+ page.list id: 'orderable_list', nextPage: next_page, sections: [
22
22
  ->(section) do
23
23
  section.header padding: glib_json_padding_list, childViews: ->(header) do
24
24
  header.h3 text: 'Section One'
File without changes
File without changes
File without changes
File without changes
@@ -133,16 +133,21 @@ json_ui_page json do |page|
133
133
 
134
134
  scroll.spacer height: 20
135
135
  scroll.h1 text: 'Drag-and-drop support'
136
- scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
137
- panel.button id: 'button1', text: '1'
138
- panel.button id: 'button2', text: '2'
139
- panel.button id: 'button3', text: '3'
140
- end, dragSupport: {
141
- onDrop: {
142
- action: 'dialogs/alert',
143
- },
144
- paramNameForFormData: 'message'
145
- }
136
+ scroll.panels_horizontal \
137
+ backgroundColor: '#b3bac2',
138
+ id: 'orderable_panel',
139
+ width: 300,
140
+ distribution: 'spaceEqually',
141
+ childViews: ->(panel) do
142
+ panel.button id: 'button1', text: '1'
143
+ panel.button id: 'button2', text: '2'
144
+ panel.button id: 'button3', text: '3'
145
+ end, dragSupport: {
146
+ onDrop: {
147
+ action: 'dialogs/alert',
148
+ },
149
+ paramNameForFormData: 'message'
150
+ }
146
151
 
147
152
  scroll.label text: "\n"
148
153
  end
@@ -30,9 +30,9 @@ json_ui_page json do |page|
30
30
  template.thumbnail title: 'Unordered List', subtitle: 'Bullet points similar to HTML\'s <ul> tag', onClick: ->(action) do
31
31
  action.windows_open url: json_ui_garage_url(path: 'panels/ul')
32
32
  end
33
- # template.thumbnail title: 'Timeline', subtitle: 'Timeline component with responsive panel as the childviews', onClick: ->(action) do
34
- # action.windows_open url: json_ui_garage_url(path: 'panels/timeline')
35
- # end
33
+ template.thumbnail title: 'Timeline', subtitle: 'Timeline component with responsive panel as the childviews', onClick: ->(action) do
34
+ action.windows_open url: json_ui_garage_url(path: 'panels/timeline')
35
+ end
36
36
  end
37
37
  end, ->(section) do
38
38
  section.header padding: glib_json_padding_list, childViews: ->(header) do