diff --git a/components/widget/widget_table.lua b/components/widget/widget_table.lua index 88b26cb6fb3..539b1fc9a9e 100644 --- a/components/widget/widget_table.lua +++ b/components/widget/widget_table.lua @@ -49,9 +49,9 @@ function Table:addClass(class) return self end ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function Table:make(injector) +function Table:make(props) local displayTable = mw.html.create('div'):addClass('csstable-widget') displayTable:css{ ['grid-template-columns'] = 'repeat(' .. (self.columns or self:_getMaxCells()) .. ', auto)', @@ -64,7 +64,7 @@ function Table:make(injector) displayTable:css(self.css) for _, row in ipairs(self.rows) do - for _, node in ipairs(WidgetFactory.work(row, injector)) do + for _, node in ipairs(WidgetFactory.work(row, props.injector)) do displayTable:node(node) end end diff --git a/components/widget/widget_table_cell.lua b/components/widget/widget_table_cell.lua index 53b7838f260..557be2e17f6 100644 --- a/components/widget/widget_table_cell.lua +++ b/components/widget/widget_table_cell.lua @@ -56,9 +56,9 @@ function TableCell:addCss(key, value) return self end ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function TableCell:make(injector) +function TableCell:make(props) local cell = mw.html.create('div'):addClass('csstable-widget-cell') cell:css{ ['grid-row'] = self.rowSpan and 'span ' .. self.rowSpan or nil, diff --git a/components/widget/widget_table_cell_new.lua b/components/widget/widget_table_cell_new.lua index 7b85a2e7897..7a1082832cd 100644 --- a/components/widget/widget_table_cell_new.lua +++ b/components/widget/widget_table_cell_new.lua @@ -42,9 +42,9 @@ local TableCell = Class.new( end ) ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function TableCell:make(injector) +function TableCell:make(props) local cell = mw.html.create(self.isHeader and 'th' or 'td') cell:attr('colspan', self.colSpan) cell:attr('rowspan', self.rowSpan) diff --git a/components/widget/widget_table_new.lua b/components/widget/widget_table_new.lua index 3b473e06596..d05fbc80325 100644 --- a/components/widget/widget_table_new.lua +++ b/components/widget/widget_table_new.lua @@ -33,9 +33,9 @@ local Table = Class.new( end ) ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function Table:make(injector) +function Table:make(props) local wrapper = mw.html.create('div'):addClass('table-responsive') local output = mw.html.create('table'):addClass('wikitable') @@ -44,7 +44,7 @@ function Table:make(injector) output:css(self.css) Array.forEach(self.children, function(child) - Array.forEach(WidgetFactory.work(child, injector), FnUtil.curry(output.node, output)) + Array.forEach(WidgetFactory.work(child, props.injector), FnUtil.curry(output.node, output)) end) wrapper:node(output) diff --git a/components/widget/widget_table_row.lua b/components/widget/widget_table_row.lua index 323b2c9d2c2..e3985cfc18c 100644 --- a/components/widget/widget_table_row.lua +++ b/components/widget/widget_table_row.lua @@ -58,9 +58,9 @@ function TableRow:getCellCount() return #self.cells end ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function TableRow:make(injector) +function TableRow:make(props) local row = mw.html.create('div'):addClass('csstable-widget-row') for _, class in ipairs(self.classes) do @@ -70,7 +70,7 @@ function TableRow:make(injector) row:css(self.css) for _, cell in ipairs(self.cells) do - for _, node in ipairs(WidgetFactory.work(cell, injector)) do + for _, node in ipairs(WidgetFactory.work(cell, props.injector)) do row:node(node) end end diff --git a/components/widget/widget_table_row_new.lua b/components/widget/widget_table_row_new.lua index 1ab3731ceed..8936c5009c0 100644 --- a/components/widget/widget_table_row_new.lua +++ b/components/widget/widget_table_row_new.lua @@ -33,9 +33,9 @@ local TableRow = Class.new( end ) ----@param injector WidgetInjector? +---@param props {injector: WidgetInjector?} ---@return {[1]: Html} -function TableRow:make(injector) +function TableRow:make(props) local row = mw.html.create('tr') Array.forEach(self.classes, FnUtil.curry(row.addClass, row)) @@ -43,7 +43,7 @@ function TableRow:make(injector) row:css(self.css) Array.forEach(self.children, function(child) - Array.forEach(WidgetFactory.work(child, injector), FnUtil.curry(row.node, row)) + Array.forEach(WidgetFactory.work(child, props.injector), FnUtil.curry(row.node, row)) end) return {row}