{"version":3,"file":"ExpandIcon.mjs","sources":["../../../../../../packages/components/table/src/ExpandIcon.tsx"],"sourcesContent":["import type { TableLocale } from '@antdv/locale';\nimport type { DefaultExpandIconProps } from './interface';\nimport { classNames } from '@antdv/utils';\n\nfunction renderExpandIcon(locale: TableLocale) {\n  return function expandIcon<RecordType>({\n    prefixCls,\n    onExpand,\n    record,\n    expanded,\n    expandable,\n  }: DefaultExpandIconProps<RecordType>) {\n    const iconPrefix = `${prefixCls}-row-expand-icon`;\n\n    return (\n      <button\n        type=\"button\"\n        onClick={(e) => {\n          onExpand(record, e!);\n          e.stopPropagation();\n        }}\n        class={classNames(iconPrefix, {\n          [`${iconPrefix}-spaced`]: !expandable,\n          [`${iconPrefix}-expanded`]: expandable && expanded,\n          [`${iconPrefix}-collapsed`]: expandable && !expanded,\n        })}\n        aria-label={expanded ? locale.collapse : locale.expand}\n        aria-expanded={expanded}\n      />\n    );\n  };\n}\n\nexport default renderExpandIcon;\n"],"names":["renderExpandIcon","locale","expandIcon","prefixCls","onExpand","record","expanded","expandable","iconPrefix","_createVNode","e","stopPropagation","classNames","collapse","expand"],"mappings":";;;;AAIA,SAASA,iBAAiBC,MAAqB,EAAA;AAC7C,EAAA,OAAO,SAASC,UAAuB,CAAA;AAAA,IACrCC,SAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,MAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,GACqC,EAAA;AACrC,IAAMC,MAAAA,UAAAA,GAAc,GAAEL,SAAU,CAAA,gBAAA,CAAA,CAAA;AAEhC,IAAA,OAAAM,YAAA,QAAA,EAAA;AAAA,MAAA,MAAA,EAAA,QAAA;AAAA,MAAA,WAGcC,CAAM,CAAA,KAAA;AACdN,QAAAA,QAAAA,CAASC,QAAQK,CAAE,CAAA,CAAA;AACnBA,QAAAA,CAAAA,CAAEC,eAAgB,EAAA,CAAA;AAAA,OACpB;AAAA,MAAC,OAAA,EACMC,WAAWJ,UAAY,EAAA;AAAA,QAC5B,CAAE,CAAA,EAAEA,UAAW,CAAA,OAAA,CAAQ,GAAG,CAACD,UAAAA;AAAAA,QAC3B,CAAE,CAAA,EAAEC,UAAW,CAAA,SAAA,CAAU,GAAGD,UAAcD,IAAAA,QAAAA;AAAAA,QAC1C,CAAE,CAAEE,EAAAA,UAAW,CAAW,UAAA,CAAA,GAAGD,cAAc,CAACD,QAAAA;AAAAA,OAC7C,CAAA;AAAA,MAAC,YACUA,EAAAA,QAAAA,GAAWL,MAAOY,CAAAA,QAAAA,GAAWZ,MAAOa,CAAAA,MAAAA;AAAAA,MAAM,eACvCR,EAAAA,QAAAA;AAAAA,OAAQ,IAAA,CAAA,CAAA;AAAA,GAG7B,CAAA;AACF;;;;"}