@ikas/storefront 0.0.48 → 0.0.50

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.
@@ -1,11 +1,13 @@
1
1
  import { IkasImage } from "../image/index";
2
2
  import { IkasHTMLMetaData } from "../html-meta-data/index";
3
+ import { ISimpleCategoryPath } from "../simple-product/index";
3
4
  export declare class IkasCategory {
4
5
  id: string;
5
6
  name: string;
6
7
  parentId: string | null;
7
8
  metaData?: IkasHTMLMetaData | null;
8
9
  image?: IkasImage | null;
10
+ path: ISimpleCategoryPath[];
9
11
  constructor(data: Partial<IkasCategory>);
10
12
  get href(): string;
11
13
  }
@@ -19,6 +19,7 @@ export { IkasProductVariant } from "./product/variant/index";
19
19
  export { IkasProductPrice } from "./product/variant/price/index";
20
20
  export { IkasProductAttribute } from "./product-attribute/index";
21
21
  export { IkasProductAttributeValue } from "./product/attribute-value/index";
22
+ export * from "./product-filter/index";
22
23
  export type { IkasState } from "./state/index";
23
24
  export * from "./variant-type/index";
24
25
  export { IkasVariantValue } from "./variant-type/variant-value/index";
@@ -1,6 +1,10 @@
1
+ import { IkasProductAttribute } from "../../product-attribute/index";
2
+ import IkasProductAttributeOption from "../../product-attribute/product-attribute-option/index";
1
3
  export declare class IkasProductAttributeValue {
2
- value: string | null;
4
+ value: any;
3
5
  productAttributeId: string | null;
4
6
  productAttributeOptionId: string | null;
7
+ productAttribute?: IkasProductAttribute | null;
8
+ productAttributeOption?: IkasProductAttributeOption | null;
5
9
  constructor(data: Partial<IkasProductAttributeValue>);
6
10
  }
@@ -3,7 +3,7 @@ export declare class IkasProductAttribute {
3
3
  id: string;
4
4
  name: string;
5
5
  type: IkasProductAttributeType;
6
- options: IkasProductAttributeOption[] | null;
6
+ options?: IkasProductAttributeOption[] | null;
7
7
  constructor(data: Partial<IkasProductAttribute>);
8
8
  }
9
9
  export declare enum IkasProductAttributeType {
@@ -0,0 +1,72 @@
1
+ import { SearchInputFilterListInput } from "../../../__generated__/global-types";
2
+ import { IkasImage } from "../image/index";
3
+ export declare class IkasProductFilter {
4
+ id: string;
5
+ key: string;
6
+ name: string;
7
+ order: number;
8
+ type: IkasProductFilterType;
9
+ displayType: IkasProductFilterDisplayType;
10
+ isMultiSelect: boolean;
11
+ values?: IkasApplicableProductFilterValue[] | null;
12
+ customValues?: string[] | null;
13
+ numberRange?: RangeValue | null;
14
+ numberRangeLimit?: RangeValue | null;
15
+ numberRangeListOptions?: NumberRangeListOption[] | null;
16
+ constructor(data?: Partial<IkasProductFilter>);
17
+ get isCustomValueFilter(): boolean;
18
+ get valueList(): string[];
19
+ get keyList(): string[];
20
+ clear(): void;
21
+ toInput(): SearchInputFilterListInput;
22
+ private rangeToId;
23
+ }
24
+ export declare class IkasApplicableProductFilterValue {
25
+ id: string;
26
+ key: string;
27
+ name: string;
28
+ colorCode?: string | null;
29
+ thumbnailImageId?: string | null;
30
+ thumbnailImage?: IkasImage | null;
31
+ private _isSelected?;
32
+ constructor(data?: Partial<IkasApplicableProductFilterValue>);
33
+ get isSelected(): boolean | undefined;
34
+ set isSelected(value: boolean | undefined);
35
+ }
36
+ export declare class IkasProductFilterValue {
37
+ id: string;
38
+ type: IkasProductFilterType;
39
+ valueList: string[];
40
+ constructor(data: IkasProductFilterValue);
41
+ }
42
+ export declare enum IkasProductFilterType {
43
+ ATTRIBUTE = "ATTRIBUTE",
44
+ BRAND = "BRAND",
45
+ DISCOUNT_RATIO = "DISCOUNT_RATIO",
46
+ PRICE = "PRICE",
47
+ STOCK_STATUS = "STOCK_STATUS",
48
+ TAG = "TAG",
49
+ VARIANT_TYPE = "VARIANT_TYPE"
50
+ }
51
+ export declare enum IkasProductFilterDisplayType {
52
+ BOX = "BOX",
53
+ DATE_RANGE = "DATE_RANGE",
54
+ LIST = "LIST",
55
+ NUMBER_RANGE_LIST = "NUMBER_RANGE_LIST",
56
+ NUMBER_RANGE = "NUMBER_RANGE",
57
+ SWATCH = "SWATCH"
58
+ }
59
+ export declare class RangeValue {
60
+ from: number;
61
+ to: number | undefined | null;
62
+ constructor(data: Partial<NumberRangeListOption>);
63
+ }
64
+ declare class NumberRangeListOption {
65
+ from: number;
66
+ to: number | undefined | null;
67
+ key: string;
68
+ isSelected: boolean;
69
+ constructor(data: Partial<NumberRangeListOption>);
70
+ }
71
+ export declare function parseRangeStr(rangeStr: string): RangeValue;
72
+ export {};
@@ -0,0 +1,134 @@
1
+ import { ProductAttributeTypeEnum, ProductTypeEnum, VariantSelectionTypeEnum } from "../../../__generated__/global-types";
2
+ export interface ISimpleProduct {
3
+ id: string;
4
+ createdAt?: Date;
5
+ updatedAt?: Date;
6
+ deleted: boolean;
7
+ name: string;
8
+ shortDescription?: string | null;
9
+ description?: string | null;
10
+ taxValue?: number | null;
11
+ weight?: number | null;
12
+ type: ProductTypeEnum;
13
+ productVariantTypes: ISimpleProductVariantType[];
14
+ categories?: ISimpleCategory[] | null;
15
+ variants: ISimpleVariant[];
16
+ attributes?: ISimpleProductAttributeValue[] | null;
17
+ tags?: ISimpleProductTag[] | null;
18
+ brand?: ISimpleProductBrand | null;
19
+ metaData?: ISimpleHTMLMetaData | null;
20
+ }
21
+ export interface ISimpleVariantType {
22
+ id: string;
23
+ name: string;
24
+ selectionType: VariantSelectionTypeEnum;
25
+ values: ISimpleVariantValue[];
26
+ }
27
+ export interface ISimpleProductVariantType {
28
+ order: number;
29
+ variantType: ISimpleVariantType;
30
+ variantValueIds: string[];
31
+ }
32
+ export interface ISimpleVariant {
33
+ id: string;
34
+ deleted: boolean;
35
+ sku?: string | null;
36
+ barcodeList?: string[] | null;
37
+ weight?: number | null;
38
+ isActive: boolean;
39
+ variantValues?: ISimpleVariationValueRelation[] | null;
40
+ attributes?: ISimpleProductAttributeValue[] | null;
41
+ images?: ISimpleProductImage[] | null;
42
+ prices?: ISimpleProductPrice[];
43
+ stocks: ISimpleProductStockLocation[];
44
+ }
45
+ export interface ISimpleProductPrice {
46
+ sellPrice: number;
47
+ discountPrice: number | null;
48
+ buyPrice: number | null;
49
+ currency: string | null;
50
+ priceListId?: string | null;
51
+ }
52
+ export interface ISimpleProductImage {
53
+ order: number;
54
+ isMain: boolean;
55
+ id: string;
56
+ }
57
+ export interface ISimpleVariationValueRelation {
58
+ variantTypeId: string;
59
+ variantValueId: string;
60
+ }
61
+ export interface ISimpleVariantValue {
62
+ id: string;
63
+ name: string;
64
+ thumbnailImageId?: string | null;
65
+ colorCode?: string;
66
+ }
67
+ export interface ISimpleProductAttributeOption {
68
+ id: string;
69
+ name: string;
70
+ }
71
+ export interface ISimpleProductAttribute {
72
+ id: string;
73
+ name: string;
74
+ type: ProductAttributeTypeEnum;
75
+ }
76
+ export interface ISimpleProductAttributeValue {
77
+ value?: string | number | Date | boolean | null;
78
+ productAttribute?: ISimpleProductAttribute | null;
79
+ productAttributeOption?: ISimpleProductAttributeOption | null;
80
+ }
81
+ export interface ISimpleHTMLMetaData {
82
+ slug: string;
83
+ pageTitle?: string | null;
84
+ description?: string | null;
85
+ redirectTo?: string | null;
86
+ metadataOverrides?: ISimpleHTMLMetaDataOverride[] | null;
87
+ }
88
+ export interface ISimpleHTMLMetaDataOverride {
89
+ pageTitle: string;
90
+ description: string;
91
+ language?: string | null;
92
+ storefrontId?: string | null;
93
+ storefrontRegionId?: string | null;
94
+ }
95
+ export interface ISimpleCategoryPath {
96
+ id: string;
97
+ name: string;
98
+ slug?: string | null;
99
+ }
100
+ export interface ISimpleCategory {
101
+ id: string;
102
+ name: string;
103
+ path: ISimpleCategoryPath[];
104
+ slug?: string | null;
105
+ }
106
+ export interface ISimpleProductTag {
107
+ id: string;
108
+ name: string;
109
+ }
110
+ export interface ISimpleProductBrand {
111
+ id: string;
112
+ name: string;
113
+ slug?: string | null;
114
+ }
115
+ export interface ISimpleProductStockLocation {
116
+ stockCount: number;
117
+ stockLocationId: string;
118
+ }
119
+ export declare class FilterStockStatusId {
120
+ static IN_STOCK: string;
121
+ static OUT_OF_STOCK: string;
122
+ static ALL_LIST: string[];
123
+ }
124
+ export declare class FilterBooleanId {
125
+ static TRUE: string;
126
+ static FALSE: string;
127
+ }
128
+ export declare const PRODUCT_FILTER: {
129
+ STOCK_STATUS: string;
130
+ DISCOUNT_RATIO: string;
131
+ PRICE: string;
132
+ TAG: string;
133
+ BRAND: string;
134
+ };
@@ -3,7 +3,7 @@ export declare class IkasVariantValue {
3
3
  id: string;
4
4
  name: string;
5
5
  colorCode: string | null;
6
- thumbnilImageId: string | null;
6
+ thumbnailImageId: string | null;
7
7
  variantTypeId: string;
8
8
  constructor(data: Partial<IkasVariantValue>);
9
9
  get slug(): string;
@@ -4,7 +4,6 @@ export type { IkasBrandListParams } from "./brand-list/index";
4
4
  export { IkasNavigationLink } from "./navigation-link/index";
5
5
  export { IkasProductDetail } from "./product-detail/index";
6
6
  export { IkasProductList, IkasProductListType, IkasProductListSortType, } from "./product-list/index";
7
- export { IkasProductListFilter } from "./product-list/filter";
8
7
  export { Validator, ValidationStatus } from "./validator/index";
9
8
  export * from "./validator/rules/index";
10
9
  export { LoginForm } from "./validator/form/login";
@@ -1,36 +1,51 @@
1
1
  import { IkasProductListPropValue } from "../../theme/index";
2
2
  import { IkasProductDetail } from "../product-detail/index";
3
- import { IkasProductListFilter } from "./filter";
3
+ import { IkasProductFilter } from "../../data/product-filter/index";
4
+ import { NextRouter } from "next/router";
4
5
  export declare class IkasProductList {
5
6
  data: IkasProductDetail[];
7
+ filters?: IkasProductFilter[] | null;
6
8
  private _type;
7
9
  private _sort;
8
10
  private _limit;
9
11
  private _page;
10
12
  private _count;
13
+ private _searchKeyword;
11
14
  private _initialized;
12
15
  private _minPage?;
13
16
  private _productListPropValue;
14
- private _filters?;
17
+ private _filterBrandId?;
18
+ private _filterCategoryId?;
15
19
  private _recommendFor?;
16
20
  private _isLoading;
17
- constructor(data: IkasProductListParams);
21
+ private _fetchRequestTime;
22
+ private router?;
23
+ constructor(data: IkasProductListParams, router?: NextRouter);
18
24
  get sort(): IkasProductListSortType;
19
25
  get limit(): number;
20
26
  get page(): number;
21
27
  get count(): number;
28
+ get searchKeyword(): string;
29
+ set searchKeyword(value: string);
22
30
  get isInitialized(): boolean;
31
+ get isFilterable(): boolean;
32
+ get isFiltered(): boolean | undefined;
23
33
  get isStatic(): boolean;
24
34
  get isDiscounted(): boolean;
25
35
  get isRecommended(): boolean;
26
36
  get hasPrev(): boolean;
27
37
  get hasNext(): boolean;
28
38
  get isLoading(): boolean;
29
- getInitial: () => Promise<void>;
39
+ get filterQueryParams(): string;
40
+ private searchProducts;
41
+ clear(): void;
42
+ private getFilters;
43
+ private applyQueryParamFilters;
44
+ applyFilters: () => Promise<void>;
45
+ getInitial: (queryParams?: URLSearchParams | undefined) => Promise<void>;
30
46
  getPrev: () => Promise<void>;
31
47
  getNext: () => Promise<void>;
32
48
  getPage: (page: number) => Promise<void>;
33
- applyFilters(): void;
34
49
  toJSON(): {
35
50
  data: IkasProductDetail[];
36
51
  type: IkasProductListType;
@@ -38,12 +53,17 @@ export declare class IkasProductList {
38
53
  limit: number;
39
54
  page: number;
40
55
  count: number;
56
+ searchKeyword: string;
41
57
  initialized: boolean;
42
58
  minPage: number | null | undefined;
43
- filters: IkasProductListFilter | null | undefined;
59
+ pageBrandId: string | null | undefined;
60
+ pageCategoryId: string | null | undefined;
61
+ filters: IkasProductFilter[] | null | undefined;
44
62
  recommendFor: string | null | undefined;
45
63
  productListPropValue: IkasProductListPropValue;
46
64
  };
65
+ private getQueryParams;
66
+ private isBrowser;
47
67
  }
48
68
  export declare type IkasProductListParams = {
49
69
  data?: IkasProductDetail[];
@@ -52,9 +72,12 @@ export declare type IkasProductListParams = {
52
72
  limit?: number;
53
73
  page?: number;
54
74
  count?: number;
75
+ searchKeyword?: string;
55
76
  initialized?: boolean;
56
77
  minPage?: number;
57
- filters?: IkasProductListFilter;
78
+ filterBrandId?: string;
79
+ filterCategoryId?: string;
80
+ filters?: IkasProductFilter[];
58
81
  recommendFor?: string;
59
82
  productListPropValue: IkasProductListPropValue;
60
83
  };
@@ -39,8 +39,8 @@ export declare class IkasPageDataProvider {
39
39
  static _initCategoryPropValue(propValue: IkasCategory): IkasCategory;
40
40
  static initCategoryListPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
41
41
  static _initCategoryListPropValue(propValue: IkasCategoryListParams): IkasCategoryList;
42
- static initProductListPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
43
- static _initProductListPropValue(propValue: IkasProductListParams): IkasProductList;
42
+ static initProductListPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue, router: NextRouter): void;
43
+ static _initProductListPropValue(propValue: IkasProductListParams, router: NextRouter): IkasProductList;
44
44
  static initProductDetailPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue, router: NextRouter, isBrowser?: boolean): void;
45
45
  static _initProductDetailPropValue(propValue: any, router: NextRouter, isBrowser?: boolean): IkasProductDetail;
46
46
  static initLinkPropValue(prop: IkasThemeComponentProp, propValue: any, pageComponentPropValue: IkasPageComponentPropValue): void;
@@ -1,8 +1,8 @@
1
1
  import { IkasProductDetail, IkasProductDetailPropValue } from "../../../models/index";
2
2
  import IkasPropValueProvider from "./index";
3
- export declare class IkasProductDetailPropValueProvider implements IkasPropValueProvider<IkasProductDetail> {
3
+ export declare class IkasProductDetailPropValueProvider implements IkasPropValueProvider<IkasProductDetail | null> {
4
4
  private productDetailPropValue;
5
5
  private pageSpecificData?;
6
6
  constructor(prop: IkasProductDetailPropValue, pageSpecificData?: any);
7
- getValue(): Promise<IkasProductDetail>;
7
+ getValue(): Promise<IkasProductDetail | null>;
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.48",
3
+ "version": "0.0.50",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",
@@ -1,18 +0,0 @@
1
- export declare class IkasProductListFilter {
2
- category?: string | null;
3
- brand?: string | null;
4
- categories: string[];
5
- brands: string[];
6
- variantValues: VariantValueFilter[];
7
- attributes: AttributeFilter[];
8
- constructor(data?: Partial<IkasProductListFilter>);
9
- }
10
- declare type VariantValueFilter = {
11
- variantType: string;
12
- values: string[];
13
- };
14
- declare type AttributeFilter = {
15
- attribute: string;
16
- values: string[];
17
- };
18
- export {};