@pisell/pisellos 0.0.10 → 0.0.13

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.
Files changed (130) hide show
  1. package/dist/modules/Account/index.d.ts +4 -2
  2. package/dist/modules/Account/index.js +23 -36
  3. package/dist/modules/Account/types.d.ts +1 -0
  4. package/dist/modules/AccountList/index.d.ts +2 -0
  5. package/dist/modules/AccountList/index.js +34 -11
  6. package/dist/modules/Cart/index.d.ts +17 -11
  7. package/dist/modules/Cart/index.js +179 -121
  8. package/dist/modules/Cart/types.d.ts +98 -9
  9. package/dist/modules/Cart/types.js +8 -0
  10. package/dist/modules/Cart/utils.d.ts +114 -0
  11. package/dist/modules/Cart/utils.js +345 -0
  12. package/dist/modules/Date/index.d.ts +11 -12
  13. package/dist/modules/Date/index.js +104 -60
  14. package/dist/modules/Date/types.d.ts +51 -20
  15. package/dist/modules/Date/types.js +2 -5
  16. package/dist/modules/Date/utils.d.ts +35 -0
  17. package/dist/modules/Date/utils.js +211 -0
  18. package/dist/modules/Discount/index.d.ts +26 -0
  19. package/dist/modules/Discount/index.js +234 -0
  20. package/dist/modules/Discount/types.d.ts +66 -0
  21. package/dist/modules/Discount/types.js +5 -0
  22. package/dist/modules/Order/index.d.ts +16 -12
  23. package/dist/modules/Order/index.js +38 -166
  24. package/dist/modules/Order/types.d.ts +18 -41
  25. package/dist/modules/Order/types.js +0 -14
  26. package/dist/modules/Payment/index.d.ts +0 -2
  27. package/dist/modules/Payment/index.js +45 -76
  28. package/dist/modules/Payment/types.d.ts +0 -2
  29. package/dist/modules/Payment/types.js +2 -0
  30. package/dist/modules/Product/types.d.ts +48 -1
  31. package/dist/modules/ProductList/index.d.ts +1 -0
  32. package/dist/modules/ProductList/index.js +21 -1
  33. package/dist/modules/ProductList/types.d.ts +1 -0
  34. package/dist/modules/Resource/types.d.ts +6 -2
  35. package/dist/modules/Rules/index.d.ts +32 -0
  36. package/dist/modules/Rules/index.js +423 -0
  37. package/dist/modules/Rules/types.d.ts +46 -0
  38. package/dist/modules/Rules/types.js +5 -0
  39. package/dist/modules/Summary/index.d.ts +13 -0
  40. package/dist/modules/Summary/index.js +80 -0
  41. package/dist/modules/Summary/types.d.ts +13 -0
  42. package/dist/modules/Summary/types.js +1 -0
  43. package/dist/modules/Summary/utils.d.ts +19 -0
  44. package/dist/modules/Summary/utils.js +56 -0
  45. package/dist/plugins/index.d.ts +3 -2
  46. package/dist/plugins/index.js +2 -1
  47. package/dist/plugins/request.d.ts +4 -3
  48. package/dist/plugins/request.js +30 -30
  49. package/dist/plugins/shopStore.d.ts +4 -0
  50. package/dist/plugins/shopStore.js +1 -0
  51. package/dist/solution/BookingByStep/index.d.ts +73 -12
  52. package/dist/solution/BookingByStep/index.js +635 -99
  53. package/dist/solution/BookingByStep/types.d.ts +2 -0
  54. package/dist/solution/BookingByStep/types.js +11 -8
  55. package/dist/solution/BookingByStep/utils/products.d.ts +11 -0
  56. package/dist/solution/BookingByStep/utils/products.js +47 -0
  57. package/dist/solution/BookingByStep/utils/resources.d.ts +59 -10
  58. package/dist/solution/BookingByStep/utils/resources.js +144 -79
  59. package/dist/solution/ShopDiscount/index.d.ts +50 -0
  60. package/dist/solution/ShopDiscount/index.js +546 -0
  61. package/dist/solution/ShopDiscount/types.d.ts +24 -0
  62. package/dist/solution/ShopDiscount/types.js +10 -0
  63. package/dist/solution/ShopDiscount/utils.d.ts +1 -0
  64. package/dist/solution/ShopDiscount/utils.js +7 -0
  65. package/dist/solution/index.d.ts +1 -0
  66. package/dist/solution/index.js +2 -1
  67. package/lib/modules/Account/index.d.ts +4 -2
  68. package/lib/modules/Account/index.js +14 -3
  69. package/lib/modules/Account/types.d.ts +1 -0
  70. package/lib/modules/AccountList/index.d.ts +2 -0
  71. package/lib/modules/AccountList/index.js +17 -0
  72. package/lib/modules/Cart/index.d.ts +17 -11
  73. package/lib/modules/Cart/index.js +72 -21
  74. package/lib/modules/Cart/types.d.ts +98 -9
  75. package/lib/modules/Cart/utils.d.ts +114 -0
  76. package/lib/modules/Cart/utils.js +320 -0
  77. package/lib/modules/Date/index.d.ts +11 -12
  78. package/lib/modules/Date/index.js +50 -31
  79. package/lib/modules/Date/types.d.ts +51 -20
  80. package/lib/modules/Date/types.js +0 -4
  81. package/lib/modules/Date/utils.d.ts +35 -0
  82. package/lib/modules/Date/utils.js +167 -0
  83. package/lib/modules/Discount/index.d.ts +26 -0
  84. package/lib/modules/Discount/index.js +118 -0
  85. package/lib/modules/Discount/types.d.ts +66 -0
  86. package/lib/modules/Discount/types.js +33 -0
  87. package/lib/modules/Order/index.d.ts +16 -12
  88. package/lib/modules/Order/index.js +23 -51
  89. package/lib/modules/Order/types.d.ts +18 -41
  90. package/lib/modules/Payment/index.d.ts +0 -2
  91. package/lib/modules/Payment/index.js +6 -17
  92. package/lib/modules/Payment/types.d.ts +0 -2
  93. package/lib/modules/Product/types.d.ts +48 -1
  94. package/lib/modules/ProductList/index.d.ts +1 -0
  95. package/lib/modules/ProductList/index.js +4 -0
  96. package/lib/modules/ProductList/types.d.ts +1 -0
  97. package/lib/modules/Resource/types.d.ts +6 -2
  98. package/lib/modules/Rules/index.d.ts +32 -0
  99. package/lib/modules/Rules/index.js +283 -0
  100. package/lib/modules/Rules/types.d.ts +46 -0
  101. package/lib/modules/Rules/types.js +33 -0
  102. package/lib/modules/Summary/index.d.ts +13 -0
  103. package/lib/modules/Summary/index.js +49 -0
  104. package/lib/modules/Summary/types.d.ts +13 -0
  105. package/lib/modules/Summary/types.js +17 -0
  106. package/lib/modules/Summary/utils.d.ts +19 -0
  107. package/lib/modules/Summary/utils.js +79 -0
  108. package/lib/plugins/index.d.ts +3 -2
  109. package/lib/plugins/index.js +3 -1
  110. package/lib/plugins/request.d.ts +4 -3
  111. package/lib/plugins/request.js +4 -20
  112. package/lib/plugins/shopStore.d.ts +4 -0
  113. package/lib/plugins/shopStore.js +17 -0
  114. package/lib/solution/BookingByStep/index.d.ts +73 -12
  115. package/lib/solution/BookingByStep/index.js +451 -24
  116. package/lib/solution/BookingByStep/types.d.ts +2 -0
  117. package/lib/solution/BookingByStep/types.js +3 -0
  118. package/lib/solution/BookingByStep/utils/products.d.ts +11 -0
  119. package/lib/solution/BookingByStep/utils/products.js +60 -0
  120. package/lib/solution/BookingByStep/utils/resources.d.ts +59 -10
  121. package/lib/solution/BookingByStep/utils/resources.js +106 -49
  122. package/lib/solution/ShopDiscount/index.d.ts +50 -0
  123. package/lib/solution/ShopDiscount/index.js +321 -0
  124. package/lib/solution/ShopDiscount/types.d.ts +24 -0
  125. package/lib/solution/ShopDiscount/types.js +38 -0
  126. package/lib/solution/ShopDiscount/utils.d.ts +1 -0
  127. package/lib/solution/ShopDiscount/utils.js +32 -0
  128. package/lib/solution/index.d.ts +1 -0
  129. package/lib/solution/index.js +3 -1
  130. package/package.json +4 -4
@@ -0,0 +1,24 @@
1
+ import { DiscountModule } from "../../modules/Discount";
2
+ import { RulesModule } from "../../modules/Rules";
3
+ export declare enum ShopDiscountHooks {
4
+ onInited = "shopDiscount:onInited",
5
+ onDestroy = "shopDiscount:onDestroy",
6
+ onLoadDiscountList = "shopDiscount:onLoadDiscountList",
7
+ onCustomerChange = "shopDiscount:onCustomerChange",
8
+ onDiscountListChange = "shopDiscount:onDiscountListChange",
9
+ onRulesListChange = "shopDiscount:onRulesListChange",
10
+ onLoadPrepareCalcResult = "shopDiscount:onLoadPrepareCalcResult"
11
+ }
12
+ export type Customer = {
13
+ id: string | number;
14
+ name: string;
15
+ email: string;
16
+ phone: string;
17
+ address: string;
18
+ };
19
+ export interface ShopDiscountState {
20
+ customer: null | Customer;
21
+ discount: DiscountModule | null;
22
+ rules: RulesModule | null;
23
+ productList: Record<string, any>[];
24
+ }
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/solution/ShopDiscount/types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ ShopDiscountHooks: () => ShopDiscountHooks
23
+ });
24
+ module.exports = __toCommonJS(types_exports);
25
+ var ShopDiscountHooks = /* @__PURE__ */ ((ShopDiscountHooks2) => {
26
+ ShopDiscountHooks2["onInited"] = "shopDiscount:onInited";
27
+ ShopDiscountHooks2["onDestroy"] = "shopDiscount:onDestroy";
28
+ ShopDiscountHooks2["onLoadDiscountList"] = "shopDiscount:onLoadDiscountList";
29
+ ShopDiscountHooks2["onCustomerChange"] = "shopDiscount:onCustomerChange";
30
+ ShopDiscountHooks2["onDiscountListChange"] = "shopDiscount:onDiscountListChange";
31
+ ShopDiscountHooks2["onRulesListChange"] = "shopDiscount:onRulesListChange";
32
+ ShopDiscountHooks2["onLoadPrepareCalcResult"] = "shopDiscount:onLoadPrepareCalcResult";
33
+ return ShopDiscountHooks2;
34
+ })(ShopDiscountHooks || {});
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ ShopDiscountHooks
38
+ });
@@ -0,0 +1 @@
1
+ export declare const uniqueById: <T>(arr: T[], key?: string) => T[];
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/solution/ShopDiscount/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ uniqueById: () => uniqueById
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var uniqueById = (arr, key = "id") => {
26
+ const seen = /* @__PURE__ */ new Set();
27
+ return arr.filter((item) => !seen.has(item[key]) && seen.add(item[key]));
28
+ };
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ uniqueById
32
+ });
@@ -1,2 +1,3 @@
1
1
  export * from './BuyTickets';
2
2
  export * from './BookingByStep';
3
+ export * from './ShopDiscount';
@@ -18,8 +18,10 @@ var solution_exports = {};
18
18
  module.exports = __toCommonJS(solution_exports);
19
19
  __reExport(solution_exports, require("./BuyTickets"), module.exports);
20
20
  __reExport(solution_exports, require("./BookingByStep"), module.exports);
21
+ __reExport(solution_exports, require("./ShopDiscount"), module.exports);
21
22
  // Annotate the CommonJS export names for ESM import in node:
22
23
  0 && (module.exports = {
23
24
  ...require("./BuyTickets"),
24
- ...require("./BookingByStep")
25
+ ...require("./BookingByStep"),
26
+ ...require("./ShopDiscount")
25
27
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.10",
4
+ "version": "0.0.13",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "build": "father build",
14
- "dev": "father dev",
14
+ "dev": "father dev --watch",
15
15
  "test": "vitest",
16
16
  "lint": "eslint src --ext .ts",
17
17
  "changeset": "changeset",
@@ -21,7 +21,7 @@
21
21
  "docs": "typedoc --out docs src/index.ts",
22
22
  "sync": "node sync.js",
23
23
  "prepublishOnly": "npm run build",
24
- "deploy": "yarn run build && yarn run changeset && yarn run version && yarn run release"
24
+ "deploy": "yarn run build && yarn run changeset && yarn run version && npm run release"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -44,6 +44,7 @@
44
44
  "@changesets/cli": "^2.26.1",
45
45
  "@types/lodash-es": "^4.17.12",
46
46
  "dayjs": "^1.11.13",
47
+ "decimal.js": "^10.5.0",
47
48
  "lodash-es": "^4.17.21"
48
49
  },
49
50
  "devDependencies": {
@@ -53,7 +54,6 @@
53
54
  "axios": "1.7.2",
54
55
  "eslint": "^8.37.0",
55
56
  "father": "^4.1.0",
56
- "parcel-bundler": "2.7.0",
57
57
  "ts-node": "^10.9.1",
58
58
  "typedoc": "^0.28.2",
59
59
  "typescript": "^5.0.3",