Move all extended component out of default bundle

This commit is contained in:
Insality 2022-10-09 17:02:54 +03:00
parent 561fdc7b38
commit 4c130a68bb

View File

@ -49,16 +49,17 @@ local static_grid = require("druid.base.static_grid")
local swipe = require("druid.base.swipe") local swipe = require("druid.base.swipe")
local text = require("druid.base.text") local text = require("druid.base.text")
local checkbox = require("druid.extended.checkbox") -- To use this components, you should register them first
local checkbox_group = require("druid.extended.checkbox_group") -- local checkbox = require("druid.extended.checkbox")
local dynamic_grid = require("druid.extended.dynamic_grid") -- local checkbox_group = require("druid.extended.checkbox_group")
local input = require("druid.extended.input") -- local dynamic_grid = require("druid.extended.dynamic_grid")
local lang_text = require("druid.extended.lang_text") -- local input = require("druid.extended.input")
local progress = require("druid.extended.progress") -- local lang_text = require("druid.extended.lang_text")
local radio_group = require("druid.extended.radio_group") -- local progress = require("druid.extended.progress")
local slider = require("druid.extended.slider") -- local radio_group = require("druid.extended.radio_group")
local timer_component = require("druid.extended.timer") -- local slider = require("druid.extended.slider")
local data_list = require("druid.extended.data_list") -- local timer_component = require("druid.extended.timer")
-- local data_list = require("druid.extended.data_list")
local DruidInstance = class("druid.druid_instance") local DruidInstance = class("druid.druid_instance")
@ -634,8 +635,7 @@ end
-- @tparam node parent The gui node parent, where items will be placed -- @tparam node parent The gui node parent, where items will be placed
-- @treturn DynamicGrid grid component -- @treturn DynamicGrid grid component
function DruidInstance.new_dynamic_grid(self, parent) function DruidInstance.new_dynamic_grid(self, parent)
-- return helper.extended_component("dynamic_grid") return helper.extended_component("dynamic_grid")
return DruidInstance.new(self, dynamic_grid, parent)
end end
@ -646,8 +646,7 @@ end
-- @tparam bool no_adjust If true, will not correct text size -- @tparam bool no_adjust If true, will not correct text size
-- @treturn LangText lang_text component -- @treturn LangText lang_text component
function DruidInstance.new_lang_text(self, node, locale_id, no_adjust) function DruidInstance.new_lang_text(self, node, locale_id, no_adjust)
-- return helper.extended_component("lang_text") return helper.extended_component("lang_text")
return DruidInstance.new(self, lang_text, node, locale_id, no_adjust)
end end
@ -658,8 +657,7 @@ end
-- @tparam[opt] function callback On slider change callback -- @tparam[opt] function callback On slider change callback
-- @treturn Slider slider component -- @treturn Slider slider component
function DruidInstance.new_slider(self, node, end_pos, callback) function DruidInstance.new_slider(self, node, end_pos, callback)
-- return helper.extended_component("slider") return helper.extended_component("slider")
return DruidInstance.new(self, slider, node, end_pos, callback)
end end
@ -671,8 +669,7 @@ end
-- @tparam[opt=false] boolean initial_state The initial state of checkbox, default - false -- @tparam[opt=false] boolean initial_state The initial state of checkbox, default - false
-- @treturn Checkbox checkbox component -- @treturn Checkbox checkbox component
function DruidInstance.new_checkbox(self, node, callback, click_node, initial_state) function DruidInstance.new_checkbox(self, node, callback, click_node, initial_state)
-- return helper.extended_component("checkbox") return helper.extended_component("checkbox")
return DruidInstance.new(self, checkbox, node, callback, click_node, initial_state)
end end
@ -683,8 +680,7 @@ end
-- @tparam[opt] number keyboard_type Gui keyboard type for input field -- @tparam[opt] number keyboard_type Gui keyboard type for input field
-- @treturn Input input component -- @treturn Input input component
function DruidInstance.new_input(self, click_node, text_node, keyboard_type) function DruidInstance.new_input(self, click_node, text_node, keyboard_type)
-- return helper.extended_component("input") return helper.extended_component("input")
return DruidInstance.new(self, input, click_node, text_node, keyboard_type)
end end
@ -695,8 +691,7 @@ end
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes
-- @treturn CheckboxGroup checkbox_group component -- @treturn CheckboxGroup checkbox_group component
function DruidInstance.new_checkbox_group(self, nodes, callback, click_nodes) function DruidInstance.new_checkbox_group(self, nodes, callback, click_nodes)
-- return helper.extended_component("checkbox_group") return helper.extended_component("checkbox_group")
return DruidInstance.new(self, checkbox_group, nodes, callback, click_nodes)
end end
@ -707,8 +702,7 @@ end
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component]) -- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
-- @treturn DataList data_list component -- @treturn DataList data_list component
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function) function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
-- return helper.extended_component("data_list") return helper.extended_component("data_list")
return DruidInstance.new(self, data_list, druid_scroll, druid_grid, create_function)
end end
@ -719,8 +713,7 @@ end
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes
-- @treturn RadioGroup radio_group component -- @treturn RadioGroup radio_group component
function DruidInstance.new_radio_group(self, nodes, callback, click_nodes) function DruidInstance.new_radio_group(self, nodes, callback, click_nodes)
-- return helper.extended_component("radio_group") return helper.extended_component("radio_group")
return DruidInstance.new(self, radio_group, nodes, callback, click_nodes)
end end
@ -732,8 +725,7 @@ end
-- @tparam[opt] function callback Function on timer end -- @tparam[opt] function callback Function on timer end
-- @treturn Timer timer component -- @treturn Timer timer component
function DruidInstance.new_timer(self, node, seconds_from, seconds_to, callback) function DruidInstance.new_timer(self, node, seconds_from, seconds_to, callback)
-- return helper.extended_component("timer") return helper.extended_component("timer")
return DruidInstance.new(self, timer_component, node, seconds_from, seconds_to, callback)
end end
@ -744,8 +736,7 @@ end
-- @tparam[opt=1] number init_value Initial value of progress bar -- @tparam[opt=1] number init_value Initial value of progress bar
-- @treturn Progress progress component -- @treturn Progress progress component
function DruidInstance.new_progress(self, node, key, init_value) function DruidInstance.new_progress(self, node, key, init_value)
-- return helper.extended_component("progress") return helper.extended_component("progress")
return DruidInstance.new(self, progress, node, key, init_value)
end end