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.17.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.17.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.16.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.15.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.14.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.13.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.13.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.12.2 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.12.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.12.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.11.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.10.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.9.1 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.9.0 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.8.9 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.8.8 app/components/coco/concerns/with_tooltip.rb
coveragebook_components-0.8.7 app/components/coco/concerns/with_tooltip.rb