@oliasoft-open-source/react-ui-library 5.0.8 → 5.0.9-beta-1

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 CHANGED
@@ -1664,6 +1664,10 @@ export declare interface IUnitTableProps extends Omit<ITableProps, 'table'> {
1664
1664
  from: number;
1665
1665
  to: number;
1666
1666
  }) => boolean;
1667
+ beforeRenderRow?: ({ row, rowIndex, }: {
1668
+ row: IUnitTableRow;
1669
+ rowIndex: number;
1670
+ }) => IUnitTableRow;
1667
1671
  }
1668
1672
 
1669
1673
  export declare interface IUnitTableRow extends Omit<TRowType, 'cells'> {
@@ -1931,7 +1935,7 @@ declare type UnitContextType = any;
1931
1935
 
1932
1936
  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
1937
 
1934
- export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, onListReorder, canListReorder, }: IUnitTableProps) => JSX_2.Element;
1938
+ export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, onListReorder, canListReorder, beforeRenderRow: beforeRenderRowProp, }: IUnitTableProps) => JSX_2.Element;
1935
1939
 
1936
1940
  export declare const useFocus: () => UseFocusReturnType;
1937
1941
 
package/dist/index.js CHANGED
@@ -169508,7 +169508,7 @@ const Table = (props) => {
169508
169508
  onListReorder = () => {
169509
169509
  },
169510
169510
  canListReorder = () => true,
169511
- beforeRenderRow = null,
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: row2,
184025
+ row: parentConvertedRow,
184024
184026
  rowIndex,
184025
184027
  selectedUnits,
184026
184028
  storageUnits,