@pisell/private-materials 3.4.55 → 3.4.56

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 (134) 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 +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
  12. package/es/components/booking/addons/index.js +20 -17
  13. package/es/components/booking/components/footer/utils.d.ts +6 -0
  14. package/es/components/booking/components/footer/utils.js +117 -53
  15. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  16. package/es/components/booking/components/voucher/index.js +27 -12
  17. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  18. package/es/components/booking/info/service/like/index.d.ts +1 -0
  19. package/es/components/booking/info/service2/utils.d.ts +1 -1
  20. package/es/components/booking/info/service2/utils.js +1 -0
  21. package/es/components/booking/info2/service/addService/index.js +3 -3
  22. package/es/components/booking/utils.d.ts +3 -2
  23. package/es/components/booking/utils.js +16 -2
  24. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  25. package/es/components/eftpos/form/index.d.ts +1 -0
  26. package/es/components/eftpos/group/index.d.ts +1 -0
  27. package/es/components/eftpos/hooks.d.ts +1 -0
  28. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  29. package/es/components/eftpos/icon/device.d.ts +1 -0
  30. package/es/components/eftpos/receipt/index.d.ts +1 -0
  31. package/es/components/eftposPay/amount.d.ts +1 -1
  32. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  33. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  34. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  35. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  36. package/es/components/eftposPay/device.d.ts +1 -1
  37. package/es/components/eftposPay/hooks.d.ts +2 -2
  38. package/es/components/eftposPay/store/index.d.ts +6 -6
  39. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  40. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  43. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  44. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  45. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  46. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  47. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  48. package/es/components/systemSettings/registry/components/SectionList.js +5 -1
  49. package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  50. package/es/components/ticketBooking/utils/index.js +23 -8
  51. package/es/components/wallet/Detail/index.js +34 -2
  52. package/es/components/wallet/Detail/index.less +11 -0
  53. package/es/components/wallet/Detail/locales.d.ts +6 -0
  54. package/es/components/wallet/Detail/locales.js +14 -2
  55. package/es/components/wallet/Voucher/index.js +11 -10
  56. package/es/components/wallet/components/WalletCard.js +5 -1
  57. package/es/components/wallet/index.js +4 -2
  58. package/es/components/wallet/serve.d.ts +7 -0
  59. package/es/components/wallet/utils.d.ts +48 -0
  60. package/es/components/wallet/utils.js +342 -0
  61. package/es/index.d.ts +1 -0
  62. package/es/index.js +1 -0
  63. package/es/plus/clientName/index.d.ts +1 -0
  64. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  65. package/es/plus/walletPassGallery/components/passDetail/index.js +79 -30
  66. package/es/plus/walletPassGallery/index.js +4 -2
  67. package/es/plus/walletPassGallery/serve.d.ts +3 -0
  68. package/es/plus/walletPassGallery/serve.js +4 -2
  69. package/es/pro/Login2.0/AuthModal.js +12 -4
  70. package/es/pro/Login2.0/index.less +7 -7
  71. package/es/pro/pisellPaymentList/example.d.ts +1 -0
  72. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  73. package/lib/components/booking/addons/index.js +10 -7
  74. package/lib/components/booking/components/footer/utils.d.ts +6 -0
  75. package/lib/components/booking/components/footer/utils.js +86 -36
  76. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  77. package/lib/components/booking/components/voucher/index.js +23 -7
  78. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  79. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  80. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  81. package/lib/components/booking/info/service2/utils.js +1 -0
  82. package/lib/components/booking/info2/service/addService/index.js +2 -2
  83. package/lib/components/booking/utils.d.ts +3 -2
  84. package/lib/components/booking/utils.js +12 -0
  85. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  86. package/lib/components/eftpos/form/index.d.ts +1 -0
  87. package/lib/components/eftpos/group/index.d.ts +1 -0
  88. package/lib/components/eftpos/hooks.d.ts +1 -0
  89. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  90. package/lib/components/eftpos/icon/device.d.ts +1 -0
  91. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  92. package/lib/components/eftposPay/amount.d.ts +1 -1
  93. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  94. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  95. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  96. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  97. package/lib/components/eftposPay/device.d.ts +1 -1
  98. package/lib/components/eftposPay/hooks.d.ts +2 -2
  99. package/lib/components/eftposPay/store/index.d.ts +6 -6
  100. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  101. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  102. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  103. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  104. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  105. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  106. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  107. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  108. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  109. package/lib/components/systemSettings/registry/components/SectionList.js +4 -1
  110. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  111. package/lib/components/ticketBooking/utils/index.js +9 -4
  112. package/lib/components/wallet/Detail/index.js +31 -3
  113. package/lib/components/wallet/Detail/index.less +11 -0
  114. package/lib/components/wallet/Detail/locales.d.ts +6 -0
  115. package/lib/components/wallet/Detail/locales.js +14 -2
  116. package/lib/components/wallet/Voucher/index.js +8 -8
  117. package/lib/components/wallet/components/WalletCard.js +4 -0
  118. package/lib/components/wallet/index.js +2 -2
  119. package/lib/components/wallet/serve.d.ts +7 -0
  120. package/lib/components/wallet/utils.d.ts +48 -0
  121. package/lib/components/wallet/utils.js +287 -0
  122. package/lib/index.d.ts +1 -0
  123. package/lib/index.js +3 -0
  124. package/lib/plus/clientName/index.d.ts +1 -0
  125. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  126. package/lib/plus/walletPassGallery/components/passDetail/index.js +50 -14
  127. package/lib/plus/walletPassGallery/index.js +4 -2
  128. package/lib/plus/walletPassGallery/serve.d.ts +3 -0
  129. package/lib/plus/walletPassGallery/serve.js +3 -2
  130. package/lib/pro/Login2.0/AuthModal.js +15 -7
  131. package/lib/pro/Login2.0/index.less +7 -7
  132. package/lib/pro/pisellPaymentList/example.d.ts +1 -0
  133. package/lowcode/wallet-pass-detail/meta.ts +89 -0
  134. package/package.json +3 -3
@@ -0,0 +1,287 @@
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/components/wallet/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ formatScheduleText: () => formatScheduleText
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ function formatDateTime(dateTime, isAll = false, locale = "zh-CN") {
26
+ const date = new Date(dateTime);
27
+ const year = date.getFullYear();
28
+ const month = String(date.getMonth() + 1).padStart(2, "0");
29
+ const day = String(date.getDate()).padStart(2, "0");
30
+ const hours = date.getHours();
31
+ const minutes = String(date.getMinutes()).padStart(2, "0");
32
+ if (isAll) {
33
+ if (locale === "en") {
34
+ return `${day}/${month}/${year}`;
35
+ } else {
36
+ return `${year}-${month}-${day}`;
37
+ }
38
+ }
39
+ if (locale === "en") {
40
+ const period = hours >= 12 ? "PM" : "AM";
41
+ const displayHours = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
42
+ return `${day}/${month}/${year} ${displayHours}:${minutes} ${period}`;
43
+ } else {
44
+ const displayHours = String(hours).padStart(2, "0");
45
+ return `${year}-${month}-${day} ${displayHours}:${minutes}`;
46
+ }
47
+ }
48
+ var textConfig = {
49
+ "zh-HK": {
50
+ weekdays: ["日", "一", "二", "三", "四", "五", "六"],
51
+ separator: "、",
52
+ timeSeparator: "–",
53
+ rangeSeparator: " 至 ",
54
+ periodSeparator: ";",
55
+ timeSlotSeparator: ",",
56
+ every: "每",
57
+ day: "天",
58
+ week: "周",
59
+ month: "月",
60
+ year: "年",
61
+ available: "可用",
62
+ unlimited: "无限期",
63
+ weekPrefix: "周"
64
+ },
65
+ "zh-CN": {
66
+ weekdays: ["日", "一", "二", "三", "四", "五", "六"],
67
+ separator: "、",
68
+ timeSeparator: "–",
69
+ rangeSeparator: " 至 ",
70
+ periodSeparator: ";",
71
+ timeSlotSeparator: ",",
72
+ every: "每",
73
+ day: "天",
74
+ week: "周",
75
+ month: "月",
76
+ year: "年",
77
+ available: "可用",
78
+ unlimited: "无限期",
79
+ weekPrefix: "周"
80
+ },
81
+ "en": {
82
+ weekdays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
83
+ separator: ", ",
84
+ timeSeparator: "–",
85
+ rangeSeparator: " - ",
86
+ periodSeparator: "; ",
87
+ timeSlotSeparator: ", ",
88
+ every: "every ",
89
+ day: "day",
90
+ week: "week",
91
+ month: "month",
92
+ year: "year",
93
+ available: "available",
94
+ unlimited: "unlimited",
95
+ weekPrefix: ""
96
+ }
97
+ };
98
+ function getWeekdayText(dayNumbers, locale) {
99
+ const config = textConfig[locale];
100
+ return dayNumbers.map((day) => config.weekdays[day]).join(config.separator);
101
+ }
102
+ function getRepeatFrequencyText(repeatType, frequency, locale) {
103
+ const config = textConfig[locale];
104
+ const typeMap = {
105
+ "daily": config.day,
106
+ "weekly": config.week,
107
+ "monthly": config.month,
108
+ "yearly": config.year
109
+ };
110
+ if (locale === "en") {
111
+ if (frequency === 1) {
112
+ return `${config.every}${typeMap[repeatType]}`;
113
+ }
114
+ return `${config.every}${frequency} ${typeMap[repeatType]}s`;
115
+ } else {
116
+ if (frequency === 1) {
117
+ return `${config.every}${typeMap[repeatType]}`;
118
+ }
119
+ return `${config.every}${frequency}${typeMap[repeatType]}`;
120
+ }
121
+ }
122
+ function formatScheduleText(scheduleList, locale = "en") {
123
+ const results = [];
124
+ const config = textConfig[locale];
125
+ scheduleList.forEach((schedule) => {
126
+ var _a, _b;
127
+ const validityTexts = [];
128
+ const excluded_date = [];
129
+ const included_date = [];
130
+ if ((_a = schedule.repeat_rule) == null ? void 0 : _a.excluded_date) {
131
+ schedule.repeat_rule.excluded_date.forEach((excludeItem) => {
132
+ const startDate = formatDateTime(excludeItem.start, true, locale);
133
+ const endDate = formatDateTime(excludeItem.end, true, locale);
134
+ if (excludeItem.start === excludeItem.end) {
135
+ excluded_date.push(startDate);
136
+ } else {
137
+ excluded_date.push(`${startDate}${config.rangeSeparator}${endDate}`);
138
+ }
139
+ });
140
+ }
141
+ if ((_b = schedule.repeat_rule) == null ? void 0 : _b.included_date) {
142
+ schedule.repeat_rule.included_date.forEach((includeItem) => {
143
+ const startDate = formatDateTime(includeItem.start, true, locale);
144
+ const endDate = formatDateTime(includeItem.end, true, locale);
145
+ if (includeItem.start === includeItem.end) {
146
+ included_date.push(startDate);
147
+ } else {
148
+ included_date.push(`${startDate}${config.rangeSeparator}${endDate}`);
149
+ }
150
+ });
151
+ }
152
+ const isAllDay = schedule.is_all === 1;
153
+ let validityText = "";
154
+ if (schedule.repeat_type === "none") {
155
+ if (schedule.type === "standard") {
156
+ const startDateTime = formatDateTime(schedule.start_time, isAllDay, locale);
157
+ const endDateTime = formatDateTime(schedule.end_time, isAllDay, locale);
158
+ validityText = `${startDateTime}${config.rangeSeparator}${endDateTime}`;
159
+ } else if (schedule.type === "time-slots" && schedule.time_slot.length > 0) {
160
+ const baseDate = formatDateTime(schedule.start_time, true, locale);
161
+ if (isAllDay) {
162
+ validityText = `${baseDate}`;
163
+ } else {
164
+ const timeSlots = schedule.time_slot.map(
165
+ (slot) => `${slot.start_time}${config.timeSeparator}${slot.end_time}`
166
+ );
167
+ validityText = `${baseDate} ${timeSlots.join(config.timeSlotSeparator)}`;
168
+ }
169
+ } else if (schedule.type === "designation" && schedule.designation) {
170
+ const designationTexts = schedule.designation.map((item) => {
171
+ if (isAllDay || item.start_time === "00:00" && item.end_time === "23:59") {
172
+ const startDate = formatDateTime(item.start_date, true, locale);
173
+ const endDate = formatDateTime(item.end_date, true, locale);
174
+ return `${startDate}${config.rangeSeparator}${endDate}`;
175
+ } else {
176
+ const startDate = formatDateTime(item.start_date, true, locale);
177
+ return `${startDate} ${item.start_time}${config.timeSeparator}${item.end_time}`;
178
+ }
179
+ });
180
+ validityTexts.push(...designationTexts);
181
+ }
182
+ } else if (schedule.repeat_rule) {
183
+ const { frequency, frequency_date } = schedule.repeat_rule;
184
+ const startText = isAllDay ? formatDateTime(schedule.start_time, true, locale) : formatDateTime(schedule.start_time, false, locale);
185
+ let endDateText = "";
186
+ if (schedule.repeat_rule.end.type === "never") {
187
+ endDateText = config.unlimited;
188
+ } else if (schedule.repeat_rule.end.end_date) {
189
+ endDateText = formatDateTime(schedule.repeat_rule.end.end_date, true, locale);
190
+ }
191
+ if (schedule.type === "standard") {
192
+ if (schedule.repeat_type === "daily") {
193
+ if (isAllDay) {
194
+ const frequencyText = getRepeatFrequencyText("daily", frequency, locale);
195
+ if (locale === "en") {
196
+ validityText = `${startText}${config.rangeSeparator}${endDateText}, ${config.available} ${frequencyText}`;
197
+ } else {
198
+ validityText = `${startText}${config.rangeSeparator}${endDateText},${frequencyText}${config.available}`;
199
+ }
200
+ } else {
201
+ const startTime = formatDateTime(schedule.start_time, false, locale);
202
+ const endTime = formatDateTime(schedule.end_time, false, locale);
203
+ const timeRange = locale === "en" ? `${startTime.split(" ")[1]} ${startTime.split(" ")[2]}${config.timeSeparator}${endTime.split(" ")[1]} ${endTime.split(" ")[2]}` : `${startTime.split(" ")[1]}${config.timeSeparator}${endTime.split(" ")[1]}`;
204
+ const frequencyText = getRepeatFrequencyText("daily", frequency, locale);
205
+ const dateRange = locale === "en" ? `${startTime.split(" ")[0]}${config.rangeSeparator}${endDateText}` : `${startText.split(" ")[0]}${config.rangeSeparator}${endDateText}`;
206
+ if (locale === "en") {
207
+ validityText = `${dateRange}, ${config.available} ${frequencyText} ${timeRange}`;
208
+ } else {
209
+ validityText = `${dateRange},${frequencyText} ${timeRange} ${config.available}`;
210
+ }
211
+ }
212
+ } else if (schedule.repeat_type === "weekly") {
213
+ const weekdaysText = getWeekdayText(frequency_date, locale);
214
+ if (isAllDay) {
215
+ if (locale === "en") {
216
+ const frequencyText = frequency === 1 ? "every week" : `every ${frequency} weeks`;
217
+ validityText = `${startText}${config.rangeSeparator}${endDateText}, ${frequencyText} on ${weekdaysText} `;
218
+ } else {
219
+ const frequencyText = frequency === 1 ? "每周" : `每${frequency}周的`;
220
+ validityText = `${startText}${config.rangeSeparator}${endDateText},${frequencyText}${config.weekPrefix}${weekdaysText}${config.available}`;
221
+ }
222
+ } else {
223
+ const startTime = formatDateTime(schedule.start_time, false, locale);
224
+ const endTime = formatDateTime(schedule.end_time, false, locale);
225
+ const timeRange = locale === "en" ? `${startTime.split(" ")[1]} ${startTime.split(" ")[2]}${config.timeSeparator}${endTime.split(" ")[1]} ${endTime.split(" ")[2]}` : `${startTime.split(" ")[1]}${config.timeSeparator}${endTime.split(" ")[1]}`;
226
+ const dateRange = locale === "en" ? `${startTime.split(" ")[0]}${config.rangeSeparator}${endDateText}` : `${startText.split(" ")[0]}${config.rangeSeparator}${endDateText}`;
227
+ if (locale === "en") {
228
+ const frequencyText = frequency === 1 ? "every week" : `every ${frequency} weeks`;
229
+ validityText = `${dateRange}, ${frequencyText} on ${weekdaysText} ${timeRange}`;
230
+ } else {
231
+ const frequencyText = frequency === 1 ? "每周" : `每${frequency}周的`;
232
+ validityText = `${dateRange},${frequencyText}${config.weekPrefix}${weekdaysText} ${timeRange}`;
233
+ }
234
+ }
235
+ }
236
+ } else if (schedule.type === "time-slots" && schedule.time_slot.length > 0) {
237
+ const baseDate = formatDateTime(schedule.start_time, true, locale);
238
+ const timeSlots = schedule.time_slot.map(
239
+ (slot) => `${slot.start_time}${config.timeSeparator}${slot.end_time}`
240
+ );
241
+ const timeSlotsText = timeSlots.join(config.timeSlotSeparator);
242
+ if (schedule.repeat_type === "daily") {
243
+ const frequencyText = getRepeatFrequencyText("daily", frequency, locale);
244
+ if (locale === "en") {
245
+ validityText = `${baseDate}${config.rangeSeparator}${endDateText}, ${config.available} ${frequencyText} ${timeSlotsText}`;
246
+ } else {
247
+ validityText = `${baseDate}${config.rangeSeparator}${endDateText},${frequencyText} ${timeSlotsText} ${config.available}`;
248
+ }
249
+ } else if (schedule.repeat_type === "weekly") {
250
+ const weekdaysText = getWeekdayText(frequency_date, locale);
251
+ if (locale === "en") {
252
+ const frequencyText = frequency === 1 ? "every week" : `every ${frequency} weeks`;
253
+ validityText = `${baseDate}${config.rangeSeparator}${endDateText}, ${frequencyText} on ${weekdaysText} ${timeSlotsText}`;
254
+ } else {
255
+ const frequencyText = frequency === 1 ? "每周" : `每${frequency}周的`;
256
+ validityText = `${baseDate}${config.rangeSeparator}${endDateText},${frequencyText}${config.weekPrefix}${weekdaysText} ${timeSlotsText} ${config.available}`;
257
+ }
258
+ }
259
+ }
260
+ } else if (schedule.type === "designation" && schedule.designation) {
261
+ const designationTexts = schedule.designation.map((item) => {
262
+ if (isAllDay || item.start_time === "00:00" && item.end_time === "23:59") {
263
+ const startDate = formatDateTime(item.start_date, true, locale);
264
+ const endDate = formatDateTime(item.end_date, true, locale);
265
+ return `${startDate}${config.rangeSeparator}${endDate}`;
266
+ } else {
267
+ const startDate = formatDateTime(item.start_date, true, locale);
268
+ return `${startDate} ${item.start_time}${config.timeSeparator}${item.end_time}`;
269
+ }
270
+ });
271
+ validityTexts.push(...designationTexts);
272
+ }
273
+ if (validityText) {
274
+ validityTexts.push(validityText);
275
+ }
276
+ results.push({
277
+ validityTexts,
278
+ excluded_date,
279
+ included_date
280
+ });
281
+ });
282
+ return results;
283
+ }
284
+ // Annotate the CommonJS export names for ESM import in node:
285
+ 0 && (module.exports = {
286
+ formatScheduleText
287
+ });
package/lib/index.d.ts CHANGED
@@ -57,4 +57,5 @@ export { default as ContactInfoModal } from './plus/contactInfoModal';
57
57
  export { Login2, Register2, AuthModal } from './pro/Login2.0';
58
58
  export { default as WalletEditor } from './plus/walletEditor';
59
59
  export { default as WalletPassGallery } from './plus/walletPassGallery';
60
+ export { default as WalletPassDetail } from './plus/walletPassGallery/components/passDetail';
60
61
  export { default as SettingsRegistry } from './components/systemSettings/registry';
package/lib/index.js CHANGED
@@ -94,6 +94,7 @@ __export(src_exports, {
94
94
  Wallet: () => import_wallet.default,
95
95
  WalletEditor: () => import_walletEditor.default,
96
96
  WalletList: () => import_walletList.default,
97
+ WalletPassDetail: () => import_passDetail.default,
97
98
  WalletPassGallery: () => import_walletPassGallery.default,
98
99
  WorkspaceList: () => import_workSpaceList.default,
99
100
  WorkspaceListDetail: () => import_workSpaceListDetail.default
@@ -159,6 +160,7 @@ var import_contactInfoModal = __toESM(require("./plus/contactInfoModal"));
159
160
  var import_Login2 = require("./pro/Login2.0");
160
161
  var import_walletEditor = __toESM(require("./plus/walletEditor"));
161
162
  var import_walletPassGallery = __toESM(require("./plus/walletPassGallery"));
163
+ var import_passDetail = __toESM(require("./plus/walletPassGallery/components/passDetail"));
162
164
  var import_registry = __toESM(require("./components/systemSettings/registry"));
163
165
  import_dayjs.default.extend(import_weekday.default);
164
166
  import_dayjs.default.extend(import_localeData.default);
@@ -229,6 +231,7 @@ import_dayjs.default.extend(import_localeData.default);
229
231
  Wallet,
230
232
  WalletEditor,
231
233
  WalletList,
234
+ WalletPassDetail,
232
235
  WalletPassGallery,
233
236
  WorkspaceList,
234
237
  WorkspaceListDetail
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { IClientNameProps } from './type';
3
4
  declare const ClientName: ({ className, dataSource, style }: IClientNameProps) => JSX.Element | null;
@@ -3,6 +3,7 @@ interface PassDetailProps {
3
3
  dataSource?: any | null;
4
4
  platform?: 'pc' | 'h5';
5
5
  buttonGroupList?: any[][];
6
+ showTimeLine?: boolean;
6
7
  }
7
8
  declare const PassDetail: (props: PassDetailProps) => JSX.Element | null;
8
9
  export default PassDetail;
@@ -48,19 +48,26 @@ var import_recharge = __toESM(require("../recharge"));
48
48
  var import_footerButton = __toESM(require("../footerButton"));
49
49
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
50
50
  var import_index = require("./index.less");
51
+ var import_utils3 = require("../../../../components/wallet/utils");
52
+ var import_locales = __toESM(require("../../locales"));
53
+ var import_utils4 = require("../../../../utils");
51
54
  var { Text } = import_antd.Typography;
52
55
  var PassDetail = (props) => {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
54
- if (!props.dataSource) return null;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
55
57
  const { symbol = "$" } = (0, import_materials.usePisellConfig)();
56
- const { dataSource, platform = "pc" } = props;
58
+ const { dataSource, platform = "pc", showTimeLine = true } = props;
57
59
  const [activeKey, setActiveKey] = (0, import_react.useState)("detail");
58
60
  const [rechargeOpen, setRechargeOpen] = (0, import_react.useState)(false);
59
61
  const containerRef = (0, import_react.useRef)(null);
60
62
  const isIndicatorVisibleRef = (0, import_react.useRef)(false);
61
63
  const context = (0, import_useEngineContext.default)();
62
64
  const { store } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || { store: {} };
63
- const timezone = ((_e = (_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) == null ? void 0 : _e.shop.timezone) || "Asia/Shanghai";
65
+ const { apiPrefix } = ((_b = context.appHelper) == null ? void 0 : _b.constants) || { apiPrefix: "/h5" };
66
+ const timezone = ((_g = (_f = (_e = (_d = (_c = store == null ? void 0 : store.getState) == null ? void 0 : _c.call(store)) == null ? void 0 : _d.global) == null ? void 0 : _e.symbol) == null ? void 0 : _f.shop) == null ? void 0 : _g.timezone) || "Asia/Shanghai";
67
+ import_utils.locales.init(import_locales.default, ((_i = (_h = context == null ? void 0 : context.engine) == null ? void 0 : _h.props) == null ? void 0 : _i.locale) || "en");
68
+ if ((_k = (_j = context.appHelper) == null ? void 0 : _j.utils) == null ? void 0 : _k.request) {
69
+ import_utils4.request.setRequest((_m = (_l = context.appHelper) == null ? void 0 : _l.utils) == null ? void 0 : _m.request);
70
+ }
64
71
  const {
65
72
  id = "",
66
73
  code = "",
@@ -69,17 +76,22 @@ var PassDetail = (props) => {
69
76
  encoded = "",
70
77
  balance,
71
78
  expire_date = "",
72
- product = {}
79
+ product = {},
80
+ custom_schedule_snapshot,
81
+ customer_id
73
82
  } = dataSource || {};
74
83
  const {
75
84
  description = "",
76
85
  extension_data = [],
77
86
  customer_order_behavior_count = 0
78
87
  } = product || {};
79
- const _getDetail = (0, import_ahooks.useRequest)(() => (0, import_serve.getDetailApi)({ id }), {
88
+ const _getDetail = (0, import_ahooks.useRequest)(() => (0, import_serve.getDetailApi)({ id, apiPrefix, order_behavior_count_customer_id: customer_id }), {
80
89
  ready: !!id,
81
- refreshDeps: [id]
90
+ refreshDeps: [id, customer_id]
82
91
  });
92
+ const scheduleList = (0, import_react.useMemo)(() => {
93
+ return (custom_schedule_snapshot == null ? void 0 : custom_schedule_snapshot.data) || [];
94
+ }, [custom_schedule_snapshot]);
83
95
  (0, import_react.useEffect)(() => {
84
96
  if (tag === "product_discount_card") {
85
97
  setActiveKey("detail");
@@ -111,7 +123,29 @@ var PassDetail = (props) => {
111
123
  return () => clearTimeout(timeoutId);
112
124
  }, []);
113
125
  const descs = (0, import_react.useMemo)(() => {
114
- var _a2;
126
+ var _a2, _b2, _c2;
127
+ const detail = (0, import_utils3.formatScheduleText)(scheduleList, (_b2 = (_a2 = context == null ? void 0 : context.engine) == null ? void 0 : _a2.props) == null ? void 0 : _b2.locale);
128
+ let expireText = expire_date ? expire_date : import_utils.locales.getText("wallet-pass-gallery.expireDate");
129
+ if (scheduleList.length > 0) {
130
+ let validityTexts = "";
131
+ let excludedText = "";
132
+ let includedText = "";
133
+ detail.forEach((item) => {
134
+ if (item.validityTexts.length > 0) {
135
+ validityTexts = `${validityTexts}${item.validityTexts.join("\n")}
136
+ `;
137
+ }
138
+ if (item.excluded_date.length > 0) {
139
+ excludedText = `${excludedText}${item.excluded_date.join("\n")}
140
+ `;
141
+ }
142
+ if (item.included_date.length > 0) {
143
+ includedText = `${includedText}${item.included_date.join("\n")}
144
+ `;
145
+ }
146
+ });
147
+ expireText = /* @__PURE__ */ import_react.default.createElement("span", { className: "wallet-detail-expire-text" }, validityTexts, excludedText && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-expire-text-title" }, import_utils.locales.getText("page.wallet.notValidDate")), excludedText, includedText && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-expire-text-title" }, import_utils.locales.getText("page.wallet.includedDate")), includedText);
148
+ }
115
149
  let data = [
116
150
  {
117
151
  label: import_utils.locales.getText("wallet-pass-gallery.cardName"),
@@ -124,11 +158,11 @@ var PassDetail = (props) => {
124
158
  },
125
159
  {
126
160
  label: import_utils.locales.getText("wallet-pass-gallery.validDate"),
127
- value: expire_date ? expire_date : import_utils.locales.getText("wallet-pass-gallery.expireDate")
161
+ value: expireText
128
162
  }
129
163
  ];
130
164
  if (tag === "product_discount_card") {
131
- const isFixedAmount = ((_a2 = dataSource.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
165
+ const isFixedAmount = ((_c2 = dataSource.metadata) == null ? void 0 : _c2.discount_card_type) === "fixed_amount";
132
166
  data.splice(2, 0, {
133
167
  label: import_utils.locales.getText("wallet-pass-gallery.discount"),
134
168
  value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
@@ -195,8 +229,10 @@ var PassDetail = (props) => {
195
229
  };
196
230
  const renderTimeLine = () => {
197
231
  if (tag === "product_discount_card") return null;
232
+ if (!showTimeLine) return null;
198
233
  return /* @__PURE__ */ import_react.default.createElement(import_timelineSection.default, { code, tag, timezone });
199
234
  };
235
+ if (!props.dataSource) return null;
200
236
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
201
237
  "div",
202
238
  {
@@ -240,7 +276,7 @@ var PassDetail = (props) => {
240
276
  },
241
277
  /* @__PURE__ */ import_react.default.createElement("div", { "data-anchor": "detail" })
242
278
  ),
243
- /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(Text, { className: "pisell-wallet-pass-gallery_detail-title" }, import_utils.locales.getText("wallet-pass-gallery.details")), platform === "pc" && tag === "gift_card" && ((_f = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _f.hide_recharge) === 0 && /* @__PURE__ */ import_react.default.createElement(
279
+ /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(Text, { className: "pisell-wallet-pass-gallery_detail-title" }, import_utils.locales.getText("wallet-pass-gallery.details")), platform === "pc" && tag === "gift_card" && ((_n = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _n.hide_recharge) === 0 && /* @__PURE__ */ import_react.default.createElement(
244
280
  import_antd.Button,
245
281
  {
246
282
  type: "primary",
@@ -272,9 +308,9 @@ var PassDetail = (props) => {
272
308
  ), platform === "h5" && tag === "gift_card" ? /* @__PURE__ */ import_react.default.createElement(
273
309
  import_footerButton.default,
274
310
  {
275
- appleWalletUrl: (_g = _getDetail.data) == null ? void 0 : _g.apple_wallet_url,
276
- googleWalletUrl: (_h = _getDetail.data) == null ? void 0 : _h.google_wallet_url,
277
- onRechargeClick: ((_i = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _i.hide_recharge) === 0 ? () => setRechargeOpen(true) : void 0,
311
+ appleWalletUrl: (_o = _getDetail.data) == null ? void 0 : _o.apple_wallet_url,
312
+ googleWalletUrl: (_p = _getDetail.data) == null ? void 0 : _p.google_wallet_url,
313
+ onRechargeClick: ((_q = dataSource == null ? void 0 : dataSource.machinecode_config) == null ? void 0 : _q.hide_recharge) === 0 ? () => setRechargeOpen(true) : void 0,
278
314
  platform
279
315
  }
280
316
  ) : null, /* @__PURE__ */ import_react.default.createElement(
@@ -89,7 +89,8 @@ var WalletPassGallery = (props) => {
89
89
  num: 20,
90
90
  skip: (d == null ? void 0 : d.nextId) || 1,
91
91
  tags: TAGS,
92
- filter_wallet_id: walletId || void 0
92
+ filter_wallet_id: walletId || void 0,
93
+ "with": ["customScheduleSnapshot"]
93
94
  });
94
95
  return {
95
96
  list: (res == null ? void 0 : res.list) || [],
@@ -115,7 +116,8 @@ var WalletPassGallery = (props) => {
115
116
  num: 20,
116
117
  skip: (d == null ? void 0 : d.nextId) || 1,
117
118
  tags: TAGS,
118
- filter_wallet_id: walletId || void 0
119
+ filter_wallet_id: walletId || void 0,
120
+ "with": ["customScheduleSnapshot"]
119
121
  });
120
122
  return {
121
123
  list: (res == null ? void 0 : res.list) || [],
@@ -17,6 +17,7 @@ export interface IWalletListParmsProps {
17
17
  skip?: number;
18
18
  filter_wallet_id?: string;
19
19
  available: 0 | 1;
20
+ with?: string[];
20
21
  }
21
22
  /**
22
23
  * 钱包列表项属性接口
@@ -171,6 +172,8 @@ export declare const getAssetList: (params: IAssetListProps) => Promise<{
171
172
  */
172
173
  export declare const getDetailApi: (params: {
173
174
  id: string;
175
+ order_behavior_count_customer_id: string;
176
+ apiPrefix: string;
174
177
  }) => Promise<IDetailResponse>;
175
178
  /**
176
179
  * 详情响应数据结构,供组件消费
@@ -69,11 +69,12 @@ var getAssetList = async (params) => {
69
69
  return data;
70
70
  };
71
71
  var getDetailApi = async (params) => {
72
- const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/detail/${params.id}`, {
72
+ const { data } = await import_utils.request.getRequest().get(`${params.apiPrefix || "/h5"}/machinecode/lowcode/detail/${params.id}`, {
73
73
  order_behavior_count: 1,
74
74
  // 订单行为次数
75
- order_behavior_count_customer: 1
75
+ order_behavior_count_customer: 1,
76
76
  // 客户订单行为次数
77
+ order_behavior_count_customer_id: params.apiPrefix === "/shop" ? params.order_behavior_count_customer_id : void 0
77
78
  }, {
78
79
  isOriginHost: true
79
80
  });
@@ -81,7 +81,7 @@ var AuthModal = () => {
81
81
  }
82
82
  }, [currentView]);
83
83
  const login2Config = (0, import_react.useMemo)(() => {
84
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
84
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
85
85
  if (!localesInitialized) {
86
86
  return {
87
87
  loginMethods: [],
@@ -262,9 +262,13 @@ var AuthModal = () => {
262
262
  show: (config == null ? void 0 : config.logo) ? true : false,
263
263
  url: config == null ? void 0 : config.logo,
264
264
  // 直接从 config.logo 读取
265
- position: "center"
265
+ position: "center",
266
+ size: {
267
+ width: ((_v = config == null ? void 0 : config.logoSize) == null ? void 0 : _v.width) || 48,
268
+ height: ((_w = config == null ? void 0 : config.logoSize) == null ? void 0 : _w.height) || 48
269
+ }
266
270
  } : void 0,
267
- themeColor: ((_x = (_w = (_v = config == null ? void 0 : config.page) == null ? void 0 : _v.login) == null ? void 0 : _w.ui) == null ? void 0 : _x.themeColor) || "#7F56D9",
271
+ themeColor: ((_z = (_y = (_x = config == null ? void 0 : config.page) == null ? void 0 : _x.login) == null ? void 0 : _y.ui) == null ? void 0 : _z.themeColor) || "#7F56D9",
268
272
  formLabels: {
269
273
  email: { show: false },
270
274
  phone: { show: false },
@@ -275,7 +279,7 @@ var AuthModal = () => {
275
279
  };
276
280
  }, [config, channel, emailLinkVerification, localesInitialized]);
277
281
  const register2Config = (0, import_react.useMemo)(() => {
278
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
282
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
279
283
  if (!localesInitialized) {
280
284
  return {
281
285
  registrationMethods: [],
@@ -395,10 +399,14 @@ var AuthModal = () => {
395
399
  show: config.logo ? true : false,
396
400
  url: config.logo,
397
401
  // 直接从 config.logo 读取
398
- position: "center"
402
+ position: "center",
403
+ size: {
404
+ width: ((_l = config == null ? void 0 : config.logoSize) == null ? void 0 : _l.width) || 48,
405
+ height: ((_m = config == null ? void 0 : config.logoSize) == null ? void 0 : _m.height) || 48
406
+ }
399
407
  } : void 0,
400
- themeColor: ((_n = (_m = (_l = config.page) == null ? void 0 : _l.register) == null ? void 0 : _m.ui) == null ? void 0 : _n.themeColor) || "#7F56D9",
401
- passwordRules: transformPasswordRules((_o = config.auth) == null ? void 0 : _o.password),
408
+ themeColor: ((_p = (_o = (_n = config.page) == null ? void 0 : _n.register) == null ? void 0 : _o.ui) == null ? void 0 : _p.themeColor) || "#7F56D9",
409
+ passwordRules: transformPasswordRules((_q = config.auth) == null ? void 0 : _q.password),
402
410
  // 传递密码规则
403
411
  formLabels: {
404
412
  email: { show: false },
@@ -326,21 +326,21 @@
326
326
  .login2-submit-button {
327
327
  height: 44px;
328
328
  border-radius: 8px;
329
- border: 1px solid var(--theme-color, #7f56d9);
330
- background: var(--theme-color, #7f56d9);
329
+ border: 1px solid var(--custom-button-bg-color, var(--theme-color, #7f56d9));
330
+ background: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
331
331
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
332
332
  font-size: 16px;
333
333
  font-weight: 600;
334
- color: #ffffff;
334
+ color: var(--custom-button-text-color, #ffffff);
335
335
 
336
336
  &:hover:not(:disabled) {
337
- background: #6941c6;
338
- border-color: #6941c6;
337
+ background: var(--custom-button-bg-color, #6941c6);
338
+ border-color: var(--custom-button-bg-color, #6941c6);
339
339
  }
340
340
 
341
341
  &:focus {
342
- background: var(--theme-color, #7f56d9);
343
- border-color: var(--theme-color, #7f56d9);
342
+ background: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
343
+ border-color: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
344
344
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
345
345
  0px 0px 0px 4px rgba(127, 86, 217, 0.1);
346
346
  }
@@ -4,6 +4,7 @@
4
4
  * 这个文件演示了如何使用 PisellPaymentList 和 PisellPaymentListItem 组件
5
5
  * 包括如何通过 Context 访问父组件配置
6
6
  */
7
+ /// <reference types="react" />
7
8
  export declare const BasicExample: () => JSX.Element;
8
9
  export declare const ChildrenExample: () => JSX.Element;
9
10
  export declare const CustomItemExample: () => JSX.Element;