Sha256: 4d69ebae1fa4d2c3cb15ec4ad554c7f83f1d5cc05e8fd91bf97da6aec0640006

Contents?: true

Size: 786 Bytes

Versions: 75

Compression:

Stored size: 786 Bytes

Contents

module Coco
  module Concerns
    module WithTooltip
      extend ActiveSupport::Concern
      include AcceptsOptions

      included do
        accepts_option :tooltip,
          alias: "tippy",
          shorthand: :content do |tt|
          tt.accepts_option :content
          tt.accepts_option :disabled, from: [true, false]
          tt.accepts_option :placement,
            from: %w[top top-start top-end right right-start right-end bottom bottom-start bottom-end left left-start left-end auto auto-start auto-end]
        end

        renders_one :tooltip, ->(content = nil, **kwargs, &block) do
          content = capture(&block) if block
          kwargs[:content] = content if content
          merge_option_values(:tooltip, kwargs)
        end
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
coveragebook_components-0.19.10 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.9 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.8 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.7 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.6 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.5 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.4 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.3 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.2 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.19.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.18.8 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.18.7 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.18.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.7 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.6 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.5 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.4 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.3 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.2 app/components/coco/concerns/with_tooltip.rb