Sha256: 702c5e582340ed1a5a6ea7a74cee0c241cc0b6ade9371e8d7c0ae0ab31ce79e8
Contents?: true
Size: 1.11 KB
Versions: 13
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true module Kpop class FrameComponent < ViewComponent::Base include Katalyst::HtmlAttributes include Turbo::FramesHelper attr_reader :id ACTIONS = %w[ popstate@window->kpop--frame#popstate scrim:dismiss@window->kpop--frame#dismiss scrim:hide@window->kpop--frame#dismiss turbo:before-frame-render->kpop--frame#beforeFrameRender turbo:before-stream-render@window->kpop--frame#beforeStreamRender turbo:before-visit@window->kpop--frame#beforeVisit turbo:frame-load->kpop--frame#frameLoad ].freeze def initialize(id: "kpop", scrim: "#scrim", **) super @id = id @scrim = scrim end def inspect "#<#{self.class.name} id: #{id.inspect}>" end private def default_html_attributes { class: "kpop--frame", data: { controller: "kpop--frame", action: ACTIONS.join(" "), "kpop--frame-scrim-outlet": @scrim, turbo_action: "advance", }, target: "_top", } end end end
Version data entries
13 entries across 13 versions & 1 rubygems