Sha256: f1ce0630924a524f459b1ea54965cc26224bb607f06409c8b0dacb2f5130f2bf

Contents?: true

Size: 910 Bytes

Versions: 69

Compression:

Stored size: 910 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbTextarea
    class Textarea
      include Playbook::Props

      partial "pb_textarea/textarea"

      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :error
      prop :object
      prop :label
      prop :method
      prop :name
      prop :placeholder
      prop :resize, type: Playbook::Props::Enum,
            values: %w[none both horizontal vertical],
            default: "none"
      prop :rows, type: Playbook::Props::Number,
            default: 4
      prop :value

      def classname
        generate_classname("pb_textarea_kit", dark_class) + error_class + resize_class
      end

    private

      def dark_class
        dark ? "dark" : nil
      end

      def error_class
        error ? " error" : ""
      end

      def resize_class
        " resize_#{resize}"
      end

    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.1.0 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.1 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-6.0.0 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_textarea/textarea.rb
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_textarea/textarea.rb