@uniformdev/mesh-sdk-react 20.51.0 → 20.53.1-alpha.7

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
@@ -82,6 +82,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
82
82
  type: TLocationType;
83
83
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
84
84
  type: TLocationType;
85
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
86
+ type: TLocationType;
85
87
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
86
88
  type: TLocationType;
87
89
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -113,6 +115,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
113
115
  type: TLocationType;
114
116
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
115
117
  type: TLocationType;
118
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
119
+ type: TLocationType;
116
120
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
117
121
  type: TLocationType;
118
122
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -143,6 +147,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
143
147
  type: TLocationType;
144
148
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
145
149
  type: TLocationType;
150
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
151
+ type: TLocationType;
146
152
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
147
153
  type: TLocationType;
148
154
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -1742,6 +1748,8 @@ type SearchAndFilterProviderProps = {
1742
1748
  onResetFilterValues?: () => void;
1743
1749
  /** the total number of results */
1744
1750
  totalResults?: number;
1751
+ /** whether data is currently loading */
1752
+ isLoading?: boolean;
1745
1753
  /** the filter mapper function */
1746
1754
  filterMapper?: FilterMapper;
1747
1755
  /** sets child components giving access to useSearchAndFilter context */
@@ -1776,6 +1784,8 @@ type SearchAndFilterContextProps = {
1776
1784
  filterMapper?: FilterMapper;
1777
1785
  /** the total number of results */
1778
1786
  totalResults?: number;
1787
+ /** whether data is currently loading */
1788
+ isLoading?: boolean;
1779
1789
  /** Allow to bind dynamic inputs to the search term */
1780
1790
  allowBindingSearchTerm?: boolean;
1781
1791
  };
@@ -1784,7 +1794,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
1784
1794
  * Search and filter provider
1785
1795
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
1786
1796
  * */
1787
- declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1797
+ 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
1798
  /** Search and filter hook
1789
1799
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
1790
1800
  */
@@ -1815,6 +1825,8 @@ declare const useSearchAndFilter: () => {
1815
1825
  filterMapper?: FilterMapper;
1816
1826
  /** the total number of results */
1817
1827
  totalResults?: number;
1828
+ /** whether data is currently loading */
1829
+ isLoading?: boolean;
1818
1830
  /** Allow to bind dynamic inputs to the search term */
1819
1831
  allowBindingSearchTerm?: boolean;
1820
1832
  };
@@ -1830,6 +1842,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1830
1842
  viewSwitchControls?: React$1.ReactNode;
1831
1843
  /** The number of total results */
1832
1844
  totalResults?: number;
1845
+ /** Whether data is currently loading */
1846
+ isLoading?: boolean;
1833
1847
  /** The results container view
1834
1848
  * @default '<SearchAndFilterResultContainer />'
1835
1849
  */
@@ -1847,7 +1861,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1847
1861
  * Search and filter component
1848
1862
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
1849
1863
  * */
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;
1864
+ 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
1865
 
1852
1866
  type FilterItemsProps = {
1853
1867
  /** The text for the add button */
package/dist/index.d.ts CHANGED
@@ -82,6 +82,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
82
82
  type: TLocationType;
83
83
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
84
84
  type: TLocationType;
85
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
86
+ type: TLocationType;
85
87
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
86
88
  type: TLocationType;
87
89
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -113,6 +115,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
113
115
  type: TLocationType;
114
116
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
115
117
  type: TLocationType;
118
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
119
+ type: TLocationType;
116
120
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
117
121
  type: TLocationType;
118
122
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -143,6 +147,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
143
147
  type: TLocationType;
144
148
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
145
149
  type: TLocationType;
150
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceSelectorLocation, {
151
+ type: TLocationType;
146
152
  }> | Extract<_uniformdev_mesh_sdk.CanvasEditorToolsLocation, {
147
153
  type: TLocationType;
148
154
  }> | Extract<_uniformdev_mesh_sdk.EmbeddedEditorLocation, {
@@ -1742,6 +1748,8 @@ type SearchAndFilterProviderProps = {
1742
1748
  onResetFilterValues?: () => void;
1743
1749
  /** the total number of results */
1744
1750
  totalResults?: number;
1751
+ /** whether data is currently loading */
1752
+ isLoading?: boolean;
1745
1753
  /** the filter mapper function */
1746
1754
  filterMapper?: FilterMapper;
1747
1755
  /** sets child components giving access to useSearchAndFilter context */
@@ -1776,6 +1784,8 @@ type SearchAndFilterContextProps = {
1776
1784
  filterMapper?: FilterMapper;
1777
1785
  /** the total number of results */
1778
1786
  totalResults?: number;
1787
+ /** whether data is currently loading */
1788
+ isLoading?: boolean;
1779
1789
  /** Allow to bind dynamic inputs to the search term */
1780
1790
  allowBindingSearchTerm?: boolean;
1781
1791
  };
@@ -1784,7 +1794,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
1784
1794
  * Search and filter provider
1785
1795
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
1786
1796
  * */
1787
- declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
1797
+ 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
1798
  /** Search and filter hook
1789
1799
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
1790
1800
  */
@@ -1815,6 +1825,8 @@ declare const useSearchAndFilter: () => {
1815
1825
  filterMapper?: FilterMapper;
1816
1826
  /** the total number of results */
1817
1827
  totalResults?: number;
1828
+ /** whether data is currently loading */
1829
+ isLoading?: boolean;
1818
1830
  /** Allow to bind dynamic inputs to the search term */
1819
1831
  allowBindingSearchTerm?: boolean;
1820
1832
  };
@@ -1830,6 +1842,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1830
1842
  viewSwitchControls?: React$1.ReactNode;
1831
1843
  /** The number of total results */
1832
1844
  totalResults?: number;
1845
+ /** Whether data is currently loading */
1846
+ isLoading?: boolean;
1833
1847
  /** The results container view
1834
1848
  * @default '<SearchAndFilterResultContainer />'
1835
1849
  */
@@ -1847,7 +1861,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
1847
1861
  * Search and filter component
1848
1862
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
1849
1863
  * */
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;
1864
+ 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
1865
 
1852
1866
  type FilterItemsProps = {
1853
1867
  /** 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.53.1-alpha.7+1c3bd56284",
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.53.1-alpha.7+1c3bd56284",
55
+ "@uniformdev/design-system": "20.53.1-alpha.7+1c3bd56284",
56
+ "@uniformdev/mesh-sdk": "20.53.1-alpha.7+1c3bd56284",
57
+ "@uniformdev/richtext": "20.53.1-alpha.7+1c3bd56284",
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": "1c3bd56284db96f16318a18e62b3b6e83cb09f9b"
89
89
  }