@etsoo/appscript 1.4.52 → 1.4.54
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/lib/cjs/business/CultureItem.d.ts +8 -0
- package/lib/cjs/business/ShoppingCart.js +2 -1
- package/lib/mjs/business/CultureItem.d.ts +8 -0
- package/lib/mjs/business/ShoppingCart.js +2 -1
- package/package.json +4 -4
- package/src/business/CultureItem.ts +10 -0
- package/src/business/ShoppingCart.ts +4 -3
|
@@ -14,6 +14,10 @@ export type CultureItem = {
|
|
|
14
14
|
* Title / label
|
|
15
15
|
*/
|
|
16
16
|
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Description
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
17
21
|
/**
|
|
18
22
|
* JSON data related
|
|
19
23
|
*/
|
|
@@ -31,6 +35,10 @@ export type CultureGridItem = {
|
|
|
31
35
|
* Title / label
|
|
32
36
|
*/
|
|
33
37
|
title: string;
|
|
38
|
+
/**
|
|
39
|
+
* Description
|
|
40
|
+
*/
|
|
41
|
+
description?: string;
|
|
34
42
|
/**
|
|
35
43
|
* JSON data related
|
|
36
44
|
*/
|
|
@@ -14,6 +14,10 @@ export type CultureItem = {
|
|
|
14
14
|
* Title / label
|
|
15
15
|
*/
|
|
16
16
|
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Description
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
17
21
|
/**
|
|
18
22
|
* JSON data related
|
|
19
23
|
*/
|
|
@@ -31,6 +35,10 @@ export type CultureGridItem = {
|
|
|
31
35
|
* Title / label
|
|
32
36
|
*/
|
|
33
37
|
title: string;
|
|
38
|
+
/**
|
|
39
|
+
* Description
|
|
40
|
+
*/
|
|
41
|
+
description?: string;
|
|
34
42
|
/**
|
|
35
43
|
* JSON data related
|
|
36
44
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.54",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/cli": "^7.22.15",
|
|
62
|
-
"@babel/core": "^7.22.
|
|
62
|
+
"@babel/core": "^7.22.20",
|
|
63
63
|
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
64
|
-
"@babel/preset-env": "^7.22.
|
|
64
|
+
"@babel/preset-env": "^7.22.20",
|
|
65
65
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
66
66
|
"@types/crypto-js": "^4.1.2",
|
|
67
|
-
"@types/jest": "^29.5.
|
|
67
|
+
"@types/jest": "^29.5.5",
|
|
68
68
|
"jest": "^29.7.0",
|
|
69
69
|
"jest-environment-jsdom": "^29.7.0",
|
|
70
70
|
"ts-jest": "^29.1.1",
|
|
@@ -17,6 +17,11 @@ export type CultureItem = {
|
|
|
17
17
|
*/
|
|
18
18
|
title: string;
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Description
|
|
22
|
+
*/
|
|
23
|
+
description?: string;
|
|
24
|
+
|
|
20
25
|
/**
|
|
21
26
|
* JSON data related
|
|
22
27
|
*/
|
|
@@ -37,6 +42,11 @@ export type CultureGridItem = {
|
|
|
37
42
|
*/
|
|
38
43
|
title: string;
|
|
39
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Description
|
|
47
|
+
*/
|
|
48
|
+
description?: string;
|
|
49
|
+
|
|
40
50
|
/**
|
|
41
51
|
* JSON data related
|
|
42
52
|
*/
|
|
@@ -353,7 +353,7 @@ export class ShoppingCart<T extends ShoppingCartItem> {
|
|
|
353
353
|
* Cached prices
|
|
354
354
|
* 缓存的价格
|
|
355
355
|
*/
|
|
356
|
-
private prices
|
|
356
|
+
private prices = <Record<T['id'], number>>{};
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
359
|
* Onchange callback
|
|
@@ -462,7 +462,7 @@ export class ShoppingCart<T extends ShoppingCartItem> {
|
|
|
462
462
|
clear(keepOwner?: boolean) {
|
|
463
463
|
this.items.length = 0;
|
|
464
464
|
this.promotions.length = 0;
|
|
465
|
-
this.prices = {}
|
|
465
|
+
this.prices = <Record<T['id'], number>>{};
|
|
466
466
|
|
|
467
467
|
if (keepOwner) {
|
|
468
468
|
this.save();
|
|
@@ -604,7 +604,8 @@ export class ShoppingCart<T extends ShoppingCartItem> {
|
|
|
604
604
|
price,
|
|
605
605
|
qty,
|
|
606
606
|
subtotal: price * qty,
|
|
607
|
-
discount: 0
|
|
607
|
+
discount: 0,
|
|
608
|
+
promotions: Array<ShoppingPromotion>()
|
|
608
609
|
} as T;
|
|
609
610
|
this.addItem(newItem);
|
|
610
611
|
}
|