@restaround/react 1.0.50 → 1.0.53
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/components/PublicMenu/ProductInCart/ProductInCart.d.ts +6 -0
- package/dist/components/PublicMenu/ProductInCart/index.d.ts +1 -0
- package/dist/components/PublicMenu/ProductQuantity/ProductQuantity.d.ts +2 -1
- package/dist/constants/translations.d.ts +31 -38
- package/dist/hooks/cart.d.ts +3 -2
- package/dist/hooks/product.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/order.d.ts +2 -1
- package/dist/models/product.d.ts +13 -0
- package/dist/store/cart.d.ts +8 -2
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/cart.d.ts +5 -0
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/models/order.d.ts +44 -0
- package/dist/utils/models/product.d.ts +13 -0
- package/dist/utils/product.d.ts +23 -2
- package/dist/utils/utils/cart.d.ts +5 -0
- package/dist/utils/utils/common.d.ts +1 -0
- package/dist/utils/utils/product.d.ts +23 -2
- package/package.json +15 -13
|
@@ -5,6 +5,18 @@ export interface ProductTranslation {
|
|
|
5
5
|
language: string;
|
|
6
6
|
productId: number;
|
|
7
7
|
}
|
|
8
|
+
export interface ProductVariantTranslations {
|
|
9
|
+
id?: number;
|
|
10
|
+
title: string;
|
|
11
|
+
language: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProductVariant {
|
|
14
|
+
id?: number;
|
|
15
|
+
price: number;
|
|
16
|
+
translations: ProductVariantTranslations[];
|
|
17
|
+
productId?: number;
|
|
18
|
+
remove?: boolean;
|
|
19
|
+
}
|
|
8
20
|
export interface Product {
|
|
9
21
|
id: number;
|
|
10
22
|
categoryId: number;
|
|
@@ -15,6 +27,7 @@ export interface Product {
|
|
|
15
27
|
image580?: string;
|
|
16
28
|
image1024?: string;
|
|
17
29
|
translations: ProductTranslation[];
|
|
30
|
+
variants: ProductVariant[];
|
|
18
31
|
}
|
|
19
32
|
export declare enum ProductView {
|
|
20
33
|
LIST = "list",
|
package/dist/utils/product.d.ts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import { Product, ProductTranslation } from "src/models/product";
|
|
1
|
+
import { Product, ProductTranslation, ProductVariant, ProductVariantTranslations } from "src/models/product";
|
|
2
2
|
export declare const getProductTranslation: (product: Product, language: string) => ProductTranslation;
|
|
3
|
-
export declare const calculateTotalPrice: (price: number, quantity: number, vat?: number) => number;
|
|
4
3
|
export declare const getProductPrice: (product: Product, currency: string, language: string, quantity?: number) => {
|
|
5
4
|
totalPrice: number;
|
|
6
5
|
formattedTotalPrice: string;
|
|
7
6
|
};
|
|
7
|
+
export declare const getProductVariant: (product: Product, variantId: number) => ProductVariant;
|
|
8
|
+
export declare const getProductVariantPrice: ({ variantId, currency, language, product, quantity, }: {
|
|
9
|
+
variantId: number;
|
|
10
|
+
currency?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
product: Product;
|
|
13
|
+
quantity?: number;
|
|
14
|
+
}) => {
|
|
15
|
+
totalPrice: number;
|
|
16
|
+
formattedTotalPrice: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => ProductVariantTranslations;
|
|
19
|
+
export declare const getProductCartPrice: ({ product, variantId, quantity, currency, language, }: {
|
|
20
|
+
product: Product;
|
|
21
|
+
variantId: number | null;
|
|
22
|
+
quantity: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
language: string;
|
|
25
|
+
}) => {
|
|
26
|
+
totalPrice: number;
|
|
27
|
+
formattedTotalPrice: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calculateTotalPrice: (price: number, quantity: number, vat?: number) => number;
|
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import { Product, ProductTranslation } from "src/models/product";
|
|
1
|
+
import { Product, ProductTranslation, ProductVariant, ProductVariantTranslations } from "src/models/product";
|
|
2
2
|
export declare const getProductTranslation: (product: Product, language: string) => ProductTranslation;
|
|
3
|
-
export declare const calculateTotalPrice: (price: number, quantity: number, vat?: number) => number;
|
|
4
3
|
export declare const getProductPrice: (product: Product, currency: string, language: string, quantity?: number) => {
|
|
5
4
|
totalPrice: number;
|
|
6
5
|
formattedTotalPrice: string;
|
|
7
6
|
};
|
|
7
|
+
export declare const getProductVariant: (product: Product, variantId: number) => ProductVariant;
|
|
8
|
+
export declare const getProductVariantPrice: ({ variantId, currency, language, product, quantity, }: {
|
|
9
|
+
variantId: number;
|
|
10
|
+
currency?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
product: Product;
|
|
13
|
+
quantity?: number;
|
|
14
|
+
}) => {
|
|
15
|
+
totalPrice: number;
|
|
16
|
+
formattedTotalPrice: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => ProductVariantTranslations;
|
|
19
|
+
export declare const getProductCartPrice: ({ product, variantId, quantity, currency, language, }: {
|
|
20
|
+
product: Product;
|
|
21
|
+
variantId: number | null;
|
|
22
|
+
quantity: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
language: string;
|
|
25
|
+
}) => {
|
|
26
|
+
totalPrice: number;
|
|
27
|
+
formattedTotalPrice: string;
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restaround/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "React Library by restaround.co",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -48,26 +48,28 @@
|
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"homepage": "https://restaround.co",
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@sorocraft/js-utils": ">=1.0.
|
|
52
|
-
"@sorocraft/ui": ">=1.0.
|
|
53
|
-
"react": ">=18.
|
|
54
|
-
"react-dom": ">=18.
|
|
51
|
+
"@sorocraft/js-utils": ">=1.0.24",
|
|
52
|
+
"@sorocraft/ui": ">=1.0.102",
|
|
53
|
+
"react": ">=18.3.1",
|
|
54
|
+
"react-dom": ">=18.3.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
58
|
-
"@rollup/plugin-node-resolve": "^
|
|
57
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
59
59
|
"@rollup/plugin-terser": "^0.4.4",
|
|
60
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
61
|
-
"@types/react": "^
|
|
62
|
-
"@types/react-dom": "^
|
|
60
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
61
|
+
"@types/react": "^19.0.2",
|
|
62
|
+
"@types/react-dom": "^19.0.2",
|
|
63
63
|
"autoprefixer": "^10.4.20",
|
|
64
|
-
"eslint": "^9.
|
|
64
|
+
"eslint": "^9.17.0",
|
|
65
|
+
"eslint-plugin-react": "^7.37.3",
|
|
65
66
|
"rimraf": "^6.0.1",
|
|
66
67
|
"rollup-plugin-copy": "^3.5.0",
|
|
67
68
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
68
69
|
"rollup-plugin-postcss": "^4.0.2",
|
|
69
|
-
"sass": "^1.
|
|
70
|
+
"sass": "^1.83.0",
|
|
70
71
|
"tslib": "^2.8.1",
|
|
71
|
-
"typescript": "^5.7.2"
|
|
72
|
+
"typescript": "^5.7.2",
|
|
73
|
+
"typescript-eslint": "^8.18.2"
|
|
72
74
|
}
|
|
73
75
|
}
|