glib-web 3.24.4 → 3.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/helpers/glib/app_feature_support_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/components.rb +6 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +7 -0
- data/app/helpers/glib/json_ui/action_builder.rb +41 -0
- data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +6 -0
- data/app/helpers/glib/json_ui/styling_helper.rb +11 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +6 -0
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/validators/email_typo_validator.rb +0 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/json_ui/garage/actions/_cookies.json.jbuilder +12 -0
- data/app/views/json_ui/garage/actions/_list.json.jbuilder +2 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +76 -3
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +6 -2
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/charts.json.jbuilder +26 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
- data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2f5d2ae1abeb1b4204f3879a5561f0396f610ebc2805ff684ce1989b08041f5
|
4
|
+
data.tar.gz: 2ceb705bdc581a4e4fcf1b3f70b9ace090fb4af8576995310f2ec46813c7c1eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f97d523b8eedd779e93c2cd54a27d5af356e4fc16287d141c0b3ec647596e7d0661713a2849c27b255684b2d7c8185a77f5a43bdcd625f15a621f86cacfa6dd
|
7
|
+
data.tar.gz: a87a2e17a6763771cb606910f3ce9c3011bde9b8e6d935c7a44616a66713ccc4aabade5d0b849b2b1c6ac078308c24ebc32ddecf7bbeb99ef6984f991be5cdda
|
File without changes
|
File without changes
|
File without changes
|
@@ -16,6 +16,12 @@ class Glib::JsonUi::ActionBuilder
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Experimental
|
19
|
+
class ReplaceChildren < Action
|
20
|
+
string :targetId
|
21
|
+
views :childViews
|
22
|
+
end
|
23
|
+
|
24
|
+
# Experimental. Can this be merged with `components_set` ?
|
19
25
|
class Replace < Action
|
20
26
|
string :targetId
|
21
27
|
action :onReplace
|
File without changes
|
@@ -30,6 +30,13 @@ class Glib::JsonUi::ActionBuilder
|
|
30
30
|
required :fallbackUrl
|
31
31
|
end
|
32
32
|
|
33
|
+
class CloseWithOpen < Action
|
34
|
+
string :url
|
35
|
+
action :onOpen
|
36
|
+
|
37
|
+
required :url
|
38
|
+
end
|
39
|
+
|
33
40
|
# Any component can listen to the refresh_state event and react appropriately.
|
34
41
|
# E.g. Stripe credit card component can refresh its token to make sure it is not stale.
|
35
42
|
class RefreshState < Action
|
@@ -109,6 +109,30 @@ module Glib
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
module Logics
|
113
|
+
# Future: Replace showIf and loadIf
|
114
|
+
# Example:
|
115
|
+
# `submitWhenNotDisplayed` is false by default
|
116
|
+
# fields_text id: 'my_text', displayed: false, submitWhenNotDisplayed: true
|
117
|
+
#
|
118
|
+
# logics_if condition: { '==', BLAH1, BLAH2 }, true: ->(action) do
|
119
|
+
# action.components_set targetId: 'my_text', displayed: true
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# class If < Action
|
123
|
+
# hash :condition
|
124
|
+
# action :true
|
125
|
+
# action :false
|
126
|
+
# end
|
127
|
+
|
128
|
+
class Set < Action
|
129
|
+
string :targetId
|
130
|
+
hash :conditionalData
|
131
|
+
hash :variables
|
132
|
+
action :onSet
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
112
136
|
module Timeouts
|
113
137
|
class Set < Action
|
114
138
|
string :timerId
|
@@ -141,7 +165,24 @@ module Glib
|
|
141
165
|
end
|
142
166
|
end
|
143
167
|
|
168
|
+
module Cookies
|
169
|
+
class Save < Action
|
170
|
+
string :key
|
171
|
+
string :value
|
172
|
+
action :onSave
|
173
|
+
end
|
174
|
+
|
175
|
+
# FUTURE
|
176
|
+
# class Remove < Action
|
177
|
+
# end
|
178
|
+
|
179
|
+
# FUTURE
|
180
|
+
# class Clear < Action
|
181
|
+
# end
|
182
|
+
end
|
183
|
+
|
144
184
|
# FUTURE
|
185
|
+
|
145
186
|
module Data
|
146
187
|
class Save < Action
|
147
188
|
string :key
|
File without changes
|
File without changes
|
@@ -50,6 +50,17 @@ module Glib
|
|
50
50
|
|
51
51
|
###
|
52
52
|
|
53
|
+
### Chart
|
54
|
+
|
55
|
+
def glib_chart_tooltip_template(options)
|
56
|
+
%{
|
57
|
+
<div style="border: 1px solid gray; border-radius: 6px;">
|
58
|
+
<div style="border-radius: 6px 6px 0 0; background-color: gray; padding: 4px; color: white;">#{options[:title]}</div>
|
59
|
+
<div style="border-radius: 0 0 6px 6px; background-color: white; padding: 4px" color: black;>#{options[:content]}</div>
|
60
|
+
</div>
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
53
64
|
end
|
54
65
|
end
|
55
66
|
end
|
@@ -10,6 +10,7 @@ class Glib::JsonUi::ViewBuilder
|
|
10
10
|
bool :disableDirtyCheck
|
11
11
|
action :onChange
|
12
12
|
string :paramNameForFormData
|
13
|
+
string :paramNameForFieldName
|
13
14
|
|
14
15
|
def default_url_options
|
15
16
|
{ only_path: true }
|
@@ -172,6 +173,11 @@ class Glib::JsonUi::ViewBuilder
|
|
172
173
|
string :cacheKey
|
173
174
|
end
|
174
175
|
|
176
|
+
# Deprecated
|
177
|
+
# Just use fields_select with options provided by the backend. This allows greater flexibility,
|
178
|
+
# which is important because different systems might want to use different values for
|
179
|
+
# countries as well as for regions, e.g. alpha2 vs alpha3
|
180
|
+
# See app/views/json_ui/garage/forms/pickers.json.jbuilder for an example
|
175
181
|
class Country < AbstractField
|
176
182
|
hash :region
|
177
183
|
end
|
File without changes
|
File without changes
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
3
|
+
header.h3 id: 'cookie', text: 'Cookies'
|
4
|
+
end
|
5
|
+
|
6
|
+
section.rows builder: ->(template) do
|
7
|
+
template.thumbnail title: 'cookies/save', onClick: ->(action) do
|
8
|
+
action.cookies_save key: 'glib_cookie', value: "test_cookie_#{DateTime.current.to_i}", onSave: ->(subaction) do
|
9
|
+
subaction.snackbars_alert message: 'Saved'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -23,5 +23,7 @@ panel.panels_list id: 'action_list', sections: [
|
|
23
23
|
render "#{@path_prefix}/actions/components", section: section
|
24
24
|
end, ->(section) do
|
25
25
|
render "#{@path_prefix}/actions/fields", section: section
|
26
|
+
end, ->(section) do
|
27
|
+
render "#{@path_prefix}/actions/cookies", section: section
|
26
28
|
end
|
27
29
|
]
|
File without changes
|
File without changes
|
File without changes
|
@@ -81,9 +81,82 @@ page.form \
|
|
81
81
|
form.spacer height: 20
|
82
82
|
form.h2 text: 'Country'
|
83
83
|
form.spacer height: 6
|
84
|
-
region_field = { name: 'user[city]', label: 'City' }
|
85
|
-
form.fields_country name: 'user[country]', width: 'matchParent', label: 'Country', region: nil
|
86
|
-
form.fields_country name: 'user[country_with_region]', width: 'matchParent', label: 'Country with region', region: region_field
|
84
|
+
# region_field = { name: 'user[city]', label: 'City' }
|
85
|
+
# form.fields_country name: 'user[country]', width: 'matchParent', label: 'Country', region: nil
|
86
|
+
# form.fields_country name: 'user[country_with_region]', width: 'matchParent', label: 'Country with region', region: region_field
|
87
|
+
|
88
|
+
countries = [
|
89
|
+
{
|
90
|
+
code: 'AU',
|
91
|
+
name: 'Australia',
|
92
|
+
regions: ['ACT', 'New South Wales', 'Victoria', 'Western Australia']
|
93
|
+
},
|
94
|
+
{
|
95
|
+
code: 'ID',
|
96
|
+
name: 'Indonesia',
|
97
|
+
regions: ['Jawa Barat', 'Java Tengah', 'Jawa Timur', 'Sumatra Utara', 'Sumatra Barat', 'Sumatra Selatan']
|
98
|
+
}
|
99
|
+
]
|
100
|
+
region_registry = countries.map do |c|
|
101
|
+
[c[:code], c[:regions].map { |r| { value: r, text: r } } ]
|
102
|
+
end.to_h
|
103
|
+
form.fields_select \
|
104
|
+
name: 'user[country1]',
|
105
|
+
width: 'matchParent',
|
106
|
+
label: 'Country',
|
107
|
+
options: countries.map { |c| { value: c[:code], text: c[:name] } },
|
108
|
+
paramNameForFormData: 'variables',
|
109
|
+
onChange: ->(action) do
|
110
|
+
action.logics_set targetId: 'region_code1', conditionalData: {
|
111
|
+
options: {
|
112
|
+
'[]' => [{ 'var': 'static[region_registry]' }, { 'var': 'user[country1]' }]
|
113
|
+
}
|
114
|
+
}, variables: {
|
115
|
+
'static[region_registry]' => region_registry
|
116
|
+
}
|
117
|
+
end
|
118
|
+
|
119
|
+
form.fields_select \
|
120
|
+
name: 'user[region1]',
|
121
|
+
width: 'matchParent',
|
122
|
+
label: 'Region',
|
123
|
+
id: 'region_code1',
|
124
|
+
options: []
|
125
|
+
|
126
|
+
form.spacer height: 20
|
127
|
+
|
128
|
+
selected_country = 'AU'
|
129
|
+
form.fields_select \
|
130
|
+
name: 'user[country2]',
|
131
|
+
width: 'matchParent',
|
132
|
+
label: 'Country',
|
133
|
+
options: countries.map { |c| { value: c[:code], text: c[:name] } },
|
134
|
+
paramNameForFormData: 'variables',
|
135
|
+
value: selected_country,
|
136
|
+
onChange: ->(action) do
|
137
|
+
action.logics_set targetId: 'region_code2', conditionalData: {
|
138
|
+
options: {
|
139
|
+
'??' => [
|
140
|
+
{
|
141
|
+
'[]' => [{ 'var': 'static[region_registry]' }, { 'var': 'user[country2]' }]
|
142
|
+
},
|
143
|
+
[]
|
144
|
+
]
|
145
|
+
},
|
146
|
+
value: nil
|
147
|
+
}, variables: {
|
148
|
+
'static[region_registry]' => region_registry
|
149
|
+
}
|
150
|
+
end
|
151
|
+
|
152
|
+
form.fields_select \
|
153
|
+
name: 'user[region2]',
|
154
|
+
width: 'matchParent',
|
155
|
+
label: 'Region',
|
156
|
+
id: 'region_code2',
|
157
|
+
value: 'Victoria',
|
158
|
+
options: region_registry[selected_country]
|
159
|
+
form.label text: 'This select options should not be blank'
|
87
160
|
|
88
161
|
form.spacer height: 20
|
89
162
|
form.h2 text: 'Map'
|
@@ -70,8 +70,12 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
70
70
|
accessory.header padding: { x: 16, y: 10 }, childViews: ->(header) do
|
71
71
|
header.label text: 'Header'
|
72
72
|
end
|
73
|
-
accessory.footer padding: { x: 16, y: 10 }, childViews: ->(footer) do
|
74
|
-
footer.
|
73
|
+
accessory.footer styleClass: 'select-footer', padding: { x: 16, y: 10 }, childViews: ->(footer) do
|
74
|
+
footer.h3 text: 'Footer'
|
75
|
+
# footer.spacer height: 4
|
76
|
+
footer.p styleClass: 'select-footer-paragraph', text: %(
|
77
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tortor consequat id porta nibh venenatis cras sed. Amet consectetur adipiscing elit duis tristique sollicitudin nibh. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Velit egestas dui id ornare arcu odio. Pretium nibh ipsum consequat nisl vel pretium. Bibendum at varius vel pharetra. Leo duis ut diam quam nulla porttitor massa id. Consectetur libero id faucibus nisl tincidunt eget nullam non. Eu facilisis sed odio morbi quis. Eu volutpat odio facilisis mauris sit amet massa vitae tortor. Sed odio morbi quis commodo odio aenean sed. Sit amet justo donec enim diam. Ullamcorper a lacus vestibulum sed arcu non odio euismod.
|
78
|
+
)
|
75
79
|
footer.spacer height: 14
|
76
80
|
footer.label text: 'Click me', onClick: ->(action) do
|
77
81
|
action.components_findClosest view: 'fields/select', onFind: ->(subaction) do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -61,6 +61,32 @@ else
|
|
61
61
|
# scroll.h1 text: 'Line chart using remote data'
|
62
62
|
# render "#{@path_prefix}/views/chart_data", json: json, builder: scroll
|
63
63
|
|
64
|
+
scroll.h2 text: 'Line chart with custom tooltip'
|
65
|
+
scroll.charts_line \
|
66
|
+
plugins: { customTooltip: true },
|
67
|
+
colors: ['#79AC78', '#3085C3'], legend: { display: false },
|
68
|
+
dataSeries: [
|
69
|
+
-> do
|
70
|
+
json.title 'Line'
|
71
|
+
|
72
|
+
points = {
|
73
|
+
'Jan' => 100,
|
74
|
+
'Feb' => 78,
|
75
|
+
'Mar' => 70,
|
76
|
+
'Apr' => 62,
|
77
|
+
}
|
78
|
+
prev = points['Jan']
|
79
|
+
|
80
|
+
|
81
|
+
json.points points.map { |k, v|
|
82
|
+
delta = prev - v
|
83
|
+
tooltip = v < prev ? "<div>Delta</div><div>▼ #{delta}</div>" : "<div>Delta</div><div>▲ #{delta}</div>"
|
84
|
+
prev = v
|
85
|
+
{ x: k, y: v, tooltip: glib_chart_tooltip_template(title: "Summary #{k}", content: tooltip) }
|
86
|
+
}
|
87
|
+
end
|
88
|
+
]
|
89
|
+
|
64
90
|
scroll.h2 text: 'Column chart (Clustered)'
|
65
91
|
scroll.charts_column dataGroups: [
|
66
92
|
-> do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/value.rb
CHANGED
File without changes
|
data/lib/glib/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- app/views/json_ui/garage/_nav_menu.json.jbuilder
|
141
141
|
- app/views/json_ui/garage/actions/_commands.json.jbuilder
|
142
142
|
- app/views/json_ui/garage/actions/_components.json.jbuilder
|
143
|
+
- app/views/json_ui/garage/actions/_cookies.json.jbuilder
|
143
144
|
- app/views/json_ui/garage/actions/_dialogs.json.jbuilder
|
144
145
|
- app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder
|
145
146
|
- app/views/json_ui/garage/actions/_fields.json.jbuilder
|
@@ -345,7 +346,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
346
|
- !ruby/object:Gem::Version
|
346
347
|
version: '0'
|
347
348
|
requirements: []
|
348
|
-
|
349
|
+
rubyforge_project:
|
350
|
+
rubygems_version: 2.7.6
|
349
351
|
signing_key:
|
350
352
|
specification_version: 4
|
351
353
|
summary: ''
|