Sha256: 0b92e06a35a0a439c7374fa7f719b065b5f0c5f6455ac96add1d7ab4905cc311

Contents?: true

Size: 565 Bytes

Versions: 13

Compression:

Stored size: 565 Bytes

Contents

module Lookbook
  class Viewport::Component < Lookbook::BaseComponent
    def initialize(src:, resize_height: true, resize_width: true, max_height: nil, iframe_id: nil, **html_attrs)
      @src = src
      @resize_height = resize_height
      @resize_width = resize_width
      @max_height = max_height
      @iframe_id = iframe_id
      super(**html_attrs)
    end

    def generate_id(*args)
      args.map { |args| args.delete_prefix("/").tr("&?=/_-", "-") }.join("-")
    end

    protected

    def alpine_component
      "viewportComponent"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/components/lookbook/viewport/component.rb
lookbook-1.5.4 app/components/lookbook/viewport/component.rb
lookbook-1.5.3 app/components/lookbook/viewport/component.rb
lookbook-1.5.2 app/components/lookbook/viewport/component.rb
lookbook-1.5.1 app/components/lookbook/viewport/component.rb
lookbook-1.5.0 app/components/lookbook/viewport/component.rb
lookbook-1.4.5 app/components/lookbook/viewport/component.rb
lookbook-1.4.4 app/components/lookbook/viewport/component.rb
lookbook-1.4.3 app/components/lookbook/viewport/component.rb
lookbook-1.4.2 app/components/lookbook/viewport/component.rb
lookbook-1.4.1 app/components/lookbook/viewport/component.rb
lookbook-1.4.0 app/components/lookbook/viewport/component.rb
lookbook-1.3.4 app/components/lookbook/viewport/component.rb