PromoCursed/node_modules/.cache/babel-loader/6a167f0cf1737ed9cad441bb9e48b7f1a5c18682c58dac68233aa7a84e53bb54.json

1 line
52 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { INTERNAL_HOOKS } from 'rc-table';\nimport { convertChildrenToColumns } from \"rc-table/es/hooks/useColumns\";\nimport omit from \"rc-util/es/omit\";\nimport useProxyImperativeHandle from '../_util/hooks/useProxyImperativeHandle';\nimport scrollTo from '../_util/scrollTo';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider/context';\nimport DefaultRenderEmpty from '../config-provider/defaultRenderEmpty';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport useSize from '../config-provider/hooks/useSize';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport defaultLocale from '../locale/en_US';\nimport Pagination from '../pagination';\nimport Spin from '../spin';\nimport { useToken } from '../theme/internal';\nimport renderExpandIcon from './ExpandIcon';\nimport useContainerWidth from './hooks/useContainerWidth';\nimport useFilter, { getFilterData } from './hooks/useFilter';\nimport useLazyKVMap from './hooks/useLazyKVMap';\nimport usePagination, { DEFAULT_PAGE_SIZE, getPaginationParam } from './hooks/usePagination';\nimport useSelection from './hooks/useSelection';\nimport useSorter, { getSortData } from './hooks/useSorter';\nimport useTitleColumns from './hooks/useTitleColumns';\nimport RcTable from './RcTable';\nimport RcVirtualTable from './RcTable/VirtualTable';\nimport useStyle from './style';\nconst EMPTY_LIST = [];\nconst InternalTable = (props, ref) => {\n var _a, _b;\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n style,\n size: customizeSize,\n bordered,\n dropdownPrefixCls: customizeDropdownPrefixCls,\n dataSource,\n pagination,\n rowSelection,\n rowKey = 'key',\n rowClassName,\n columns,\n children,\n childrenColumnName: legacyChildrenColumnName,\n onChange,\n getPopupContainer,\n loading,\n expandIcon,\n expandable,\n expandedRowRender,\n expandIconColumnIndex,\n indentSize,\n scroll,\n sortDirections,\n locale,\n showSorterTooltip = {\n target: 'full-header'\n },\n virtual\n } = props;\n const warning = devUseWarning('Table');\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof rowKey === 'function' && rowKey.length > 1), 'usage', '`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.') : void 0;\n }\n const baseColumns = React.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);\n const needResponsive = React.useMemo(() => baseColumns.some(col => col.responsive), [baseColumns]);\n const screens = useBreakpoint(needResponsive);\n const mergedColumns = React.useMemo(() => {\n const matched = new Set(Object.keys(screens).filter(m => screens[m]));\n return baseColumns.filter(c => !c.responsive || c.responsive.some(r => matched.has(r)));\n }, [baseColumns, screens]);\n const tableProps = omit(props, ['className', 'style', 'columns']);\n const {\n locale: contextLocale = defaultLocale,\n direction,\n table,\n renderEmpty,\n getPrefixCls,\n getPopupContainer: getContextPopupContainer\n } = React.useContext(ConfigContext);\n const mergedSize = useSize(customizeSize);\n const tableLocale = Object.assign(Object.assign({}, contextLocale.Table), locale);\n const rawData = dataSource || EMPTY_LIST;\n const prefixCls = getPrefixCls('table', customizePrefixCls);\n const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);\n const [, token] = useToken();\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const mergedExpandable = Object.assign(Object.assign({\n childrenColumnName: legacyChildrenColumnName,\n expandIconColumnIndex\n }, expandable), {\n expandIcon: (_a = expandable === null || expandable === void 0 ? void 0 :