Latest updates from IceHrmPro
This commit is contained in:
25
web/node_modules/antd/es/table/hooks/useTitleColumns.js
generated
vendored
Normal file
25
web/node_modules/antd/es/table/hooks/useTitleColumns.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
import * as React from 'react';
|
||||
import { renderColumnTitle } from '../util';
|
||||
|
||||
function fillTitle(columns, columnTitleProps) {
|
||||
return columns.map(function (column) {
|
||||
var cloneColumn = _extends({}, column);
|
||||
|
||||
cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
|
||||
|
||||
if ('children' in cloneColumn) {
|
||||
cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
|
||||
}
|
||||
|
||||
return cloneColumn;
|
||||
});
|
||||
}
|
||||
|
||||
export default function useTitleColumns(columnTitleProps) {
|
||||
var filledColumns = React.useCallback(function (columns) {
|
||||
return fillTitle(columns, columnTitleProps);
|
||||
}, [columnTitleProps]);
|
||||
return [filledColumns];
|
||||
}
|
||||
Reference in New Issue
Block a user