@freedom_sky/feige-lib 4.58.1 → 4.58.4

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.
@@ -8,10 +8,9 @@ export interface PrinteDishInfo {
8
8
  /**
9
9
  *
10
10
  */
11
- export declare function getDishArrFromContents({ contents, lang, specificationInNewLine, order, showBuffet, text, }: {
11
+ export declare function getDishArrFromContents({ contents, lang, order, showBuffet, text, }: {
12
12
  contents: Content[];
13
13
  lang: string;
14
- specificationInNewLine: boolean;
15
14
  order: Order;
16
15
  showBuffet?: boolean;
17
16
  text?: {
@@ -5,7 +5,7 @@ var index_1 = require("../index");
5
5
  *
6
6
  */
7
7
  function getDishArrFromContents(_a) {
8
- var contents = _a.contents, lang = _a.lang, specificationInNewLine = _a.specificationInNewLine, order = _a.order, showBuffet = _a.showBuffet, text = _a.text;
8
+ var contents = _a.contents, lang = _a.lang, order = _a.order, showBuffet = _a.showBuffet, text = _a.text;
9
9
  var result = contents.map(function (dishGroup) {
10
10
  var _a;
11
11
  var selectedNames = [];
@@ -15,9 +15,6 @@ function getDishArrFromContents(_a) {
15
15
  });
16
16
  });
17
17
  var name = index_1.getNameFromNames(dishGroup.dishSnapshot.names, lang, index_1.CONST.DEFALUT_LANGUAGE) || '';
18
- if (!specificationInNewLine && selectedNames.length > 0) {
19
- name += "(" + selectedNames.join() + ")";
20
- }
21
18
  if (dishGroup.dishSnapshot.type === index_1.DishType.Weigh) {
22
19
  name += "(" + dishGroup.weight + (index_1.getNameFromNames(dishGroup.dishSnapshot.units, lang, index_1.CONST.DEFALUT_LANGUAGE) || '') + ")";
23
20
  }
@@ -37,18 +34,14 @@ function getDishArrFromContents(_a) {
37
34
  });
38
35
  if (showBuffet && order.type === index_1.OrderTypeEnum.Buffet) {
39
36
  var specifications = [];
40
- if (specificationInNewLine) {
41
- if (order.adultNum) {
42
- specifications.push("" + (text === null || text === void 0 ? void 0 : text.adult) + order.adultNum);
43
- }
44
- if (order.childNum) {
45
- specifications.push("" + (text === null || text === void 0 ? void 0 : text.child) + order.childNum);
46
- }
37
+ if (order.adultNum) {
38
+ specifications.push("" + (text === null || text === void 0 ? void 0 : text.adult) + order.adultNum);
39
+ }
40
+ if (order.childNum) {
41
+ specifications.push("" + (text === null || text === void 0 ? void 0 : text.child) + order.childNum);
47
42
  }
48
43
  result.unshift({
49
- name: index_1.getNameFromNames(order.buffet.snapshot.names, lang, index_1.CONST.DEFALUT_LANGUAGE) + specificationInNewLine
50
- ? ''
51
- : "(" + specifications.join() + ")",
44
+ name: index_1.getNameFromNames(order.buffet.snapshot.names, lang, index_1.CONST.DEFALUT_LANGUAGE),
52
45
  count: 1,
53
46
  price: index_1.calcBuffetTotalPrice(order.buffet.snapshot, order.adultNum, order.childNum),
54
47
  specifications: specifications,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "4.58.1",
3
+ "version": "4.58.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -22,14 +22,12 @@ export interface PrinteDishInfo {
22
22
  export function getDishArrFromContents({
23
23
  contents,
24
24
  lang,
25
- specificationInNewLine,
26
25
  order,
27
26
  showBuffet,
28
27
  text,
29
28
  }: {
30
29
  contents: Content[];
31
30
  lang: string;
32
- specificationInNewLine: boolean;
33
31
  order: Order;
34
32
  showBuffet?: boolean;
35
33
  text?: {
@@ -45,9 +43,6 @@ export function getDishArrFromContents({
45
43
  });
46
44
  });
47
45
  let name = getNameFromNames(dishGroup.dishSnapshot.names, lang, CONST.DEFALUT_LANGUAGE) || '';
48
- if (!specificationInNewLine && selectedNames.length > 0) {
49
- name += `(${selectedNames.join()})`;
50
- }
51
46
  if (dishGroup.dishSnapshot.type === DishType.Weigh) {
52
47
  name += `(${dishGroup.weight}${
53
48
  getNameFromNames(dishGroup.dishSnapshot.units, lang, CONST.DEFALUT_LANGUAGE) || ''
@@ -70,19 +65,14 @@ export function getDishArrFromContents({
70
65
  });
71
66
  if (showBuffet && order.type === OrderTypeEnum.Buffet) {
72
67
  const specifications = [];
73
- if (specificationInNewLine) {
74
- if (order.adultNum) {
75
- specifications.push(`${text?.adult}${order.adultNum}`);
76
- }
77
- if (order.childNum) {
78
- specifications.push(`${text?.child}${order.childNum}`);
79
- }
68
+ if (order.adultNum) {
69
+ specifications.push(`${text?.adult}${order.adultNum}`);
70
+ }
71
+ if (order.childNum) {
72
+ specifications.push(`${text?.child}${order.childNum}`);
80
73
  }
81
74
  result.unshift({
82
- name:
83
- getNameFromNames(order.buffet.snapshot.names, lang, CONST.DEFALUT_LANGUAGE) + specificationInNewLine
84
- ? ''
85
- : `(${specifications.join()})`,
75
+ name: getNameFromNames(order.buffet.snapshot.names, lang, CONST.DEFALUT_LANGUAGE),
86
76
  count: 1,
87
77
  price: calcBuffetTotalPrice(order.buffet.snapshot, order.adultNum, order.childNum),
88
78
  specifications: specifications,