avo 3.8.1 → 3.9.0
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/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 +8 -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: b549ce14ee4f91492b5a4c8c51e4c1a280bc834d3c787a7018d7b9a16c30a376
|
4
|
+
data.tar.gz: 26957d4d96f81d6194bb43a1fc0ff40bcbf3f38c69624fdd2dbe81e77e2c4a2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 676100b03573860af0ee7e54adcf9f83ed18be336a20504a60dccb820962f28cdbe8ed17062dc766300d494afe059b86374e26df8cb50908728f1ad18af6d61e
|
7
|
+
data.tar.gz: 4a5379cabd1e163224d722d2a327f58b5be4b3a3bfc6ee652d2ef9981c4f3c24826df8ec45a3a2a95456ead995a6a020a0b7b3c8408861341bde43862b4ff9d4
|
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.
|
@@ -7354,6 +7354,10 @@ tag.tagify__tag{
|
|
7354
7354
|
right:1rem
|
7355
7355
|
}
|
7356
7356
|
|
7357
|
+
.right-\[0\.3rem\]{
|
7358
|
+
right:0.3rem
|
7359
|
+
}
|
7360
|
+
|
7357
7361
|
.start-1{
|
7358
7362
|
inset-inline-start:0.25rem
|
7359
7363
|
}
|
@@ -8637,6 +8641,10 @@ tag.tagify__tag{
|
|
8637
8641
|
border-width:1px
|
8638
8642
|
}
|
8639
8643
|
|
8644
|
+
.\!border-b-2{
|
8645
|
+
border-bottom-width:2px !important
|
8646
|
+
}
|
8647
|
+
|
8640
8648
|
.border-b{
|
8641
8649
|
border-bottom-width:1px
|
8642
8650
|
}
|
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.
|
4
|
+
version: 3.9.0
|
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
|