ingeniuscliq-core 0.5.22 → 0.5.25
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/classes/CoreBaseBuilder.d.ts +26 -0
- package/dist/classes/CoreBaseBuilder.d.ts.map +1 -1
- package/dist/classes/CoreBaseBuilder.js +15 -3
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts +9 -9
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts.map +1 -1
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +9 -9
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts.map +1 -1
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts +9 -9
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts.map +1 -1
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +9 -9
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts.map +1 -1
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +9 -9
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +9 -9
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +4 -1
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +9 -19
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +15 -12
- package/package.json +1 -1
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { CoreBuilder } from './CoreBuilder';
|
|
2
|
+
/**
|
|
3
|
+
* Extension options for configuring builder behavior
|
|
4
|
+
*/
|
|
5
|
+
export interface CoreBuilderExtensions<TStore> {
|
|
6
|
+
/**
|
|
7
|
+
* Additional initial state properties
|
|
8
|
+
*/
|
|
9
|
+
initialState?: Partial<TStore>;
|
|
10
|
+
/**
|
|
11
|
+
* Additional actions/methods for the store
|
|
12
|
+
*/
|
|
13
|
+
actions?: (set: any, get: any) => Partial<TStore>;
|
|
14
|
+
/**
|
|
15
|
+
* Additional properties to persist in storage
|
|
16
|
+
*/
|
|
17
|
+
partialize?: (state: TStore) => Record<string, any>;
|
|
18
|
+
}
|
|
2
19
|
/**
|
|
3
20
|
* Base builder class with extensibility hooks
|
|
4
21
|
* Provides a pattern for extending store state and actions without duplicating code
|
|
5
22
|
* @template TStore - The type of the store state that will be built
|
|
6
23
|
*/
|
|
7
24
|
export declare abstract class CoreBaseBuilder<TStore> implements CoreBuilder {
|
|
25
|
+
protected extensions: CoreBuilderExtensions<TStore>;
|
|
8
26
|
abstract build(): any;
|
|
9
27
|
/**
|
|
10
28
|
* Hook method to get the base store state
|
|
@@ -14,9 +32,15 @@ export declare abstract class CoreBaseBuilder<TStore> implements CoreBuilder {
|
|
|
14
32
|
* @returns Object with base state and actions
|
|
15
33
|
*/
|
|
16
34
|
protected abstract getBaseState(set: any, get: any): TStore;
|
|
35
|
+
/**
|
|
36
|
+
* Set extension options for the builder
|
|
37
|
+
* @param extensions - Extension configuration object
|
|
38
|
+
*/
|
|
39
|
+
setExtensions(extensions: CoreBuilderExtensions<TStore>): this;
|
|
17
40
|
/**
|
|
18
41
|
* Hook method to allow extending initial state
|
|
19
42
|
* Override this in child classes to add custom properties to the store state
|
|
43
|
+
* Combines properties from child class implementation with runtime extensions
|
|
20
44
|
* @returns Object with additional state properties
|
|
21
45
|
* @example
|
|
22
46
|
* protected extendInitialState() {
|
|
@@ -30,6 +54,7 @@ export declare abstract class CoreBaseBuilder<TStore> implements CoreBuilder {
|
|
|
30
54
|
/**
|
|
31
55
|
* Hook method to allow extending store actions
|
|
32
56
|
* Override this in child classes to add custom methods to the store
|
|
57
|
+
* Combines actions from child class implementation with runtime extensions
|
|
33
58
|
* @param set - Zustand set function
|
|
34
59
|
* @param get - Zustand get function
|
|
35
60
|
* @returns Object with additional actions/methods
|
|
@@ -45,6 +70,7 @@ export declare abstract class CoreBaseBuilder<TStore> implements CoreBuilder {
|
|
|
45
70
|
/**
|
|
46
71
|
* Hook method to allow extending partialize storage
|
|
47
72
|
* Override this in child classes to persist custom properties
|
|
73
|
+
* Combines partialize config from child class implementation with runtime extensions
|
|
48
74
|
* @param state - Current store state
|
|
49
75
|
* @returns Object with properties to persist
|
|
50
76
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreBaseBuilder.d.ts","sourceRoot":"","sources":["../../src/classes/CoreBaseBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,8BAAsB,eAAe,CAAC,MAAM,CAAE,YAAW,WAAW;IAChE,QAAQ,CAAC,KAAK,IAAI,GAAG;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAE3D
|
|
1
|
+
{"version":3,"file":"CoreBaseBuilder.d.ts","sourceRoot":"","sources":["../../src/classes/CoreBaseBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IACzC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAElD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACvD;AAED;;;;GAIG;AACH,8BAAsB,eAAe,CAAC,MAAM,CAAE,YAAW,WAAW;IAChE,SAAS,CAAC,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAM;IAEzD,QAAQ,CAAC,KAAK,IAAI,GAAG;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAE3D;;;OAGG;IACI,aAAa,CAAC,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,IAAI;IAKrE;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/C;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5D;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI9D;;;;;;OAMG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;CAOxD"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
class CoreBaseBuilder {
|
|
2
|
+
extensions = {};
|
|
3
|
+
/**
|
|
4
|
+
* Set extension options for the builder
|
|
5
|
+
* @param extensions - Extension configuration object
|
|
6
|
+
*/
|
|
7
|
+
setExtensions(extensions) {
|
|
8
|
+
this.extensions = { ...this.extensions, ...extensions };
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
2
11
|
/**
|
|
3
12
|
* Hook method to allow extending initial state
|
|
4
13
|
* Override this in child classes to add custom properties to the store state
|
|
14
|
+
* Combines properties from child class implementation with runtime extensions
|
|
5
15
|
* @returns Object with additional state properties
|
|
6
16
|
* @example
|
|
7
17
|
* protected extendInitialState() {
|
|
@@ -12,11 +22,12 @@ class CoreBaseBuilder {
|
|
|
12
22
|
* }
|
|
13
23
|
*/
|
|
14
24
|
extendInitialState() {
|
|
15
|
-
return {};
|
|
25
|
+
return { ...this.extensions.initialState };
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* Hook method to allow extending store actions
|
|
19
29
|
* Override this in child classes to add custom methods to the store
|
|
30
|
+
* Combines actions from child class implementation with runtime extensions
|
|
20
31
|
* @param set - Zustand set function
|
|
21
32
|
* @param get - Zustand get function
|
|
22
33
|
* @returns Object with additional actions/methods
|
|
@@ -29,11 +40,12 @@ class CoreBaseBuilder {
|
|
|
29
40
|
* }
|
|
30
41
|
*/
|
|
31
42
|
extendActions(set, get) {
|
|
32
|
-
return {};
|
|
43
|
+
return { ...this.extensions.actions?.(set, get) };
|
|
33
44
|
}
|
|
34
45
|
/**
|
|
35
46
|
* Hook method to allow extending partialize storage
|
|
36
47
|
* Override this in child classes to persist custom properties
|
|
48
|
+
* Combines partialize config from child class implementation with runtime extensions
|
|
37
49
|
* @param state - Current store state
|
|
38
50
|
* @returns Object with properties to persist
|
|
39
51
|
* @example
|
|
@@ -44,7 +56,7 @@ class CoreBaseBuilder {
|
|
|
44
56
|
* }
|
|
45
57
|
*/
|
|
46
58
|
extendPartialize(state) {
|
|
47
|
-
return {};
|
|
59
|
+
return { ...this.extensions.partialize?.(state) };
|
|
48
60
|
}
|
|
49
61
|
/**
|
|
50
62
|
* Combines base state with extended state and actions
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { CoreAuthBaseService } from '../services/base';
|
|
2
2
|
import { CoreUser, CoreAuthStore } from '../types/CoreAuth';
|
|
3
3
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
4
|
-
export declare class CoreAuthBuilder<T extends CoreUser
|
|
4
|
+
export declare class CoreAuthBuilder<T extends CoreUser, TStore extends CoreAuthStore<T> = CoreAuthStore<T>> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected authService: CoreAuthBaseService<T>;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(authService?: CoreAuthBaseService<T>, initialState?: Partial<
|
|
8
|
-
protected getBaseState(set: any, get: any):
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
6
|
+
protected initialState: Pick<TStore, "user" | "isAuthenticated" | "loading" | "error">;
|
|
7
|
+
constructor(authService?: CoreAuthBaseService<T>, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
12
12
|
user: T;
|
|
13
13
|
isAuthenticated: boolean;
|
|
14
14
|
}>>) => void;
|
|
15
15
|
clearStorage: () => void;
|
|
16
16
|
rehydrate: () => Promise<void> | void;
|
|
17
17
|
hasHydrated: () => boolean;
|
|
18
|
-
onHydrate: (fn: (state:
|
|
19
|
-
onFinishHydration: (fn: (state:
|
|
20
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
18
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
19
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
20
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
21
21
|
user: T;
|
|
22
22
|
isAuthenticated: boolean;
|
|
23
23
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreAuthBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/classes/CoreAuthBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAiD,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,eAAe,CAAC,CAAC,SAAS,QAAQ,
|
|
1
|
+
{"version":3,"file":"CoreAuthBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreAuth/classes/CoreAuthBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAiD,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,eAAe,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAClI,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,YAAY,EAKjB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGlE,WAAW,GAAE,mBAAmB,CAAC,CAAC,CAAgC,EAClE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IA8K3C,KAAK;;;;;;;;;;;;;;;;;CAeb"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CoreCustomizationBaseService } from '../services/base';
|
|
2
2
|
import { CoreCustomizationStore } from '../types/CoreCustomization';
|
|
3
3
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
4
|
-
export declare class CoreCustomizationBuilder extends CoreBaseBuilder<
|
|
4
|
+
export declare class CoreCustomizationBuilder<TStore extends CoreCustomizationStore = CoreCustomizationStore> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected customizationService: CoreCustomizationBaseService;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(service?: CoreCustomizationBaseService, initialState?: Partial<
|
|
8
|
-
protected getBaseState(set: any, _get: any):
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
6
|
+
protected initialState: Pick<TStore, "template" | "components" | "styles" | "settings" | "loading" | "error">;
|
|
7
|
+
constructor(service?: CoreCustomizationBaseService, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, _get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
12
12
|
template: string;
|
|
13
13
|
components: {
|
|
14
14
|
key: string;
|
|
@@ -20,9 +20,9 @@ export declare class CoreCustomizationBuilder extends CoreBaseBuilder<CoreCustom
|
|
|
20
20
|
clearStorage: () => void;
|
|
21
21
|
rehydrate: () => Promise<void> | void;
|
|
22
22
|
hasHydrated: () => boolean;
|
|
23
|
-
onHydrate: (fn: (state:
|
|
24
|
-
onFinishHydration: (fn: (state:
|
|
25
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
23
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
24
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
25
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
26
26
|
template: string;
|
|
27
27
|
components: {
|
|
28
28
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCustomizationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreCustomization/classes/CoreCustomizationBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,
|
|
1
|
+
{"version":3,"file":"CoreCustomizationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreCustomization/classes/CoreCustomizationBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,wBAAwB,CACnC,MAAM,SAAS,sBAAsB,GAAG,sBAAsB,CAC9D,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;IAC7D,SAAS,CAAC,YAAY,EAOjB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGzF,OAAO,GAAE,4BAAiE,EAC1E,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM;IA4E5C,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBb"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { CoreOrderBaseService } from '../services/base';
|
|
2
2
|
import { CoreOrder, CoreOrderStore } from '../types/CoreOrder';
|
|
3
3
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
4
|
-
export declare class CoreOrderBuilder<T
|
|
4
|
+
export declare class CoreOrderBuilder<T, TStore extends CoreOrderStore<T> = CoreOrderStore<T>> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected orderService: CoreOrderBaseService;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(orderService?: CoreOrderBaseService, initialState?: Partial<
|
|
8
|
-
protected getBaseState(set: any, get: any):
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
6
|
+
protected initialState: Pick<TStore, "orderDetails" | "orders" | "loading" | "error">;
|
|
7
|
+
constructor(orderService?: CoreOrderBaseService, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
12
12
|
orderDetails: CoreOrder<T>;
|
|
13
13
|
}>>) => void;
|
|
14
14
|
clearStorage: () => void;
|
|
15
15
|
rehydrate: () => Promise<void> | void;
|
|
16
16
|
hasHydrated: () => boolean;
|
|
17
|
-
onHydrate: (fn: (state:
|
|
18
|
-
onFinishHydration: (fn: (state:
|
|
19
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
17
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
18
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
19
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
20
20
|
orderDetails: CoreOrder<T>;
|
|
21
21
|
}>>;
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreOrderBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreOrder/classes/CoreOrderBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,gBAAgB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"CoreOrderBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreOrder/classes/CoreOrderBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,gBAAgB,CAAC,CAAC,EAAE,MAAM,SAAS,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IACpH,SAAS,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC7C,SAAS,CAAC,YAAY,EAKjB,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGjE,YAAY,GAAE,oBAAiD,EAC/D,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IA0G3C,KAAK;;;;;;;;;;;;;;;CAcb"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { CorePayFormBaseService } from '../services/base';
|
|
2
2
|
import { CorePayForm, CorePayFormStore } from '../types/CorePayForm';
|
|
3
3
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
4
|
-
export declare class CorePayFormBuilder<T extends CorePayForm = CorePayForm
|
|
4
|
+
export declare class CorePayFormBuilder<T extends CorePayForm = CorePayForm, TStore extends CorePayFormStore<T> = CorePayFormStore<T>> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected payFormService: CorePayFormBaseService;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(service?: CorePayFormBaseService, initialState?: Partial<
|
|
8
|
-
protected getBaseState(set: any, get: any):
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
6
|
+
protected initialState: Pick<TStore, "payForms" | "loading" | "error">;
|
|
7
|
+
constructor(service?: CorePayFormBaseService, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
12
12
|
payForms: T[];
|
|
13
13
|
}>>) => void;
|
|
14
14
|
clearStorage: () => void;
|
|
15
15
|
rehydrate: () => Promise<void> | void;
|
|
16
16
|
hasHydrated: () => boolean;
|
|
17
|
-
onHydrate: (fn: (state:
|
|
18
|
-
onFinishHydration: (fn: (state:
|
|
19
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
17
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
18
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
19
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
20
20
|
payForms: T[];
|
|
21
21
|
}>>;
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CorePayFormBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CorePayForm/classes/CorePayFormBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CorePayFormBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CorePayForm/classes/CorePayFormBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,MAAM,SAAS,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CACxD,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC;IACjD,SAAS,CAAC,YAAY,EAIjB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGlD,OAAO,GAAE,sBAAqD,EAC9D,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAsD3C,KAAK;;;;;;;;;;;;;;;CAcb"}
|
|
@@ -2,14 +2,14 @@ import { CoreProductBaseService } from '../services/base';
|
|
|
2
2
|
import { CoreProduct, CoreProductStore } from '../types/CoreProduct';
|
|
3
3
|
import { CoreProductCategory } from '../types/CoreProductCategory';
|
|
4
4
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
5
|
-
export declare class CoreProductBuilder<T extends CoreProduct = CoreProduct, K extends CoreProductCategory = CoreProductCategory
|
|
5
|
+
export declare class CoreProductBuilder<T extends CoreProduct = CoreProduct, K extends CoreProductCategory = CoreProductCategory, TStore extends CoreProductStore<T, K> = CoreProductStore<T, K>> extends CoreBaseBuilder<TStore> {
|
|
6
6
|
protected productService: CoreProductBaseService;
|
|
7
|
-
protected initialState: Pick<
|
|
8
|
-
constructor(service?: CoreProductBaseService, initialState?: Partial<
|
|
9
|
-
protected getBaseState(set: any, get: any):
|
|
10
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
7
|
+
protected initialState: Pick<TStore, "productDetails" | "products" | "categories" | "bestSellers" | "loading" | "error">;
|
|
8
|
+
constructor(service?: CoreProductBaseService, initialState?: Partial<TStore>);
|
|
9
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
10
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
11
11
|
persist: {
|
|
12
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
12
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
13
13
|
productDetails: T;
|
|
14
14
|
products: import('../../../types').BasePagination<T>;
|
|
15
15
|
categories: K[];
|
|
@@ -18,9 +18,9 @@ export declare class CoreProductBuilder<T extends CoreProduct = CoreProduct, K e
|
|
|
18
18
|
clearStorage: () => void;
|
|
19
19
|
rehydrate: () => Promise<void> | void;
|
|
20
20
|
hasHydrated: () => boolean;
|
|
21
|
-
onHydrate: (fn: (state:
|
|
22
|
-
onFinishHydration: (fn: (state:
|
|
23
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
21
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
22
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
23
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
24
24
|
productDetails: T;
|
|
25
25
|
products: import('../../../types').BasePagination<T>;
|
|
26
26
|
categories: K[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreProductBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreProduct/classes/CoreProductBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"CoreProductBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreProduct/classes/CoreProductBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,kBAAkB,CAC7B,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,EACnD,MAAM,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAC9D,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC;IACjD,SAAS,CAAC,YAAY,EAOjB,IAAI,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGpG,OAAO,GAAE,sBAAqD,EAC9D,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAqI3C,KAAK;;;;;;;;;;;;;;;;;;;;;CAiBb"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
2
2
|
import { CoreShipmentBaseService } from '../services/base';
|
|
3
3
|
import { CoreShippingAddress, CoreShipmentStore, CoreShippingMethod, CoreShippingMethodTypes, CoreShipmentBeneficiary } from '../types/CoreShipment';
|
|
4
|
-
export declare class CoreShipmentBuilder<T extends CoreShippingMethod<Z>, K extends CoreShippingAddress, Z extends CoreShippingMethodTypes, Y extends CoreShipmentBeneficiary
|
|
4
|
+
export declare class CoreShipmentBuilder<T extends CoreShippingMethod<Z>, K extends CoreShippingAddress, Z extends CoreShippingMethodTypes, Y extends CoreShipmentBeneficiary, TStore extends CoreShipmentStore<T, K, Z, Y> = CoreShipmentStore<T, K, Z, Y>> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected shipmentService: CoreShipmentBaseService<T, K, Z, Y>;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(service?: CoreShipmentBaseService<T, K, Z, Y>, initialState?:
|
|
8
|
-
protected getBaseState(set: any, get: any):
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<
|
|
6
|
+
protected initialState: Pick<TStore, 'shippingMethods' | 'shippingAddresses' | 'beneficiaries' | 'selectedAddress' | 'loading' | 'error'>;
|
|
7
|
+
constructor(service?: CoreShipmentBaseService<T, K, Z, Y>, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
12
12
|
shippingMethods: T[];
|
|
13
13
|
shippingAddresses: import('../../..').BasePagination<K>;
|
|
14
14
|
beneficiaries: import('../../..').BasePagination<Y>;
|
|
@@ -16,9 +16,9 @@ export declare class CoreShipmentBuilder<T extends CoreShippingMethod<Z>, K exte
|
|
|
16
16
|
clearStorage: () => void;
|
|
17
17
|
rehydrate: () => Promise<void> | void;
|
|
18
18
|
hasHydrated: () => boolean;
|
|
19
|
-
onHydrate: (fn: (state:
|
|
20
|
-
onFinishHydration: (fn: (state:
|
|
21
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
19
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
20
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
21
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
22
22
|
shippingMethods: T[];
|
|
23
23
|
shippingAddresses: import('../../..').BasePagination<K>;
|
|
24
24
|
beneficiaries: import('../../..').BasePagination<Y>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreShipmentBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShipment/classes/CoreShipmentBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EAGxB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,mBAAmB,CAC9B,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAC/B,CAAC,SAAS,mBAAmB,EAC7B,CAAC,SAAS,uBAAuB,EACjC,CAAC,SAAS,uBAAuB,
|
|
1
|
+
{"version":3,"file":"CoreShipmentBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShipment/classes/CoreShipmentBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EAGxB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,mBAAmB,CAC9B,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAC/B,CAAC,SAAS,mBAAmB,EAC7B,CAAC,SAAS,uBAAuB,EACjC,CAAC,SAAS,uBAAuB,EACjC,MAAM,SAAS,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAC5E,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,eAAe,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGxI,OAAO,CAAC,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC7C,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAiBhC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAgN3C,KAAK;;;;;;;;;;;;;;;;;;;CAgBb"}
|
|
@@ -9,7 +9,7 @@ class CoreShipmentBuilder extends CoreBaseBuilder {
|
|
|
9
9
|
constructor(service, initialState) {
|
|
10
10
|
super();
|
|
11
11
|
this.shipmentService = service || new CoreShipmentBaseService();
|
|
12
|
-
this.initialState =
|
|
12
|
+
this.initialState = {
|
|
13
13
|
shippingMethods: null,
|
|
14
14
|
shippingAddresses: null,
|
|
15
15
|
beneficiaries: null,
|
|
@@ -17,6 +17,9 @@ class CoreShipmentBuilder extends CoreBaseBuilder {
|
|
|
17
17
|
loading: false,
|
|
18
18
|
error: null
|
|
19
19
|
};
|
|
20
|
+
if (initialState) {
|
|
21
|
+
this.initialState = { ...this.initialState, ...initialState };
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
24
|
getBaseState(set, get) {
|
|
22
25
|
return {
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import { CoreShopCartBaseService } from '../services/base';
|
|
2
2
|
import { CoreShopCartStore } from '../types/CoreShopCart';
|
|
3
3
|
import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder';
|
|
4
|
-
export declare class CoreShopCartBuilder<T
|
|
4
|
+
export declare class CoreShopCartBuilder<T, TStore extends CoreShopCartStore<T> = CoreShopCartStore<T>> extends CoreBaseBuilder<TStore> {
|
|
5
5
|
protected shopCartService: CoreShopCartBaseService<T>;
|
|
6
|
-
protected initialState: Pick<
|
|
7
|
-
constructor(service?: CoreShopCartBaseService<T>, initialState?:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
subtotal: number;
|
|
11
|
-
total: number;
|
|
12
|
-
itemized_subtotals: any[];
|
|
13
|
-
};
|
|
14
|
-
cartItems: any[];
|
|
15
|
-
loading: boolean;
|
|
16
|
-
error: any;
|
|
17
|
-
});
|
|
18
|
-
protected getBaseState(set: any, get: any): CoreShopCartStore<T>;
|
|
19
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShopCartStore<T>>, "persist"> & {
|
|
6
|
+
protected initialState: Pick<TStore, 'cart' | 'cartItems' | 'loading' | 'error'>;
|
|
7
|
+
constructor(service?: CoreShopCartBaseService<T>, initialState?: Partial<TStore>);
|
|
8
|
+
protected getBaseState(set: any, get: any): TStore;
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TStore>, "persist"> & {
|
|
20
10
|
persist: {
|
|
21
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
22
12
|
cart: import('../types').CoreShopCart<T>;
|
|
23
13
|
cartItems: import('../types').CoreCartItem<T>[];
|
|
24
14
|
}>>) => void;
|
|
25
15
|
clearStorage: () => void;
|
|
26
16
|
rehydrate: () => Promise<void> | void;
|
|
27
17
|
hasHydrated: () => boolean;
|
|
28
|
-
onHydrate: (fn: (state:
|
|
29
|
-
onFinishHydration: (fn: (state:
|
|
30
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<
|
|
18
|
+
onHydrate: (fn: (state: TStore) => void) => () => void;
|
|
19
|
+
onFinishHydration: (fn: (state: TStore) => void) => () => void;
|
|
20
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<TStore, {
|
|
31
21
|
cart: import('../types').CoreShopCart<T>;
|
|
32
22
|
cartItems: import('../types').CoreCartItem<T>[];
|
|
33
23
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreShopCartBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/classes/CoreShopCartBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,mBAAmB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"CoreShopCartBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/classes/CoreShopCartBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,mBAAmB,CAAC,CAAC,EAAE,MAAM,SAAS,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC7H,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAG/E,OAAO,GAAE,uBAAuB,CAAC,CAAC,CAAoC,EACtE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAoBhC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAiK3C,KAAK;;;;;;;;;;;;;;;;;CAeb"}
|
|
@@ -6,20 +6,23 @@ import { CoreBaseBuilder } from '../../../classes/CoreBaseBuilder.js';
|
|
|
6
6
|
class CoreShopCartBuilder extends CoreBaseBuilder {
|
|
7
7
|
shopCartService;
|
|
8
8
|
initialState;
|
|
9
|
-
constructor(service = new CoreShopCartBaseService(), initialState
|
|
10
|
-
cart: {
|
|
11
|
-
items: [],
|
|
12
|
-
subtotal: 0,
|
|
13
|
-
total: 0,
|
|
14
|
-
itemized_subtotals: []
|
|
15
|
-
},
|
|
16
|
-
cartItems: [],
|
|
17
|
-
loading: false,
|
|
18
|
-
error: null
|
|
19
|
-
}) {
|
|
9
|
+
constructor(service = new CoreShopCartBaseService(), initialState) {
|
|
20
10
|
super();
|
|
21
11
|
this.shopCartService = service;
|
|
22
|
-
this.initialState =
|
|
12
|
+
this.initialState = {
|
|
13
|
+
cart: {
|
|
14
|
+
items: [],
|
|
15
|
+
subtotal: 0,
|
|
16
|
+
total: 0,
|
|
17
|
+
itemized_subtotals: []
|
|
18
|
+
},
|
|
19
|
+
cartItems: [],
|
|
20
|
+
loading: false,
|
|
21
|
+
error: null
|
|
22
|
+
};
|
|
23
|
+
if (initialState) {
|
|
24
|
+
this.initialState = { ...this.initialState, ...initialState };
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
getBaseState(set, get) {
|
|
25
28
|
return {
|