Update Rich Input with selection/arrows control. Add template and nodes to self:get_druid

This commit is contained in:
Insality
2024-09-07 17:15:40 +03:00
parent f93d0c7d40
commit 986a4695f6
18 changed files with 380 additions and 90 deletions

View File

@@ -205,10 +205,22 @@ end
--- Get Druid instance for inner component creation.
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam string|nil template The template name
-- @tparam table|nil nodes The nodes table
-- @treturn DruidInstance Druid instance with component context
function BaseComponent.get_druid(self)
function BaseComponent.get_druid(self, template, nodes)
local context = { _context = self }
return setmetatable(context, { __index = self._meta.druid })
local druid_instance = setmetatable(context, { __index = self._meta.druid })
if template then
self:set_template(template)
end
if nodes then
self:set_nodes(nodes)
end
return druid_instance
end