Skip to content

Commit

Permalink
Merge branch 'main' into feature/replace-openstruct-with-data
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Singh-Pathania committed Oct 4, 2024
2 parents ec93dbc + d860282 commit ce64420
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ GIT
PATH
remote: .
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion app/components/avo/modal_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Avo::ModalComponent < Avo::BaseComponent

prop :width, Symbol, default: :md
prop :body_class, _Nilable(String)
prop :overflow, Symbol, default: :auto
prop :overflow, _Nilable(Symbol), default: :auto

def width_classes
case @width.to_sym
Expand Down
16 changes: 6 additions & 10 deletions app/javascript/js/controllers/toggle_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default class extends Controller {
static targets = ['panel']

static values = {
// One may want to have an element that is exempt from triggerring the click outside event
exemptionContainer: String,
// One may want to have elements that are exempt from triggering the click outside event
exemptionContainers: Array,
}

get exemptionContainerTarget() {
return document.querySelector(this.exemptionContainerValue)
get exemptionContainerTargets() {
return this.exemptionContainersValue.map((selector) => document.querySelector(selector)).filter(Boolean)
}

connect() {
Expand All @@ -20,13 +20,9 @@ export default class extends Controller {

clickOutside(e) {
if (this.hasPanelTarget) {
if (this.hasExemptionContainerValue && this.exemptionContainerTarget) {
const inExemptionContainer = this.exemptionContainerTarget.contains(e.target)
const isInExemptionContainer = this.hasExemptionContainersValue && this.exemptionContainerTargets.some((container) => container.contains(e.target))

if (!inExemptionContainer) {
leave(this.panelTarget)
}
} else {
if (!isInExemptionContainer) {
leave(this.panelTarget)
}
}
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.2.0.beta2_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.2.0.beta2_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ PATH
PATH
remote: ..
specs:
avo (3.13.1)
avo (3.13.3)
actionview (>= 6.1)
active_link_to
activerecord (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/avo/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Avo
VERSION = "3.13.1" unless const_defined?(:VERSION)
VERSION = "3.13.3" unless const_defined?(:VERSION)
end

0 comments on commit ce64420

Please sign in to comment.