Sha256: ed592a4a4087c6492da4d4ce1bd8367948d2ad25dca5180a17dfa8b8867ee049

Contents?: true

Size: 517 Bytes

Versions: 3

Compression:

Stored size: 517 Bytes

Contents

module Lookbook
  class Viewport::Component < Lookbook::Component
    def initialize(src:, resize_height: true, resize_width: true, max_height: nil, **html_attrs)
      @src = src
      @resize_height = resize_height
      @resize_width = resize_width
      @max_height = max_height
      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

3 entries across 3 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.2 app/components/lookbook/viewport/component.rb
lookbook-1.0.0.beta.1 app/components/lookbook/viewport/component.rb
lookbook-1.0.0.beta.0 app/components/lookbook/viewport/component.rb