@orderingstack/ordering-types 1.0.11 → 1.0.13

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.
@@ -101,7 +101,7 @@ export interface IProduct {
101
101
  attrs?: Record<string, string | boolean>;
102
102
  }
103
103
  export interface IProductState {
104
- selected: IProductStateFilter;
104
+ selected: IProductStateSelected;
105
105
  filter: IProductStateFilter;
106
106
  }
107
107
  export interface IProductStateFilter {
@@ -1,7 +1,7 @@
1
1
  import React, { ReactElement } from "react";
2
2
  import { UseFormRegisterReturn } from "react-hook-form";
3
3
  import { UseTransitionProps } from "react-spring";
4
- import { IProduct, IOrder } from "./index";
4
+ import { IProduct, IOrder, IProductStateSelected, IProductStateFilter } from "./index";
5
5
  import { IOrderLine } from "./index";
6
6
  export declare enum EPaymentStatus {
7
7
  UNINITIALIZED = "UNINITIALIZED",
@@ -85,13 +85,20 @@ export interface IMenuCategorySectionProps {
85
85
  export interface IProductConfiguratorProps {
86
86
  product: IProduct;
87
87
  components: IProductConfiguratorComponents;
88
+ currency: string;
88
89
  isOpen?: boolean;
89
90
  showDebugState?: boolean;
90
91
  lang?: string;
91
- handleAddToCart: (obj: any) => void;
92
+ handleAddToCart: (data: IAddToCartData) => void;
92
93
  handleGoBack: () => void;
93
94
  handleClose?: () => void;
94
95
  }
96
+ export interface IAddToCartData {
97
+ price: number;
98
+ quantity: number;
99
+ selected: IProductStateSelected;
100
+ filter: IProductStateFilter;
101
+ }
95
102
  export interface IProductConfiguratorComponents {
96
103
  MenuProductRootUI?: React.FC<IMenuProductRootUIProps>;
97
104
  MenuItemsUI?: React.FC<IMenuItemsUIProps>;
@@ -101,10 +108,17 @@ export interface IProductConfiguratorComponents {
101
108
  export interface IMenuProductRootUIProps {
102
109
  product: IProduct;
103
110
  countedProductPrice: number;
111
+ countedProductTotalPrice: number;
104
112
  productQuantity: number;
105
113
  showDebugState?: boolean;
106
114
  children: ReactElement;
115
+ validationMap: {
116
+ [selCtx: string]: {
117
+ isValid: boolean;
118
+ };
119
+ };
107
120
  isOpen?: boolean;
121
+ currency: string;
108
122
  increaseProductQuantity: () => void;
109
123
  decreaseProductQuantity: () => void;
110
124
  handleOnSubmit: () => void;
@@ -114,10 +128,11 @@ export interface IMenuProductRootUIProps {
114
128
  export interface IMenuOptionsUIProps {
115
129
  optionsItem: IProduct;
116
130
  parentSelCtx: string;
117
- selected: any;
131
+ selected: IProductStateSelected;
118
132
  isOnSubmitted: boolean;
119
133
  actualQtyCnt: number;
120
134
  actualSelCnt: number;
135
+ currency: string;
121
136
  children: ReactElement;
122
137
  }
123
138
  export interface IMenuProductUIProps {
@@ -136,6 +151,7 @@ export interface IMenuProductUIProps {
136
151
  counterValue: number;
137
152
  handleCounterIncrementQty: () => void;
138
153
  handleCounterDecrementQty: () => void;
154
+ currency: string;
139
155
  children: ReactElement;
140
156
  }
141
157
  export interface IMenuItemsUIProps {
@@ -101,7 +101,7 @@ export interface IProduct {
101
101
  attrs?: Record<string, string | boolean>;
102
102
  }
103
103
  export interface IProductState {
104
- selected: IProductStateFilter;
104
+ selected: IProductStateSelected;
105
105
  filter: IProductStateFilter;
106
106
  }
107
107
  export interface IProductStateFilter {
@@ -1,7 +1,7 @@
1
1
  import React, { ReactElement } from "react";
2
2
  import { UseFormRegisterReturn } from "react-hook-form";
3
3
  import { UseTransitionProps } from "react-spring";
4
- import { IProduct, IOrder } from "./index";
4
+ import { IProduct, IOrder, IProductStateSelected, IProductStateFilter } from "./index";
5
5
  import { IOrderLine } from "./index";
6
6
  export declare enum EPaymentStatus {
7
7
  UNINITIALIZED = "UNINITIALIZED",
@@ -85,13 +85,20 @@ export interface IMenuCategorySectionProps {
85
85
  export interface IProductConfiguratorProps {
86
86
  product: IProduct;
87
87
  components: IProductConfiguratorComponents;
88
+ currency: string;
88
89
  isOpen?: boolean;
89
90
  showDebugState?: boolean;
90
91
  lang?: string;
91
- handleAddToCart: (obj: any) => void;
92
+ handleAddToCart: (data: IAddToCartData) => void;
92
93
  handleGoBack: () => void;
93
94
  handleClose?: () => void;
94
95
  }
96
+ export interface IAddToCartData {
97
+ price: number;
98
+ quantity: number;
99
+ selected: IProductStateSelected;
100
+ filter: IProductStateFilter;
101
+ }
95
102
  export interface IProductConfiguratorComponents {
96
103
  MenuProductRootUI?: React.FC<IMenuProductRootUIProps>;
97
104
  MenuItemsUI?: React.FC<IMenuItemsUIProps>;
@@ -101,10 +108,17 @@ export interface IProductConfiguratorComponents {
101
108
  export interface IMenuProductRootUIProps {
102
109
  product: IProduct;
103
110
  countedProductPrice: number;
111
+ countedProductTotalPrice: number;
104
112
  productQuantity: number;
105
113
  showDebugState?: boolean;
106
114
  children: ReactElement;
115
+ validationMap: {
116
+ [selCtx: string]: {
117
+ isValid: boolean;
118
+ };
119
+ };
107
120
  isOpen?: boolean;
121
+ currency: string;
108
122
  increaseProductQuantity: () => void;
109
123
  decreaseProductQuantity: () => void;
110
124
  handleOnSubmit: () => void;
@@ -114,10 +128,11 @@ export interface IMenuProductRootUIProps {
114
128
  export interface IMenuOptionsUIProps {
115
129
  optionsItem: IProduct;
116
130
  parentSelCtx: string;
117
- selected: any;
131
+ selected: IProductStateSelected;
118
132
  isOnSubmitted: boolean;
119
133
  actualQtyCnt: number;
120
134
  actualSelCnt: number;
135
+ currency: string;
121
136
  children: ReactElement;
122
137
  }
123
138
  export interface IMenuProductUIProps {
@@ -136,6 +151,7 @@ export interface IMenuProductUIProps {
136
151
  counterValue: number;
137
152
  handleCounterIncrementQty: () => void;
138
153
  handleCounterDecrementQty: () => void;
154
+ currency: string;
139
155
  children: ReactElement;
140
156
  }
141
157
  export interface IMenuItemsUIProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderingstack/ordering-types",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Typescript types for @orderingstack",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "main": "dist/cjs/index.js",