Sha256: ae889ba3f2a5d2ca5e5db74b4c369fbe50bf600b8a2f94cf1ec82a0c4d04cb6c

Contents?: true

Size: 748 Bytes

Versions: 727

Compression:

Stored size: 748 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Overflow
    def self.included(base)
      base.prop :overflow
      base.prop :overflow_x
      base.prop :overflow_y
    end

    def overflow_values
      %w[visible hidden scroll auto]
    end

    def overflow_options
      {
        overflow: "overflow",
        overflow_x: "overflow_x",
        overflow_y: "overflow_y",
      }
    end

    def overflow_props
      selected_props = overflow_options.keys.select { |sk| try(sk) }
      return nil unless selected_props.present?

      selected_props.map do |k|
        overflow_value = send(k)
        "#{overflow_options[k]}_#{overflow_value}" if overflow_values.include? overflow_value
      end.compact.join(" ")
    end
  end
end

Version data entries

727 entries across 727 versions & 1 rubygems

Version Path
playbook_ui-13.6.0.pre.alpha.play845allkitsbytypes1219 lib/playbook/overflow.rb
playbook_ui-13.7.0 lib/playbook/overflow.rb
playbook_ui-13.6.0.pre.alpha.tiptapreacthookformbug1210 lib/playbook/overflow.rb
playbook_ui-13.6.0 lib/playbook/overflow.rb
playbook_ui-13.5.0.pre.alpha.play984collapsiblekithidestooltips1203 lib/playbook/overflow.rb
playbook_ui-13.5.0.pre.alpha.PLAY823globalpropoverflow1191 lib/playbook/overflow.rb
playbook_ui-13.5.0.pre.alpha.PLAY823globalpropoverflow1188 lib/playbook/overflow.rb