hasting-swatchcart-module 1.0.30 → 1.0.32
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/assets/index.css +1 -0
- package/dist/cdn/lib/components/SwatchesModule.d.ts +11 -0
- package/dist/cdn/lib/main.d.ts +9 -0
- package/dist/cdn/lib/store/LibraryProvider.d.ts +4 -0
- package/dist/cdn/lib/store/rootReducer.d.ts +11 -0
- package/dist/cdn/lib/store/store.d.ts +25 -0
- package/dist/cdn/lib/store/withStore.d.ts +2 -0
- package/dist/cdn/lib/vite-env.d.ts +1 -0
- package/dist/cdn/main.css +1 -0
- package/dist/cdn/main.js +31596 -0
- package/dist/cdn/src/app/App.d.ts +2 -0
- package/dist/cdn/src/app/assets/svg/ArrowIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/CheckMarkIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/ChevronSVGIcon.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/CloseIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/DarkWhiteIconSVG.d.ts +1 -0
- package/dist/cdn/src/app/assets/svg/MinusIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/PlusIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/SearchIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/TrashIconSVG.d.ts +3 -0
- package/dist/cdn/src/app/assets/svg/WhiteWhiteIconSVG.d.ts +1 -0
- package/dist/cdn/src/app/main.d.ts +0 -0
- package/dist/cdn/src/app/providers/StoreProvider.d.ts +6 -0
- package/dist/cdn/src/app/store/rootReducer.d.ts +11 -0
- package/dist/cdn/src/app/store/store.d.ts +24 -0
- package/dist/cdn/src/features/Cart/lib/CartCervices.d.ts +5 -0
- package/dist/cdn/src/features/Cart/model/cartSlice.d.ts +3 -0
- package/dist/cdn/src/features/Cart/model/selectors.d.ts +223 -0
- package/dist/cdn/src/features/Cart/model/types.d.ts +7 -0
- package/dist/cdn/src/features/Cart/ui/CartHeader/CartHeader.d.ts +7 -0
- package/dist/cdn/src/features/Cart/ui/CartList/CartList.d.ts +1 -0
- package/dist/cdn/src/features/Cart/ui/CartListItem/CartListItem.d.ts +10 -0
- package/dist/cdn/src/features/Cart/ui/CartWrapper/CartWrapper.d.ts +9 -0
- package/dist/cdn/src/features/Cart/ui/Counter/Counter.d.ts +9 -0
- package/dist/cdn/src/features/DataAdapter/lib/DataAdapterServices.d.ts +14 -0
- package/dist/cdn/src/features/DataAdapter/utils/types.d.ts +11 -0
- package/dist/cdn/src/features/MultiProduct/lib/MultiProductCartServices.d.ts +13 -0
- package/dist/cdn/src/features/MultiProduct/model/API/api.d.ts +4 -0
- package/dist/cdn/src/features/MultiProduct/model/API/routes.d.ts +4 -0
- package/dist/cdn/src/features/MultiProduct/model/multiProductCartSlice.d.ts +9 -0
- package/dist/cdn/src/features/MultiProduct/model/selectors.d.ts +38 -0
- package/dist/cdn/src/features/MultiProduct/model/thunk.d.ts +11 -0
- package/dist/cdn/src/features/MultiProduct/model/types.d.ts +63 -0
- package/dist/cdn/src/features/MultiProduct/ui/CartSelectedProductList/CartSelectedProductList.d.ts +1 -0
- package/dist/cdn/src/features/MultiProduct/ui/FiltersSelectedProductItem/FiltersSelectedProductItem.d.ts +1 -0
- package/dist/cdn/src/features/MultiProduct/ui/MaterialMultiProductList/MaterialMultiProductList.d.ts +42 -0
- package/dist/cdn/src/features/MultiProduct/ui/MultiProductCartHeader/MultiProductCartHeader.d.ts +5 -0
- package/dist/cdn/src/features/MultiProduct/ui/MultiProductItemCart/MultiProductItemCart.d.ts +5 -0
- package/dist/cdn/src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.d.ts +6 -0
- package/dist/cdn/src/features/MultiProduct/ui/ProductList/ProductList.d.ts +1 -0
- package/dist/cdn/src/features/MultiProduct/ui/ProductListItem/ProductListItem.d.ts +6 -0
- package/dist/cdn/src/features/MultiProduct/ui/SelectedProductItem/SelectedProductItem.d.ts +1 -0
- package/dist/cdn/src/features/MultiProduct/ui/SwatchContentContainer/SwatchContentContainer.d.ts +15 -0
- package/dist/cdn/src/features/MultiProduct/ui/SwatchListItem/SwatchListItem.d.ts +41 -0
- package/dist/cdn/src/features/MultiProduct/ui/SwatchesMultiProductList/SwatchesMultiProductList.d.ts +29 -0
- package/dist/cdn/src/features/MultiProduct/utils/constants.d.ts +6 -0
- package/dist/cdn/src/features/MultiProduct/utils/randomList.d.ts +2 -0
- package/dist/cdn/src/features/SwatchModule/SwatchModule/ui/SwatchModule.d.ts +2 -0
- package/dist/cdn/src/features/swatches/lib/AttributeHelper.d.ts +7 -0
- package/dist/cdn/src/features/swatches/lib/SwatchesServices.d.ts +11 -0
- package/dist/cdn/src/features/swatches/model/selectors.d.ts +10 -0
- package/dist/cdn/src/features/swatches/model/swatchesSlice.d.ts +54 -0
- package/dist/cdn/src/features/swatches/model/thunks.d.ts +12 -0
- package/dist/cdn/src/features/swatches/model/types.d.ts +148 -0
- package/dist/cdn/src/features/swatches/ui/Filters/ColorsFilter.d.ts +1 -0
- package/dist/cdn/src/features/swatches/ui/Filters/LooksFilter.d.ts +1 -0
- package/dist/cdn/src/features/swatches/ui/Filters/MaterialsFilter.d.ts +1 -0
- package/dist/cdn/src/features/swatches/ui/Filters/index.d.ts +1 -0
- package/dist/cdn/src/features/swatches/ui/HexGridZoom/HexGridZoom.d.ts +3 -0
- package/dist/cdn/src/features/swatches/ui/ImageGridZoom/ImageGridZoom.d.ts +3 -0
- package/dist/cdn/src/features/swatches/ui/MaterialSingleProductList/MaterialSingleProductList.d.ts +7 -0
- package/dist/cdn/src/features/swatches/ui/ProductElement/index.d.ts +6 -0
- package/dist/cdn/src/features/swatches/ui/SwatchWrapper/SwatchWrapper.d.ts +8 -0
- package/dist/cdn/src/features/swatches/ui/Swatches.d.ts +2 -0
- package/dist/cdn/src/features/swatches/ui/SwatchesList/SwatchesList.d.ts +7 -0
- package/dist/cdn/src/features/swatches/ui/SwatchesListWrapper/SwatchesListWrapper.d.ts +1 -0
- package/dist/cdn/src/features/swatches/utils/constants.d.ts +3 -0
- package/dist/cdn/src/features/swatches/utils/types.d.ts +22 -0
- package/dist/cdn/src/shared/constants/constants.d.ts +1 -0
- package/dist/cdn/src/shared/constants/props.d.ts +1058 -0
- package/dist/cdn/src/shared/constants/select.d.ts +4 -0
- package/dist/cdn/src/shared/constants/selectedMaterials.d.ts +1 -0
- package/dist/cdn/src/shared/types/activeTab.d.ts +5 -0
- package/dist/cdn/src/shared/types/fetchData.d.ts +41 -0
- package/dist/cdn/src/shared/types/svg.d.ts +3 -0
- package/dist/cdn/src/shared/ui/CartPrice/CartPrice.d.ts +7 -0
- package/dist/cdn/src/shared/ui/Checkbox/Checkbox.d.ts +4 -0
- package/dist/cdn/src/shared/ui/CustomButton/CustomButton.d.ts +6 -0
- package/dist/cdn/src/shared/ui/CustomModal/CustomModal.d.ts +11 -0
- package/dist/cdn/src/shared/ui/CustomSidebar/CustomSidebar.d.ts +8 -0
- package/dist/cdn/src/shared/ui/Dialog/Dialog.d.ts +19 -0
- package/dist/cdn/src/shared/ui/Hint/Hint.d.ts +60 -0
- package/dist/cdn/src/shared/ui/Label/Label.d.ts +7 -0
- package/dist/cdn/src/shared/ui/Loader/Loader.d.ts +10 -0
- package/dist/cdn/src/shared/ui/Markdown/MDWithAccordion.d.ts +10 -0
- package/dist/cdn/src/shared/ui/MaterialItem/MaterialItem.d.ts +8 -0
- package/dist/cdn/src/shared/ui/MaterialListItem/MaterialListItem.d.ts +7 -0
- package/dist/cdn/src/shared/ui/MultiSelect/MultiSelect.d.ts +20 -0
- package/dist/cdn/src/shared/ui/PopoverTooltip/InfoIcon.d.ts +1 -0
- package/dist/cdn/src/shared/ui/PopoverTooltip/PopoverTooltip.d.ts +11 -0
- package/dist/cdn/src/shared/ui/SingleSelect/SingleSelect.d.ts +18 -0
- package/dist/cdn/src/shared/ui/Slider/Slider.d.ts +11 -0
- package/dist/cdn/src/shared/ui/SwatchLimitModal/SwatchLimitModal.d.ts +6 -0
- package/dist/cdn/src/shared/ui/popover.d.ts +9 -0
- package/dist/cdn/src/shared/utils/cn.d.ts +2 -0
- package/dist/cdn/src/shared/utils/uniqueList.d.ts +1 -0
- package/dist/components/SwatchesModule.d.ts +11 -0
- package/dist/main.cjs +150 -0
- package/dist/main.cjs.map +1 -0
- package/dist/main.d.ts +9 -0
- package/dist/main.js +24420 -0
- package/dist/main.js.map +1 -0
- package/dist/store/LibraryProvider.d.ts +4 -0
- package/dist/store/rootReducer.d.ts +11 -0
- package/dist/store/store.d.ts +25 -0
- package/dist/store/withStore.d.ts +2 -0
- package/package.json +1 -1
- package/dist/assets/index-BxOF0-6c.js +0 -156
- package/dist/assets/index-WOZaSyBx.css +0 -1
- package/dist/index.html +0 -14
- /package/dist/{vite.svg → cdn/vite.svg} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProductList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IProductListItem } from '../../model/types';
|
|
2
|
+
interface IProductListItemProps {
|
|
3
|
+
productListItem: IProductListItem;
|
|
4
|
+
}
|
|
5
|
+
export declare const ProductListItem: ({ productListItem }: IProductListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectedProductItem: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/cdn/src/features/MultiProduct/ui/SwatchContentContainer/SwatchContentContainer.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container component responsible for:
|
|
3
|
+
* - Displaying a combined list of swatches from all selected products
|
|
4
|
+
* - Showing a preview section and an action button
|
|
5
|
+
* - Handling the opening of the Multi-Product Cart modal
|
|
6
|
+
*
|
|
7
|
+
* It collects materials from all products, normalizes them with additional
|
|
8
|
+
* context (product name), and renders them in a structured two-column layout.
|
|
9
|
+
*
|
|
10
|
+
* Also includes the "Add Swatches to Cart" button which opens the cart modal
|
|
11
|
+
* only when there are selected items.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
*/
|
|
15
|
+
export declare const SwatchContentContainer: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISwatchSelectedMaterial } from '../../model/types';
|
|
3
|
+
interface ISwatchesListItemProps {
|
|
4
|
+
val: ISwatchSelectedMaterial;
|
|
5
|
+
onDelete: (arg: ISwatchSelectedMaterial) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders a selected swatch item inside the list of chosen materials.
|
|
9
|
+
*
|
|
10
|
+
* The component shows the material preview (image or HEX grid), displays a
|
|
11
|
+
* delete button, and on hover opens a `Hint` tooltip with detailed material
|
|
12
|
+
* information (material name, parent category, product name).
|
|
13
|
+
*
|
|
14
|
+
* Hover logic:
|
|
15
|
+
* - When the user hovers over the swatch, it captures the hovered element,
|
|
16
|
+
* prepares the tooltip text, and opens the `Hint` component.
|
|
17
|
+
* - The tooltip closes when the mouse leaves the item.
|
|
18
|
+
*
|
|
19
|
+
* Delete logic:
|
|
20
|
+
* - Clicking the close icon triggers `onDelete` with the full swatch object.
|
|
21
|
+
* - The click event is stopped from bubbling so that it does not interfere
|
|
22
|
+
* with parent click handlers.
|
|
23
|
+
*
|
|
24
|
+
* Accessibility:
|
|
25
|
+
* - The swatch container is focusable (`tabIndex={0}`) for keyboard navigation.
|
|
26
|
+
* - Enter/Space keys are prevented to avoid unintended actions.
|
|
27
|
+
* - ARIA label describes the content for screen readers.
|
|
28
|
+
*
|
|
29
|
+
* @component
|
|
30
|
+
*
|
|
31
|
+
* @param {ISwatchSelectedMaterial} val
|
|
32
|
+
* The selected material object containing metadata, image/hex info,
|
|
33
|
+
* and product/category names.
|
|
34
|
+
*
|
|
35
|
+
* @param {(arg: ISwatchSelectedMaterial) => void} onDelete
|
|
36
|
+
* Callback triggered when the user removes the swatch from the list.
|
|
37
|
+
*
|
|
38
|
+
* @returns {JSX.Element}
|
|
39
|
+
*/
|
|
40
|
+
declare const SwatchListItem: React.FC<ISwatchesListItemProps>;
|
|
41
|
+
export default SwatchListItem;
|
package/dist/cdn/src/features/MultiProduct/ui/SwatchesMultiProductList/SwatchesMultiProductList.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ISwatchSelectedMaterial } from '../../model/types';
|
|
2
|
+
interface ISwatchesListProps {
|
|
3
|
+
/**
|
|
4
|
+
* Optional wrapper classes for the outer container
|
|
5
|
+
* (padding, border, etc. – Tailwind / className string).
|
|
6
|
+
*/
|
|
7
|
+
containerStyles?: string;
|
|
8
|
+
/**
|
|
9
|
+
* List of currently selected swatch materials across products.
|
|
10
|
+
* Used to render the visual list and compute remaining free slots.
|
|
11
|
+
*/
|
|
12
|
+
selectedMaterials: ISwatchSelectedMaterial[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders the "Swatches list" section for the multi-product cart.
|
|
16
|
+
*
|
|
17
|
+
* Features:
|
|
18
|
+
* - Displays all selected swatches as tiles using `SwatchListItem`.
|
|
19
|
+
* - Allows removing a swatch across all products via `onDelete`.
|
|
20
|
+
* - Shows the current count and the `MAX_SLOTS` limit (with "Free" label).
|
|
21
|
+
* - Fills remaining slots with placeholder tiles (`MockTile`) for a
|
|
22
|
+
* consistent grid layout.
|
|
23
|
+
*
|
|
24
|
+
* Removal logic:
|
|
25
|
+
* - When the user deletes a swatch, finds which product currently owns it,
|
|
26
|
+
* removes that swatch from that product, and updates the multi-cart store.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SwatchesMultiProductList: ({ selectedMaterials, containerStyles, }: ISwatchesListProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class AttributeHelper {
|
|
2
|
+
static getImage(value: any): string | undefined;
|
|
3
|
+
static getValueLabel(attribute: any): any;
|
|
4
|
+
static getZoomIconColor(value: any): any;
|
|
5
|
+
static getHexColor(value: any): any;
|
|
6
|
+
static getAttributeLabel(attribute: any): any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IAttributeAsset, AttributeValue, IMaterialSelectState } from '../model/types';
|
|
2
|
+
import { INonZeroSelectedFilters, TAllValue, TFilterGroup } from '../utils/types';
|
|
3
|
+
export declare class SwatchesServices {
|
|
4
|
+
static getMaterialsValuesFromOptions(options: IAttributeAsset[]): AttributeValue[] | undefined;
|
|
5
|
+
static getUniqueByAssetId<T extends {
|
|
6
|
+
assetId: string;
|
|
7
|
+
}>(array: T[]): T[];
|
|
8
|
+
static normalizeToArray(input: string | string[] | null | undefined, splitByComma?: boolean): string[];
|
|
9
|
+
static mapFiltersFromValues(allValues: TAllValue[], selected: IMaterialSelectState): TFilterGroup[];
|
|
10
|
+
static getPositiveSelectedFilers(mappedData: TFilterGroup[]): INonZeroSelectedFilters[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RootState } from '../../../app/store/store';
|
|
2
|
+
export declare const getListAttributes: (state: RootState) => import('./types').IAttributeAsset[];
|
|
3
|
+
export declare const getAttributeByName: (optionName: string) => (state: RootState) => import('./types').IAttributeAsset | undefined;
|
|
4
|
+
export declare const getAllMaterialValues: (state: RootState) => import('./types').AttributeValue[];
|
|
5
|
+
export declare const getMaterialSelectStateFilters: (state: RootState) => import('./types').IMaterialSelectState;
|
|
6
|
+
export declare const getProductElementOptions: (state: RootState) => any[];
|
|
7
|
+
export declare const getSelectedMaterials: (state: RootState) => import('./types').AttributeValue[];
|
|
8
|
+
export declare const getIsLoadingSelectedProduct: (state: RootState) => boolean;
|
|
9
|
+
export declare const getIsOpenMultiCart: (state: RootState) => boolean;
|
|
10
|
+
export declare const getSelectedProduct: (state: RootState) => import('../../MultiProduct/model/types').IProductListItem | null;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { AttributeValue, IAttributeAsset, IMaterialSelectState, ISetFiltersPayload, ISwatchesSlice } from './types';
|
|
3
|
+
import { IMapUIData } from '../../DataAdapter/utils/types';
|
|
4
|
+
import { IProductListItem } from '../../MultiProduct/model/types';
|
|
5
|
+
export declare const swatchesSlice: import('@reduxjs/toolkit').Slice<ISwatchesSlice, {
|
|
6
|
+
setMaterialSelect(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<ISetFiltersPayload>): void;
|
|
7
|
+
setPanelFilter(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
8
|
+
attributes: IAttributeAsset[];
|
|
9
|
+
}>): void;
|
|
10
|
+
clearMaterialFilter: (state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<keyof IMaterialSelectState>) => void;
|
|
11
|
+
clearAllMaterialFilters: (state: import('immer').WritableDraft<ISwatchesSlice>) => void;
|
|
12
|
+
setAllMaterialsOptions: (state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<IMapUIData>) => void;
|
|
13
|
+
setSelectedMaterial(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
14
|
+
materialCount: number;
|
|
15
|
+
selectedMaterial: AttributeValue;
|
|
16
|
+
selectedMaterials: AttributeValue[];
|
|
17
|
+
limitCb?: () => void;
|
|
18
|
+
}>): void;
|
|
19
|
+
resetSelectedMaterials(state: import('immer').WritableDraft<ISwatchesSlice>): void;
|
|
20
|
+
setSelectedProduct(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<IProductListItem>): void;
|
|
21
|
+
deleteSelectedProduct(state: import('immer').WritableDraft<ISwatchesSlice>): void;
|
|
22
|
+
setIsOpenMultiProductCart(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<boolean>): void;
|
|
23
|
+
removeItem(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
24
|
+
selectedMaterial: AttributeValue;
|
|
25
|
+
}>): void;
|
|
26
|
+
increment(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
27
|
+
selectedMaterial: AttributeValue;
|
|
28
|
+
}>): void;
|
|
29
|
+
decrement(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
30
|
+
selectedMaterial: AttributeValue;
|
|
31
|
+
}>): void;
|
|
32
|
+
setCount(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
|
|
33
|
+
selectedMaterial: AttributeValue;
|
|
34
|
+
next: number;
|
|
35
|
+
}>): void;
|
|
36
|
+
}, "swatches", "swatches", import('@reduxjs/toolkit').SliceSelectors<ISwatchesSlice>>;
|
|
37
|
+
export declare const swatchesReducer: import('redux').Reducer<ISwatchesSlice>;
|
|
38
|
+
export declare const setMaterialSelect: import('@reduxjs/toolkit').ActionCreatorWithPayload<ISetFiltersPayload, "swatches/setMaterialSelect">, setAllMaterialsOptions: import('@reduxjs/toolkit').ActionCreatorWithPayload<IMapUIData, "swatches/setAllMaterialsOptions">, setPanelFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
39
|
+
attributes: IAttributeAsset[];
|
|
40
|
+
}, "swatches/setPanelFilter">, setSelectedMaterial: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
41
|
+
materialCount: number;
|
|
42
|
+
selectedMaterial: AttributeValue;
|
|
43
|
+
selectedMaterials: AttributeValue[];
|
|
44
|
+
limitCb?: () => void;
|
|
45
|
+
}, "swatches/setSelectedMaterial">, clearMaterialFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<keyof IMaterialSelectState, "swatches/clearMaterialFilter">, clearAllMaterialFilters: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/clearAllMaterialFilters">, setSelectedProduct: import('@reduxjs/toolkit').ActionCreatorWithPayload<IProductListItem, "swatches/setSelectedProduct">, deleteSelectedProduct: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/deleteSelectedProduct">, setIsOpenMultiProductCart: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "swatches/setIsOpenMultiProductCart">, resetSelectedMaterials: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/resetSelectedMaterials">, removeItem: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
46
|
+
selectedMaterial: AttributeValue;
|
|
47
|
+
}, "swatches/removeItem">, increment: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
48
|
+
selectedMaterial: AttributeValue;
|
|
49
|
+
}, "swatches/increment">, decrement: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
50
|
+
selectedMaterial: AttributeValue;
|
|
51
|
+
}, "swatches/decrement">, setCount: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
52
|
+
selectedMaterial: AttributeValue;
|
|
53
|
+
next: number;
|
|
54
|
+
}, "swatches/setCount">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IGetProductParameters } from '../../MultiProduct/model/types';
|
|
2
|
+
import { IFetchProductData } from '../../../shared/types/fetchData';
|
|
3
|
+
export declare const getSelectedProductThunk: import('@reduxjs/toolkit').AsyncThunk<IFetchProductData, IGetProductParameters, {
|
|
4
|
+
rejectValue: string;
|
|
5
|
+
state?: unknown;
|
|
6
|
+
dispatch?: import('redux-thunk').ThunkDispatch<unknown, unknown, import('redux').UnknownAction> | undefined;
|
|
7
|
+
extra?: unknown;
|
|
8
|
+
serializedErrorType?: unknown;
|
|
9
|
+
pendingMeta?: unknown;
|
|
10
|
+
fulfilledMeta?: unknown;
|
|
11
|
+
rejectedMeta?: unknown;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { IProductListItem } from '../../MultiProduct/model/types';
|
|
2
|
+
export interface IProduct {
|
|
3
|
+
attributes: AttributeValue[] | any[];
|
|
4
|
+
name: string;
|
|
5
|
+
productId: number;
|
|
6
|
+
categories: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ISwatchesSlice {
|
|
9
|
+
listAttributes: IAttributeAsset[];
|
|
10
|
+
productElementOptions: any[];
|
|
11
|
+
materialSelectState: IMaterialSelectState;
|
|
12
|
+
allMaterialsValues: AttributeValue[];
|
|
13
|
+
selectedMaterials: AttributeValue[];
|
|
14
|
+
selectedProduct: IProductListItem | null;
|
|
15
|
+
isLoadingSelectedProduct: boolean;
|
|
16
|
+
isOpenMultiProductCart: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IMaterialSelectState {
|
|
19
|
+
Finish: string[];
|
|
20
|
+
Color: string[];
|
|
21
|
+
Look: string[];
|
|
22
|
+
}
|
|
23
|
+
export type TFilterName = keyof IMaterialSelectState;
|
|
24
|
+
export interface ISetFiltersPayload {
|
|
25
|
+
filterName: keyof IMaterialSelectState;
|
|
26
|
+
values: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface IAttributeAsset {
|
|
29
|
+
assetType: string;
|
|
30
|
+
blacklist: unknown[];
|
|
31
|
+
defaultValue: {
|
|
32
|
+
assetId: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}[];
|
|
35
|
+
disabledValues: unknown[];
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
global: {
|
|
38
|
+
defaultValue: {
|
|
39
|
+
assetId: string;
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
id: string;
|
|
43
|
+
metadata: unknown[];
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
hiddenValues: unknown[];
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
metadata: {
|
|
51
|
+
[key: string]: string;
|
|
52
|
+
};
|
|
53
|
+
name: string;
|
|
54
|
+
type: string;
|
|
55
|
+
value: {
|
|
56
|
+
assetId: string;
|
|
57
|
+
configuration: unknown;
|
|
58
|
+
metadata: {
|
|
59
|
+
[key: string]: string;
|
|
60
|
+
};
|
|
61
|
+
name: string;
|
|
62
|
+
tags: string[];
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
values: IAttributeAssetValues[];
|
|
66
|
+
visible: boolean;
|
|
67
|
+
valuesArray?: IMaterialMetadata[];
|
|
68
|
+
option?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface IAttributeAssetValues {
|
|
71
|
+
assetId: string;
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
fileSize: number;
|
|
74
|
+
handleSelect: () => unknown;
|
|
75
|
+
label: string;
|
|
76
|
+
metadata: {
|
|
77
|
+
[key: string]: string;
|
|
78
|
+
};
|
|
79
|
+
name: string;
|
|
80
|
+
selected: boolean;
|
|
81
|
+
tagids: string[];
|
|
82
|
+
tags: string[];
|
|
83
|
+
type: string;
|
|
84
|
+
visible: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface IValueItem {
|
|
87
|
+
value: string;
|
|
88
|
+
label: string;
|
|
89
|
+
additionalFilter?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface IOption {
|
|
92
|
+
option: string;
|
|
93
|
+
label: string;
|
|
94
|
+
optionName: string;
|
|
95
|
+
order: string;
|
|
96
|
+
type: string;
|
|
97
|
+
typeComponent: string;
|
|
98
|
+
values?: Record<string, string>;
|
|
99
|
+
valuesArray?: IValueItem[];
|
|
100
|
+
}
|
|
101
|
+
export interface IGroup {
|
|
102
|
+
groupName: string;
|
|
103
|
+
order: string;
|
|
104
|
+
type: string;
|
|
105
|
+
options: IOption[];
|
|
106
|
+
}
|
|
107
|
+
export interface ISection {
|
|
108
|
+
section: string;
|
|
109
|
+
sort: string;
|
|
110
|
+
groups: IGroup[];
|
|
111
|
+
enabledCTA: boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare const ETypeComponent: {
|
|
114
|
+
readonly MATERIAL: "material";
|
|
115
|
+
readonly FILTRATION: "filtration";
|
|
116
|
+
readonly LIST: "list";
|
|
117
|
+
readonly IMAGE: "image";
|
|
118
|
+
readonly COMBINED: "combined";
|
|
119
|
+
};
|
|
120
|
+
export type ETypeComponent = (typeof ETypeComponent)[keyof typeof ETypeComponent];
|
|
121
|
+
export interface AttributeValue {
|
|
122
|
+
count: number;
|
|
123
|
+
assetId?: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
tags?: string[];
|
|
126
|
+
metadata?: IMaterialMetadata;
|
|
127
|
+
parentName: string;
|
|
128
|
+
fileSize?: number;
|
|
129
|
+
tagids?: string[];
|
|
130
|
+
type?: 'item' | string;
|
|
131
|
+
label: string;
|
|
132
|
+
visible?: boolean;
|
|
133
|
+
enabled?: boolean;
|
|
134
|
+
option?: string;
|
|
135
|
+
optionName?: string;
|
|
136
|
+
valuesArray?: IMaterialMetadata[];
|
|
137
|
+
value?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface IMaterialMetadata {
|
|
140
|
+
Look?: string;
|
|
141
|
+
Color?: string;
|
|
142
|
+
image?: string;
|
|
143
|
+
label?: string;
|
|
144
|
+
value?: string;
|
|
145
|
+
Material?: string;
|
|
146
|
+
zoomIconColor?: string;
|
|
147
|
+
[key: string]: string | undefined;
|
|
148
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ColorsFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LooksFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MaterialsFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Filters: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/cdn/src/features/swatches/ui/MaterialSingleProductList/MaterialSingleProductList.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface IMaterialListProps {
|
|
2
|
+
containerStyles?: string;
|
|
3
|
+
gridStyles?: string;
|
|
4
|
+
desktopColumnsCount?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const MaterialSingleProductList: ({ containerStyles, gridStyles, desktopColumnsCount, }: IMaterialListProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EActiveTab } from '../../../../shared/types/activeTab';
|
|
2
|
+
interface ISidebarWrapperProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onSetActiveTab: (activeTab: EActiveTab) => void;
|
|
5
|
+
onToggleSidebar: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SwatchWrapper: ({ isOpen, onToggleSidebar, onSetActiveTab, }: ISidebarWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AttributeValue } from '../../model/types';
|
|
2
|
+
interface ISwatchesListProps {
|
|
3
|
+
containerStyles?: string;
|
|
4
|
+
selectedMaterials: AttributeValue[];
|
|
5
|
+
}
|
|
6
|
+
export declare const SwatchesList: ({ selectedMaterials, containerStyles, }: ISwatchesListProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SwatchesSingleProductListWrapper: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TFilterName } from '../model/types';
|
|
2
|
+
export type TValueKey = 'Material' | 'Color' | 'Look';
|
|
3
|
+
export type TValueEntry = {
|
|
4
|
+
metadata?: Partial<Record<TValueKey, string | string[] | null | undefined>>;
|
|
5
|
+
};
|
|
6
|
+
export type TFilterItem = {
|
|
7
|
+
filterKey: string;
|
|
8
|
+
filterCount: number;
|
|
9
|
+
};
|
|
10
|
+
export type TFilterGroup = {
|
|
11
|
+
filterType: TFilterName;
|
|
12
|
+
filters: TFilterItem[];
|
|
13
|
+
};
|
|
14
|
+
export interface INonZeroSelectedFilters {
|
|
15
|
+
filterName: TFilterName;
|
|
16
|
+
filterKeys: string[];
|
|
17
|
+
}
|
|
18
|
+
export type TAllValue = {
|
|
19
|
+
assetId: string;
|
|
20
|
+
name: string;
|
|
21
|
+
values?: TValueEntry[] | null;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MATERIAL_PRICE = 6.5;
|