Comparing version 7.35.0 to 7.35.1
@@ -62,3 +62,2 @@ /** | ||
sticky?: boolean | TableSticky; | ||
reference?: React.Ref<Reference>; | ||
/** | ||
@@ -97,5 +96,10 @@ * @private Internal usage, may remove by refactor. Should always use `columns` instead. | ||
} | ||
declare function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<RecordType>): React.JSX.Element; | ||
export declare function genTable(shouldTriggerRender?: CompareProps<typeof Table>): typeof Table; | ||
declare const ImmutableTable: typeof Table; | ||
declare function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<RecordType>, ref: React.Ref<Reference>): React.JSX.Element; | ||
export type ForwardGenericTable = (<RecordType extends DefaultRecordType = any>(props: TableProps<RecordType> & { | ||
ref?: React.Ref<Reference>; | ||
}) => React.ReactElement) & { | ||
displayName?: string; | ||
}; | ||
export declare function genTable(shouldTriggerRender?: CompareProps<typeof Table>): ForwardGenericTable; | ||
declare const ImmutableTable: ForwardGenericTable; | ||
type ImmutableTableType = typeof ImmutableTable & { | ||
@@ -102,0 +106,0 @@ EXPAND_COLUMN: typeof EXPAND_COLUMN; |
@@ -71,3 +71,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
} | ||
function Table(tableProps) { | ||
function Table(tableProps, ref) { | ||
var _classNames; | ||
@@ -88,3 +88,2 @@ var props = _objectSpread({ | ||
direction = props.direction, | ||
reference = props.reference, | ||
title = props.title, | ||
@@ -189,3 +188,3 @@ footer = props.footer, | ||
var scrollBodyContainerRef = React.useRef(); | ||
React.useImperativeHandle(reference, function () { | ||
React.useImperativeHandle(ref, function () { | ||
return { | ||
@@ -656,4 +655,8 @@ nativeElement: fullTableRef.current, | ||
} | ||
var RefTable = /*#__PURE__*/React.forwardRef(Table); | ||
if (process.env.NODE_ENV !== 'production') { | ||
RefTable.displayName = 'Table'; | ||
} | ||
export function genTable(shouldTriggerRender) { | ||
return makeImmutable(Table, shouldTriggerRender); | ||
return makeImmutable(RefTable, shouldTriggerRender); | ||
} | ||
@@ -660,0 +663,0 @@ var ImmutableTable = genTable(); |
@@ -65,3 +65,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _listRef$current; | ||
console.log('!!!!', config); | ||
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(config); | ||
@@ -68,0 +67,0 @@ } |
import type { CompareProps } from '@rc-component/context/lib/Immutable'; | ||
import * as React from 'react'; | ||
import type { Reference } from '../interface'; | ||
import Table, { type TableProps } from '../Table'; | ||
@@ -11,5 +12,9 @@ export interface VirtualTableProps<RecordType> extends Omit<TableProps<RecordType>, 'scroll'> { | ||
} | ||
declare function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>): React.JSX.Element; | ||
export declare function genVirtualTable(shouldTriggerRender?: CompareProps<typeof Table>): typeof VirtualTable; | ||
declare const _default: typeof VirtualTable; | ||
export type ForwardGenericVirtualTable = (<RecordType>(props: TableProps<RecordType> & { | ||
ref?: React.Ref<Reference>; | ||
}) => React.ReactElement) & { | ||
displayName?: string; | ||
}; | ||
export declare function genVirtualTable(shouldTriggerRender?: CompareProps<typeof Table>): ForwardGenericVirtualTable; | ||
declare const _default: ForwardGenericVirtualTable; | ||
export default _default; |
@@ -20,3 +20,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
}; | ||
function VirtualTable(props) { | ||
function VirtualTable(props, ref) { | ||
var columns = props.columns, | ||
@@ -71,8 +71,13 @@ scroll = props.scroll, | ||
internalHooks: INTERNAL_HOOKS, | ||
tailor: true | ||
tailor: true, | ||
ref: ref | ||
}))); | ||
} | ||
var RefVirtualTable = /*#__PURE__*/React.forwardRef(VirtualTable); | ||
if (process.env.NODE_ENV !== 'production') { | ||
RefVirtualTable.displayName = 'VirtualTable'; | ||
} | ||
export function genVirtualTable(shouldTriggerRender) { | ||
return makeImmutable(VirtualTable, shouldTriggerRender); | ||
return makeImmutable(RefVirtualTable, shouldTriggerRender); | ||
} | ||
export default genVirtualTable(); |
@@ -62,3 +62,2 @@ /** | ||
sticky?: boolean | TableSticky; | ||
reference?: React.Ref<Reference>; | ||
/** | ||
@@ -97,5 +96,10 @@ * @private Internal usage, may remove by refactor. Should always use `columns` instead. | ||
} | ||
declare function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<RecordType>): React.JSX.Element; | ||
export declare function genTable(shouldTriggerRender?: CompareProps<typeof Table>): typeof Table; | ||
declare const ImmutableTable: typeof Table; | ||
declare function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<RecordType>, ref: React.Ref<Reference>): React.JSX.Element; | ||
export type ForwardGenericTable = (<RecordType extends DefaultRecordType = any>(props: TableProps<RecordType> & { | ||
ref?: React.Ref<Reference>; | ||
}) => React.ReactElement) & { | ||
displayName?: string; | ||
}; | ||
export declare function genTable(shouldTriggerRender?: CompareProps<typeof Table>): ForwardGenericTable; | ||
declare const ImmutableTable: ForwardGenericTable; | ||
type ImmutableTableType = typeof ImmutableTable & { | ||
@@ -102,0 +106,0 @@ EXPAND_COLUMN: typeof EXPAND_COLUMN; |
@@ -83,3 +83,3 @@ "use strict"; | ||
} | ||
function Table(tableProps) { | ||
function Table(tableProps, ref) { | ||
var _classNames; | ||
@@ -100,3 +100,2 @@ var props = (0, _objectSpread2.default)({ | ||
direction = props.direction, | ||
reference = props.reference, | ||
title = props.title, | ||
@@ -201,3 +200,3 @@ footer = props.footer, | ||
var scrollBodyContainerRef = React.useRef(); | ||
React.useImperativeHandle(reference, function () { | ||
React.useImperativeHandle(ref, function () { | ||
return { | ||
@@ -668,4 +667,8 @@ nativeElement: fullTableRef.current, | ||
} | ||
var RefTable = /*#__PURE__*/React.forwardRef(Table); | ||
if (process.env.NODE_ENV !== 'production') { | ||
RefTable.displayName = 'Table'; | ||
} | ||
function genTable(shouldTriggerRender) { | ||
return (0, _TableContext.makeImmutable)(Table, shouldTriggerRender); | ||
return (0, _TableContext.makeImmutable)(RefTable, shouldTriggerRender); | ||
} | ||
@@ -672,0 +675,0 @@ var ImmutableTable = genTable(); |
@@ -75,3 +75,2 @@ "use strict"; | ||
var _listRef$current; | ||
console.log('!!!!', config); | ||
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(config); | ||
@@ -78,0 +77,0 @@ } |
import type { CompareProps } from '@rc-component/context/lib/Immutable'; | ||
import * as React from 'react'; | ||
import type { Reference } from '../interface'; | ||
import Table, { type TableProps } from '../Table'; | ||
@@ -11,5 +12,9 @@ export interface VirtualTableProps<RecordType> extends Omit<TableProps<RecordType>, 'scroll'> { | ||
} | ||
declare function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>): React.JSX.Element; | ||
export declare function genVirtualTable(shouldTriggerRender?: CompareProps<typeof Table>): typeof VirtualTable; | ||
declare const _default: typeof VirtualTable; | ||
export type ForwardGenericVirtualTable = (<RecordType>(props: TableProps<RecordType> & { | ||
ref?: React.Ref<Reference>; | ||
}) => React.ReactElement) & { | ||
displayName?: string; | ||
}; | ||
export declare function genVirtualTable(shouldTriggerRender?: CompareProps<typeof Table>): ForwardGenericVirtualTable; | ||
declare const _default: ForwardGenericVirtualTable; | ||
export default _default; |
@@ -31,3 +31,3 @@ "use strict"; | ||
}; | ||
function VirtualTable(props) { | ||
function VirtualTable(props, ref) { | ||
var columns = props.columns, | ||
@@ -82,9 +82,14 @@ scroll = props.scroll, | ||
internalHooks: _constant.INTERNAL_HOOKS, | ||
tailor: true | ||
tailor: true, | ||
ref: ref | ||
}))); | ||
} | ||
var RefVirtualTable = /*#__PURE__*/React.forwardRef(VirtualTable); | ||
if (process.env.NODE_ENV !== 'production') { | ||
RefVirtualTable.displayName = 'VirtualTable'; | ||
} | ||
function genVirtualTable(shouldTriggerRender) { | ||
return (0, _TableContext.makeImmutable)(VirtualTable, shouldTriggerRender); | ||
return (0, _TableContext.makeImmutable)(RefVirtualTable, shouldTriggerRender); | ||
} | ||
var _default = genVirtualTable(); | ||
exports.default = _default; |
{ | ||
"name": "rc-table", | ||
"version": "7.35.0", | ||
"version": "7.35.1", | ||
"description": "table ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
400855
8751
50