Class: LightningUiKit::ScrollAreaComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- LightningUiKit::ScrollAreaComponent
- Defined in:
- app/components/lightning_ui_kit/scroll_area_component.rb
Constant Summary collapse
- ORIENTATIONS =
%i[vertical horizontal both].freeze
Instance Method Summary collapse
- #classes ⇒ Object
- #data ⇒ Object
-
#initialize(orientation: :vertical, **options) ⇒ ScrollAreaComponent
constructor
A new instance of ScrollAreaComponent.
Constructor Details
#initialize(orientation: :vertical, **options) ⇒ ScrollAreaComponent
Returns a new instance of ScrollAreaComponent.
4 5 6 7 |
# File 'app/components/lightning_ui_kit/scroll_area_component.rb', line 4 def initialize(orientation: :vertical, **) @orientation = ORIENTATIONS.include?(orientation) ? orientation : :vertical @options = end |
Instance Method Details
#classes ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/components/lightning_ui_kit/scroll_area_component.rb', line 9 def classes = "lui:[scrollbar-width:thin] " \ "lui:[&::-webkit-scrollbar]:h-2 lui:[&::-webkit-scrollbar]:w-2 " \ "lui:[&::-webkit-scrollbar-track]:bg-transparent " \ "lui:[&::-webkit-scrollbar-thumb]:rounded-full lui:[&::-webkit-scrollbar-thumb]:bg-border-hover " \ "lui:[&::-webkit-scrollbar-thumb:hover]:bg-foreground-faint" merge_classes(["lui:relative", overflow_classes, , @options[:class]].compact.join(" ")) end |
#data ⇒ Object
19 20 21 |
# File 'app/components/lightning_ui_kit/scroll_area_component.rb', line 19 def data @options[:data] || {} end |