@pisell/private-materials 3.3.101 → 3.3.103

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 (143) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/Sales/Cart/index.js +5 -1
  12. package/es/components/Sales/Cart/utils.d.ts +40 -0
  13. package/es/components/Sales/Cart/utils.js +167 -0
  14. package/es/components/Sales/Checkout/index.d.ts +4 -0
  15. package/es/components/Sales/Checkout/index.js +52 -8
  16. package/es/components/Sales/Checkout/serve.d.ts +13 -0
  17. package/es/components/Sales/Checkout/serve.js +16 -2
  18. package/es/components/Sales/Checkout/utils.js +7 -1
  19. package/es/components/Sales/Summary/index.d.ts +10 -0
  20. package/es/components/Sales/Summary/index.js +17 -2
  21. package/es/components/Sales/Summary/serve.d.ts +1 -0
  22. package/es/components/Sales/Summary/serve.js +6 -0
  23. package/es/components/Sales/Summary/utils.d.ts +15 -0
  24. package/es/components/Sales/Summary/utils.js +43 -1
  25. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  26. package/es/components/appointmentBooking/components/Content/index.js +15 -1
  27. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  28. package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  29. package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
  30. package/es/components/appointmentBooking/components/Services/index.js +23 -27
  31. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
  32. package/es/components/appointmentBooking/deposit/index.js +4 -2
  33. package/es/components/appointmentBooking/index.js +14 -0
  34. package/es/components/appointmentBooking/index.less +1 -1
  35. package/es/components/booking/components/voucher/index.js +2 -2
  36. package/es/components/booking/info/service/editService/index.js +1 -1
  37. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  38. package/es/components/eftposPay/const.d.ts +4 -1
  39. package/es/components/eftposPay/const.js +3 -1
  40. package/es/components/eftposPay/hooks.d.ts +1 -1
  41. package/es/components/eftposPay/hooks.js +3 -1
  42. package/es/components/eftposPay/index.js +1 -1
  43. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  44. package/es/components/eftposPay/linkly/const.js +82 -0
  45. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  46. package/es/components/eftposPay/linkly/hooks/index.js +2 -0
  47. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  48. package/es/components/eftposPay/linkly/hooks/normal.js +321 -0
  49. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  50. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
  51. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  52. package/es/components/eftposPay/linkly/index.js +197 -0
  53. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  54. package/es/components/eftposPay/linkly/service.js +81 -0
  55. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  56. package/es/components/eftposPay/manufacturer.js +4 -0
  57. package/es/components/eftposPay/pay.d.ts +1 -1
  58. package/es/components/eftposPay/pay.js +6 -2
  59. package/es/components/eftposPay/store/index.d.ts +1 -1
  60. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
  61. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  62. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
  63. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
  64. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  65. package/es/components/eventBooking/components/bookingDetailModal/index.js +3 -1
  66. package/es/components/eventBooking/locales.d.ts +24 -0
  67. package/es/components/eventBooking/locales.js +27 -3
  68. package/es/components/pay/toC/PaymentMethods/index.js +5 -4
  69. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  70. package/es/components/ticketBooking/components/ticketBooking/index.js +120 -1
  71. package/es/components/ticketBooking/locales.d.ts +164 -146
  72. package/es/components/ticketBooking/locales.js +195 -147
  73. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  74. package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
  75. package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
  76. package/es/components/ticketBooking/utils/formatTime.js +144 -0
  77. package/lib/components/Sales/Cart/index.js +1 -0
  78. package/lib/components/Sales/Cart/utils.d.ts +40 -0
  79. package/lib/components/Sales/Cart/utils.js +117 -0
  80. package/lib/components/Sales/Checkout/index.d.ts +4 -0
  81. package/lib/components/Sales/Checkout/index.js +39 -7
  82. package/lib/components/Sales/Checkout/serve.d.ts +13 -0
  83. package/lib/components/Sales/Checkout/serve.js +7 -2
  84. package/lib/components/Sales/Checkout/utils.js +2 -0
  85. package/lib/components/Sales/Summary/index.d.ts +10 -0
  86. package/lib/components/Sales/Summary/index.js +7 -1
  87. package/lib/components/Sales/Summary/serve.d.ts +1 -0
  88. package/lib/components/Sales/Summary/serve.js +32 -0
  89. package/lib/components/Sales/Summary/utils.d.ts +15 -0
  90. package/lib/components/Sales/Summary/utils.js +30 -1
  91. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  92. package/lib/components/appointmentBooking/components/Content/index.js +6 -1
  93. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  94. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  95. package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
  96. package/lib/components/appointmentBooking/components/Services/index.js +6 -11
  97. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
  98. package/lib/components/appointmentBooking/deposit/index.js +4 -2
  99. package/lib/components/appointmentBooking/index.js +11 -0
  100. package/lib/components/appointmentBooking/index.less +1 -1
  101. package/lib/components/booking/components/voucher/index.js +2 -2
  102. package/lib/components/booking/info/service/editService/index.js +1 -0
  103. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  104. package/lib/components/eftposPay/const.d.ts +4 -1
  105. package/lib/components/eftposPay/const.js +2 -0
  106. package/lib/components/eftposPay/hooks.d.ts +1 -1
  107. package/lib/components/eftposPay/hooks.js +11 -4
  108. package/lib/components/eftposPay/index.js +1 -1
  109. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  110. package/lib/components/eftposPay/linkly/const.js +102 -0
  111. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  112. package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
  113. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  114. package/lib/components/eftposPay/linkly/hooks/normal.js +242 -0
  115. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  116. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
  117. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  118. package/lib/components/eftposPay/linkly/index.js +208 -0
  119. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  120. package/lib/components/eftposPay/linkly/service.js +55 -0
  121. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  122. package/lib/components/eftposPay/manufacturer.js +6 -0
  123. package/lib/components/eftposPay/pay.d.ts +1 -1
  124. package/lib/components/eftposPay/pay.js +13 -2
  125. package/lib/components/eftposPay/store/index.d.ts +1 -1
  126. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -3
  127. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  128. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
  129. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
  130. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  131. package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
  132. package/lib/components/eventBooking/locales.d.ts +24 -0
  133. package/lib/components/eventBooking/locales.js +27 -3
  134. package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
  135. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  136. package/lib/components/ticketBooking/components/ticketBooking/index.js +120 -1
  137. package/lib/components/ticketBooking/locales.d.ts +164 -146
  138. package/lib/components/ticketBooking/locales.js +22 -4
  139. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  140. package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
  141. package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
  142. package/lib/components/ticketBooking/utils/formatTime.js +139 -0
  143. package/package.json +2 -2
@@ -0,0 +1,139 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/ticketBooking/utils/formatTime.ts
30
+ var formatTime_exports = {};
31
+ __export(formatTime_exports, {
32
+ formatMultiDayDate: () => formatMultiDayDate,
33
+ getServiceTime: () => getServiceTime,
34
+ isEn: () => isEn
35
+ });
36
+ module.exports = __toCommonJS(formatTime_exports);
37
+ var import_dayjs = __toESM(require("dayjs"));
38
+ var import_utils = require("@pisell/utils");
39
+ var import_zh_cn = require("dayjs/locale/zh-cn");
40
+ var import_en = require("dayjs/locale/en");
41
+ var import_zh_tw = require("dayjs/locale/zh-tw");
42
+ var isEn = (item) => {
43
+ const locale = (item == null ? void 0 : item.locale) || "en-US";
44
+ const _isEn = locale === "en-US" || locale === "en";
45
+ const localeTypes = {
46
+ "en-US": "en",
47
+ "zh-CN": "zh-cn",
48
+ "zh-HK": "zh-tw"
49
+ };
50
+ import_dayjs.default.locale(localeTypes[locale]);
51
+ return _isEn;
52
+ };
53
+ var formatMultiDayDate = (item) => {
54
+ const _isEn = isEn(item);
55
+ const startDate = (0, import_dayjs.default)(item == null ? void 0 : item.start_date);
56
+ const endDate = (0, import_dayjs.default)(item == null ? void 0 : item.end_date);
57
+ const _format = _isEn ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
58
+ const date = `${startDate.format(_format)} ~ ${endDate.format(_format)}`;
59
+ return date;
60
+ };
61
+ var getServiceTime = (item, currentDate, utils) => {
62
+ var _a, _b, _c, _d;
63
+ if (!(0, import_dayjs.default)(currentDate).isValid()) return "";
64
+ const locale = (item == null ? void 0 : item.locale) || ((_a = utils == null ? void 0 : utils.storage) == null ? void 0 : _a.get("umi_locale")) || "en-US";
65
+ const isEn2 = locale === "en-US" || locale === "en";
66
+ const localeTypes = {
67
+ "en-US": "en",
68
+ "zh-CN": "zh-cn",
69
+ "zh-HK": "zh-tw"
70
+ };
71
+ import_dayjs.default.locale(localeTypes[locale]);
72
+ let startDate = (0, import_dayjs.default)(item == null ? void 0 : item.start_date);
73
+ let endDate = (0, import_dayjs.default)(item == null ? void 0 : item.end_date);
74
+ let diffInDays = (item == null ? void 0 : item.custom_day_count) || endDate.diff(startDate, "day");
75
+ if (item == null ? void 0 : item.duration_type) {
76
+ const sameDay = startDate.isSame(endDate, "day");
77
+ const dateFormat = isEn2 ? "DD/MM/YYYY" : "YYYY-MM-DD";
78
+ const timeFormat = "HH:mm";
79
+ const startTime = (item == null ? void 0 : item.start_time) || startDate.format(timeFormat);
80
+ const endTime = (item == null ? void 0 : item.end_time) || endDate.format(timeFormat);
81
+ let dateTime = "";
82
+ if (sameDay) {
83
+ if (isEn2) {
84
+ dateTime = `${startTime} ~ ${endTime} ${startDate.format(dateFormat)}`;
85
+ } else {
86
+ dateTime = `${startDate.format(dateFormat)} ${startTime} ~ ${endTime}`;
87
+ }
88
+ } else {
89
+ if (isEn2) {
90
+ dateTime = `${startTime} ${startDate.format(dateFormat)} ~ ${endTime} ${endDate.format(dateFormat)}`;
91
+ } else {
92
+ dateTime = `${startDate.format(dateFormat)} ${startTime} ~ ${endDate.format(dateFormat)} ${endTime}`;
93
+ }
94
+ }
95
+ const startDateTime = `${startDate.format("YYYY-MM-DD")} ${startTime}`;
96
+ const endDateTime = `${endDate.format("YYYY-MM-DD")} ${endTime}`;
97
+ let _duration = (0, import_dayjs.default)(endDateTime).diff((0, import_dayjs.default)(startDateTime), item == null ? void 0 : item.duration_type);
98
+ let durationText = "";
99
+ if ((item == null ? void 0 : item.duration_type) === "minutes") {
100
+ const hours = Math.floor(_duration / 60);
101
+ const minutes = _duration % 60;
102
+ durationText = import_utils.locales.getText("pisell2.product.card.hour.minute")(hours, minutes);
103
+ } else if ((item == null ? void 0 : item.duration_type) === "days") {
104
+ durationText = import_utils.locales.getText("pisell2.product.card.day")(_duration);
105
+ } else {
106
+ durationText = `${_duration}`;
107
+ }
108
+ return `${dateTime} (${durationText})`;
109
+ }
110
+ let _format = isEn2 ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
111
+ if ((item == null ? void 0 : item.hasOwnProperty("format")) && ((_b = item == null ? void 0 : item.format) == null ? void 0 : _b.length) > 0) {
112
+ _format = isEn2 ? (_c = item == null ? void 0 : item.format) == null ? void 0 : _c[0] : (_d = item == null ? void 0 : item.format) == null ? void 0 : _d[1];
113
+ }
114
+ if (item == null ? void 0 : item.show_time) {
115
+ startDate = (0, import_dayjs.default)((item == null ? void 0 : item.start_time) ? `${item == null ? void 0 : item.start_date} ${item == null ? void 0 : item.start_time}` : startDate.format("YYYY-MM-DD HH:mm"));
116
+ endDate = (0, import_dayjs.default)((item == null ? void 0 : item.end_time) ? `${item == null ? void 0 : item.end_date} ${item == null ? void 0 : item.end_time}` : endDate.format("YYYY-MM-DD HH:mm"));
117
+ }
118
+ if ((item == null ? void 0 : item.duration_type) === "minutes") {
119
+ diffInDays = endDate.diff(startDate, "minute");
120
+ }
121
+ const date = `${startDate.format(_format)} ~ ${endDate.format(_format)}`;
122
+ let text = import_utils.locales.getText("pisell2.product.card.day")(diffInDays);
123
+ if (item == null ? void 0 : item.custom_day_count) {
124
+ text = import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays);
125
+ }
126
+ const textTypes = {
127
+ "minutes": import_utils.locales.getText("pisell2.product.card.minute")(diffInDays),
128
+ "event": import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays)
129
+ };
130
+ text = (textTypes == null ? void 0 : textTypes[item == null ? void 0 : item.duration_type]) || text;
131
+ let duration = `${diffInDays}${text}`;
132
+ return `${date} (${duration})`;
133
+ };
134
+ // Annotate the CommonJS export names for ESM import in node:
135
+ 0 && (module.exports = {
136
+ formatMultiDayDate,
137
+ getServiceTime,
138
+ isEn
139
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.3.101",
3
+ "version": "3.3.103",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  "@pisell/utils": "3.0.0",
63
63
  "@pisell/materials": "3.3.35",
64
64
  "@pisell/icon": "0.0.11",
65
- "@pisell/date-picker": "3.0.2"
65
+ "@pisell/date-picker": "3.0.4"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",