ExpandIcon.js 847 B

1234567891011121314151617181920212223242526272829
  1. import { createVNode as _createVNode } from "vue";
  2. import classNames from '../_util/classNames';
  3. function renderExpandIcon(locale) {
  4. return function expandIcon(_ref) {
  5. let {
  6. prefixCls,
  7. onExpand,
  8. record,
  9. expanded,
  10. expandable
  11. } = _ref;
  12. const iconPrefix = `${prefixCls}-row-expand-icon`;
  13. return _createVNode("button", {
  14. "type": "button",
  15. "onClick": e => {
  16. onExpand(record, e);
  17. e.stopPropagation();
  18. },
  19. "class": classNames(iconPrefix, {
  20. [`${iconPrefix}-spaced`]: !expandable,
  21. [`${iconPrefix}-expanded`]: expandable && expanded,
  22. [`${iconPrefix}-collapsed`]: expandable && !expanded
  23. }),
  24. "aria-label": expanded ? locale.collapse : locale.expand,
  25. "aria-expanded": expanded
  26. }, null);
  27. };
  28. }
  29. export default renderExpandIcon;