Class: Katalyst::Content::Editor::NewItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Katalyst::Content::Editor::NewItemComponent
show all
- Includes:
- Turbo::StreamsHelper
- Defined in:
- app/components/katalyst/content/editor/new_item_component.rb
Constant Summary
collapse
- ACTIONS =
<<~ACTIONS.gsub(/\s+/, " ").freeze
dragstart->#{NEW_ITEM_CONTROLLER}#dragstart
ACTIONS
BaseComponent::CONTAINER_CONTROLLER, BaseComponent::ITEM_CONTROLLER, BaseComponent::LIST_CONTROLLER, BaseComponent::NEW_ITEM_CONTROLLER, BaseComponent::STATUS_BAR_CONTROLLER
Instance Attribute Summary
#container, #item
Instance Method Summary
collapse
#attributes_scope, #call, #container_form_id, #inspect
Constructor Details
#initialize(item:, container: item.container) ⇒ NewItemComponent
Returns a new instance of NewItemComponent.
15
16
17
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 15
def initialize(item:, container: item.container)
super(item:, container:)
end
|
Instance Method Details
#item_component ⇒ Object
19
20
21
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 19
def item_component(**)
ItemComponent.new(item:, container:, **)
end
|
#item_type ⇒ Object
31
32
33
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 31
def item_type
item.model_name.param_key
end
|
#label ⇒ Object
27
28
29
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 27
def label
t("katalyst.content.editor.new_item.#{item_type}", default: item.model_name.human)
end
|
#row_component ⇒ Object
23
24
25
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 23
def row_component(**)
RowComponent.new(item:, container:, **)
end
|