UNPKG

acud

Version:

acg react 组件库

26 lines • 960 B
import * as React from 'react'; import classNames from 'classnames'; import OutlinedDown from "acud-icon/es/icons/OutlinedDown"; import OutlinedUp from "acud-icon/es/icons/OutlinedUp"; function renderExpandIcon(locale) { return function expandIcon(_ref) { var prefixCls = _ref.prefixCls, onExpand = _ref.onExpand, record = _ref.record, expanded = _ref.expanded, expandable = _ref.expandable; var iconPrefix = "".concat(prefixCls, "-row-expand-icon"); if (!expandable) { return null; } return /*#__PURE__*/React.createElement("span", { onClick: function onClick(e) { onExpand(record, e); e.stopPropagation(); }, className: classNames(iconPrefix), "aria-label": expanded ? locale.collapse : locale.expand }, expanded ? /*#__PURE__*/React.createElement(OutlinedUp, null) : /*#__PURE__*/React.createElement(OutlinedDown, null)); }; } export default renderExpandIcon;