@pisell/private-materials 3.4.76 → 3.4.78

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 (208) 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 +2 -2
  6. package/build/lowcode/preview.js +7 -7
  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 +10 -10
  11. package/es/components/booking/addons/model.d.ts +1 -10
  12. package/es/components/booking/forms/model.d.ts +1 -10
  13. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  14. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  15. package/es/components/booking/info/model.d.ts +1 -10
  16. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  18. package/es/components/booking/model.d.ts +1 -9
  19. package/es/components/booking/notes/model.d.ts +1 -10
  20. package/es/components/booking/payments/model.d.ts +1 -10
  21. package/es/components/booking/utils.d.ts +2 -2
  22. package/es/components/eftpos/hooks.d.ts +0 -1
  23. package/es/components/eftposPay/amount.d.ts +1 -1
  24. package/es/components/eftposPay/device.d.ts +1 -1
  25. package/es/components/eftposPay/hooks.d.ts +1 -1
  26. package/es/components/eftposPay/store/index.d.ts +2 -2
  27. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  28. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  29. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  30. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  31. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  32. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  33. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  34. package/es/components/pay/toC/model.d.ts +1 -9
  35. package/es/components/schedules/model.d.ts +1 -9
  36. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  37. package/es/hooks/useTranslationOriginal.d.ts +1 -0
  38. package/es/hooks/useTranslationOriginal.js +10 -0
  39. package/es/index.d.ts +3 -0
  40. package/es/index.js +3 -0
  41. package/es/plus/clientCard/index.d.ts +7 -0
  42. package/es/plus/clientCard/index.js +462 -0
  43. package/es/plus/clientCard/index.less +515 -0
  44. package/es/plus/clientCard/line/index.d.ts +9 -0
  45. package/es/plus/clientCard/line/index.js +157 -0
  46. package/es/plus/clientCard/line/index.less +142 -0
  47. package/es/plus/clientCard/locales.d.ts +18 -0
  48. package/es/plus/clientCard/locales.js +17 -0
  49. package/es/plus/clientCard/types.d.ts +135 -0
  50. package/es/plus/clientCard/types.js +1 -0
  51. package/es/plus/clientCard/utils.d.ts +8 -0
  52. package/es/plus/clientCard/utils.js +59 -0
  53. package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +3 -0
  54. package/es/plus/clinetSearch/Add/BirthdayField/index.js +277 -0
  55. package/es/plus/clinetSearch/Add/GenderField/index.d.ts +3 -0
  56. package/es/plus/clinetSearch/Add/GenderField/index.js +18 -0
  57. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +3 -0
  58. package/es/plus/clinetSearch/Add/PhoneField/index.js +52 -0
  59. package/es/plus/clinetSearch/Add/PhoneField/serve.d.ts +2 -0
  60. package/es/plus/clinetSearch/Add/PhoneField/serve.js +166 -0
  61. package/es/plus/clinetSearch/Add/index.d.ts +18 -0
  62. package/es/plus/clinetSearch/Add/index.js +213 -0
  63. package/es/plus/clinetSearch/Add/index.less +30 -0
  64. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  65. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.js +265 -0
  66. package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  67. package/es/plus/clinetSearch/InfiniteScroll/index.js +1 -0
  68. package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  69. package/es/plus/clinetSearch/InfiniteScroll/types.js +1 -0
  70. package/es/plus/clinetSearch/index.d.ts +18 -0
  71. package/es/plus/clinetSearch/index.js +234 -0
  72. package/es/plus/clinetSearch/index.less +95 -0
  73. package/es/plus/clinetSearch/locales.d.ts +108 -0
  74. package/es/plus/clinetSearch/locales.js +107 -0
  75. package/es/plus/clinetSearch/serve.d.ts +1 -0
  76. package/es/plus/clinetSearch/serve.js +31 -0
  77. package/es/plus/clinetSearch/types.d.ts +70 -0
  78. package/es/plus/clinetSearch/types.js +1 -0
  79. package/es/plus/saasAttendance/locales.d.ts +63 -0
  80. package/es/plus/saasAttendance/locales.js +71 -2
  81. package/es/plus/saasAttendance/settings/PermissonTab.d.ts +5 -0
  82. package/es/plus/saasAttendance/settings/PermissonTab.js +79 -0
  83. package/es/plus/saasAttendance/settings/ShiftScheduleTab.js +9 -3
  84. package/es/plus/saasAttendance/settings/components/MapField.js +69 -33
  85. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.d.ts +7 -0
  86. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.js +149 -0
  87. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.less +119 -0
  88. package/es/plus/saasAttendance/settings/index.js +7 -0
  89. package/es/plus/saasAttendance/settings/index.less +15 -0
  90. package/es/plus/saasAttendance/settings/types.d.ts +6 -0
  91. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  92. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +2 -0
  93. package/es/plus/walletPassGallery/components/passDetail/index.js +104 -39
  94. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +2 -0
  95. package/es/plus/walletPassGallery/components/timelineSection/index.js +19 -2
  96. package/es/plus/walletPassGallery/index.d.ts +4 -0
  97. package/es/plus/walletPassGallery/index.js +121 -42
  98. package/es/plus/walletPassGallery/serve.d.ts +3 -1
  99. package/es/plus/walletPassGallery/serve.js +13 -13
  100. package/es/pro/pisellPhoneKeyboard/index.d.ts +13 -0
  101. package/es/pro/pisellPhoneKeyboard/index.js +210 -0
  102. package/es/pro/pisellPhoneKeyboard/index.less +157 -0
  103. package/es/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  104. package/es/pro/pisellPhoneKeyboard/locales.js +11 -0
  105. package/lib/components/booking/addons/model.d.ts +1 -10
  106. package/lib/components/booking/forms/model.d.ts +1 -10
  107. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  108. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  109. package/lib/components/booking/info/model.d.ts +1 -10
  110. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  111. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  112. package/lib/components/booking/model.d.ts +1 -9
  113. package/lib/components/booking/notes/model.d.ts +1 -10
  114. package/lib/components/booking/payments/model.d.ts +1 -10
  115. package/lib/components/booking/utils.d.ts +2 -2
  116. package/lib/components/eftpos/hooks.d.ts +0 -1
  117. package/lib/components/eftposPay/amount.d.ts +1 -1
  118. package/lib/components/eftposPay/device.d.ts +1 -1
  119. package/lib/components/eftposPay/hooks.d.ts +1 -1
  120. package/lib/components/eftposPay/store/index.d.ts +2 -2
  121. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  122. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  123. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  124. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  125. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  126. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  127. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  128. package/lib/components/pay/toC/model.d.ts +1 -9
  129. package/lib/components/schedules/model.d.ts +1 -9
  130. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  131. package/lib/hooks/useTranslationOriginal.d.ts +1 -0
  132. package/lib/hooks/useTranslationOriginal.js +42 -0
  133. package/lib/index.d.ts +3 -0
  134. package/lib/index.js +9 -0
  135. package/lib/plus/clientCard/index.d.ts +7 -0
  136. package/lib/plus/clientCard/index.js +457 -0
  137. package/lib/plus/clientCard/index.less +515 -0
  138. package/lib/plus/clientCard/line/index.d.ts +9 -0
  139. package/lib/plus/clientCard/line/index.js +153 -0
  140. package/lib/plus/clientCard/line/index.less +142 -0
  141. package/lib/plus/clientCard/locales.d.ts +18 -0
  142. package/lib/plus/clientCard/locales.js +41 -0
  143. package/lib/plus/clientCard/types.d.ts +135 -0
  144. package/lib/plus/clientCard/types.js +17 -0
  145. package/lib/plus/clientCard/utils.d.ts +8 -0
  146. package/lib/plus/clientCard/utils.js +75 -0
  147. package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +3 -0
  148. package/lib/plus/clinetSearch/Add/BirthdayField/index.js +256 -0
  149. package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +3 -0
  150. package/lib/plus/clinetSearch/Add/GenderField/index.js +52 -0
  151. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +3 -0
  152. package/lib/plus/clinetSearch/Add/PhoneField/index.js +78 -0
  153. package/lib/plus/clinetSearch/Add/PhoneField/serve.d.ts +2 -0
  154. package/lib/plus/clinetSearch/Add/PhoneField/serve.js +193 -0
  155. package/lib/plus/clinetSearch/Add/index.d.ts +18 -0
  156. package/lib/plus/clinetSearch/Add/index.js +244 -0
  157. package/lib/plus/clinetSearch/Add/index.less +30 -0
  158. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  159. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.js +235 -0
  160. package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  161. package/lib/plus/clinetSearch/InfiniteScroll/index.js +35 -0
  162. package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  163. package/lib/plus/clinetSearch/InfiniteScroll/types.js +17 -0
  164. package/lib/plus/clinetSearch/index.d.ts +18 -0
  165. package/lib/plus/clinetSearch/index.js +237 -0
  166. package/lib/plus/clinetSearch/index.less +95 -0
  167. package/lib/plus/clinetSearch/locales.d.ts +108 -0
  168. package/lib/plus/clinetSearch/locales.js +131 -0
  169. package/lib/plus/clinetSearch/serve.d.ts +1 -0
  170. package/lib/plus/clinetSearch/serve.js +33 -0
  171. package/lib/plus/clinetSearch/types.d.ts +70 -0
  172. package/lib/plus/clinetSearch/types.js +17 -0
  173. package/lib/plus/saasAttendance/locales.d.ts +63 -0
  174. package/lib/plus/saasAttendance/locales.js +65 -2
  175. package/lib/plus/saasAttendance/settings/PermissonTab.d.ts +5 -0
  176. package/lib/plus/saasAttendance/settings/PermissonTab.js +128 -0
  177. package/lib/plus/saasAttendance/settings/ShiftScheduleTab.js +2 -1
  178. package/lib/plus/saasAttendance/settings/components/MapField.js +50 -11
  179. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.d.ts +7 -0
  180. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.js +150 -0
  181. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.less +119 -0
  182. package/lib/plus/saasAttendance/settings/index.js +12 -0
  183. package/lib/plus/saasAttendance/settings/index.less +15 -0
  184. package/lib/plus/saasAttendance/settings/types.d.ts +6 -0
  185. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  186. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +2 -0
  187. package/lib/plus/walletPassGallery/components/passDetail/index.js +57 -5
  188. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +2 -0
  189. package/lib/plus/walletPassGallery/components/timelineSection/index.js +17 -2
  190. package/lib/plus/walletPassGallery/index.d.ts +4 -0
  191. package/lib/plus/walletPassGallery/index.js +141 -42
  192. package/lib/plus/walletPassGallery/serve.d.ts +3 -1
  193. package/lib/plus/walletPassGallery/serve.js +2 -2
  194. package/lib/pro/pisellPhoneKeyboard/index.d.ts +13 -0
  195. package/lib/pro/pisellPhoneKeyboard/index.js +219 -0
  196. package/lib/pro/pisellPhoneKeyboard/index.less +157 -0
  197. package/lib/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  198. package/lib/pro/pisellPhoneKeyboard/locales.js +35 -0
  199. package/lowcode/client-card/fragments/cardStyle.ts +63 -0
  200. package/lowcode/client-card/fragments/nameStyle.ts +34 -0
  201. package/lowcode/client-card/fragments/pisellAvatar.ts +87 -0
  202. package/lowcode/client-card/fragments/tagConfig.ts +88 -0
  203. package/lowcode/client-card/meta.ts +343 -0
  204. package/lowcode/client-search/meta.ts +316 -0
  205. package/lowcode/eco-cup-list/meta.ts +1 -1
  206. package/lowcode/eco-customer-list/meta.ts +1 -1
  207. package/lowcode/wallet-pass-gallery/meta.ts +66 -1
  208. package/package.json +4 -4
@@ -0,0 +1,149 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useMemo } from 'react';
8
+ import { locales } from '@pisell/utils';
9
+ import "./ShiftPreview.less";
10
+ var WEEKDAYS = [1, 2, 3, 4, 5, 6, 7];
11
+ var getWeekdayText = function getWeekdayText(weekday) {
12
+ return locales.getText("pisell2.attendance.group-settings.shift-schedule.modal.weekday.".concat(weekday));
13
+ };
14
+ var parseMinutes = function parseMinutes(hhmm) {
15
+ var _split$map = (hhmm || '').split(':').map(function (v) {
16
+ return Number(v);
17
+ }),
18
+ _split$map2 = _slicedToArray(_split$map, 2),
19
+ h = _split$map2[0],
20
+ m = _split$map2[1];
21
+ if (!Number.isFinite(h) || !Number.isFinite(m)) {
22
+ return null;
23
+ }
24
+ return h * 60 + m;
25
+ };
26
+ var formatClock = function formatClock(hhmm) {
27
+ var totalMinutes = parseMinutes(hhmm);
28
+ if (totalMinutes === null) return '';
29
+ var hours24 = Math.floor(totalMinutes / 60) % 24;
30
+ var minutes = totalMinutes % 60;
31
+ var suffix = hours24 >= 12 ? locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.period.pm') : locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.period.am');
32
+ var hours12 = hours24 % 12 === 0 ? 12 : hours24 % 12;
33
+ return "".concat(hours12, ":").concat(String(minutes).padStart(2, '0'), " ").concat(suffix);
34
+ };
35
+ var formatWeeklyHours = function formatWeeklyHours(totalMinutes) {
36
+ var hours = totalMinutes / 60;
37
+ if (Number.isInteger(hours)) return "".concat(hours);
38
+ return "".concat(hours.toFixed(2)).replace(/\.?0+$/, '');
39
+ };
40
+ var formatDuration = function formatDuration(totalMinutes) {
41
+ var hours = Math.floor(totalMinutes / 60);
42
+ var minutes = totalMinutes % 60;
43
+ return locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.duration')(hours, minutes);
44
+ };
45
+ var ShiftPreview = function ShiftPreview(props) {
46
+ var schedule = Array.isArray(props.value) ? props.value : [];
47
+ var previewDays = useMemo(function () {
48
+ var byWeekday = new Map();
49
+ schedule.forEach(function (item) {
50
+ if (item && typeof item.weekday === 'number') {
51
+ byWeekday.set(item.weekday, item);
52
+ }
53
+ });
54
+ return WEEKDAYS.map(function (weekday) {
55
+ var item = byWeekday.get(weekday);
56
+ var times = Array.isArray(item === null || item === void 0 ? void 0 : item.times) ? item.times : [];
57
+ var timeRanges = times.map(function (time) {
58
+ var startText = formatClock(time === null || time === void 0 ? void 0 : time.start);
59
+ var endText = formatClock(time === null || time === void 0 ? void 0 : time.end);
60
+ if (!startText || !endText) return null;
61
+ return {
62
+ startText: startText,
63
+ endText: endText
64
+ };
65
+ }).filter(Boolean);
66
+ var totalMinutes = times.reduce(function (sum, time) {
67
+ var start = parseMinutes(time === null || time === void 0 ? void 0 : time.start);
68
+ var end = parseMinutes(time === null || time === void 0 ? void 0 : time.end);
69
+ if (start === null || end === null || end <= start) {
70
+ return sum;
71
+ }
72
+ return sum + (end - start);
73
+ }, 0);
74
+ return {
75
+ weekday: weekday,
76
+ timeRanges: timeRanges,
77
+ totalMinutes: totalMinutes
78
+ };
79
+ });
80
+ }, [schedule]);
81
+ var workingDays = previewDays.filter(function (day) {
82
+ return day.totalMinutes > 0;
83
+ }).length;
84
+ var weeklyMinutes = previewDays.reduce(function (sum, day) {
85
+ return sum + day.totalMinutes;
86
+ }, 0);
87
+ return /*#__PURE__*/React.createElement("div", {
88
+ className: "saas-attendance-group-settings__shift-preview"
89
+ }, /*#__PURE__*/React.createElement("div", {
90
+ className: "saas-attendance-group-settings__shift-summary"
91
+ }, /*#__PURE__*/React.createElement("div", {
92
+ className: "saas-attendance-group-settings__shift-summary-card"
93
+ }, /*#__PURE__*/React.createElement("div", {
94
+ className: "saas-attendance-group-settings__shift-summary-label"
95
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.working-days')), /*#__PURE__*/React.createElement("div", {
96
+ className: "saas-attendance-group-settings__shift-summary-value"
97
+ }, workingDays), /*#__PURE__*/React.createElement("div", {
98
+ className: "saas-attendance-group-settings__shift-summary-unit"
99
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.days-per-week'))), /*#__PURE__*/React.createElement("div", {
100
+ className: "saas-attendance-group-settings__shift-summary-card"
101
+ }, /*#__PURE__*/React.createElement("div", {
102
+ className: "saas-attendance-group-settings__shift-summary-label"
103
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.weekly-hours')), /*#__PURE__*/React.createElement("div", {
104
+ className: "saas-attendance-group-settings__shift-summary-value"
105
+ }, formatWeeklyHours(weeklyMinutes)), /*#__PURE__*/React.createElement("div", {
106
+ className: "saas-attendance-group-settings__shift-summary-unit"
107
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.hours')))), /*#__PURE__*/React.createElement("div", {
108
+ className: "saas-attendance-group-settings__shift-table"
109
+ }, /*#__PURE__*/React.createElement("div", {
110
+ className: "saas-attendance-group-settings__shift-table-head"
111
+ }, /*#__PURE__*/React.createElement("div", {
112
+ className: "saas-attendance-group-settings__shift-table-cell"
113
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.table.day')), /*#__PURE__*/React.createElement("div", {
114
+ className: "saas-attendance-group-settings__shift-table-cell"
115
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.table.shift-times')), /*#__PURE__*/React.createElement("div", {
116
+ className: "saas-attendance-group-settings__shift-table-cell"
117
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.table.duration'))), previewDays.map(function (day) {
118
+ return /*#__PURE__*/React.createElement("div", {
119
+ key: day.weekday,
120
+ className: "saas-attendance-group-settings__shift-table-row"
121
+ }, /*#__PURE__*/React.createElement("div", {
122
+ className: "saas-attendance-group-settings__shift-table-cell"
123
+ }, getWeekdayText(day.weekday)), /*#__PURE__*/React.createElement("div", {
124
+ className: "saas-attendance-group-settings__shift-table-cell"
125
+ }, day.timeRanges.length > 0 ? /*#__PURE__*/React.createElement("div", {
126
+ className: "saas-attendance-group-settings__shift-times"
127
+ }, day.timeRanges.map(function (range, index) {
128
+ return /*#__PURE__*/React.createElement("div", {
129
+ key: "".concat(day.weekday, "-").concat(index),
130
+ className: "saas-attendance-group-settings__shift-time-tag"
131
+ }, /*#__PURE__*/React.createElement("span", {
132
+ className: "saas-attendance-group-settings__shift-time-text"
133
+ }, range.startText), /*#__PURE__*/React.createElement("span", {
134
+ className: "saas-attendance-group-settings__shift-time-arrow"
135
+ }, "\u2192"), /*#__PURE__*/React.createElement("span", {
136
+ className: "saas-attendance-group-settings__shift-time-text"
137
+ }, range.endText));
138
+ })) : /*#__PURE__*/React.createElement("div", {
139
+ className: "saas-attendance-group-settings__shift-empty"
140
+ }, locales.getText('pisell2.attendance.group-settings.shift-schedule.preview.no-shift'))), /*#__PURE__*/React.createElement("div", {
141
+ className: "saas-attendance-group-settings__shift-table-cell"
142
+ }, day.totalMinutes > 0 ? /*#__PURE__*/React.createElement("div", {
143
+ className: "saas-attendance-group-settings__shift-duration"
144
+ }, formatDuration(day.totalMinutes)) : /*#__PURE__*/React.createElement("div", {
145
+ className: "saas-attendance-group-settings__shift-duration-empty"
146
+ }, formatDuration(0))));
147
+ })));
148
+ };
149
+ export default ShiftPreview;
@@ -0,0 +1,119 @@
1
+ .saas-attendance-group-settings__shift-preview {
2
+ margin-top: 12px;
3
+ }
4
+
5
+ .saas-attendance-group-settings__shift-summary {
6
+ display: grid;
7
+ grid-template-columns: 1fr 1fr;
8
+ gap: 12px;
9
+ margin-top: 12px;
10
+ }
11
+
12
+ .saas-attendance-group-settings__shift-summary-card {
13
+ border: 1px solid #e5e7eb;
14
+ border-radius: 10px;
15
+ background: #ffffff;
16
+ padding: 14px 16px;
17
+ }
18
+
19
+ .saas-attendance-group-settings__shift-summary-label {
20
+ font-size: 12px;
21
+ line-height: 18px;
22
+ color: #6b7280;
23
+ }
24
+
25
+ .saas-attendance-group-settings__shift-summary-value {
26
+ margin-top: 8px;
27
+ font-size: 28px;
28
+ line-height: 32px;
29
+ font-weight: 600;
30
+ color: #111827;
31
+ }
32
+
33
+ .saas-attendance-group-settings__shift-summary-unit {
34
+ margin-top: 4px;
35
+ font-size: 12px;
36
+ line-height: 18px;
37
+ color: #6b7280;
38
+ }
39
+
40
+ .saas-attendance-group-settings__shift-table {
41
+ margin-top: 12px;
42
+ border: 1px solid #e5e7eb;
43
+ border-radius: 10px;
44
+ overflow: hidden;
45
+ background: #ffffff;
46
+ }
47
+
48
+ .saas-attendance-group-settings__shift-table-head {
49
+ display: grid;
50
+ grid-template-columns: 1fr 3fr 1fr;
51
+ gap: 0;
52
+ padding: 12px 16px;
53
+ background: #f9fafb;
54
+ border-bottom: 1px solid #e5e7eb;
55
+ font-size: 12px;
56
+ color: #6b7280;
57
+ }
58
+
59
+ .saas-attendance-group-settings__shift-table-row {
60
+ display: grid;
61
+ grid-template-columns: 1fr 3fr 1fr;
62
+ gap: 0;
63
+ padding: 12px 16px;
64
+ border-bottom: 1px solid #f3f4f6;
65
+ }
66
+
67
+ .saas-attendance-group-settings__shift-table-row:last-child {
68
+ border-bottom: none;
69
+ }
70
+
71
+ .saas-attendance-group-settings__shift-table-cell {
72
+ display: flex;
73
+ align-items: center;
74
+ }
75
+
76
+ .saas-attendance-group-settings__shift-times {
77
+ display: flex;
78
+ flex-direction: column;
79
+ gap: 8px;
80
+ }
81
+
82
+ .saas-attendance-group-settings__shift-time-tag {
83
+ padding: 2px 4px;
84
+ border-radius: 6px;
85
+ background: #f3f4f6;
86
+ color: #374151;
87
+ font-size: 12px;
88
+ font-weight: 500;
89
+ display: inline-flex;
90
+ align-items: center;
91
+ gap: 6px;
92
+ }
93
+
94
+ .saas-attendance-group-settings__shift-time-text {
95
+ color: inherit;
96
+ }
97
+
98
+ .saas-attendance-group-settings__shift-time-arrow {
99
+ color: #6b7280;
100
+ }
101
+
102
+ .saas-attendance-group-settings__shift-empty {
103
+ color: #9ca3af;
104
+ font-size: 12px;
105
+ }
106
+
107
+ .saas-attendance-group-settings__shift-duration {
108
+ padding: 2px 4px;
109
+ border-radius: 2px;
110
+ background: #ecfdf5;
111
+ color: #14532d;
112
+ font-size: 10px;
113
+ font-weight: 600;
114
+ }
115
+
116
+ .saas-attendance-group-settings__shift-duration-empty {
117
+ color: #9ca3af;
118
+ font-size: 12px;
119
+ }
@@ -23,6 +23,7 @@ import useEngineContext from "../../../hooks/useEngineContext";
23
23
  import { request } from "../../../utils";
24
24
  import localeTexts from "../locales";
25
25
  import BasicInfoTab from "./BasicInfoTab";
26
+ import PermissonTab from "./PermissonTab";
26
27
  import ShiftScheduleTab from "./ShiftScheduleTab";
27
28
  import ClockInMethodTab from "./ClockInMethodTab";
28
29
  import CorrectionPolicyTab from "./CorrectionPolicyTab";
@@ -45,6 +46,10 @@ var TAB_CONFIGS = [{
45
46
  key: 'correction',
46
47
  icon: 'pisell2-clock',
47
48
  labelKey: 'pisell2.attendance.group-settings.correction-policy'
49
+ }, {
50
+ key: 'permission',
51
+ icon: 'pisell2-user-01',
52
+ labelKey: 'pisell2.attendance.group-settings.data-permission'
48
53
  }];
49
54
 
50
55
  // 生成简单的唯一 ID
@@ -250,6 +255,8 @@ var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
250
255
  }), /*#__PURE__*/React.createElement(CorrectionPolicyTab, {
251
256
  form: form,
252
257
  id: "saas-attendance-settings-section-".concat(_uniqueId, "-correction")
258
+ }), /*#__PURE__*/React.createElement(PermissonTab, {
259
+ id: "saas-attendance-settings-section-".concat(_uniqueId, "-permission")
253
260
  }))));
254
261
  });
255
262
  export default Settings;
@@ -485,6 +485,21 @@
485
485
  gap: 8px;
486
486
  }
487
487
 
488
+ .saas-attendance-map-field__location-actions {
489
+ display: flex;
490
+ align-items: center;
491
+ gap: 4px;
492
+ }
493
+
494
+ .saas-attendance-map-field__edit-btn {
495
+ color: #9ca3af;
496
+ transition: color 0.2s ease;
497
+
498
+ &:hover {
499
+ color: #7f56d9;
500
+ }
501
+ }
502
+
488
503
  .saas-attendance-map-field__delete-btn {
489
504
  color: #9ca3af;
490
505
  transition: color 0.2s ease;
@@ -65,6 +65,10 @@ export interface AttendanceCorrection {
65
65
  period_type: FrequencyType;
66
66
  period_custom: number | null;
67
67
  }
68
+ export declare type MemberDataViewRange = 'this_week' | 'last_week' | 'this_month';
69
+ export interface AttendancePermission {
70
+ member_data_view_range?: MemberDataViewRange[];
71
+ }
68
72
  /**
69
73
  * 考勤组设置值 - 完整的API数据结构
70
74
  */
@@ -76,6 +80,7 @@ export interface AttendanceGroupSettingsValue {
76
80
  place: AttendancePlace;
77
81
  member_ids: number[];
78
82
  correction: AttendanceCorrection;
83
+ permission?: AttendancePermission;
79
84
  creator_type?: string;
80
85
  creator_id?: number;
81
86
  editor_type?: string;
@@ -90,6 +95,7 @@ export interface BasicInfoTabValue {
90
95
  name: MultiLangName;
91
96
  timezone: string;
92
97
  member_ids: number[];
98
+ permission?: AttendancePermission;
93
99
  }
94
100
  /**
95
101
  * 排班规则Tab的值
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => import("react").JSX.Element;
4
3
  export default ErrorTip;
@@ -5,6 +5,8 @@ interface PassDetailProps {
5
5
  platform?: 'pc' | 'h5';
6
6
  buttonGroupList?: any[][];
7
7
  showTimeLine?: boolean;
8
+ onDetailRefresh?: (passId: number | string, patch: any) => void;
9
+ onListRefresh?: () => void;
8
10
  }
9
11
  declare const PassDetail: (props: PassDetailProps) => React.JSX.Element | null;
10
12
  export default PassDetail;
@@ -2,6 +2,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
6
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
7
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
10
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -37,7 +40,9 @@ var PassDetail = function PassDetail(props) {
37
40
  _props$platform = props.platform,
38
41
  platform = _props$platform === void 0 ? 'pc' : _props$platform,
39
42
  _props$showTimeLine = props.showTimeLine,
40
- showTimeLine = _props$showTimeLine === void 0 ? true : _props$showTimeLine;
43
+ showTimeLine = _props$showTimeLine === void 0 ? true : _props$showTimeLine,
44
+ onDetailRefresh = props.onDetailRefresh,
45
+ onListRefresh = props.onListRefresh;
41
46
  var _useState = useState('detail'),
42
47
  _useState2 = _slicedToArray(_useState, 2),
43
48
  activeKey = _useState2[0],
@@ -51,45 +56,47 @@ var PassDetail = function PassDetail(props) {
51
56
  var containerRef = useRef(null);
52
57
  var isIndicatorVisibleRef = useRef(false);
53
58
  var context = useEngineContext();
54
- var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {
55
- store: {}
56
- },
57
- store = _ref.store;
58
- var _ref2 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.constants) || {
59
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
60
+ store = _context$appHelper$ut.store,
61
+ isTerminal = _context$appHelper$ut.isTerminal,
62
+ interaction = _context$appHelper$ut.interaction,
63
+ isApp = _context$appHelper$ut.isApp;
64
+ var _ref = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.constants) || {
59
65
  apiPrefix: '/h5'
60
66
  },
61
- apiPrefix = _ref2.apiPrefix;
67
+ apiPrefix = _ref.apiPrefix;
62
68
  var timezone = (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.symbol) === null || _store$getState === void 0 || (_store$getState = _store$getState.shop) === null || _store$getState === void 0 ? void 0 : _store$getState.timezone) || 'Asia/Shanghai';
69
+ var isTerminalEnv = (typeof isTerminal === 'function' ? isTerminal() : !!isTerminal) || (isApp === null || isApp === void 0 ? void 0 : isApp());
63
70
  locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
64
71
  if ((_context$appHelper3 = context.appHelper) !== null && _context$appHelper3 !== void 0 && (_context$appHelper3 = _context$appHelper3.utils) !== null && _context$appHelper3 !== void 0 && _context$appHelper3.request) {
65
72
  var _context$appHelper4;
66
73
  request.setRequest((_context$appHelper4 = context.appHelper) === null || _context$appHelper4 === void 0 || (_context$appHelper4 = _context$appHelper4.utils) === null || _context$appHelper4 === void 0 ? void 0 : _context$appHelper4.request);
67
74
  }
68
- var _ref3 = dataSource || {},
69
- _ref3$id = _ref3.id,
70
- id = _ref3$id === void 0 ? '' : _ref3$id,
71
- _ref3$code = _ref3.code,
72
- code = _ref3$code === void 0 ? '' : _ref3$code,
73
- _ref3$tag = _ref3.tag,
74
- tag = _ref3$tag === void 0 ? '' : _ref3$tag,
75
- _ref3$product_title = _ref3.product_title,
76
- product_title = _ref3$product_title === void 0 ? '' : _ref3$product_title,
77
- _ref3$encoded = _ref3.encoded,
78
- encoded = _ref3$encoded === void 0 ? '' : _ref3$encoded,
79
- balance = _ref3.balance,
80
- _ref3$expire_date = _ref3.expire_date,
81
- expire_date = _ref3$expire_date === void 0 ? '' : _ref3$expire_date,
82
- _ref3$product = _ref3.product,
83
- product = _ref3$product === void 0 ? {} : _ref3$product,
84
- custom_schedule_snapshot = _ref3.custom_schedule_snapshot,
85
- customer_id = _ref3.customer_id;
86
- var _ref4 = product || {},
87
- _ref4$description = _ref4.description,
88
- description = _ref4$description === void 0 ? '' : _ref4$description,
89
- _ref4$extension_data = _ref4.extension_data,
90
- extension_data = _ref4$extension_data === void 0 ? [] : _ref4$extension_data,
91
- _ref4$customer_order_ = _ref4.customer_order_behavior_count,
92
- customer_order_behavior_count = _ref4$customer_order_ === void 0 ? 0 : _ref4$customer_order_;
75
+ var _ref2 = dataSource || {},
76
+ _ref2$id = _ref2.id,
77
+ id = _ref2$id === void 0 ? '' : _ref2$id,
78
+ _ref2$code = _ref2.code,
79
+ code = _ref2$code === void 0 ? '' : _ref2$code,
80
+ _ref2$tag = _ref2.tag,
81
+ tag = _ref2$tag === void 0 ? '' : _ref2$tag,
82
+ _ref2$product_title = _ref2.product_title,
83
+ product_title = _ref2$product_title === void 0 ? '' : _ref2$product_title,
84
+ _ref2$encoded = _ref2.encoded,
85
+ encoded = _ref2$encoded === void 0 ? '' : _ref2$encoded,
86
+ balance = _ref2.balance,
87
+ _ref2$expire_date = _ref2.expire_date,
88
+ expire_date = _ref2$expire_date === void 0 ? '' : _ref2$expire_date,
89
+ _ref2$product = _ref2.product,
90
+ product = _ref2$product === void 0 ? {} : _ref2$product,
91
+ custom_schedule_snapshot = _ref2.custom_schedule_snapshot,
92
+ customer_id = _ref2.customer_id;
93
+ var _ref3 = product || {},
94
+ _ref3$description = _ref3.description,
95
+ description = _ref3$description === void 0 ? '' : _ref3$description,
96
+ _ref3$extension_data = _ref3.extension_data,
97
+ extension_data = _ref3$extension_data === void 0 ? [] : _ref3$extension_data,
98
+ _ref3$customer_order_ = _ref3.customer_order_behavior_count,
99
+ customer_order_behavior_count = _ref3$customer_order_ === void 0 ? 0 : _ref3$customer_order_;
93
100
  var _getDetail = useRequest(function () {
94
101
  return getDetailApi({
95
102
  id: id,
@@ -100,6 +107,48 @@ var PassDetail = function PassDetail(props) {
100
107
  ready: !!id,
101
108
  refreshDeps: [id, customer_id]
102
109
  });
110
+ useEffect(function () {
111
+ var _interaction$utils, _interaction$utils$mo;
112
+ interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$mo = _interaction$utils.mountFunction) === null || _interaction$utils$mo === void 0 || _interaction$utils$mo.call(_interaction$utils, 'customer', 'recharge', /*#__PURE__*/function () {
113
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(strVal) {
114
+ var _getDetail$refreshAsy, latest, patch;
115
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
116
+ while (1) switch (_context.prev = _context.next) {
117
+ case 0:
118
+ if (strVal) {
119
+ _context.next = 2;
120
+ break;
121
+ }
122
+ return _context.abrupt("return", onListRefresh === null || onListRefresh === void 0 ? void 0 : onListRefresh());
123
+ case 2:
124
+ _context.prev = 2;
125
+ _context.next = 5;
126
+ return (_getDetail$refreshAsy = _getDetail.refreshAsync) === null || _getDetail$refreshAsy === void 0 ? void 0 : _getDetail$refreshAsy.call(_getDetail);
127
+ case 5:
128
+ latest = _context.sent;
129
+ patch = {
130
+ balance: (latest === null || latest === void 0 ? void 0 : latest.balance) !== undefined ? latest.balance : balance !== null && balance !== void 0 ? balance : undefined,
131
+ expire_date: (latest === null || latest === void 0 ? void 0 : latest.expire_date) !== undefined ? latest.expire_date : expire_date !== null && expire_date !== void 0 ? expire_date : undefined,
132
+ unified_available_status: latest === null || latest === void 0 ? void 0 : latest.unified_available_status
133
+ };
134
+ onDetailRefresh === null || onDetailRefresh === void 0 || onDetailRefresh(id, patch);
135
+ _context.next = 13;
136
+ break;
137
+ case 10:
138
+ _context.prev = 10;
139
+ _context.t0 = _context["catch"](2);
140
+ console.error(_context.t0);
141
+ case 13:
142
+ case "end":
143
+ return _context.stop();
144
+ }
145
+ }, _callee, null, [[2, 10]]);
146
+ }));
147
+ return function (_x) {
148
+ return _ref4.apply(this, arguments);
149
+ };
150
+ }());
151
+ }, [id]);
103
152
  var scheduleList = useMemo(function () {
104
153
  return (custom_schedule_snapshot === null || custom_schedule_snapshot === void 0 ? void 0 : custom_schedule_snapshot.data) || [];
105
154
  }, [custom_schedule_snapshot]);
@@ -208,6 +257,24 @@ var PassDetail = function PassDetail(props) {
208
257
  setActiveKey(_key);
209
258
  }
210
259
  }, []);
260
+ var handleRechargeClick = useCallback(function () {
261
+ if (isTerminalEnv) {
262
+ var _interaction$utils2, _interaction$utils2$p;
263
+ var productId = (product === null || product === void 0 ? void 0 : product.id) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.product_id) || '';
264
+ interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$p = _interaction$utils2.postMessageToApp) === null || _interaction$utils2$p === void 0 || _interaction$utils2$p.call(_interaction$utils2, {
265
+ module: 'customer',
266
+ key: 'recharge',
267
+ data: {
268
+ product_id: String(productId || ''),
269
+ card_id: String(id || ''),
270
+ card_code: String(code || ''),
271
+ customer_id: String(customer_id || '')
272
+ }
273
+ });
274
+ return;
275
+ }
276
+ setRechargeOpen(true);
277
+ }, [isTerminalEnv, id, code, customer_id, product, dataSource]);
211
278
  if (!dataSource) {
212
279
  return /*#__PURE__*/React.createElement(Empty, null);
213
280
  }
@@ -247,7 +314,9 @@ var PassDetail = function PassDetail(props) {
247
314
  code: code,
248
315
  tag: tag,
249
316
  timezone: timezone,
250
- apiPrefix: apiPrefix
317
+ apiPrefix: apiPrefix,
318
+ isTerminalEnv: isTerminalEnv,
319
+ interaction: interaction
251
320
  });
252
321
  };
253
322
  if (!props.dataSource) return null;
@@ -283,9 +352,7 @@ var PassDetail = function PassDetail(props) {
283
352
  }, locales.getText('wallet-pass-gallery.details')), platform === 'pc' && tag === 'gift_card' && (dataSource === null || dataSource === void 0 || (_dataSource$machineco = dataSource.machinecode_config) === null || _dataSource$machineco === void 0 ? void 0 : _dataSource$machineco.hide_recharge) === 0 && /*#__PURE__*/React.createElement(Button, {
284
353
  type: "primary",
285
354
  size: "large",
286
- onClick: function onClick() {
287
- return setRechargeOpen(true);
288
- }
355
+ onClick: handleRechargeClick
289
356
  }, locales.getText('wallet-pass-gallery.recharge')), /*#__PURE__*/React.createElement(PisellStatisticList, {
290
357
  data: descs,
291
358
  labelColor: "#667085",
@@ -312,9 +379,7 @@ var PassDetail = function PassDetail(props) {
312
379
  })), /*#__PURE__*/React.createElement("div", null, renderTimeLine())))), platform === 'h5' && tag === 'gift_card' ? /*#__PURE__*/React.createElement(FooterButtons, {
313
380
  appleWalletUrl: (_getDetail$data = _getDetail.data) === null || _getDetail$data === void 0 ? void 0 : _getDetail$data.apple_wallet_url,
314
381
  googleWalletUrl: (_getDetail$data2 = _getDetail.data) === null || _getDetail$data2 === void 0 ? void 0 : _getDetail$data2.google_wallet_url,
315
- onRechargeClick: (dataSource === null || dataSource === void 0 || (_dataSource$machineco2 = dataSource.machinecode_config) === null || _dataSource$machineco2 === void 0 ? void 0 : _dataSource$machineco2.hide_recharge) === 0 ? function () {
316
- return setRechargeOpen(true);
317
- } : undefined,
382
+ onRechargeClick: (dataSource === null || dataSource === void 0 || (_dataSource$machineco2 = dataSource.machinecode_config) === null || _dataSource$machineco2 === void 0 ? void 0 : _dataSource$machineco2.hide_recharge) === 0 ? handleRechargeClick : undefined,
318
383
  platform: platform
319
384
  }) : null, /*#__PURE__*/React.createElement(Recharge, {
320
385
  platform: platform,
@@ -5,6 +5,8 @@ interface TimelineSectionProps {
5
5
  tag: string;
6
6
  timezone: string;
7
7
  apiPrefix?: '/shop' | '/h5';
8
+ isTerminalEnv?: boolean;
9
+ interaction?: any;
8
10
  }
9
11
  declare const TimelineSection: (props: TimelineSectionProps) => React.JSX.Element;
10
12
  export default TimelineSection;
@@ -20,7 +20,9 @@ var TimelineSection = function TimelineSection(props) {
20
20
  var code = props.code,
21
21
  tag = props.tag,
22
22
  timezone = props.timezone,
23
- apiPrefix = props.apiPrefix;
23
+ apiPrefix = props.apiPrefix,
24
+ isTerminalEnv = props.isTerminalEnv,
25
+ interaction = props.interaction;
24
26
  var _usePisellConfig = usePisellConfig(),
25
27
  _usePisellConfig$symb = _usePisellConfig.symbol,
26
28
  symbol = _usePisellConfig$symb === void 0 ? '$' : _usePisellConfig$symb;
@@ -171,7 +173,22 @@ var TimelineSection = function TimelineSection(props) {
171
173
  label: locales.getText('wallet-pass-gallery.viewOrder'),
172
174
  value: timeLineDetail && timeLineDetail !== null && timeLineDetail !== void 0 && timeLineDetail.resource_code ? "#".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_code) : timeLineDetail !== null && timeLineDetail !== void 0 && timeLineDetail.transaction_id ? "#".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.transaction_id) : '',
173
175
  isLink: !!(timeLineDetail && timeLineDetail !== null && timeLineDetail !== void 0 && timeLineDetail.resource_id),
174
- link: timeLineDetail && timeLineDetail !== null && timeLineDetail !== void 0 && timeLineDetail.resource_id ? apiPrefix === '/shop' ? "/admin/order/orders/detail?id=".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_id) : "/order/details?id=".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_id) : undefined
176
+ onClick: function onClick() {
177
+ if (isTerminalEnv) {
178
+ var _interaction$utils, _interaction$utils$po;
179
+ return interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 ? void 0 : _interaction$utils$po.call(_interaction$utils, {
180
+ module: 'booking',
181
+ key: 'view_order',
182
+ data: {
183
+ order_id: timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_id
184
+ },
185
+ origin: '/booking'
186
+ });
187
+ }
188
+ var link = apiPrefix === '/shop' ? "/admin/order/orders/detail?id=".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_id) : "/order/details?id=".concat(timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.resource_id);
189
+ location.replace(link);
190
+ },
191
+ link: timeLineDetail && timeLineDetail !== null && timeLineDetail !== void 0 && timeLineDetail.resource_id ? true : undefined
175
192
  }],
176
193
  labelColor: "#101828",
177
194
  valueColor: "#101828",
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
3
  export interface WalletPassGalleryProps {
4
+ hideTitle: boolean;
5
+ hideAddButton: boolean;
6
+ customer?: any;
7
+ platform?: 'pc' | 'h5';
4
8
  [key: string]: any;
5
9
  }
6
10
  declare const WalletPassGallery: (props: WalletPassGalleryProps) => React.JSX.Element;