Sha256: 005971f37fe21e3e021c341c5113ee12dbc27ffb8be09a40fb68d3552cac4692

Contents?: true

Size: 583 Bytes

Versions: 25

Compression:

Stored size: 583 Bytes

Contents

module Coco
  class SeamlessTextarea < Coco::Component
    include TagHelper
    include Concerns::AcceptsOptions

    accepts_option :multiline, from: [true, false]
    accepts_option :focus, from: [true, false]

    attr_reader :placeholder

    def initialize(textarea: nil, value: nil, placeholder: nil, **kwargs)
      @textarea_args = textarea.to_h
      @value = value
      @placeholder = placeholder
    end

    def multiline?
      get_option_value(:multiline)
    end

    def value
      (@value.presence || content.presence || "").strip_heredoc.strip
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.7 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.6 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.5 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.4 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.3 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.2 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.1 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.19.0 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.18.8 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.18.7 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.18.0 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.7 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.6 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.5 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.4 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.3 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.2 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.1 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb
coveragebook_components-0.17.0 app/components/coco/utilities/seamless_textarea/seamless_textarea.rb