@uniformdev/mesh-sdk-react 13.0.1-alpha.133 → 13.0.1-alpha.311
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/LICENSE.txt +2 -0
- package/dist/index.d.ts +21 -15
- package/dist/index.esm.js +131 -136
- package/dist/index.js +133 -138
- package/dist/index.mjs +131 -136
- package/package.json +13 -11
package/LICENSE.txt
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import React__default, { SVGProps } from 'react';
|
|
|
6
6
|
import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
|
|
7
7
|
import { TDate } from 'timeago.js';
|
|
8
8
|
import * as _emotion_react from '@emotion/react';
|
|
9
|
-
export { Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Theme, ThemeProps } from '@uniformdev/design-system';
|
|
9
|
+
export { Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Textarea, TextareaProps, Theme, ThemeProps } from '@uniformdev/design-system';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Provides convenient access to the current Uniform Mesh location via React hook.
|
|
@@ -88,7 +88,7 @@ declare type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchRes
|
|
|
88
88
|
logoIcon: string | React.ComponentType<{
|
|
89
89
|
className?: string;
|
|
90
90
|
}>;
|
|
91
|
-
select: (
|
|
91
|
+
select: (items: TResult[], selectedContentType?: string) => void;
|
|
92
92
|
requireContentType?: boolean;
|
|
93
93
|
multiSelectId?: string;
|
|
94
94
|
multiSelect?: boolean;
|
|
@@ -103,7 +103,9 @@ declare type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchRes
|
|
|
103
103
|
selectedContentType?: string;
|
|
104
104
|
}>;
|
|
105
105
|
helpComponent?: JSX.Element;
|
|
106
|
-
onSort?: (
|
|
106
|
+
onSort?: (items: TResult[]) => void;
|
|
107
|
+
typeSelectorLabel?: string;
|
|
108
|
+
typeSelectorAllTypesOptionText?: string;
|
|
107
109
|
};
|
|
108
110
|
interface EntrySearchResult {
|
|
109
111
|
id: string;
|
|
@@ -121,7 +123,7 @@ interface NoResultsProps {
|
|
|
121
123
|
searchText: string | undefined;
|
|
122
124
|
selectedContentType: string | undefined;
|
|
123
125
|
}
|
|
124
|
-
declare const EntrySearch: <TResult extends EntrySearchResult>({ search, results, contentTypes, selectedItems, logoIcon, select, multiSelect, multiSelectId, rowComponent, selectedItemComponent, totalResults, resultsLoading, requireContentType, onAddNew, onEditClosed, onCancel, noResultsComponent, helpComponent, onSort, }: EntrySearchProps<TResult>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
126
|
+
declare const EntrySearch: <TResult extends EntrySearchResult>({ search, results, contentTypes, selectedItems, logoIcon, select, multiSelect, multiSelectId, rowComponent, selectedItemComponent, totalResults, resultsLoading, requireContentType, onAddNew, onEditClosed, onCancel, noResultsComponent, helpComponent, onSort, typeSelectorLabel, typeSelectorAllTypesOptionText, }: EntrySearchProps<TResult>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
125
127
|
|
|
126
128
|
declare const searchRowContainer: _emotion_react.SerializedStyles;
|
|
127
129
|
declare const searchRowContainerActive: _emotion_react.SerializedStyles;
|
|
@@ -222,6 +224,9 @@ interface ProductQueryProps<TValue extends ProductDynamicSelectorValue = Product
|
|
|
222
224
|
name: string;
|
|
223
225
|
sortOrderKey: string;
|
|
224
226
|
}>;
|
|
227
|
+
categoryLabel?: string;
|
|
228
|
+
brandLabel?: string;
|
|
229
|
+
disableBrands?: boolean;
|
|
225
230
|
}
|
|
226
231
|
interface ProductQueryCategory {
|
|
227
232
|
id: string;
|
|
@@ -232,7 +237,7 @@ interface Brand {
|
|
|
232
237
|
id: string;
|
|
233
238
|
name: string;
|
|
234
239
|
}
|
|
235
|
-
declare const ProductQuery: ({ value, setValue, brands, categories, loading, categoriesLoading, brandsLoading, logoIcon, onGetProducts, sortOptions, sortOrderOptions, }: ProductQueryProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
240
|
+
declare const ProductQuery: ({ value, setValue, brands, categories, loading, categoriesLoading, brandsLoading, logoIcon, onGetProducts, sortOptions, sortOrderOptions, categoryLabel, brandLabel, disableBrands, }: ProductQueryProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
236
241
|
interface ProductQueryContextValue {
|
|
237
242
|
categories: ProductQueryProps['categories'];
|
|
238
243
|
logoIcon: ProductQueryProps['logoIcon'];
|
|
@@ -240,13 +245,9 @@ interface ProductQueryContextValue {
|
|
|
240
245
|
declare const ProductQueryContext: React__default.Context<ProductQueryContextValue | undefined>;
|
|
241
246
|
declare const useProductQueryContext: () => ProductQueryContextValue;
|
|
242
247
|
|
|
243
|
-
declare type ProductSearchProps<TResult extends ProductSearchResult = ProductSearchResult> = Pick<EntrySearchProps<TResult>, 'multiSelect' | 'multiSelectId' | 'logoIcon' | 'rowComponent' | 'selectedItemComponent'> & {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
onGetSelectedProducts: (args: {
|
|
247
|
-
ids: string[];
|
|
248
|
-
options?: GetProductOptions;
|
|
249
|
-
}) => Promise<TResult[]>;
|
|
248
|
+
declare type ProductSearchProps<TResult extends ProductSearchResult = ProductSearchResult> = Pick<EntrySearchProps<TResult>, 'multiSelect' | 'multiSelectId' | 'logoIcon' | 'rowComponent' | 'selectedItemComponent' | 'helpComponent' | 'noResultsComponent' | 'onSort' | 'typeSelectorAllTypesOptionText' | 'typeSelectorLabel'> & {
|
|
249
|
+
selectedProducts: TResult[] | undefined;
|
|
250
|
+
setSelectedProducts: (products: TResult[] | undefined) => Promise<void>;
|
|
250
251
|
onGetCategories: () => Promise<ProductCategory[]>;
|
|
251
252
|
onSearchProducts: (args: {
|
|
252
253
|
text: string;
|
|
@@ -255,13 +256,17 @@ declare type ProductSearchProps<TResult extends ProductSearchResult = ProductSea
|
|
|
255
256
|
total: number;
|
|
256
257
|
products: TResult[];
|
|
257
258
|
}>;
|
|
259
|
+
errorComponent?: React__default.ComponentType<{
|
|
260
|
+
categoriesError?: Error;
|
|
261
|
+
searchError?: Error;
|
|
262
|
+
}>;
|
|
258
263
|
};
|
|
259
264
|
interface GetProductOptions {
|
|
260
265
|
limit?: number;
|
|
261
266
|
offset?: number;
|
|
262
267
|
categoryId?: string;
|
|
263
268
|
}
|
|
264
|
-
declare function ProductSearch({
|
|
269
|
+
declare function ProductSearch({ selectedProducts, setSelectedProducts, onGetCategories, onSearchProducts, logoIcon, multiSelect, multiSelectId, selectedItemComponent, rowComponent, errorComponent, helpComponent, noResultsComponent, onSort, typeSelectorAllTypesOptionText, typeSelectorLabel, }: ProductSearchProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
265
270
|
interface ProductSearchContextValue {
|
|
266
271
|
logoIcon: ProductSearchProps['logoIcon'];
|
|
267
272
|
categories: ProductCategory[] | undefined;
|
|
@@ -296,8 +301,9 @@ declare type SelectionFieldValue = {
|
|
|
296
301
|
id: string;
|
|
297
302
|
name: string;
|
|
298
303
|
};
|
|
299
|
-
declare const SelectionField: ({
|
|
300
|
-
|
|
304
|
+
declare const SelectionField: ({ id, label, loading, selectedValues, values, onAdd, onRemove, }: {
|
|
305
|
+
id: string;
|
|
306
|
+
label: string;
|
|
301
307
|
loading: boolean;
|
|
302
308
|
selectedValues: string[] | undefined;
|
|
303
309
|
values: SelectionFieldValue[];
|