gantri-components 2.130.0 → 2.132.0
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/components/components.types.d.ts +4 -1
- package/dist/components/tooltip/tooltip.types.d.ts +2 -0
- package/dist/helpers/generate-skus-functions/generate-sku/__tests__/generate-sku.test.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-sku/generate-sku.d.ts +30 -0
- package/dist/helpers/generate-skus-functions/generate-sku/generate-sku.types.d.ts +7 -0
- package/dist/helpers/generate-skus-functions/generate-sku/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-skus/__tests__/generate-skus.test.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-skus/generate-skus.d.ts +41 -0
- package/dist/helpers/generate-skus-functions/generate-skus/generate-skus.types.d.ts +7 -0
- package/dist/helpers/generate-skus-functions/generate-skus/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/__tests__/generate-skus-for-product-id.tests.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/generate-skus-for-product-id.d.ts +42 -0
- package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/generate-skus-for-product-id.types.d.ts +7 -0
- package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/generate-skus.types.d.ts +3 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product/__tests__/get-colors-by-product.test.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product/get-colors-by-product.d.ts +5 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product/get-colors-by-product.types.d.ts +11 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product/index.d.ts +2 -0
- 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/helpers/flatten-options/flatten-options.d.ts +2 -0
- package/dist/helpers/generate-skus-functions/helpers/flatten-options/flatten-options.types.d.ts +6 -0
- package/dist/helpers/generate-skus-functions/helpers/flatten-options/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/helpers/generate-skus-from-options/generate-skus-from-options.d.ts +2 -0
- package/dist/helpers/generate-skus-functions/helpers/generate-skus-from-options/generate-skus-from-options.types.d.ts +5 -0
- package/dist/helpers/generate-skus-functions/helpers/generate-skus-from-options/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/helpers/get-is-color-available-for-product-id/__tests__/get-is-color-available-for-product-id.test.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/helpers/get-is-color-available-for-product-id/get-is-color-available-for-product-id.constants.d.ts +4 -0
- package/dist/helpers/generate-skus-functions/helpers/get-is-color-available-for-product-id/get-is-color-available-for-product-id.d.ts +6 -0
- package/dist/helpers/generate-skus-functions/helpers/get-is-color-available-for-product-id/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/helpers/index.d.ts +3 -0
- package/dist/helpers/generate-skus-functions/index.d.ts +5 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { TooltipProps } from './tooltip/tooltip.types';
|
|
1
2
|
export type DynamicListItem<T extends Record<any, any>> = T & {
|
|
2
3
|
disabled?: boolean;
|
|
3
|
-
|
|
4
|
+
/** @deprecated use `disabledTooltipProps` to provide any overrides. */
|
|
5
|
+
disabledTooltipDescription?: TooltipProps['description'];
|
|
6
|
+
disabledTooltipProps?: TooltipProps;
|
|
4
7
|
};
|
|
5
8
|
export type DynamicListItemDefaultData = {
|
|
6
9
|
label: string;
|
|
@@ -11,8 +11,10 @@ export type TooltipProps = Partial<TooltipDefaultProps> & Pick<OverlayProps, 'on
|
|
|
11
11
|
/** Milliseconds to delay the unhover behavior. */
|
|
12
12
|
closeDelay?: number;
|
|
13
13
|
description?: string;
|
|
14
|
+
descriptionHtmlText?: string;
|
|
14
15
|
descriptionTx?: string;
|
|
15
16
|
title?: string;
|
|
17
|
+
titleHtmlText?: string;
|
|
16
18
|
titleTx?: string;
|
|
17
19
|
};
|
|
18
20
|
export type TooltipDefaultProps = Required<Pick<OverlayProps, 'position' | 'triggerEvent'>> & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GenerateSkuProps } from './generate-sku.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provide a product's selected options and get the configured sku back.
|
|
4
|
+
*
|
|
5
|
+
* *`variants` must be input in the same index order they were provided in!*
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* // options as strings
|
|
10
|
+
* const sku = generateSku({
|
|
11
|
+
* color: 'carbon',
|
|
12
|
+
* productId: 123456,
|
|
13
|
+
* size: 'sm',
|
|
14
|
+
* variants: ['chrome_rod_finish', 'white_cord_color'],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // options as code objects
|
|
18
|
+
* const sku = generateSku({
|
|
19
|
+
* color: { code: 'carbon' },
|
|
20
|
+
* productId: 123456,
|
|
21
|
+
* size: { code: 'sm' },
|
|
22
|
+
* variants: [{ code: 'chrome_rod_finish' }, { code: 'white_cord_color' }],
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @returns
|
|
26
|
+
* ```
|
|
27
|
+
* '123456-sm-carbon-chrome_rod_finish-white_cord_color'
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const generateSku: (props: GenerateSkuProps) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generate-sku';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GenerateSkusProps } from './generate-skus.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provide all of a product's options and get all possible skus back.
|
|
4
|
+
*
|
|
5
|
+
* *`variants` must be input in the same index order they were provided in!*
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* // options as strings
|
|
10
|
+
* const sku = generateSkus({
|
|
11
|
+
* color: ['carbon', 'snow'],
|
|
12
|
+
* productId: 123456,
|
|
13
|
+
* size: 'sm',
|
|
14
|
+
* variants: [
|
|
15
|
+
* ['chrome_rod_finish'],
|
|
16
|
+
* ['black_cord_color', 'white_cord_color']
|
|
17
|
+
* ],
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // options as code objects
|
|
21
|
+
* const sku = generateSkus({
|
|
22
|
+
* color: [{ code: 'carbon' }, {code: 'snow'}],
|
|
23
|
+
* productId: 123456,
|
|
24
|
+
* size: { code: 'sm' },
|
|
25
|
+
* variants: [
|
|
26
|
+
* [{ code: 'chrome_rod_finish' }],
|
|
27
|
+
* [{ code: 'black_cord_color' }, { code: 'white_cord_color' }]
|
|
28
|
+
* ],
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* @returns
|
|
32
|
+
* ```
|
|
33
|
+
* [
|
|
34
|
+
* '123456-sm-carbon-chrome_rod_finish-black_cord_color',
|
|
35
|
+
* '123456-sm-carbon-chrome_rod_finish-white_cord_color',
|
|
36
|
+
* '123456-sm-snow-chrome_rod_finish-black_cord_color',
|
|
37
|
+
* '123456-sm-snow-chrome_rod_finish-white_cord_color'
|
|
38
|
+
* ]
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const generateSkus: (props: GenerateSkusProps) => string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generate-skus';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GenerateSkusForProductIdProps } from './generate-skus-for-product-id.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provide all of a product's options (if `isPainted` is `true`, available colors are automatically configured based on product ID) and get all possible skus back.
|
|
4
|
+
*
|
|
5
|
+
* *`variants` must be input in the same index order they were provided in!*
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* // options as strings
|
|
10
|
+
* const sku = generateSkusForProductId({
|
|
11
|
+
* isPainted: true,
|
|
12
|
+
* productId: 123456,
|
|
13
|
+
* size: 'sm',
|
|
14
|
+
* variants: [
|
|
15
|
+
* ['chrome_rod_finish'],
|
|
16
|
+
* ['black_cord_color', 'white_cord_color']
|
|
17
|
+
* ],
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // options as code objects
|
|
21
|
+
* const sku = generateSkusForProductId({
|
|
22
|
+
* isPainted: true,
|
|
23
|
+
* productId: 123456,
|
|
24
|
+
* size: { code: 'sm' },
|
|
25
|
+
* variants: [
|
|
26
|
+
* [{ code: 'chrome_rod_finish' }],
|
|
27
|
+
* [{ code: 'black_cord_color' }, { code: 'white_cord_color' }]
|
|
28
|
+
* ],
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* @returns
|
|
32
|
+
* ```
|
|
33
|
+
* [
|
|
34
|
+
* '123456-sm-blossompink-chrome_rod_finish-black_cord_color',
|
|
35
|
+
* '123456-sm-blossompink-chrome_rod_finish-white_cord_color',
|
|
36
|
+
* '123456-sm-canyon-chrome_rod_finish-black_cord_color',
|
|
37
|
+
* '123456-sm-canyon-chrome_rod_finish-white_cord_color',
|
|
38
|
+
* ...etc
|
|
39
|
+
* ]
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare const generateSkusForProductId: (props: GenerateSkusForProductIdProps) => string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generate-skus-for-product-id';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetColorsByProductProps, ProductColorDetail } from './get-colors-by-product.types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of colors that are available for a particular product ID.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getColorsByProduct: (props: GetColorsByProductProps) => ProductColorDetail[];
|
package/dist/helpers/generate-skus-functions/get-colors-by-product/get-colors-by-product.types.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProductColorCode } from '../../../styles/theme';
|
|
2
|
+
export interface ProductColorDetail {
|
|
3
|
+
code: ProductColorCode;
|
|
4
|
+
hexColor: string;
|
|
5
|
+
shortColorName: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GetColorsByProductProps {
|
|
8
|
+
allowTradeColors: boolean;
|
|
9
|
+
isPainted: boolean;
|
|
10
|
+
productId: number;
|
|
11
|
+
}
|
|
@@ -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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './flatten-options';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generate-skus-from-options';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const momaExclusiveColorsProductIds: number[];
|
|
2
|
+
export declare const momaExclusiveColorCodes: readonly ["cobalt", "poppy"];
|
|
3
|
+
export declare const kobbleExclusiveColorsProductIds: number[];
|
|
4
|
+
export declare const kobbleExclusiveColorCodes: readonly ["glossysnowwhite"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-is-color-available-for-product-id';
|
package/dist/helpers/index.d.ts
CHANGED