@oliasoft-open-source/react-ui-library 5.0.8 → 5.0.9-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1384,6 +1384,7 @@ declare interface ITableTableProps {
|
|
|
1384
1384
|
defaultEmptyRow?: any;
|
|
1385
1385
|
stickyHeaders?: string | boolean;
|
|
1386
1386
|
actions?: any;
|
|
1387
|
+
rowCount?: number;
|
|
1387
1388
|
}
|
|
1388
1389
|
|
|
1389
1390
|
declare interface ITabOption {
|
|
@@ -1664,6 +1665,10 @@ export declare interface IUnitTableProps extends Omit<ITableProps, 'table'> {
|
|
|
1664
1665
|
from: number;
|
|
1665
1666
|
to: number;
|
|
1666
1667
|
}) => boolean;
|
|
1668
|
+
beforeRenderRow?: ({ row, rowIndex, }: {
|
|
1669
|
+
row: IUnitTableRow;
|
|
1670
|
+
rowIndex: number;
|
|
1671
|
+
}) => IUnitTableRow;
|
|
1667
1672
|
}
|
|
1668
1673
|
|
|
1669
1674
|
export declare interface IUnitTableRow extends Omit<TRowType, 'cells'> {
|
|
@@ -1931,7 +1936,7 @@ declare type UnitContextType = any;
|
|
|
1931
1936
|
|
|
1932
1937
|
export declare const UnitInput: ({ name, placeholder, disabled, disabledUnit, error, left, small, width, value, unitkey, initUnit, noConversion, onChange, onClick, onFocus, onSwitchUnit, unitTemplate, testId, warning, predefinedOptions, initialPredefinedOption, shouldLinkAutomaticly, selectedPredefinedOptionKey, validationCallback, disabledValidation, allowEmpty, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, roundDisplayValue, selectOnFocus, groupOrder, }: IUnitInputProps) => JSX_2.Element;
|
|
1933
1938
|
|
|
1934
|
-
export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, onListReorder, canListReorder, }: IUnitTableProps) => JSX_2.Element;
|
|
1939
|
+
export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, onListReorder, canListReorder, beforeRenderRow: beforeRenderRowProp, }: IUnitTableProps) => JSX_2.Element;
|
|
1935
1940
|
|
|
1936
1941
|
export declare const useFocus: () => UseFocusReturnType;
|
|
1937
1942
|
|
package/dist/index.js
CHANGED
|
@@ -169466,7 +169466,7 @@ const TableVirtualScrollWrapper = ({
|
|
|
169466
169466
|
const MIN_ITEM_HEIGHT = 30;
|
|
169467
169467
|
const BORDER_WIDTH = 1;
|
|
169468
169468
|
const virtualizer = useVirtualizer({
|
|
169469
|
-
count: ((_a2 = table2.rows) == null ? void 0 : _a2.length) ?? 0,
|
|
169469
|
+
count: (table2 == null ? void 0 : table2.rowCount) ?? ((_a2 = table2.rows) == null ? void 0 : _a2.length) ?? 0,
|
|
169470
169470
|
getScrollElement: () => containerRef.current,
|
|
169471
169471
|
estimateSize: () => MIN_ITEM_HEIGHT + BORDER_WIDTH,
|
|
169472
169472
|
overscan: 10
|
|
@@ -169508,7 +169508,7 @@ const Table = (props) => {
|
|
|
169508
169508
|
onListReorder = () => {
|
|
169509
169509
|
},
|
|
169510
169510
|
canListReorder = () => true,
|
|
169511
|
-
beforeRenderRow
|
|
169511
|
+
beforeRenderRow,
|
|
169512
169512
|
table: propTable
|
|
169513
169513
|
} = props;
|
|
169514
169514
|
const {
|
|
@@ -183992,7 +183992,8 @@ const UnitTable = ({
|
|
|
183992
183992
|
enableCosmeticRounding = true,
|
|
183993
183993
|
enableDisplayRounding = true,
|
|
183994
183994
|
onListReorder,
|
|
183995
|
-
canListReorder
|
|
183995
|
+
canListReorder,
|
|
183996
|
+
beforeRenderRow: beforeRenderRowProp
|
|
183996
183997
|
}) => {
|
|
183997
183998
|
const { headers, ...otherProps } = table2;
|
|
183998
183999
|
const { storageUnits, preferredUnits } = normalizeUnits(unitConfig);
|
|
@@ -184019,8 +184020,9 @@ const UnitTable = ({
|
|
|
184019
184020
|
};
|
|
184020
184021
|
const beforeRenderRow = useCallback(
|
|
184021
184022
|
({ row: row2, rowIndex }) => {
|
|
184023
|
+
const parentConvertedRow = beforeRenderRowProp ? beforeRenderRowProp({ row: row2, rowIndex }) : row2;
|
|
184022
184024
|
return convertRow({
|
|
184023
|
-
row:
|
|
184025
|
+
row: parentConvertedRow,
|
|
184024
184026
|
rowIndex,
|
|
184025
184027
|
selectedUnits,
|
|
184026
184028
|
storageUnits,
|