Class: Anchor::AutocompleteComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/anchor/autocomplete_component.rb

Constant Summary collapse

LIST_BOX_CLASSES =
%w(
  absolute
  bg-white
  border
  border-gray-300
  max-h-[200px]
  mt-2
  overflow-y-auto
  py-2
  rounded-md
  shadow-lg
  w-full
  z-10
).join(" ").freeze

Instance Method Summary collapse

Methods inherited from Component

generate_id

Methods included from ViewHelper

#text_prose

Methods included from FetchOrFallbackHelper

#fetch_or_fallback

Constructor Details

#initialize(form_builder:, name:, src:, readonly: false, input_data: {}) ⇒ AutocompleteComponent

Returns a new instance of AutocompleteComponent.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/anchor/autocomplete_component.rb', line 18

def initialize(
  form_builder:,
  name:,
  src:,
  readonly: false,
  input_data: {}
)
  @form_builder = form_builder
  @name = name
  @readonly = readonly
  @input_data = input_data
  @src = src

  super
end

Instance Method Details

#list_box_classesObject



34
35
36
# File 'app/components/anchor/autocomplete_component.rb', line 34

def list_box_classes
  LIST_BOX_CLASSES
end