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-7.3.0.pre.alpha8 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha7 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha6 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha5 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha4 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha3 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.3.0.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.2.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.0.pre.alpha2 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.1.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.0.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.0.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.1.0 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.0.1.pre.alpha15 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.0.0.pre.alpha15 app/pb_kits/playbook/pb_flex/flex_item.rb
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/pb_flex/flex_item.rb