Sha256: eaa8c845590bf6ea1f4f9e8a5c864122668baee02a7f733cf597793443a5651c

Contents?: true

Size: 647 Bytes

Versions: 183

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbFlex
    class FlexItem
      include Playbook::Props

      partial "pb_flex/flex_item"

      prop :fixed_size, default: nil
      prop :grow, type: Playbook::Props::Boolean,
                  default: false

      def classname
        generate_classname("pb_flex_item_kit", fixed_size_class, grow_class)
      end

      def style_value
        "flex-basis: #{fixed_size};" if fixed_size.present?
      end

    private

      def fixed_size_class
        fixed_size.present? ? "fixed_size" : nil
      end

      def grow_class
        grow ? "grow" : nil
      end
    end
  end
end

Version data entries

183 entries across 183 versions & 1 rubygems

Version Path
playbook_ui-4.13.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.12.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.11.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.10.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.9.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.8.2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.8.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.7.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.7.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.6.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.6.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.5.2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.5.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.5.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.4.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-4.4.0 app/pb_kits/playbook/pb_flex/flex_item.rb