@dropins/storefront-quick-order 0.0.1-alpha1
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.md +188 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/index.d.ts +3 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +10 -0
- package/api.d.ts +1 -0
- package/api.js +4 -0
- package/api.js.map +1 -0
- package/chunks/CsvFileInput.js +4 -0
- package/chunks/CsvFileInput.js.map +1 -0
- package/chunks/Search.js +4 -0
- package/chunks/Search.js.map +1 -0
- package/components/CsvFileInput/CsvFileInput.d.ts +5 -0
- package/components/CsvFileInput/index.d.ts +19 -0
- package/components/QuickOrderItemsList/QuickOrderItemsList.d.ts +5 -0
- package/components/QuickOrderItemsList/index.d.ts +19 -0
- package/components/QuickOrderListItem/QuickOrderListItem.d.ts +5 -0
- package/components/QuickOrderListItem/index.d.ts +19 -0
- package/components/Search/Search.d.ts +4 -0
- package/components/Search/index.d.ts +19 -0
- package/components/SkuListInput/SkuListInput.d.ts +5 -0
- package/components/SkuListInput/index.d.ts +19 -0
- package/components/index.d.ts +22 -0
- package/configs/index.d.ts +19 -0
- package/configs/order-item.config.d.ts +4 -0
- package/configs/search-filter.config.d.ts +5 -0
- package/containers/QuickOrderCsvUpload/QuickOrderCsvUpload.d.ts +5 -0
- package/containers/QuickOrderCsvUpload/index.d.ts +19 -0
- package/containers/QuickOrderCsvUpload.d.ts +3 -0
- package/containers/QuickOrderCsvUpload.js +7 -0
- package/containers/QuickOrderCsvUpload.js.map +1 -0
- package/containers/QuickOrderItems/QuickOrderItems.d.ts +5 -0
- package/containers/QuickOrderItems/index.d.ts +19 -0
- package/containers/QuickOrderItems.d.ts +3 -0
- package/containers/QuickOrderItems.js +4 -0
- package/containers/QuickOrderItems.js.map +1 -0
- package/containers/QuickOrderMultipleSku/QuickOrderMultipleSku.d.ts +5 -0
- package/containers/QuickOrderMultipleSku/index.d.ts +19 -0
- package/containers/QuickOrderMultipleSku.d.ts +3 -0
- package/containers/QuickOrderMultipleSku.js +4 -0
- package/containers/QuickOrderMultipleSku.js.map +1 -0
- package/containers/index.d.ts +20 -0
- package/data/models/index.d.ts +2 -0
- package/data/transforms/index.d.ts +2 -0
- package/hooks/index.d.ts +21 -0
- package/hooks/useItemSearch.d.ts +11 -0
- package/hooks/useQuickOrderCsvUpload.d.ts +4 -0
- package/hooks/useQuickOrderItems.d.ts +4 -0
- package/hooks/useQuickOrderMultipleSku.d.ts +4 -0
- package/i18n/en_US.json.d.ts +66 -0
- package/lib/addOrMergeItems.d.ts +13 -0
- package/lib/buildCartItem.d.ts +32 -0
- package/lib/buildCartItemsFromForms.d.ts +8 -0
- package/lib/cleanCsvValue.d.ts +24 -0
- package/lib/findDuplicateItem.d.ts +19 -0
- package/lib/generateItemId.d.ts +22 -0
- package/lib/getItemScope.d.ts +8 -0
- package/lib/index.d.ts +35 -0
- package/lib/mapProductsToOrderItems.d.ts +11 -0
- package/lib/mergeDuplicateItems.d.ts +8 -0
- package/lib/processFormOptions.d.ts +29 -0
- package/lib/productOptionsStorage.d.ts +41 -0
- package/lib/removeReplacedItems.d.ts +7 -0
- package/lib/replaceOrAddItems.d.ts +18 -0
- package/lib/searchBlurHandler.d.ts +38 -0
- package/lib/searchKeyboardNavigation.d.ts +42 -0
- package/lib/updateItemInList.d.ts +13 -0
- package/lib/validateCsvContent.d.ts +20 -0
- package/lib/validateOrderItems.d.ts +18 -0
- package/package.json +1 -0
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +6 -0
- package/render.js.map +1 -0
- package/types/index.d.ts +21 -0
- package/types/quickOrderCsvUpload.types.d.ts +32 -0
- package/types/quickOrderItems.types.d.ts +205 -0
- package/types/quickOrderMultipleSku.types.d.ts +34 -0
- package/types/search.types.d.ts +41 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/lib/slot';
|
|
2
|
+
|
|
3
|
+
export type SubmitSkuValue = Array<{
|
|
4
|
+
sku: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
}>;
|
|
7
|
+
type DefaultSlotContext = {
|
|
8
|
+
handleAddToList: (values: SubmitSkuValue) => void;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
textAreaValue: string;
|
|
11
|
+
};
|
|
12
|
+
export interface QuickOrderMultipleSkuProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
onChange?: (skus: string[]) => void;
|
|
15
|
+
slots?: {
|
|
16
|
+
AddToListButton?: SlotProps<DefaultSlotContext>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface SkuListInputProps {
|
|
20
|
+
t: Record<string, string>;
|
|
21
|
+
onChange: (e: Event) => void;
|
|
22
|
+
textAreaValue: string;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface UseQuickOrderMultipleSkuProps extends Omit<QuickOrderMultipleSkuProps, 'className'> {
|
|
26
|
+
}
|
|
27
|
+
export interface UseQuickOrderMultipleSkuReturn {
|
|
28
|
+
handleChange: (e: Event) => void;
|
|
29
|
+
textAreaValue: string;
|
|
30
|
+
loading: boolean;
|
|
31
|
+
handleAddToList: (values?: SubmitSkuValue) => void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=quickOrderMultipleSku.types.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AddAllToCartContext, OrderItem, ProductOptionsContext, ProductPriceContext, QuickOrderItemSearchContext, QuickOrderSearchAutocompleteItemContext } from '.';
|
|
2
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/lib/slot';
|
|
3
|
+
|
|
4
|
+
export interface SearchItem {
|
|
5
|
+
sku: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface SearchProps<T extends SearchItem = SearchItem> {
|
|
9
|
+
t: Record<string, string>;
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (e: Event) => void;
|
|
12
|
+
items: T[];
|
|
13
|
+
shouldShowResults?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
onItemClick?: (item: T) => void;
|
|
16
|
+
slots?: {
|
|
17
|
+
AddAllToCartButton?: SlotProps<AddAllToCartContext>;
|
|
18
|
+
ProductPrice?: SlotProps<ProductPriceContext>;
|
|
19
|
+
ProductOptions?: SlotProps<ProductOptionsContext>;
|
|
20
|
+
QuickOrderItemSearch?: SlotProps<QuickOrderItemSearchContext>;
|
|
21
|
+
QuickOrderSearchAutocompleteItem?: SlotProps<QuickOrderSearchAutocompleteItemContext<T>>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface UseItemSearchProps {
|
|
25
|
+
productsSearch?: (params: {
|
|
26
|
+
phrase: string;
|
|
27
|
+
filter: Array<{
|
|
28
|
+
attribute: string;
|
|
29
|
+
in: string[];
|
|
30
|
+
}>;
|
|
31
|
+
}) => Promise<{
|
|
32
|
+
items: OrderItem[];
|
|
33
|
+
}>;
|
|
34
|
+
initialSku: string;
|
|
35
|
+
replaceItemSku?: string;
|
|
36
|
+
searchFilter?: Array<{
|
|
37
|
+
attribute: string;
|
|
38
|
+
in: string[];
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=search.types.d.ts.map
|