glib-web 0.5.91 → 0.5.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/view_builder/fields.rb +3 -1
- data/app/helpers/glib/json_ui/view_builder/panels.rb +2 -0
- data/app/helpers/glib/json_ui/view_builder.rb +6 -1
- data/app/models/concerns/glib/soft_deletable.rb +5 -0
- data/app/views/json_ui/garage/_nav_menu.json.jbuilder +3 -1
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +9 -1
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +2 -2
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +10 -0
- data/app/views/json_ui/garage/panels/split.json.jbuilder +1 -1
- data/app/views/json_ui/garage/views/controls.json.jbuilder +30 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cb9b3907a46c36dad7a924d84b450afc471d6ab1a693be9e931ce27b9b9311a
|
4
|
+
data.tar.gz: f3043a444591cd9cc1458beac075b0d540851147947b34778f8d249489c16489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce1ce72300b95f4a9ac7db885cdc89e322fb4d605cf91822784933cee7945b755d0019636f1508df2ac62e4d9b3e575d3c485d8a18b34cb39fac601b12e55ad6
|
7
|
+
data.tar.gz: ac71cd656382ca60cffddf0765d08be6b3490ff72e577d67b1a757981c4bc7025fec2b5c6b8ae3bf697e5f2d532b03ed8709e3f8bbf940bba2dd7b4461c944a9
|
@@ -241,9 +241,11 @@ class Glib::JsonUi::ViewBuilder
|
|
241
241
|
class Date < AbstractField
|
242
242
|
date :min
|
243
243
|
date :max
|
244
|
-
|
244
|
+
string :type
|
245
|
+
|
245
246
|
# Override
|
246
247
|
def value(value)
|
248
|
+
value = "#{value}-01" if value.is_a?(String) && value&.length == 7 # yyyy-mm
|
247
249
|
super(value&.to_date)
|
248
250
|
end
|
249
251
|
end
|
@@ -33,6 +33,7 @@ module Glib
|
|
33
33
|
hash :showIf
|
34
34
|
hash :valueIf
|
35
35
|
hash :analytics
|
36
|
+
hash :tooltip
|
36
37
|
|
37
38
|
# def initialize(json, page)
|
38
39
|
# super(json, page)
|
@@ -75,7 +76,7 @@ module Glib
|
|
75
76
|
|
76
77
|
### View definitions
|
77
78
|
|
78
|
-
class AbstractText < View
|
79
|
+
class AbstractText < View
|
79
80
|
string :textAlign
|
80
81
|
text :text
|
81
82
|
color :color
|
@@ -164,6 +165,7 @@ module Glib
|
|
164
165
|
string :text, cache: true
|
165
166
|
action :onClick
|
166
167
|
color :color
|
168
|
+
bool :disabled
|
167
169
|
end
|
168
170
|
|
169
171
|
class Fab < View
|
@@ -197,6 +199,9 @@ module Glib
|
|
197
199
|
class Chip < View
|
198
200
|
string :text
|
199
201
|
action :onClick
|
202
|
+
|
203
|
+
string :badgeContent
|
204
|
+
color :badgeColor
|
200
205
|
end
|
201
206
|
|
202
207
|
class Calendar < View
|
@@ -1,3 +1,8 @@
|
|
1
|
+
# To use this, simply:
|
2
|
+
# - Include the module
|
3
|
+
# - Add this migration: `add_column :model, :deleted_at, :datetime, null: true`
|
4
|
+
#
|
5
|
+
# After that, any call to `destroy` will automatically be a soft-deletion.
|
1
6
|
module Glib
|
2
7
|
module SoftDeletable
|
3
8
|
extend ActiveSupport::Concern
|
@@ -56,7 +56,9 @@ if local_assigns[:top_nav] || json_ui_app_is_web?
|
|
56
56
|
action.windows_reload
|
57
57
|
end
|
58
58
|
|
59
|
-
|
59
|
+
# Consider deprecating icon badge
|
60
|
+
# menu.button icon: { name: 'zoom_in', badge: '!' }, text: 'Diagnostics', onClick: ->(action) do
|
61
|
+
menu.button icon: 'zoom_in', text: 'Diagnostics', badgeContent: '!', onClick: ->(action) do
|
60
62
|
action.dialogs_alert message: %{
|
61
63
|
Bundle ID: #{json_ui_app_bundle_id || '<unknown>'}
|
62
64
|
App Version: #{json_ui_app_build_version || '<unknown>'}
|
@@ -47,7 +47,7 @@ page.form \
|
|
47
47
|
width: 'matchParent',
|
48
48
|
label: 'Date',
|
49
49
|
min: '2010-01-01',
|
50
|
-
max: '
|
50
|
+
max: '2010-01-15',
|
51
51
|
value: '2010-02-01'
|
52
52
|
form.fields_datetime \
|
53
53
|
name: 'user[date_time]',
|
@@ -56,6 +56,14 @@ page.form \
|
|
56
56
|
min: '2018-06-09T00:00',
|
57
57
|
max: '2018-06-17T00:00',
|
58
58
|
value: '2018-06-15T19:30'
|
59
|
+
form.fields_date \
|
60
|
+
name: 'user[month]',
|
61
|
+
width: 'matchParent',
|
62
|
+
label: 'Month',
|
63
|
+
type: 'month',
|
64
|
+
min: '2021-01-01',
|
65
|
+
max: '2021-03-01',
|
66
|
+
value: '2021-11'
|
59
67
|
|
60
68
|
form.spacer height: 20
|
61
69
|
form.h2 text: 'Country'
|
@@ -5,7 +5,7 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
5
|
|
6
6
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
7
7
|
scroll.h1 text: 'Basic'
|
8
|
-
scroll.panels_flow width: 300, backgroundColor: '#b3bac2', childViews: ->(panel) do
|
8
|
+
scroll.panels_flow width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
|
9
9
|
panel.button text: '1'
|
10
10
|
panel.button text: '2'
|
11
11
|
panel.button text: '3'
|
@@ -17,7 +17,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
17
17
|
|
18
18
|
scroll.label text: "\n"
|
19
19
|
scroll.h1 text: 'Spacers'
|
20
|
-
scroll.panels_flow width: 300, backgroundColor: '#b3bac2', childViews: ->(panel) do
|
20
|
+
scroll.panels_flow width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
|
21
21
|
panel.button text: '1'
|
22
22
|
panel.spacer width: 30
|
23
23
|
panel.button text: '2'
|
@@ -87,5 +87,15 @@ json_ui_page json do |page|
|
|
87
87
|
panel.spacer width: 10
|
88
88
|
panel.label text: 'bottom'
|
89
89
|
end
|
90
|
+
|
91
|
+
scroll.label text: "\n"
|
92
|
+
scroll.h1 text: 'Label combo'
|
93
|
+
scroll.panels_horizontal childViews: ->(panel) do
|
94
|
+
panel.label backgroundColor: '#b3bac2', text: 'Label 1'
|
95
|
+
panel.label text: 'Label 2'
|
96
|
+
panel.label backgroundColor: '#b3bac2', text: 'Label 3'
|
97
|
+
end
|
98
|
+
|
99
|
+
scroll.label text: "\n"
|
90
100
|
end
|
91
101
|
end
|
@@ -104,7 +104,7 @@ json_ui_page json do |page|
|
|
104
104
|
left.button text: 'L'
|
105
105
|
end
|
106
106
|
content.center childViews: ->(center) do
|
107
|
-
center.panels_flow width: 'matchParent', backgroundColor: '#b3bac2', childViews: ->(h) do
|
107
|
+
center.panels_flow width: 'matchParent', innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(h) do
|
108
108
|
(1..20).each do |index|
|
109
109
|
h.button text: index
|
110
110
|
end
|
@@ -5,23 +5,46 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
5
|
|
6
6
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
7
7
|
scroll.h2 text: 'Button'
|
8
|
-
scroll.spacer height:
|
9
|
-
|
8
|
+
scroll.spacer height: 20
|
9
|
+
|
10
|
+
scroll.button text: 'Button', onClick: ->(action) do
|
11
|
+
action.dialogs_alert message: 'Perform action'
|
12
|
+
end
|
13
|
+
scroll.spacer height: 20
|
14
|
+
|
15
|
+
scroll.button text: 'Buton with build-in classes', styleClasses: ['rounded', 'outlined', 'tile', 'depressed'], onClick: ->(action) do
|
10
16
|
action.dialogs_alert message: 'Perform action'
|
11
17
|
end
|
18
|
+
scroll.spacer height: 20
|
19
|
+
|
20
|
+
scroll.button icon: 'info', text: 'Button with Icon and Tooltip', tooltip: { text: 'Tooltip text'}, onClick: ->(action) do
|
21
|
+
action.dialogs_alert message: 'Perform action'
|
22
|
+
end
|
23
|
+
scroll.spacer height: 20
|
24
|
+
|
25
|
+
scroll.button \
|
26
|
+
icon: 'info',
|
27
|
+
styleClass: 'icon',
|
28
|
+
tooltip: { text: 'Disabled Icon button with tooltip text and custom tooltip position', position: 'right'},
|
29
|
+
disabled: true
|
30
|
+
scroll.spacer height: 20
|
31
|
+
|
32
|
+
|
12
33
|
|
13
34
|
scroll.spacer height: 20
|
14
35
|
scroll.h2 text: 'Chip'
|
15
|
-
scroll.spacer height:
|
16
|
-
scroll.chip styleClass: 'success', text: '
|
17
|
-
scroll.spacer height:
|
18
|
-
scroll.chip text: '
|
36
|
+
scroll.spacer height: 10
|
37
|
+
scroll.chip styleClass: 'success', text: 'Success'
|
38
|
+
scroll.spacer height: 10
|
39
|
+
scroll.chip text: 'With Action', onClick: ->(action) do
|
19
40
|
action.dialogs_alert message: 'Perform action'
|
20
41
|
end
|
42
|
+
scroll.spacer height: 10
|
43
|
+
scroll.chip text: 'With Badge', badgeContent: '99'
|
21
44
|
|
22
45
|
scroll.spacer height: 20
|
23
46
|
scroll.h2 text: 'Switch'
|
24
|
-
scroll.spacer height:
|
47
|
+
scroll.spacer height: 10
|
25
48
|
scroll.switch \
|
26
49
|
text: 'Email notification',
|
27
50
|
onEnabled: ->(action) do
|