@omniumretail/component-library 1.3.10 → 1.3.12

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.
@@ -24858,8 +24858,8 @@ const ResponsiveTable = (props) => {
24858
24858
  cleanCellSelection,
24859
24859
  cellSelectionStyle,
24860
24860
  renderSelectedCell,
24861
- useOrderedCellSelection = true
24862
- // Por padrão mantém comportamento antigo
24861
+ useOrderedCellSelection = true,
24862
+ initialSelectedCells
24863
24863
  } = props;
24864
24864
  const [customFilters, setCustomFilters] = useState([]);
24865
24865
  const [customColumns, setCustomColumns] = useState([]);
@@ -24867,7 +24867,7 @@ const ResponsiveTable = (props) => {
24867
24867
  const [selectedRowKeys, setselectedRowKeys] = useState(rowSelection?.selectedRowKeys || []);
24868
24868
  const [selectedAllRowKeys, setSelectedAllRowKeys] = useState(false);
24869
24869
  const [deselectAll, setDeselectAll] = useState(false);
24870
- const [selectedCells, setSelectedCells] = useState([]);
24870
+ const [selectedCells, setSelectedCells] = useState(initialSelectedCells || []);
24871
24871
  const defaultCellStyle = {
24872
24872
  firstCell: {
24873
24873
  backgroundColor: "#ffebee",
@@ -24923,6 +24923,11 @@ const ResponsiveTable = (props) => {
24923
24923
  }
24924
24924
  }
24925
24925
  }, [cleanCellSelection]);
24926
+ useEffect(() => {
24927
+ if (initialSelectedCells && initialSelectedCells.length > 0) {
24928
+ setSelectedCells(initialSelectedCells);
24929
+ }
24930
+ }, [initialSelectedCells]);
24926
24931
  const onSelectChange = (newSelectedRowKeys) => {
24927
24932
  if (rowSelection.type === "radio") {
24928
24933
  setselectedRowKeys(newSelectedRowKeys);