1 | import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2 | import * as React from 'react';
|
3 | import classNames from 'classnames';
|
4 |
|
5 | function renderExpandIcon(locale) {
|
6 | return function expandIcon(_ref) {
|
7 | var _classNames;
|
8 |
|
9 | var prefixCls = _ref.prefixCls,
|
10 | onExpand = _ref.onExpand,
|
11 | record = _ref.record,
|
12 | expanded = _ref.expanded,
|
13 | expandable = _ref.expandable;
|
14 | var iconPrefix = "".concat(prefixCls, "-row-expand-icon");
|
15 | return React.createElement("button", {
|
16 | type: "button",
|
17 | onClick: function onClick(e) {
|
18 | onExpand(record, e);
|
19 | e.stopPropagation();
|
20 | },
|
21 | className: classNames(iconPrefix, (_classNames = {}, _defineProperty(_classNames, "".concat(iconPrefix, "-spaced"), !expandable), _defineProperty(_classNames, "".concat(iconPrefix, "-expanded"), expandable && expanded), _defineProperty(_classNames, "".concat(iconPrefix, "-collapsed"), expandable && !expanded), _classNames)),
|
22 | "aria-label": expanded ? locale.collapse : locale.expand
|
23 | });
|
24 | };
|
25 | }
|
26 |
|
27 | export default renderExpandIcon; |
\ | No newline at end of file |