Comparing version 7.36.1 to 7.37.0
@@ -123,3 +123,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
// >>>>> ClassName | ||
var mergedClassName = classNames(cellPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-ellipsis"), ellipsis), _defineProperty(_classNames, "".concat(cellPrefixCls, "-with-append"), appendNode), _defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering), _classNames), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className); | ||
var mergedClassName = classNames(cellPrefixCls, className, (_classNames = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), "".concat(cellPrefixCls, "-ellipsis"), ellipsis), "".concat(cellPrefixCls, "-with-append"), appendNode), "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), _defineProperty(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering)), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className); | ||
@@ -126,0 +126,0 @@ // >>>>> Style |
@@ -32,2 +32,15 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
} | ||
function filterHiddenColumns(columns) { | ||
return columns.filter(function (column) { | ||
return column && _typeof(column) === 'object' && !column.hidden; | ||
}).map(function (column) { | ||
var subColumns = column.children; | ||
if (subColumns && subColumns.length > 0) { | ||
return _objectSpread(_objectSpread({}, column), {}, { | ||
children: filterHiddenColumns(subColumns) | ||
}); | ||
} | ||
return column; | ||
}); | ||
} | ||
function flatColumns(columns) { | ||
@@ -119,3 +132,4 @@ var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key'; | ||
var baseColumns = React.useMemo(function () { | ||
return columns || convertChildrenToColumns(children); | ||
var newColumns = columns || convertChildrenToColumns(children) || []; | ||
return filterHiddenColumns(newColumns.slice()); | ||
}, [columns, children]); | ||
@@ -126,3 +140,2 @@ | ||
if (expandable) { | ||
var _expandColumn; | ||
var cloneColumns = baseColumns.slice(); | ||
@@ -166,6 +179,6 @@ | ||
// >>> Create expandable column | ||
var expandColumn = (_expandColumn = {}, _defineProperty(_expandColumn, INTERNAL_COL_DEFINE, { | ||
var expandColumn = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, INTERNAL_COL_DEFINE, { | ||
className: "".concat(prefixCls, "-expand-icon-col"), | ||
columnType: 'EXPAND_COLUMN' | ||
}), _defineProperty(_expandColumn, "title", columnTitle), _defineProperty(_expandColumn, "fixed", fixedColumn), _defineProperty(_expandColumn, "className", "".concat(prefixCls, "-row-expand-icon-cell")), _defineProperty(_expandColumn, "width", columnWidth), _defineProperty(_expandColumn, "render", function render(_, record, index) { | ||
}), "title", columnTitle), "fixed", fixedColumn), "className", "".concat(prefixCls, "-row-expand-icon-cell")), "width", columnWidth), "render", function render(_, record, index) { | ||
var rowKey = getRowKey(record, index); | ||
@@ -189,3 +202,3 @@ var expanded = expandedKeys.has(rowKey); | ||
return icon; | ||
}), _expandColumn); | ||
}); | ||
return cloneColumns.map(function (col) { | ||
@@ -192,0 +205,0 @@ return col === EXPAND_COLUMN ? expandColumn : col; |
@@ -61,2 +61,3 @@ import type * as React from 'react'; | ||
className?: string; | ||
hidden?: boolean; | ||
fixed?: FixedType; | ||
@@ -63,0 +64,0 @@ onHeaderCell?: GetComponentProps<ColumnsType<RecordType>[number]>; |
@@ -5,3 +5,4 @@ /* istanbul ignore next */ | ||
* So HOC will not work on this. | ||
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function Column(_) { | ||
@@ -8,0 +9,0 @@ return null; |
@@ -5,3 +5,4 @@ /* istanbul ignore next */ | ||
* So HOC will not work on this. | ||
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function ColumnGroup(_) { | ||
@@ -8,0 +9,0 @@ return null; |
@@ -72,3 +72,2 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function Table(tableProps, ref) { | ||
var _classNames; | ||
var props = _objectSpread({ | ||
@@ -575,3 +574,3 @@ rowKey: 'key', | ||
var fullTable = /*#__PURE__*/React.createElement("div", _extends({ | ||
className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames, "".concat(prefixCls, "-ping-left"), pingedLeft), _defineProperty(_classNames, "".concat(prefixCls, "-ping-right"), pingedRight), _defineProperty(_classNames, "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), _defineProperty(_classNames, "".concat(prefixCls, "-fixed-header"), fixHeader), _defineProperty(_classNames, "".concat(prefixCls, "-fixed-column"), fixColumn), _defineProperty(_classNames, "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), _defineProperty(_classNames, "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), _defineProperty(_classNames, "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right'), _classNames)), | ||
className: classNames(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-ping-left"), pingedLeft), "".concat(prefixCls, "-ping-right"), pingedRight), "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), "".concat(prefixCls, "-fixed-header"), fixHeader), "".concat(prefixCls, "-fixed-column"), fixColumn), "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right')), | ||
style: style, | ||
@@ -578,0 +577,0 @@ id: id, |
@@ -5,3 +5,2 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
export function renderExpandIcon(_ref) { | ||
var _classNames; | ||
var prefixCls = _ref.prefixCls, | ||
@@ -23,3 +22,3 @@ record = _ref.record, | ||
return /*#__PURE__*/React.createElement("span", { | ||
className: classNames(expandClassName, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), _defineProperty(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)), | ||
className: classNames(expandClassName, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-row-expanded"), expanded), "".concat(prefixCls, "-row-collapsed"), !expanded)), | ||
onClick: onClick | ||
@@ -26,0 +25,0 @@ }); |
@@ -133,3 +133,3 @@ "use strict"; | ||
// >>>>> ClassName | ||
var mergedClassName = (0, _classnames.default)(cellPrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-ellipsis"), ellipsis), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-with-append"), appendNode), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering), _classNames), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className); | ||
var mergedClassName = (0, _classnames.default)(cellPrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), "".concat(cellPrefixCls, "-ellipsis"), ellipsis), "".concat(cellPrefixCls, "-with-append"), appendNode), "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), (0, _defineProperty2.default)(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering)), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className); | ||
@@ -136,0 +136,0 @@ // >>>>> Style |
@@ -43,2 +43,15 @@ "use strict"; | ||
} | ||
function filterHiddenColumns(columns) { | ||
return columns.filter(function (column) { | ||
return column && (0, _typeof2.default)(column) === 'object' && !column.hidden; | ||
}).map(function (column) { | ||
var subColumns = column.children; | ||
if (subColumns && subColumns.length > 0) { | ||
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, { | ||
children: filterHiddenColumns(subColumns) | ||
}); | ||
} | ||
return column; | ||
}); | ||
} | ||
function flatColumns(columns) { | ||
@@ -130,3 +143,4 @@ var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key'; | ||
var baseColumns = React.useMemo(function () { | ||
return columns || convertChildrenToColumns(children); | ||
var newColumns = columns || convertChildrenToColumns(children) || []; | ||
return filterHiddenColumns(newColumns.slice()); | ||
}, [columns, children]); | ||
@@ -137,3 +151,2 @@ | ||
if (expandable) { | ||
var _expandColumn; | ||
var cloneColumns = baseColumns.slice(); | ||
@@ -177,6 +190,6 @@ | ||
// >>> Create expandable column | ||
var expandColumn = (_expandColumn = {}, (0, _defineProperty2.default)(_expandColumn, _legacyUtil.INTERNAL_COL_DEFINE, { | ||
var expandColumn = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _legacyUtil.INTERNAL_COL_DEFINE, { | ||
className: "".concat(prefixCls, "-expand-icon-col"), | ||
columnType: 'EXPAND_COLUMN' | ||
}), (0, _defineProperty2.default)(_expandColumn, "title", columnTitle), (0, _defineProperty2.default)(_expandColumn, "fixed", fixedColumn), (0, _defineProperty2.default)(_expandColumn, "className", "".concat(prefixCls, "-row-expand-icon-cell")), (0, _defineProperty2.default)(_expandColumn, "width", columnWidth), (0, _defineProperty2.default)(_expandColumn, "render", function render(_, record, index) { | ||
}), "title", columnTitle), "fixed", fixedColumn), "className", "".concat(prefixCls, "-row-expand-icon-cell")), "width", columnWidth), "render", function render(_, record, index) { | ||
var rowKey = getRowKey(record, index); | ||
@@ -200,3 +213,3 @@ var expanded = expandedKeys.has(rowKey); | ||
return icon; | ||
}), _expandColumn); | ||
}); | ||
return cloneColumns.map(function (col) { | ||
@@ -203,0 +216,0 @@ return col === _constant.EXPAND_COLUMN ? expandColumn : col; |
@@ -61,2 +61,3 @@ import type * as React from 'react'; | ||
className?: string; | ||
hidden?: boolean; | ||
fixed?: FixedType; | ||
@@ -63,0 +64,0 @@ onHeaderCell?: GetComponentProps<ColumnsType<RecordType>[number]>; |
@@ -11,3 +11,4 @@ "use strict"; | ||
* So HOC will not work on this. | ||
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function Column(_) { | ||
@@ -14,0 +15,0 @@ return null; |
@@ -11,3 +11,4 @@ "use strict"; | ||
* So HOC will not work on this. | ||
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function ColumnGroup(_) { | ||
@@ -14,0 +15,0 @@ return null; |
@@ -83,3 +83,2 @@ "use strict"; | ||
function Table(tableProps, ref) { | ||
var _classNames; | ||
var props = (0, _objectSpread2.default)({ | ||
@@ -586,3 +585,3 @@ rowKey: 'key', | ||
var fullTable = /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ | ||
className: (0, _classnames.default)(prefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-ping-left"), pingedLeft), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-ping-right"), pingedRight), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-fixed-header"), fixHeader), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-fixed-column"), fixColumn), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right'), _classNames)), | ||
className: (0, _classnames.default)(prefixCls, className, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-ping-left"), pingedLeft), "".concat(prefixCls, "-ping-right"), pingedRight), "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), "".concat(prefixCls, "-fixed-header"), fixHeader), "".concat(prefixCls, "-fixed-column"), fixColumn), "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right')), | ||
style: style, | ||
@@ -589,0 +588,0 @@ id: id, |
@@ -16,3 +16,2 @@ "use strict"; | ||
function renderExpandIcon(_ref) { | ||
var _classNames; | ||
var prefixCls = _ref.prefixCls, | ||
@@ -34,3 +33,3 @@ record = _ref.record, | ||
return /*#__PURE__*/React.createElement("span", { | ||
className: (0, _classnames.default)(expandClassName, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)), | ||
className: (0, _classnames.default)(expandClassName, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-row-expanded"), expanded), "".concat(prefixCls, "-row-collapsed"), !expanded)), | ||
onClick: onClick | ||
@@ -37,0 +36,0 @@ }); |
{ | ||
"name": "rc-table", | ||
"version": "7.36.1", | ||
"version": "7.37.0", | ||
"description": "table ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -112,2 +112,3 @@ # rc-table | ||
| showHeader | Boolean | true | whether table head is shown | | ||
| hidden | Boolean | `false` | Hidden column. | | ||
| title | Function(currentData) | | table title render function | | ||
@@ -114,0 +115,0 @@ | footer | Function(currentData) | | table footer render function | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
390452
8673
160