@bluemarble/bm-components 1.11.2 → 1.11.4

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.mjs CHANGED
@@ -4635,7 +4635,7 @@ var AuthHelper = class {
4635
4635
  };
4636
4636
  try {
4637
4637
  const { fullName, email } = yield this.oauthSignInCallback(code);
4638
- const userExists = this.onGetUserData(email);
4638
+ const userExists = yield this.onGetUserData(email);
4639
4639
  if (!userExists && this.oauth) {
4640
4640
  yield this.oauth.onCreateUser({ fullname: fullName, email });
4641
4641
  }
@@ -4775,7 +4775,7 @@ function createFilter(filters) {
4775
4775
  import sortBy from "sort-by";
4776
4776
  function useGrid({
4777
4777
  columns,
4778
- filters = [],
4778
+ filters,
4779
4779
  search,
4780
4780
  rowsPerPageOptions = [30, 60, 100],
4781
4781
  defaultData: externalDefaultData,
@@ -4828,7 +4828,6 @@ function useGrid({
4828
4828
  [toggleSortedDirection, sortedBy]
4829
4829
  );
4830
4830
  const set = useCallback5((data) => {
4831
- setUpdatedTimes((prev) => prev + 1);
4832
4831
  setDefaultData(data);
4833
4832
  }, []);
4834
4833
  const sortData = useCallback5(
@@ -4870,9 +4869,11 @@ function useGrid({
4870
4869
  const searchBy = createSearch(search);
4871
4870
  newData = newData.filter(searchBy);
4872
4871
  }
4872
+ if (!filters)
4873
+ return newData;
4873
4874
  const newFilter = createFilter(filters);
4874
4875
  return newData.filter(newFilter.apply);
4875
- }, [defaultData, filters, search]);
4876
+ }, [defaultData, search, filters]);
4876
4877
  const displayData = useMemo3(() => {
4877
4878
  const sortedData = sortData(filteredData);
4878
4879
  const startPage = currentPage * rowsPerPage;
@@ -4884,6 +4885,9 @@ function useGrid({
4884
4885
  if (externalDefaultData)
4885
4886
  setDefaultData(externalDefaultData);
4886
4887
  }, [externalDefaultData]);
4888
+ useEffect5(() => {
4889
+ setUpdatedTimes((prev) => prev + 1);
4890
+ }, [displayData]);
4887
4891
  return {
4888
4892
  data: displayData,
4889
4893
  updatedTimes,