@tabres/react 1.0.50 → 1.0.51
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/AllergenIcons/AllergenIcons.d.ts +25 -0
- package/dist/components/AllergenIcons/AllergenIcons.test.d.ts +1 -0
- package/dist/components/AllergenIcons/icons/Buckwheat.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Celery.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Crustaceans.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Eggs.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Fish.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Gluten.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Lupin.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Milk.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Molluscs.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Mustard.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Peanuts.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Sesame.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Soy.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Sulphites.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/TreeNuts.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/index.d.ts +19 -0
- package/dist/components/AllergenIcons/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- 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 +1 -1
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/modules/product/models.d.ts +58 -0
- package/dist/models/modules/product/utils.d.ts +21 -1
- package/dist/models/services/translation/locales/az/index.d.ts +1 -0
- package/dist/models/services/translation/locales/az/order.d.ts +1 -0
- package/dist/models/services/translation/locales/es/index.d.ts +1 -0
- package/dist/models/services/translation/locales/es/order.d.ts +1 -0
- package/dist/models/services/translation/locales/et/index.d.ts +1 -0
- package/dist/models/services/translation/locales/et/order.d.ts +1 -0
- package/dist/models/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/models/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/models/services/translation/locales/index.d.ts +9 -0
- package/dist/models/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/models/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/models/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/models/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/models/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/models/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/models/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/models/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/models/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/models/services/translation/locales/tr/order.d.ts +1 -0
- package/dist/modules/product/models.d.ts +58 -0
- package/dist/modules/product/utils.d.ts +21 -1
- package/dist/modules/product/utils.test.d.ts +1 -0
- package/dist/services/translation/locales/az/index.d.ts +1 -0
- package/dist/services/translation/locales/az/order.d.ts +1 -0
- package/dist/services/translation/locales/es/index.d.ts +1 -0
- package/dist/services/translation/locales/es/order.d.ts +1 -0
- package/dist/services/translation/locales/et/index.d.ts +1 -0
- package/dist/services/translation/locales/et/order.d.ts +1 -0
- package/dist/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/services/translation/locales/index.d.ts +9 -0
- package/dist/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/services/translation/locales/tr/order.d.ts +1 -0
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- 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/modules/product/models.d.ts +58 -0
- package/dist/utils/modules/product/utils.d.ts +21 -1
- package/dist/utils/services/translation/locales/az/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/az/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/es/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/es/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/et/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/et/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/index.d.ts +9 -0
- package/dist/utils/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/tr/order.d.ts +1 -0
- package/package.json +1 -1
|
@@ -77,6 +77,7 @@ declare const _default: {
|
|
|
77
77
|
Tip: string;
|
|
78
78
|
"Total with tip": string;
|
|
79
79
|
"Enter tip amount": string;
|
|
80
|
+
"Contains allergens": string;
|
|
80
81
|
};
|
|
81
82
|
customer: {
|
|
82
83
|
"Unknown address": string;
|
|
@@ -284,6 +285,7 @@ declare const _default: {
|
|
|
284
285
|
Tip: string;
|
|
285
286
|
"Total with tip": string;
|
|
286
287
|
"Enter tip amount": string;
|
|
288
|
+
"Contains allergens": string;
|
|
287
289
|
};
|
|
288
290
|
};
|
|
289
291
|
ru: {
|
|
@@ -363,6 +365,7 @@ declare const _default: {
|
|
|
363
365
|
Tip: string;
|
|
364
366
|
"Total with tip": string;
|
|
365
367
|
"Enter tip amount": string;
|
|
368
|
+
"Contains allergens": string;
|
|
366
369
|
};
|
|
367
370
|
customer: {
|
|
368
371
|
"Unknown address": string;
|
|
@@ -488,6 +491,7 @@ declare const _default: {
|
|
|
488
491
|
Tip: string;
|
|
489
492
|
"Total with tip": string;
|
|
490
493
|
"Enter tip amount": string;
|
|
494
|
+
"Contains allergens": string;
|
|
491
495
|
};
|
|
492
496
|
customer: {
|
|
493
497
|
"Unknown address": string;
|
|
@@ -613,6 +617,7 @@ declare const _default: {
|
|
|
613
617
|
Tip: string;
|
|
614
618
|
"Total with tip": string;
|
|
615
619
|
"Enter tip amount": string;
|
|
620
|
+
"Contains allergens": string;
|
|
616
621
|
};
|
|
617
622
|
customer: {
|
|
618
623
|
"Unknown address": string;
|
|
@@ -738,6 +743,7 @@ declare const _default: {
|
|
|
738
743
|
Tip: string;
|
|
739
744
|
"Total with tip": string;
|
|
740
745
|
"Enter tip amount": string;
|
|
746
|
+
"Contains allergens": string;
|
|
741
747
|
};
|
|
742
748
|
customer: {
|
|
743
749
|
"Unknown address": string;
|
|
@@ -864,6 +870,7 @@ declare const _default: {
|
|
|
864
870
|
Tip: string;
|
|
865
871
|
"Total with tip": string;
|
|
866
872
|
"Enter tip amount": string;
|
|
873
|
+
"Contains allergens": string;
|
|
867
874
|
};
|
|
868
875
|
customer: {
|
|
869
876
|
"Unknown address": string;
|
|
@@ -991,6 +998,7 @@ declare const _default: {
|
|
|
991
998
|
Tip: string;
|
|
992
999
|
"Total with tip": string;
|
|
993
1000
|
"Enter tip amount": string;
|
|
1001
|
+
"Contains allergens": string;
|
|
994
1002
|
};
|
|
995
1003
|
customer: {
|
|
996
1004
|
"Unknown address": string;
|
|
@@ -1118,6 +1126,7 @@ declare const _default: {
|
|
|
1118
1126
|
Tip: string;
|
|
1119
1127
|
"Total with tip": string;
|
|
1120
1128
|
"Enter tip amount": string;
|
|
1129
|
+
"Contains allergens": string;
|
|
1121
1130
|
};
|
|
1122
1131
|
customer: {
|
|
1123
1132
|
"Unknown address": string;
|
|
@@ -41,6 +41,64 @@ export interface Product {
|
|
|
41
41
|
videoUrl?: string;
|
|
42
42
|
sellUnitType?: SellUnitType;
|
|
43
43
|
taxClassId?: number | null;
|
|
44
|
+
/**
|
|
45
|
+
* The bare allergen codes the business declared, `[]` when none — the shape
|
|
46
|
+
* a product is authored and saved in. Rendering reads `allergenDetails`
|
|
47
|
+
* instead, since that carries the same codes plus their wording.
|
|
48
|
+
*/
|
|
49
|
+
allergens?: AllergenCode[];
|
|
50
|
+
/**
|
|
51
|
+
* The declared allergens as the menu renders them: each code paired with its
|
|
52
|
+
* label in every language the business publishes. The API owns the catalog
|
|
53
|
+
* and translates it, so a code it adds is legible here without a release of
|
|
54
|
+
* this package, and the list is taken as given — order included.
|
|
55
|
+
*/
|
|
56
|
+
allergenDetails?: AllergenDetail[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* One declared allergen: the standardized code plus its label per language
|
|
60
|
+
* code. Labels arrive as a map rather than a single localized string because
|
|
61
|
+
* the public menu is served from one language-agnostic cached payload — the
|
|
62
|
+
* guest switches language locally and the row has to relabel without a
|
|
63
|
+
* refetch. Mirrors `domains/product/types/allergen_detail.go`.
|
|
64
|
+
*/
|
|
65
|
+
export interface AllergenDetail {
|
|
66
|
+
code: AllergenCode;
|
|
67
|
+
/** Label keyed by language code, e.g. `{ en: "Gluten", az: "Qlüten" }`. */
|
|
68
|
+
translations: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* An allergen code as it comes off the wire. Deliberately open: the API owns
|
|
72
|
+
* the catalog, so it may send a code this package has never heard of, and that
|
|
73
|
+
* code still has to reach the guest — a declared allergen going missing is the
|
|
74
|
+
* one failure mode this feature cannot have. `Allergen` names the codes we
|
|
75
|
+
* have a glyph for; everything else falls back to a generic mark (see
|
|
76
|
+
* `AllergenIcons`). Wording never depends on this list.
|
|
77
|
+
*/
|
|
78
|
+
export type AllergenCode = Allergen | (string & Record<never, never>);
|
|
79
|
+
/**
|
|
80
|
+
* The 14 major food allergens of EU Regulation 1169/2011 (Annex II) plus
|
|
81
|
+
* buckwheat — mirrors `domains/product/constants/allergens.go` on the API,
|
|
82
|
+
* which is the server of record for the catalog. This is the subset with a
|
|
83
|
+
* glyph of its own; it is not a limit on what the API may send, and it exists
|
|
84
|
+
* in this package only because an icon cannot travel over the wire.
|
|
85
|
+
*/
|
|
86
|
+
export declare enum Allergen {
|
|
87
|
+
GLUTEN = "GLUTEN",
|
|
88
|
+
CRUSTACEANS = "CRUSTACEANS",
|
|
89
|
+
EGGS = "EGGS",
|
|
90
|
+
FISH = "FISH",
|
|
91
|
+
PEANUTS = "PEANUTS",
|
|
92
|
+
SOY = "SOY",
|
|
93
|
+
MILK = "MILK",
|
|
94
|
+
TREE_NUTS = "TREE_NUTS",
|
|
95
|
+
CELERY = "CELERY",
|
|
96
|
+
MUSTARD = "MUSTARD",
|
|
97
|
+
SESAME = "SESAME",
|
|
98
|
+
SULPHITES = "SULPHITES",
|
|
99
|
+
LUPIN = "LUPIN",
|
|
100
|
+
MOLLUSCS = "MOLLUSCS",
|
|
101
|
+
BUCKWHEAT = "BUCKWHEAT"
|
|
44
102
|
}
|
|
45
103
|
export declare enum ProductView {
|
|
46
104
|
LIST = "list",
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import { LocalizedContent, Product, ProductVariant, SellUnitType } from "./models";
|
|
1
|
+
import { AllergenCode, LocalizedContent, Product, ProductVariant, SellUnitType } from "./models";
|
|
2
2
|
import { MenuAddon } from "src/modules/addon/models";
|
|
3
3
|
export declare const getProductTranslation: (product: Pick<Product, "translations">, language: string) => LocalizedContent;
|
|
4
4
|
export declare const getProductVariant: (product: Pick<Product, "variants">, variantId: number) => ProductVariant;
|
|
5
5
|
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => string;
|
|
6
6
|
export declare const getProductAddon: (product: Product, addonId: number) => MenuAddon;
|
|
7
|
+
/**
|
|
8
|
+
* A declared allergen ready to render: the code that picks the glyph, and the
|
|
9
|
+
* name to show the guest.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProductAllergen {
|
|
12
|
+
code: AllergenCode;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The product's declared allergens, labelled for `language` and ready to
|
|
17
|
+
* render.
|
|
18
|
+
*
|
|
19
|
+
* Passed through exactly as the API sent them — same codes, same order, nothing
|
|
20
|
+
* dropped. The API is the server of record for the catalog: it normalizes the
|
|
21
|
+
* codes on write (upper-cased, de-duplicated, validated) and labels each one,
|
|
22
|
+
* so there is nothing left here to second-guess. Re-filtering client-side could
|
|
23
|
+
* only ever make a declared allergen disappear, which is the one failure mode
|
|
24
|
+
* this feature cannot have.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getProductAllergens: (product: Pick<Product, "allergenDetails">, language?: string) => ProductAllergen[];
|
|
7
27
|
export declare const getPriceSuffix: (sellUnitType: SellUnitType) => "" | " / kg" | " / l";
|
|
8
28
|
export declare const getProductSellUnitShortCuts: (sellUnitType: SellUnitType) => {
|
|
9
29
|
"50gr": number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -77,6 +77,7 @@ declare const _default: {
|
|
|
77
77
|
Tip: string;
|
|
78
78
|
"Total with tip": string;
|
|
79
79
|
"Enter tip amount": string;
|
|
80
|
+
"Contains allergens": string;
|
|
80
81
|
};
|
|
81
82
|
customer: {
|
|
82
83
|
"Unknown address": string;
|
|
@@ -284,6 +285,7 @@ declare const _default: {
|
|
|
284
285
|
Tip: string;
|
|
285
286
|
"Total with tip": string;
|
|
286
287
|
"Enter tip amount": string;
|
|
288
|
+
"Contains allergens": string;
|
|
287
289
|
};
|
|
288
290
|
};
|
|
289
291
|
ru: {
|
|
@@ -363,6 +365,7 @@ declare const _default: {
|
|
|
363
365
|
Tip: string;
|
|
364
366
|
"Total with tip": string;
|
|
365
367
|
"Enter tip amount": string;
|
|
368
|
+
"Contains allergens": string;
|
|
366
369
|
};
|
|
367
370
|
customer: {
|
|
368
371
|
"Unknown address": string;
|
|
@@ -488,6 +491,7 @@ declare const _default: {
|
|
|
488
491
|
Tip: string;
|
|
489
492
|
"Total with tip": string;
|
|
490
493
|
"Enter tip amount": string;
|
|
494
|
+
"Contains allergens": string;
|
|
491
495
|
};
|
|
492
496
|
customer: {
|
|
493
497
|
"Unknown address": string;
|
|
@@ -613,6 +617,7 @@ declare const _default: {
|
|
|
613
617
|
Tip: string;
|
|
614
618
|
"Total with tip": string;
|
|
615
619
|
"Enter tip amount": string;
|
|
620
|
+
"Contains allergens": string;
|
|
616
621
|
};
|
|
617
622
|
customer: {
|
|
618
623
|
"Unknown address": string;
|
|
@@ -738,6 +743,7 @@ declare const _default: {
|
|
|
738
743
|
Tip: string;
|
|
739
744
|
"Total with tip": string;
|
|
740
745
|
"Enter tip amount": string;
|
|
746
|
+
"Contains allergens": string;
|
|
741
747
|
};
|
|
742
748
|
customer: {
|
|
743
749
|
"Unknown address": string;
|
|
@@ -864,6 +870,7 @@ declare const _default: {
|
|
|
864
870
|
Tip: string;
|
|
865
871
|
"Total with tip": string;
|
|
866
872
|
"Enter tip amount": string;
|
|
873
|
+
"Contains allergens": string;
|
|
867
874
|
};
|
|
868
875
|
customer: {
|
|
869
876
|
"Unknown address": string;
|
|
@@ -991,6 +998,7 @@ declare const _default: {
|
|
|
991
998
|
Tip: string;
|
|
992
999
|
"Total with tip": string;
|
|
993
1000
|
"Enter tip amount": string;
|
|
1001
|
+
"Contains allergens": string;
|
|
994
1002
|
};
|
|
995
1003
|
customer: {
|
|
996
1004
|
"Unknown address": string;
|
|
@@ -1118,6 +1126,7 @@ declare const _default: {
|
|
|
1118
1126
|
Tip: string;
|
|
1119
1127
|
"Total with tip": string;
|
|
1120
1128
|
"Enter tip amount": string;
|
|
1129
|
+
"Contains allergens": string;
|
|
1121
1130
|
};
|
|
1122
1131
|
customer: {
|
|
1123
1132
|
"Unknown address": string;
|