@uniformdev/mesh-sdk-react 20.51.0 → 20.51.1-alpha.14

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.mts CHANGED
@@ -1742,6 +1742,8 @@ type SearchAndFilterProviderProps = {
1742
1742
  onResetFilterValues?: () => void;
1743
1743
  /** the total number of results */
1744
1744
  totalResults?: number;
1745
+ /** whether data is currently loading */
1746
+ isLoading?: boolean;
1745
1747
  /** the filter mapper function */
1746
1748
  filterMapper?: FilterMapper;
1747
1749
  /** sets child components giving access to useSearchAndFilter context */
@@ -1776,6 +1778,8 @@ type SearchAndFilterContextProps = {
1776
1778
  filterMapper?: FilterMapper;
1777
1779
  /** the total number of results */
1778
1780
  totalResults?: number;
1781
+ /** whether data is currently loading */
1782
+ isLoading?: boolean;
1779
1783
  /** Allow to bind dynamic inputs to the search term */
1780
1784
  allowBindingSearchTerm?: boolean;
1781
1785
  };
@@ -1784,7 +1788,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
1784
1788
  * Search and filter provider
1785
1789
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
1786
1790
  * */
1787
- declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1791
+ declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, isLoading, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1788
1792
  /** Search and filter hook
1789
1793
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
1790
1794
  */
@@ -1815,6 +1819,8 @@ declare const useSearchAndFilter: () => {
1815
1819
  filterMapper?: FilterMapper;
1816
1820
  /** the total number of results */
1817
1821
  totalResults?: number;
1822
+ /** whether data is currently loading */
1823
+ isLoading?: boolean;
1818
1824
  /** Allow to bind dynamic inputs to the search term */
1819
1825
  allowBindingSearchTerm?: boolean;
1820
1826
  };
@@ -1830,6 +1836,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1830
1836
  viewSwitchControls?: React$1.ReactNode;
1831
1837
  /** The number of total results */
1832
1838
  totalResults?: number;
1839
+ /** Whether data is currently loading */
1840
+ isLoading?: boolean;
1833
1841
  /** The results container view
1834
1842
  * @default '<SearchAndFilterResultContainer />'
1835
1843
  */
@@ -1847,7 +1855,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1847
1855
  * Search and filter component
1848
1856
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
1849
1857
  * */
1850
- declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
1858
+ declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, isLoading, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
1851
1859
 
1852
1860
  type FilterItemsProps = {
1853
1861
  /** The text for the add button */
package/dist/index.d.ts CHANGED
@@ -1742,6 +1742,8 @@ type SearchAndFilterProviderProps = {
1742
1742
  onResetFilterValues?: () => void;
1743
1743
  /** the total number of results */
1744
1744
  totalResults?: number;
1745
+ /** whether data is currently loading */
1746
+ isLoading?: boolean;
1745
1747
  /** the filter mapper function */
1746
1748
  filterMapper?: FilterMapper;
1747
1749
  /** sets child components giving access to useSearchAndFilter context */
@@ -1776,6 +1778,8 @@ type SearchAndFilterContextProps = {
1776
1778
  filterMapper?: FilterMapper;
1777
1779
  /** the total number of results */
1778
1780
  totalResults?: number;
1781
+ /** whether data is currently loading */
1782
+ isLoading?: boolean;
1779
1783
  /** Allow to bind dynamic inputs to the search term */
1780
1784
  allowBindingSearchTerm?: boolean;
1781
1785
  };
@@ -1784,7 +1788,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
1784
1788
  * Search and filter provider
1785
1789
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
1786
1790
  * */
1787
- declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1791
+ declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, isLoading, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1788
1792
  /** Search and filter hook
1789
1793
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
1790
1794
  */
@@ -1815,6 +1819,8 @@ declare const useSearchAndFilter: () => {
1815
1819
  filterMapper?: FilterMapper;
1816
1820
  /** the total number of results */
1817
1821
  totalResults?: number;
1822
+ /** whether data is currently loading */
1823
+ isLoading?: boolean;
1818
1824
  /** Allow to bind dynamic inputs to the search term */
1819
1825
  allowBindingSearchTerm?: boolean;
1820
1826
  };
@@ -1830,6 +1836,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1830
1836
  viewSwitchControls?: React$1.ReactNode;
1831
1837
  /** The number of total results */
1832
1838
  totalResults?: number;
1839
+ /** Whether data is currently loading */
1840
+ isLoading?: boolean;
1833
1841
  /** The results container view
1834
1842
  * @default '<SearchAndFilterResultContainer />'
1835
1843
  */
@@ -1847,7 +1855,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1847
1855
  * Search and filter component
1848
1856
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
1849
1857
  * */
1850
- declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
1858
+ declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, isLoading, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
1851
1859
 
1852
1860
  type FilterItemsProps = {
1853
1861
  /** The text for the add button */
package/dist/index.esm.js CHANGED
@@ -6429,6 +6429,7 @@ var SearchAndFilterContext = createContext6({
6429
6429
  validFilterQuery: [],
6430
6430
  filterMapper: {},
6431
6431
  totalResults: 0,
6432
+ isLoading: false,
6432
6433
  allowBindingSearchTerm: false
6433
6434
  });
6434
6435
  var SearchAndFilterProvider = ({
@@ -6442,6 +6443,7 @@ var SearchAndFilterProvider = ({
6442
6443
  resetFilterValues = [{ field: "", operator: "", value: "" }],
6443
6444
  onResetFilterValues,
6444
6445
  totalResults,
6446
+ isLoading,
6445
6447
  filterMapper: filterMapper2 = filterMapper,
6446
6448
  children,
6447
6449
  allowBindingSearchTerm
@@ -6517,6 +6519,7 @@ var SearchAndFilterProvider = ({
6517
6519
  filterOptions,
6518
6520
  validFilterQuery,
6519
6521
  totalResults,
6522
+ isLoading,
6520
6523
  filterMapper: filterMapper2,
6521
6524
  allowBindingSearchTerm
6522
6525
  },
@@ -7045,7 +7048,7 @@ var SearchAndFilterResultContainer = ({
7045
7048
  onHandleClear,
7046
7049
  hideClearButton
7047
7050
  }) => {
7048
- const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
7051
+ const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm, isLoading } = useSearchAndFilter();
7049
7052
  const emptyFilters = filters.length === 0 || filters.every((filter) => !filter.value);
7050
7053
  const getTextValue = ({
7051
7054
  defaultPropText,
@@ -7076,7 +7079,7 @@ var SearchAndFilterResultContainer = ({
7076
7079
  filterText: "No results match the selected filters",
7077
7080
  fallbackText: "No matching results found"
7078
7081
  });
7079
- if (totalResults && totalResults > 0) {
7082
+ if (isLoading || totalResults === void 0 || totalResults > 0) {
7080
7083
  return null;
7081
7084
  }
7082
7085
  const handleClearSearch = () => {
@@ -7127,6 +7130,7 @@ var SearchAndFilter = ({
7127
7130
  defaultSearchTerm,
7128
7131
  onSearchChange,
7129
7132
  totalResults,
7133
+ isLoading,
7130
7134
  allowBindingSearchTerm = false,
7131
7135
  resetFilterValues = [],
7132
7136
  onResetFilterValues
@@ -7141,6 +7145,7 @@ var SearchAndFilter = ({
7141
7145
  defaultSearchTerm,
7142
7146
  onSearchChange,
7143
7147
  totalResults,
7148
+ isLoading,
7144
7149
  resetFilterValues,
7145
7150
  filterMapper: filterMapper2,
7146
7151
  allowBindingSearchTerm,
package/dist/index.js CHANGED
@@ -6491,6 +6491,7 @@ var SearchAndFilterContext = (0, import_react64.createContext)({
6491
6491
  validFilterQuery: [],
6492
6492
  filterMapper: {},
6493
6493
  totalResults: 0,
6494
+ isLoading: false,
6494
6495
  allowBindingSearchTerm: false
6495
6496
  });
6496
6497
  var SearchAndFilterProvider = ({
@@ -6504,6 +6505,7 @@ var SearchAndFilterProvider = ({
6504
6505
  resetFilterValues = [{ field: "", operator: "", value: "" }],
6505
6506
  onResetFilterValues,
6506
6507
  totalResults,
6508
+ isLoading,
6507
6509
  filterMapper: filterMapper2 = filterMapper,
6508
6510
  children,
6509
6511
  allowBindingSearchTerm
@@ -6579,6 +6581,7 @@ var SearchAndFilterProvider = ({
6579
6581
  filterOptions,
6580
6582
  validFilterQuery,
6581
6583
  totalResults,
6584
+ isLoading,
6582
6585
  filterMapper: filterMapper2,
6583
6586
  allowBindingSearchTerm
6584
6587
  },
@@ -7107,7 +7110,7 @@ var SearchAndFilterResultContainer = ({
7107
7110
  onHandleClear,
7108
7111
  hideClearButton
7109
7112
  }) => {
7110
- const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
7113
+ const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm, isLoading } = useSearchAndFilter();
7111
7114
  const emptyFilters = filters.length === 0 || filters.every((filter) => !filter.value);
7112
7115
  const getTextValue = ({
7113
7116
  defaultPropText,
@@ -7138,7 +7141,7 @@ var SearchAndFilterResultContainer = ({
7138
7141
  filterText: "No results match the selected filters",
7139
7142
  fallbackText: "No matching results found"
7140
7143
  });
7141
- if (totalResults && totalResults > 0) {
7144
+ if (isLoading || totalResults === void 0 || totalResults > 0) {
7142
7145
  return null;
7143
7146
  }
7144
7147
  const handleClearSearch = () => {
@@ -7189,6 +7192,7 @@ var SearchAndFilter = ({
7189
7192
  defaultSearchTerm,
7190
7193
  onSearchChange,
7191
7194
  totalResults,
7195
+ isLoading,
7192
7196
  allowBindingSearchTerm = false,
7193
7197
  resetFilterValues = [],
7194
7198
  onResetFilterValues
@@ -7203,6 +7207,7 @@ var SearchAndFilter = ({
7203
7207
  defaultSearchTerm,
7204
7208
  onSearchChange,
7205
7209
  totalResults,
7210
+ isLoading,
7206
7211
  resetFilterValues,
7207
7212
  filterMapper: filterMapper2,
7208
7213
  allowBindingSearchTerm,
package/dist/index.mjs CHANGED
@@ -6429,6 +6429,7 @@ var SearchAndFilterContext = createContext6({
6429
6429
  validFilterQuery: [],
6430
6430
  filterMapper: {},
6431
6431
  totalResults: 0,
6432
+ isLoading: false,
6432
6433
  allowBindingSearchTerm: false
6433
6434
  });
6434
6435
  var SearchAndFilterProvider = ({
@@ -6442,6 +6443,7 @@ var SearchAndFilterProvider = ({
6442
6443
  resetFilterValues = [{ field: "", operator: "", value: "" }],
6443
6444
  onResetFilterValues,
6444
6445
  totalResults,
6446
+ isLoading,
6445
6447
  filterMapper: filterMapper2 = filterMapper,
6446
6448
  children,
6447
6449
  allowBindingSearchTerm
@@ -6517,6 +6519,7 @@ var SearchAndFilterProvider = ({
6517
6519
  filterOptions,
6518
6520
  validFilterQuery,
6519
6521
  totalResults,
6522
+ isLoading,
6520
6523
  filterMapper: filterMapper2,
6521
6524
  allowBindingSearchTerm
6522
6525
  },
@@ -7045,7 +7048,7 @@ var SearchAndFilterResultContainer = ({
7045
7048
  onHandleClear,
7046
7049
  hideClearButton
7047
7050
  }) => {
7048
- const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
7051
+ const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm, isLoading } = useSearchAndFilter();
7049
7052
  const emptyFilters = filters.length === 0 || filters.every((filter) => !filter.value);
7050
7053
  const getTextValue = ({
7051
7054
  defaultPropText,
@@ -7076,7 +7079,7 @@ var SearchAndFilterResultContainer = ({
7076
7079
  filterText: "No results match the selected filters",
7077
7080
  fallbackText: "No matching results found"
7078
7081
  });
7079
- if (totalResults && totalResults > 0) {
7082
+ if (isLoading || totalResults === void 0 || totalResults > 0) {
7080
7083
  return null;
7081
7084
  }
7082
7085
  const handleClearSearch = () => {
@@ -7127,6 +7130,7 @@ var SearchAndFilter = ({
7127
7130
  defaultSearchTerm,
7128
7131
  onSearchChange,
7129
7132
  totalResults,
7133
+ isLoading,
7130
7134
  allowBindingSearchTerm = false,
7131
7135
  resetFilterValues = [],
7132
7136
  onResetFilterValues
@@ -7141,6 +7145,7 @@ var SearchAndFilter = ({
7141
7145
  defaultSearchTerm,
7142
7146
  onSearchChange,
7143
7147
  totalResults,
7148
+ isLoading,
7144
7149
  resetFilterValues,
7145
7150
  filterMapper: filterMapper2,
7146
7151
  allowBindingSearchTerm,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "20.51.0",
3
+ "version": "20.51.1-alpha.14+1acdc51f11",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -51,10 +51,10 @@
51
51
  "@lexical/selection": "0.39.0",
52
52
  "@lexical/utils": "0.39.0",
53
53
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
54
- "@uniformdev/canvas": "20.51.0",
55
- "@uniformdev/design-system": "20.51.0",
56
- "@uniformdev/mesh-sdk": "20.51.0",
57
- "@uniformdev/richtext": "20.51.0",
54
+ "@uniformdev/canvas": "20.51.1-alpha.14+1acdc51f11",
55
+ "@uniformdev/design-system": "20.51.1-alpha.14+1acdc51f11",
56
+ "@uniformdev/mesh-sdk": "20.51.1-alpha.14+1acdc51f11",
57
+ "@uniformdev/richtext": "20.51.1-alpha.14+1acdc51f11",
58
58
  "dequal": "^2.0.3",
59
59
  "lexical": "0.39.0",
60
60
  "mitt": "3.0.1",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "4e1041ff207d9098efcdca31686c5d58615315b3"
88
+ "gitHead": "1acdc51f11d2e4d35097fcb2f0e2d0777fab0c24"
89
89
  }