Sha256: 9a7a6fde612a27525d8058e0fed23458aeabb30dbb25e5c79bc3c8385d590f0c
Contents?: true
Size: 1.16 KB
Versions: 17
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module Katalyst module Content module Editor class BaseComponent < ViewComponent::Base include Katalyst::HtmlAttributes CONTAINER_CONTROLLER = "content--editor--container" LIST_CONTROLLER = "content--editor--list" ITEM_CONTROLLER = "content--editor--item" STATUS_BAR_CONTROLLER = "content--editor--status-bar" NEW_ITEM_CONTROLLER = "content--editor--new-item" attr_accessor :container, :item delegate :config, to: ::Katalyst::Content def initialize(container:, item: nil, **) super(**) @container = container @item = item end def call; end def container_form_id dom_id(container, :items) end def attributes_scope "#{container.model_name.param_key}[items_attributes][]" end def inspect if item.present? "<#{self.class.name} container: #{container.inspect}, item: #{item.inspect}>" else "<#{self.class.name} container: #{container.inspect}>" end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems