Sha256: afde3837b0362ffe00fa83772980f29c58e49a058ca3ad8ca0c39728032e46f6

Contents?: true

Size: 941 Bytes

Versions: 898

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module FlexWrap
    def self.included(base)
      base.prop :flex_wrap
    end

    # rubocop:disable Style/IfInsideElse
    def flex_wrap_props
      selected_props = flex_wrap_options.keys.select { |sk| try(sk) }
      return nil unless selected_props.present?

      selected_props.map do |k|
        flex_wrap_value = send(k)
        if flex_wrap_value.is_a?(Hash)
          flex_wrap_value.map do |media_size, wrap_value|
            "flex_wrap_#{media_size}_#{wrap_value.underscore}" if flex_wrap_values.include? wrap_value
          end
        else
          "flex_wrap_#{flex_wrap_value}" if flex_wrap_values.include? flex_wrap_value
        end
      end.compact.join(" ")
    end
    # rubocop:enable Style/IfInsideElse

    def flex_wrap_options
      {
        flex_wrap: "flex_wrap",
      }
    end

    def flex_wrap_values
      %w[wrap nowrap wrapReverse]
    end
  end
end

Version data entries

898 entries across 898 versions & 1 rubygems

Version Path
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.8 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.7 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.6 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.5 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.4 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.3 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.2 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4563 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4559 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.1 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.PLAY16254545 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 lib/playbook/flex_wrap.rb
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4539 lib/playbook/flex_wrap.rb
playbook_ui-14.9.0.pre.rc.0 lib/playbook/flex_wrap.rb