Latest updates from IceHrmPro
This commit is contained in:
43
web/node_modules/rc-table/es/utils/expandUtil.js
generated
vendored
Normal file
43
web/node_modules/rc-table/es/utils/expandUtil.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
export function renderExpandIcon(_ref) {
|
||||
var _classNames;
|
||||
|
||||
var prefixCls = _ref.prefixCls,
|
||||
record = _ref.record,
|
||||
onExpand = _ref.onExpand,
|
||||
expanded = _ref.expanded,
|
||||
expandable = _ref.expandable;
|
||||
var expandClassName = "".concat(prefixCls, "-row-expand-icon");
|
||||
|
||||
if (!expandable) {
|
||||
return React.createElement("span", {
|
||||
className: classNames(expandClassName, "".concat(prefixCls, "-row-spaced"))
|
||||
});
|
||||
}
|
||||
|
||||
var onClick = function onClick(event) {
|
||||
onExpand(record, event);
|
||||
event.stopPropagation();
|
||||
};
|
||||
|
||||
return React.createElement("span", {
|
||||
className: classNames(expandClassName, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), _defineProperty(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)),
|
||||
onClick: onClick
|
||||
});
|
||||
}
|
||||
export function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
|
||||
var keys = [];
|
||||
|
||||
function dig(list) {
|
||||
(list || []).forEach(function (item, index) {
|
||||
keys.push(getRowKey(item, index));
|
||||
dig(item[childrenColumnName]);
|
||||
});
|
||||
}
|
||||
|
||||
dig(data);
|
||||
return keys;
|
||||
}
|
||||
Reference in New Issue
Block a user