avo 4.1.10 → 4.1.11

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: 90f959e8ef3f97c60529547224a14021887a228f1d4d1acfff73b60f97293b3f
4
- data.tar.gz: 03d04787aae5bc9ba4a880f69f007aed595f831b1d9488b030c7623f6da8474d
3
+ metadata.gz: b75d350bbabce26a04fbe5ff8967073b84ab93ffa6aa38033000c6cdf7023a08
4
+ data.tar.gz: 491411e9d13ea7ee2e6bdc604424019e03540456303d8007fc2afe6b54371e27
5
5
  SHA512:
6
- metadata.gz: dc91308c6d18e7b6a45a0c5bcd70bc82f627840c6751f666ed25709ee6c3e93428c599d4eed27c507ae0b2e671a096eceac663a4a0564f2cee7a2157c96b8b18
7
- data.tar.gz: 199e5be527728e623579b262f2c95d67adca773b439e4087733b19d957e9296c758468bedf4606dc23f951af5635c7cb89a3ba402c9fa9d2721f770b9fe5198c
6
+ metadata.gz: d7a94a371d5c4efdc7ad152e57ffb46dcee355a349cf3873dde1aea54d5b628e1e4a2cb3f3565423847955a2a61bd7a5dcdd180b3f7f9e1c58e75dc9b4e35d65
7
+ data.tar.gz: fb430818f2ed8b7ae860c05a1590ede18c292fc19a684405f52709673be20042da41d5764e78c28bf4f5abfc0209761ee7b12d5bc5d7f6681f4977ee199e1920
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (4.1.10)
4
+ avo (4.1.11)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -122,12 +122,13 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
122
122
  end
123
123
 
124
124
  def stacked?
125
- # Override on the declaration level
126
- return @stacked unless @stacked.nil?
127
-
128
- # Fetch it from the field
125
+ # The field declaration is the user's explicit intent, so it wins over the
126
+ # layout default a parent component passes in (sidebars, preview, etc.).
129
127
  return @field.stacked unless @field.stacked.nil?
130
128
 
129
+ # Fallback to what the rendering component asked for
130
+ return @stacked unless @stacked.nil?
131
+
131
132
  # Fallback to defaults
132
133
  Avo.configuration.field_wrapper_layout == :stacked
133
134
  end
@@ -117,7 +117,7 @@ module Avo
117
117
 
118
118
  @width = args[:width] || 100
119
119
 
120
- if width_option.present? && width_option != 100
120
+ if @stacked.nil? && width_option.present? && width_option != 100
121
121
  @stacked = true
122
122
  end
123
123
 
@@ -143,7 +143,7 @@ Every field accepts these common options (full list + types at the field-options
143
143
  - **`copyable:`** — clipboard icon on Show/Index. Copies the **displayed** (formatted) value.
144
144
  - **`link_to_record:`** — make the Index cell a link to the record. Only on `:id`, `:text`, `:gravatar`, and `belongs_to`.
145
145
  - **`for_attribute:`** — back the field with a different attribute than its id (lets you show one column two ways).
146
- - **`width:`** / **`stacked:`** — column width (`25/33/50/66/75/100`; any value <100 auto-stacks) and label-above-value layout.
146
+ - **`width:`** / **`stacked:`** — column width (`25/33/50/66/75/100`; any value <100 auto-stacks) and label-above-value layout. `stacked:` on the field wins everywhere, so `stacked: false` opts out of the auto-stacking and of sidebars/preview stacking too.
147
147
  - **`html:`** — attach `style`/`classes`/`data` to the field's wrapper/label/input per view (e.g. right-align a number: `html: {index: {wrapper: {classes: "text-right"}}}`). See the html page.
148
148
 
149
149
  ### Computed (block) fields
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "4.1.10" unless const_defined?(:VERSION)
2
+ VERSION = "4.1.11" 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.1.10
4
+ version: 4.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin