Class: Shadcn::Combobox::Preview

Inherits:
ApplicationViewComponentPreview show all
Defined in:
app/components/shadcn/combobox/preview.rb

Instance Method Summary collapse

Instance Method Details

#defaultObject

Upstream's own first example: type to filter, arrows to walk, Enter to take.



8
9
10
# File 'app/components/shadcn/combobox/preview.rb', line 8

def default
  render_with_template
end

#groupedObject

Groups with labels, and the separator between them.



19
20
21
# File 'app/components/shadcn/combobox/preview.rb', line 19

def grouped
  render_with_template
end

#multipleObject

Multiple selection: the chips box in place of the field. Two values start chosen, so the server-rendered half — the ticks, the chips and the hidden inputs agreeing before anything is clicked — is covered too.



26
27
28
# File 'app/components/shadcn/combobox/preview.rb', line 26

def multiple
  render_with_template
end

#with_clearObject

Upstream's "Clear": the X that empties the field, which hides the chevron while it is there — upstream's own rule, in a class.



14
15
16
# File 'app/components/shadcn/combobox/preview.rb', line 14

def with_clear
  render_with_template
end