@orderingstack/ordering-types 1.0.10 → 1.0.11
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/cjs/index.d.ts +9 -5
- package/dist/cjs/kiosk.d.ts +82 -20
- package/dist/esm/index.d.ts +9 -5
- package/dist/esm/kiosk.d.ts +82 -20
- package/package.json +23 -22
package/dist/cjs/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface ILanguage {
|
|
|
36
36
|
key: string;
|
|
37
37
|
icon: any;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export type StringBoolean = "true" | "false";
|
|
40
40
|
export declare enum EProductKind {
|
|
41
41
|
GROUP = "3e/group",
|
|
42
42
|
PRODUCT = "3e/product",
|
|
@@ -51,13 +51,13 @@ export declare enum EProductKindBucket {
|
|
|
51
51
|
GROUP = "group",
|
|
52
52
|
PRODUCT = "product"
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type TLiterals = {
|
|
55
55
|
name: string;
|
|
56
56
|
fiscal?: string;
|
|
57
57
|
"target-product-id"?: string;
|
|
58
58
|
description?: string;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type TMedia = {
|
|
61
61
|
url: string;
|
|
62
62
|
name: string;
|
|
63
63
|
};
|
|
@@ -117,6 +117,10 @@ export interface IProductStateSelected {
|
|
|
117
117
|
export interface IProductEmit {
|
|
118
118
|
[id: string]: string;
|
|
119
119
|
}
|
|
120
|
+
export interface ICategory {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
}
|
|
120
124
|
export interface IProductFilter {
|
|
121
125
|
[fltCtx: string]: string[];
|
|
122
126
|
}
|
|
@@ -413,8 +417,8 @@ export declare enum EOrderProductKind {
|
|
|
413
417
|
export interface IProductLiterals {
|
|
414
418
|
[propName: string]: any;
|
|
415
419
|
}
|
|
416
|
-
|
|
417
|
-
export
|
|
420
|
+
type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
|
|
421
|
+
export type TSaleChannelWeek = Partial<Record<TWeekDay, {
|
|
418
422
|
from: string;
|
|
419
423
|
to: string;
|
|
420
424
|
}[]>>;
|
package/dist/cjs/kiosk.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { UseFormRegisterReturn } from "react-hook-form";
|
|
3
3
|
import { UseTransitionProps } from "react-spring";
|
|
4
|
+
import { IProduct, IOrder } from "./index";
|
|
4
5
|
import { IOrderLine } from "./index";
|
|
5
6
|
export declare enum EPaymentStatus {
|
|
6
7
|
UNINITIALIZED = "UNINITIALIZED",
|
|
@@ -19,24 +20,24 @@ export declare enum EPaymentStatus {
|
|
|
19
20
|
* @
|
|
20
21
|
*/
|
|
21
22
|
export interface ITheme {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
"--color-primary": string;
|
|
24
|
+
"--color-primary-light": string;
|
|
25
|
+
"--color-primary-dark": string;
|
|
26
|
+
"--color-secondary": string;
|
|
27
|
+
"--color-grey-light": string;
|
|
28
|
+
"--color-red": string;
|
|
29
|
+
"--color-red-light": string;
|
|
30
|
+
"--fontFamily": string;
|
|
31
|
+
"--fontFamily-upper": string;
|
|
32
|
+
"--color-background": string;
|
|
33
|
+
"--color-btn-primary": string;
|
|
34
|
+
"--color-btn-secondary": string;
|
|
35
|
+
"--color-btn-disabled": string;
|
|
36
|
+
"--font-color-btn-primary": string;
|
|
37
|
+
"--font-color-btn-secondary": string;
|
|
38
|
+
"--font-color-btn-disabled": string;
|
|
39
|
+
"--font-color-bg-primary": string;
|
|
40
|
+
"--product-tile-border-color": string;
|
|
40
41
|
[property: string]: string;
|
|
41
42
|
}
|
|
42
43
|
export interface IMenuProps {
|
|
@@ -56,7 +57,7 @@ export interface IMenuProps {
|
|
|
56
57
|
availabilityCheckInterval?: number;
|
|
57
58
|
cols?: number;
|
|
58
59
|
colsLg?: number;
|
|
59
|
-
stacking:
|
|
60
|
+
stacking: "vertical" | "horizontal";
|
|
60
61
|
transitionProps?: UseTransitionProps;
|
|
61
62
|
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
62
63
|
goToCheckout: () => void;
|
|
@@ -81,3 +82,64 @@ export interface IMenuCategorySectionProps {
|
|
|
81
82
|
colsLg?: number;
|
|
82
83
|
MenuTile?: React.FC<IMenuTileProps>;
|
|
83
84
|
}
|
|
85
|
+
export interface IProductConfiguratorProps {
|
|
86
|
+
product: IProduct;
|
|
87
|
+
components: IProductConfiguratorComponents;
|
|
88
|
+
isOpen?: boolean;
|
|
89
|
+
showDebugState?: boolean;
|
|
90
|
+
lang?: string;
|
|
91
|
+
handleAddToCart: (obj: any) => void;
|
|
92
|
+
handleGoBack: () => void;
|
|
93
|
+
handleClose?: () => void;
|
|
94
|
+
}
|
|
95
|
+
export interface IProductConfiguratorComponents {
|
|
96
|
+
MenuProductRootUI?: React.FC<IMenuProductRootUIProps>;
|
|
97
|
+
MenuItemsUI?: React.FC<IMenuItemsUIProps>;
|
|
98
|
+
MenuOptionsUI?: React.FC<IMenuOptionsUIProps>;
|
|
99
|
+
MenuProductUI?: React.FC<IMenuProductUIProps>;
|
|
100
|
+
}
|
|
101
|
+
export interface IMenuProductRootUIProps {
|
|
102
|
+
product: IProduct;
|
|
103
|
+
countedProductPrice: number;
|
|
104
|
+
productQuantity: number;
|
|
105
|
+
showDebugState?: boolean;
|
|
106
|
+
children: ReactElement;
|
|
107
|
+
isOpen?: boolean;
|
|
108
|
+
increaseProductQuantity: () => void;
|
|
109
|
+
decreaseProductQuantity: () => void;
|
|
110
|
+
handleOnSubmit: () => void;
|
|
111
|
+
handleGoBack: () => void;
|
|
112
|
+
handleClose?: () => void;
|
|
113
|
+
}
|
|
114
|
+
export interface IMenuOptionsUIProps {
|
|
115
|
+
optionsItem: IProduct;
|
|
116
|
+
parentSelCtx: string;
|
|
117
|
+
selected: any;
|
|
118
|
+
isOnSubmitted: boolean;
|
|
119
|
+
actualQtyCnt: number;
|
|
120
|
+
actualSelCnt: number;
|
|
121
|
+
children: ReactElement;
|
|
122
|
+
}
|
|
123
|
+
export interface IMenuProductUIProps {
|
|
124
|
+
product: IProduct;
|
|
125
|
+
nestedLvl: number;
|
|
126
|
+
registerProps: UseFormRegisterReturn;
|
|
127
|
+
inputId: string;
|
|
128
|
+
radioInputValue: string;
|
|
129
|
+
isRadio: boolean;
|
|
130
|
+
isCheckbox: boolean;
|
|
131
|
+
isCounter: boolean;
|
|
132
|
+
isDecrementEnabled: boolean;
|
|
133
|
+
isIncrementEnabled: boolean;
|
|
134
|
+
isChecked: boolean;
|
|
135
|
+
isCheckboxEnabled: boolean;
|
|
136
|
+
counterValue: number;
|
|
137
|
+
handleCounterIncrementQty: () => void;
|
|
138
|
+
handleCounterDecrementQty: () => void;
|
|
139
|
+
children: ReactElement;
|
|
140
|
+
}
|
|
141
|
+
export interface IMenuItemsUIProps {
|
|
142
|
+
productItems: IProduct[];
|
|
143
|
+
parentProduct: IProduct;
|
|
144
|
+
renderMenuItem: (item: IProduct) => ReactElement;
|
|
145
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface ILanguage {
|
|
|
36
36
|
key: string;
|
|
37
37
|
icon: any;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export type StringBoolean = "true" | "false";
|
|
40
40
|
export declare enum EProductKind {
|
|
41
41
|
GROUP = "3e/group",
|
|
42
42
|
PRODUCT = "3e/product",
|
|
@@ -51,13 +51,13 @@ export declare enum EProductKindBucket {
|
|
|
51
51
|
GROUP = "group",
|
|
52
52
|
PRODUCT = "product"
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type TLiterals = {
|
|
55
55
|
name: string;
|
|
56
56
|
fiscal?: string;
|
|
57
57
|
"target-product-id"?: string;
|
|
58
58
|
description?: string;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type TMedia = {
|
|
61
61
|
url: string;
|
|
62
62
|
name: string;
|
|
63
63
|
};
|
|
@@ -117,6 +117,10 @@ export interface IProductStateSelected {
|
|
|
117
117
|
export interface IProductEmit {
|
|
118
118
|
[id: string]: string;
|
|
119
119
|
}
|
|
120
|
+
export interface ICategory {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
}
|
|
120
124
|
export interface IProductFilter {
|
|
121
125
|
[fltCtx: string]: string[];
|
|
122
126
|
}
|
|
@@ -413,8 +417,8 @@ export declare enum EOrderProductKind {
|
|
|
413
417
|
export interface IProductLiterals {
|
|
414
418
|
[propName: string]: any;
|
|
415
419
|
}
|
|
416
|
-
|
|
417
|
-
export
|
|
420
|
+
type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
|
|
421
|
+
export type TSaleChannelWeek = Partial<Record<TWeekDay, {
|
|
418
422
|
from: string;
|
|
419
423
|
to: string;
|
|
420
424
|
}[]>>;
|
package/dist/esm/kiosk.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { UseFormRegisterReturn } from "react-hook-form";
|
|
3
3
|
import { UseTransitionProps } from "react-spring";
|
|
4
|
+
import { IProduct, IOrder } from "./index";
|
|
4
5
|
import { IOrderLine } from "./index";
|
|
5
6
|
export declare enum EPaymentStatus {
|
|
6
7
|
UNINITIALIZED = "UNINITIALIZED",
|
|
@@ -19,24 +20,24 @@ export declare enum EPaymentStatus {
|
|
|
19
20
|
* @
|
|
20
21
|
*/
|
|
21
22
|
export interface ITheme {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
"--color-primary": string;
|
|
24
|
+
"--color-primary-light": string;
|
|
25
|
+
"--color-primary-dark": string;
|
|
26
|
+
"--color-secondary": string;
|
|
27
|
+
"--color-grey-light": string;
|
|
28
|
+
"--color-red": string;
|
|
29
|
+
"--color-red-light": string;
|
|
30
|
+
"--fontFamily": string;
|
|
31
|
+
"--fontFamily-upper": string;
|
|
32
|
+
"--color-background": string;
|
|
33
|
+
"--color-btn-primary": string;
|
|
34
|
+
"--color-btn-secondary": string;
|
|
35
|
+
"--color-btn-disabled": string;
|
|
36
|
+
"--font-color-btn-primary": string;
|
|
37
|
+
"--font-color-btn-secondary": string;
|
|
38
|
+
"--font-color-btn-disabled": string;
|
|
39
|
+
"--font-color-bg-primary": string;
|
|
40
|
+
"--product-tile-border-color": string;
|
|
40
41
|
[property: string]: string;
|
|
41
42
|
}
|
|
42
43
|
export interface IMenuProps {
|
|
@@ -56,7 +57,7 @@ export interface IMenuProps {
|
|
|
56
57
|
availabilityCheckInterval?: number;
|
|
57
58
|
cols?: number;
|
|
58
59
|
colsLg?: number;
|
|
59
|
-
stacking:
|
|
60
|
+
stacking: "vertical" | "horizontal";
|
|
60
61
|
transitionProps?: UseTransitionProps;
|
|
61
62
|
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
62
63
|
goToCheckout: () => void;
|
|
@@ -81,3 +82,64 @@ export interface IMenuCategorySectionProps {
|
|
|
81
82
|
colsLg?: number;
|
|
82
83
|
MenuTile?: React.FC<IMenuTileProps>;
|
|
83
84
|
}
|
|
85
|
+
export interface IProductConfiguratorProps {
|
|
86
|
+
product: IProduct;
|
|
87
|
+
components: IProductConfiguratorComponents;
|
|
88
|
+
isOpen?: boolean;
|
|
89
|
+
showDebugState?: boolean;
|
|
90
|
+
lang?: string;
|
|
91
|
+
handleAddToCart: (obj: any) => void;
|
|
92
|
+
handleGoBack: () => void;
|
|
93
|
+
handleClose?: () => void;
|
|
94
|
+
}
|
|
95
|
+
export interface IProductConfiguratorComponents {
|
|
96
|
+
MenuProductRootUI?: React.FC<IMenuProductRootUIProps>;
|
|
97
|
+
MenuItemsUI?: React.FC<IMenuItemsUIProps>;
|
|
98
|
+
MenuOptionsUI?: React.FC<IMenuOptionsUIProps>;
|
|
99
|
+
MenuProductUI?: React.FC<IMenuProductUIProps>;
|
|
100
|
+
}
|
|
101
|
+
export interface IMenuProductRootUIProps {
|
|
102
|
+
product: IProduct;
|
|
103
|
+
countedProductPrice: number;
|
|
104
|
+
productQuantity: number;
|
|
105
|
+
showDebugState?: boolean;
|
|
106
|
+
children: ReactElement;
|
|
107
|
+
isOpen?: boolean;
|
|
108
|
+
increaseProductQuantity: () => void;
|
|
109
|
+
decreaseProductQuantity: () => void;
|
|
110
|
+
handleOnSubmit: () => void;
|
|
111
|
+
handleGoBack: () => void;
|
|
112
|
+
handleClose?: () => void;
|
|
113
|
+
}
|
|
114
|
+
export interface IMenuOptionsUIProps {
|
|
115
|
+
optionsItem: IProduct;
|
|
116
|
+
parentSelCtx: string;
|
|
117
|
+
selected: any;
|
|
118
|
+
isOnSubmitted: boolean;
|
|
119
|
+
actualQtyCnt: number;
|
|
120
|
+
actualSelCnt: number;
|
|
121
|
+
children: ReactElement;
|
|
122
|
+
}
|
|
123
|
+
export interface IMenuProductUIProps {
|
|
124
|
+
product: IProduct;
|
|
125
|
+
nestedLvl: number;
|
|
126
|
+
registerProps: UseFormRegisterReturn;
|
|
127
|
+
inputId: string;
|
|
128
|
+
radioInputValue: string;
|
|
129
|
+
isRadio: boolean;
|
|
130
|
+
isCheckbox: boolean;
|
|
131
|
+
isCounter: boolean;
|
|
132
|
+
isDecrementEnabled: boolean;
|
|
133
|
+
isIncrementEnabled: boolean;
|
|
134
|
+
isChecked: boolean;
|
|
135
|
+
isCheckboxEnabled: boolean;
|
|
136
|
+
counterValue: number;
|
|
137
|
+
handleCounterIncrementQty: () => void;
|
|
138
|
+
handleCounterDecrementQty: () => void;
|
|
139
|
+
children: ReactElement;
|
|
140
|
+
}
|
|
141
|
+
export interface IMenuItemsUIProps {
|
|
142
|
+
productItems: IProduct[];
|
|
143
|
+
parentProduct: IProduct;
|
|
144
|
+
renderMenuItem: (item: IProduct) => ReactElement;
|
|
145
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@orderingstack/ordering-types",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Typescript types for @orderingstack",
|
|
5
|
-
"types": "dist/esm/index.d.ts",
|
|
6
|
-
"main": "dist/cjs/index.js",
|
|
7
|
-
"module": "dist/esm/index.js",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist/"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
14
|
-
},
|
|
15
|
-
"author": "Tomasz Rojek <tomasz.rojek@e3.pl>",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/react": "^18.0.26",
|
|
18
|
-
"react": "^18.2.0",
|
|
19
|
-
"react-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@orderingstack/ordering-types",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"description": "Typescript types for @orderingstack",
|
|
5
|
+
"types": "dist/esm/index.d.ts",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"author": "Tomasz Rojek <tomasz.rojek@e3.pl>",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^18.0.26",
|
|
18
|
+
"react": "^18.2.0",
|
|
19
|
+
"react-hook-form": "^7.42.0",
|
|
20
|
+
"react-spring": "^9.6.1",
|
|
21
|
+
"typescript": "next"
|
|
22
|
+
}
|
|
23
|
+
}
|