Class: Protos::Command::Input

Inherits:
Protos::Component show all
Defined in:
lib/protos/command/input.rb

Instance Method Summary collapse

Methods inherited from Protos::Component

#initialize

Constructor Details

This class inherits a constructor from Protos::Component

Instance Method Details

#view_template(&block) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/protos/command/input.rb', line 14

def view_template(&block)
  li(**attrs) do
    label(class: css[:label]) do
      div(class: css[:icon], &block) if block
      input(
        type: :text,
        data: {
          action: "protos--command#filter",
          "protos--command-target": "input"
        },
        class: css[:input],
        placeholder:,
        autocomplete: :off
      )
    end
  end
end