gantri-components 2.129.0-beta.6 → 2.129.0-beta.8
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/helpers/generate-skus-functions/generate-skus.types.d.ts +0 -11
- package/dist/helpers/generate-skus-functions/get-sku-details/get-sku-details.d.ts +31 -0
- package/dist/helpers/generate-skus-functions/get-sku-details/get-sku-details.types.d.ts +18 -0
- package/dist/helpers/generate-skus-functions/get-sku-details/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.types.d.ts +5 -2
- package/dist/helpers/generate-skus-functions/index.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
export interface VariantOption {
|
|
2
|
-
code: string;
|
|
3
|
-
name: string;
|
|
4
|
-
partials: VariantPartial[];
|
|
5
|
-
}
|
|
6
|
-
interface VariantPartial {
|
|
7
|
-
code: string;
|
|
8
|
-
label: string;
|
|
9
|
-
name: string;
|
|
10
|
-
}
|
|
11
1
|
export type ProductOption = {
|
|
12
2
|
code: string;
|
|
13
3
|
} | string | null | undefined;
|
|
14
|
-
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GetSkuDetailsProps } from './get-sku-details.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provide a sku and the variant options and get all the product option codes back.
|
|
4
|
+
*
|
|
5
|
+
* *`variantOptions` must be input in the same index order they were provided in!*
|
|
6
|
+
*/
|
|
7
|
+
export declare const getSkuDetails: (props: GetSkuDetailsProps) => {
|
|
8
|
+
color: string;
|
|
9
|
+
productId: number;
|
|
10
|
+
size: string;
|
|
11
|
+
/**
|
|
12
|
+
* The partial codes that make up the full variant code.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* // variants === ['black_7_10_feet_cord', 'chrome_rod_finish']
|
|
17
|
+
*
|
|
18
|
+
* [
|
|
19
|
+
* ['black', '7_10_feet'],
|
|
20
|
+
* ['chrome']
|
|
21
|
+
* ]
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
variantPartials: string[][];
|
|
25
|
+
/**
|
|
26
|
+
* The full variant codes.
|
|
27
|
+
*
|
|
28
|
+
* @example ['black_7_10_feet_cord', 'chrome_rod_finish']
|
|
29
|
+
*/
|
|
30
|
+
variants: string[];
|
|
31
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface GetSkuDetailsProps {
|
|
2
|
+
sku: string;
|
|
3
|
+
skuPartialCodes: SkuPartialCode[][];
|
|
4
|
+
}
|
|
5
|
+
export interface SkuPartialCode {
|
|
6
|
+
/**
|
|
7
|
+
* The full variant code.
|
|
8
|
+
*
|
|
9
|
+
* @example 'black_7_10_feet_cord'
|
|
10
|
+
*/
|
|
11
|
+
code: string;
|
|
12
|
+
/**
|
|
13
|
+
* The partial codes that make up the full variant code.
|
|
14
|
+
*
|
|
15
|
+
* @example ['black', '7_10_feet']
|
|
16
|
+
*/
|
|
17
|
+
partialCodes: string[];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-sku-details';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { VariantOption } from '../generate-skus.types';
|
|
2
1
|
export interface GetSkuSelectorsProps {
|
|
3
2
|
sku: string;
|
|
4
|
-
variantOptions:
|
|
3
|
+
variantOptions: VariantDetails[][];
|
|
4
|
+
}
|
|
5
|
+
export interface VariantDetails {
|
|
6
|
+
code: string;
|
|
7
|
+
partialCodes: string[];
|
|
5
8
|
}
|