avo 3.8.1 → 3.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/avo/actions_component.rb +10 -4
- data/app/components/avo/alert_component.html.erb +1 -1
- data/app/components/avo/divider_component.html.erb +6 -2
- data/app/components/avo/divider_component.rb +4 -1
- data/lib/avo/base_resource.rb +2 -2
- data/lib/avo/configuration.rb +2 -0
- data/lib/avo/divider.rb +8 -0
- data/lib/avo/resources/controls/actions_list.rb +3 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +3 -0
- data/public/avo-assets/avo.base.css +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 745b76955bfdb3e636261b64e29e8b12f5c67b3ada16d7ccfa6f2fdc39897d61
|
4
|
+
data.tar.gz: a33c1412465d6331ef311ef4f821a347c88df33466534f20daa421008552c804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1bdc25b6c128606f520598ecf9864a1af66b35f95e9a2fb800e39026b6b88051d2fd300d7403b2ad8d3bac9d1fac7a4aaec946e04d68b704f834646a47d6c7f
|
7
|
+
data.tar.gz: a4a151098747eb7499a511c2d59426a3701dd66058b1f3d1180e2e83d5740d7715cf85bda04c651f594188098cc5a896e720fce01304fd240f76d57c1cbdcb25
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ class Avo::ActionsComponent < ViewComponent::Base
|
|
4
4
|
include Avo::ApplicationHelper
|
5
5
|
attr_reader :label, :size, :as_row_control
|
6
6
|
|
7
|
-
def initialize(actions: [], resource: nil, view: nil, exclude: [], include: [], style: :outline, color: :primary, label: nil, size: :md, as_row_control: false, icon:
|
7
|
+
def initialize(actions: [], resource: nil, view: nil, exclude: [], include: [], style: :outline, color: :primary, label: nil, size: :md, as_row_control: false, icon: nil)
|
8
8
|
@actions = actions || []
|
9
9
|
@resource = resource
|
10
10
|
@view = view
|
@@ -86,15 +86,21 @@ class Avo::ActionsComponent < ViewComponent::Base
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def render_item(action)
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
case action
|
90
|
+
when Avo::Divider
|
91
|
+
render_divider(action)
|
92
|
+
when Avo::BaseAction
|
92
93
|
render_action_link(action)
|
93
94
|
end
|
94
95
|
end
|
95
96
|
|
96
97
|
private
|
97
98
|
|
99
|
+
def render_divider(action)
|
100
|
+
label = action.label.is_a?(Hash) ? action.label[:label] : nil
|
101
|
+
render Avo::DividerComponent.new(label)
|
102
|
+
end
|
103
|
+
|
98
104
|
def render_action_link(action)
|
99
105
|
link_to action_path(action),
|
100
106
|
data: action_data_attributes(action),
|
@@ -1,3 +1,7 @@
|
|
1
|
-
<div class="relative
|
2
|
-
<div class="absolute inset-auto
|
1
|
+
<div class="relative flex justify-center items-center w-full !border-b-2 border-gray-200 border-solid">
|
2
|
+
<div class="absolute inset-auto z-20 text-xs font-semibold uppercase leading-none text-gray-500 bg-white px-2">
|
3
|
+
<%if label.present?%>
|
4
|
+
<%=label%>
|
5
|
+
<%end%>
|
6
|
+
</div>
|
3
7
|
</div>
|
data/lib/avo/base_resource.rb
CHANGED
data/lib/avo/configuration.rb
CHANGED
@@ -49,6 +49,7 @@ module Avo
|
|
49
49
|
attr_accessor :resource_parent_controller
|
50
50
|
attr_accessor :mount_avo_engines
|
51
51
|
attr_accessor :default_url_options
|
52
|
+
attr_accessor :alert_dismiss_time
|
52
53
|
|
53
54
|
def initialize
|
54
55
|
@root_path = "/avo"
|
@@ -105,6 +106,7 @@ module Avo
|
|
105
106
|
@turbo = default_turbo
|
106
107
|
@default_url_options = []
|
107
108
|
@pagination = {}
|
109
|
+
@alert_dismiss_time = 5000
|
108
110
|
end
|
109
111
|
|
110
112
|
def current_user_method(&block)
|
data/lib/avo/divider.rb
ADDED
@@ -2,6 +2,8 @@ module Avo
|
|
2
2
|
module Resources
|
3
3
|
module Controls
|
4
4
|
class ActionsList < BaseControl
|
5
|
+
ACTIONS_LIST_DROPDOWN_ICON = "heroicons/outline/arrow-down-circle"
|
6
|
+
|
5
7
|
attr_reader :color, :exclude, :include, :style, :icon
|
6
8
|
|
7
9
|
def initialize(**args)
|
@@ -11,7 +13,7 @@ module Avo
|
|
11
13
|
@exclude = args[:exclude] || []
|
12
14
|
@include = args[:include] || []
|
13
15
|
@style = args[:style] || :outline
|
14
|
-
@icon = args[:icon]
|
16
|
+
@icon = args[:icon] || ACTIONS_LIST_DROPDOWN_ICON
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/avo/version.rb
CHANGED
@@ -58,6 +58,9 @@ Avo.configure do |config|
|
|
58
58
|
# }
|
59
59
|
# end
|
60
60
|
|
61
|
+
## == Response messages dismiss time ==
|
62
|
+
# config.alert_dismiss_time = 5000
|
63
|
+
|
61
64
|
## == Cache options ==
|
62
65
|
## Provide a lambda to customize the cache store used by Avo.
|
63
66
|
## We compute the cache store by default, this is NOT the default, just an example.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-06-
|
13
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -2202,6 +2202,7 @@ files:
|
|
2202
2202
|
- lib/avo/configuration/branding.rb
|
2203
2203
|
- lib/avo/configuration/resource_configuration.rb
|
2204
2204
|
- lib/avo/current.rb
|
2205
|
+
- lib/avo/divider.rb
|
2205
2206
|
- lib/avo/dsl/field_parser.rb
|
2206
2207
|
- lib/avo/dynamic_router.rb
|
2207
2208
|
- lib/avo/engine.rb
|