1
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _clsx = require("clsx");
|
||||
function renderExpandIcon(locale) {
|
||||
return props => {
|
||||
const {
|
||||
prefixCls,
|
||||
onExpand,
|
||||
record,
|
||||
expanded,
|
||||
expandable
|
||||
} = props;
|
||||
const iconPrefix = `${prefixCls}-row-expand-icon`;
|
||||
return /*#__PURE__*/React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: e => {
|
||||
onExpand(record, e);
|
||||
e.stopPropagation();
|
||||
},
|
||||
className: (0, _clsx.clsx)(iconPrefix, {
|
||||
[`${iconPrefix}-spaced`]: !expandable,
|
||||
[`${iconPrefix}-expanded`]: expandable && expanded,
|
||||
[`${iconPrefix}-collapsed`]: expandable && !expanded
|
||||
}),
|
||||
"aria-label": expanded ? locale.collapse : locale.expand,
|
||||
"aria-expanded": expanded
|
||||
});
|
||||
};
|
||||
}
|
||||
var _default = exports.default = renderExpandIcon;
|
||||
Reference in New Issue
Block a user