avo 4.0.0.beta.22 → 4.0.0.beta.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c28db16cfc485179da2019f6b605cc36e88d1d63fdf2773a1633553bcf664f
4
- data.tar.gz: abcb3b8b5327c4c715a6302f0276fe279a15dd46170820870773ed07b90e9975
3
+ metadata.gz: 7ad13349d5d3575f4e1ae465316afb7fa6c4aa7b1beae7f220a6ed6177b454e6
4
+ data.tar.gz: 17a139db5d23f75ef5cb879f2dda7f02f61af1265cedaeddc61478f8e6d20373
5
5
  SHA512:
6
- metadata.gz: c2b9423611e6f1037ca706f1c6e8d0652abb85f4c28a46a58ba0961f9474db800892c59f5ec11ea868e6dfc2b9ca7399e2b30e7e1d3b1bb14c88824d452101c7
7
- data.tar.gz: 2ed8e07ba8eb75a04d221df32aa47d7467ab17e0fd7d676dec7df4be5853609916ce065812f246217ede2b580168741ef4cc2e170a9b9a0c1d55d53cabe4a3a5
6
+ metadata.gz: 11c6a04aba745c9bc0ace5dc504a149f7affb272aa45016c7bff180cb94f400b3a8592715a6b3ba008dd88ef3a96a8a90d8455b223b1ec15e72e244600d547e8
7
+ data.tar.gz: 13ae6a96bbb589cf620bcc5778baa2ebe893314027fda0a18074f095c65a5779d4b37c7364dc467a496c4061ffbe3c8b983eb013887e232ea95f4dc1141fe763
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (4.0.0.beta.22)
4
+ avo (4.0.0.beta.23)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -632,9 +632,6 @@
632
632
  .z-30 {
633
633
  z-index: 30;
634
634
  }
635
- .z-40 {
636
- z-index: 40;
637
- }
638
635
  .z-50 {
639
636
  z-index: 50;
640
637
  }
@@ -7524,10 +7521,19 @@
7524
7521
  background-color: var(--color-primary);
7525
7522
  padding: calc(var(--spacing) * 0);
7526
7523
  position-anchor: auto;
7527
- position-area: bottom span-right;
7524
+ position-area: bottom span-left;
7528
7525
  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
7529
7526
  box-shadow: var(--box-shadow-card);
7530
7527
  }
7528
+ .popover-menu__panel--summary {
7529
+ margin-block-end: 1rem;
7530
+ position-area: bottom center;
7531
+ }
7532
+ .popover-menu__panel--summary > .dropdown-menu {
7533
+ max-height: 70dvh;
7534
+ overflow-y: auto;
7535
+ overscroll-behavior: contain;
7536
+ }
7531
7537
  .popover-menu__panel::backdrop {
7532
7538
  background-color: transparent;
7533
7539
  }
@@ -8,11 +8,22 @@
8
8
  .popover-menu__panel {
9
9
  @apply m-0 p-0 border-0 rounded-lg bg-primary mt-1;
10
10
  position-anchor: auto;
11
- position-area: bottom span-right;
11
+ position-area: bottom span-left;
12
12
  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
13
13
  box-shadow: var(--box-shadow-card);
14
14
  }
15
15
 
16
+ .popover-menu__panel--summary {
17
+ margin-block-end: 1rem;
18
+ position-area: bottom center;
19
+ }
20
+
21
+ .popover-menu__panel--summary > .dropdown-menu {
22
+ max-height: 70dvh;
23
+ overflow-y: auto;
24
+ overscroll-behavior: contain;
25
+ }
26
+
16
27
  .popover-menu__panel::backdrop {
17
28
  @apply bg-transparent;
18
29
  }
@@ -58,7 +58,6 @@
58
58
  class: class_names("relative text-start px-2 py-2 whitespace-nowrap rounded-s", field.table_header_class),
59
59
  data: {
60
60
  control: "resource-field-th",
61
- controller: "toggle",
62
61
  table_header_field_id: field.id,
63
62
  table_header_field_type: field.type,
64
63
  } do %>
@@ -82,34 +81,34 @@
82
81
  <% end %>
83
82
 
84
83
  <% if field.summarizable %>
85
- <div
86
- id="summary-header-<%= field.id %>"
87
- class="cursor-pointer <%= text_classes %>"
88
- data-action="click->toggle#togglePanel"
89
- >
90
- <%= svg 'tabler/filled/chart-pie-4', class: 'h-3 ms-1' %>
84
+ <% summary_popover_id = "summary-popover-#{field.id}" %>
85
+ <div class="popover-menu">
86
+ <button
87
+ type="button"
88
+ class="cursor-pointer <%= text_classes %>"
89
+ popovertarget="<%= summary_popover_id %>"
90
+ >
91
+ <%= svg 'tabler/filled/chart-pie-4', class: 'h-3 ms-1' %>
92
+ </button>
93
+ <turbo-frame
94
+ id="<%= summary_popover_id %>"
95
+ popover="auto"
96
+ loading="lazy"
97
+ src="<%= distribution_chart_path(
98
+ {
99
+ resource_name: field.resource.model_class,
100
+ field_id: field.id,
101
+ via_record_id: @parent_record&.to_param,
102
+ via_resource_class: @parent_resource&.class&.to_s,
103
+ association_name: @field&.attribute_id
104
+ }.compact
105
+ ) %>"
106
+ class="popover-menu__panel popover-menu__panel--summary"
107
+ data-controller="popover-menu"
108
+ >
109
+ <%= render Avo::LoadingComponent.new %>
110
+ </turbo-frame>
91
111
  </div>
92
- <turbo-frame
93
- id="summary-frame-<%= field.id %>"
94
- loading="lazy"
95
- src="<%= distribution_chart_path(
96
- {
97
- resource_name: field.resource.model_class,
98
- field_id: field.id,
99
- via_record_id: @parent_record&.to_param,
100
- via_resource_class: @parent_resource&.class&.to_s,
101
- association_name: @field&.attribute_id
102
- }.compact
103
- ) %>"
104
- class="
105
- absolute inset-auto top-0 z-40 mt-6 w-full overflow-hidden rounded-sm border border-tertiary
106
- bg-primary p-4 shadow-modal sm:w-[400px]
107
- "
108
- data-toggle-target="panel"
109
- hidden
110
- >
111
- <%= render Avo::LoadingComponent.new %>
112
- </turbo-frame>
113
112
  <% end %>
114
113
  <% end %>
115
114
  <% end %>
@@ -1,22 +1,24 @@
1
- <turbo-frame id="summary-frame-<%= @field_id %>">
2
- <div class="grid grid-cols-12 items-center">
3
- <ul class="col-span-5" id="<%= @field_id %>-summary">
4
- <% @values_summary.each_with_index do |(key, value), index| %>
5
- <li class="grid grid-cols-6 items-center gap-3 text-sm font-semibold text-(--color-content-secondary) uppercase">
6
- <div class="col-span-5 flex items-center space-x-1 truncate rtl:space-x-reverse">
7
- <%= tag.div class: class_names("inline-block size-3 rounded-full", "bg-[#{chart_color(index)}]") %>
8
- <span><%= key %></span>
9
- </div>
1
+ <turbo-frame id="summary-popover-<%= @field_id %>">
2
+ <div class="dropdown-menu p-4 sm:w-[400px]">
3
+ <div class="grid grid-cols-12 items-center">
4
+ <ul class="col-span-5" id="<%= @field_id %>-summary">
5
+ <% @values_summary.each_with_index do |(key, value), index| %>
6
+ <li class="grid grid-cols-6 items-center gap-3 text-sm font-semibold text-(--color-content-secondary) uppercase">
7
+ <div class="col-span-5 flex items-center space-x-1 truncate rtl:space-x-reverse">
8
+ <%= tag.div class: class_names("inline-block size-3 rounded-full", "bg-[#{chart_color(index)}]") %>
9
+ <span><%= key %></span>
10
+ </div>
10
11
 
11
- <div class="col-span-1 text-end">
12
- <%= value %>
13
- </div>
14
- </li>
15
- <% end %>
16
- </ul>
12
+ <div class="col-span-1 text-end">
13
+ <%= value %>
14
+ </div>
15
+ </li>
16
+ <% end %>
17
+ </ul>
17
18
 
18
- <div class="col-span-6 col-start-7">
19
- <%= pie_chart @values_summary, id: "chart-#{@field_id}", legend: false, height: "200px", colors: Avo.configuration.branding.chart_colors %>
19
+ <div class="col-span-6 col-start-7">
20
+ <%= pie_chart @values_summary, id: "chart-#{@field_id}", legend: false, height: "200px", colors: Avo.configuration.branding.chart_colors %>
21
+ </div>
20
22
  </div>
21
23
  </div>
22
24
  </turbo-frame>
data/lib/avo/engine.rb CHANGED
@@ -44,6 +44,7 @@ module Avo
44
44
 
45
45
  initializer "avo.tailwindcss", after: :load_config_initializers do
46
46
  next unless Rails.env.development?
47
+ next if defined?(Rails::Console)
47
48
 
48
49
  Rails.application.config.after_initialize do
49
50
  next unless Avo::TailwindBuilder.enabled?
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "4.0.0.beta.22" unless const_defined?(:VERSION)
2
+ VERSION = "4.0.0.beta.23" unless const_defined?(:VERSION)
3
3
  end
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: 4.0.0.beta.22
4
+ version: 4.0.0.beta.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin