Module: UI::ScrollAreaScrollbarBehavior

Included in:
ScrollAreaScrollbar, ScrollAreaScrollbarComponent
Defined in:
app/helpers/ui/scroll_area_scrollbar_behavior.rb,
app/behaviors/ui/scroll_area_scrollbar_behavior.rb

Overview

UI::ScrollAreaScrollbarBehavior

Instance Method Summary collapse

Instance Method Details

#scroll_area_scrollbar_classesObject

Returns combined CSS classes



23
24
25
26
27
28
29
30
31
32
# File 'app/helpers/ui/scroll_area_scrollbar_behavior.rb', line 23

def scroll_area_scrollbar_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  orientation_value = respond_to?(:orientation, true) ? orientation : @orientation

  TailwindMerge::Merger.new.merge([
    scroll_area_scrollbar_base_classes,
    scroll_area_scrollbar_orientation_classes(orientation_value),
    classes_value
  ].compact.join(" "))
end

#scroll_area_scrollbar_html_attributesObject

Returns HTML attributes for the scrollbar element



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/ui/scroll_area_scrollbar_behavior.rb', line 9

def scroll_area_scrollbar_html_attributes
  attributes_value = respond_to?(:attributes, true) ? attributes : @attributes
  orientation_value = respond_to?(:orientation, true) ? orientation : @orientation

  {
    class: scroll_area_scrollbar_classes,
    data: {
      slot: "scroll-area-scrollbar",
      orientation: orientation_value
    }
  }.merge(attributes_value || {})
end