@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
@@ -62,6 +62,7 @@ var TAGS = [
62
62
  ];
63
63
  var WalletPassGallery = (props) => {
64
64
  var _a, _b, _c, _d, _e, _f, _g;
65
+ const { hideAddButton, hideTitle, customer, platform: platformProp } = props;
65
66
  const [activeKey, setActiveKey] = (0, import_react.useState)("available");
66
67
  const [currentItemId, setCurrentItemId] = (0, import_react.useState)(void 0);
67
68
  const [isOpenAddModal, setIsOpenAddModal] = (0, import_react.useState)(false);
@@ -70,16 +71,20 @@ var WalletPassGallery = (props) => {
70
71
  const [updateHolderLoading, setUpdateHolderLoading] = (0, import_react.useState)(false);
71
72
  const context = (0, import_useEngineContext.default)();
72
73
  const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
74
+ const { apiPrefix } = ((_b = context.appHelper) == null ? void 0 : _b.constants) || { apiPrefix: "/h5" };
75
+ const { isTerminal, isApp, interaction } = utils;
76
+ const isTerminalEnv = (typeof isTerminal === "function" ? isTerminal() : !!isTerminal) || (isApp == null ? void 0 : isApp());
73
77
  const platform = (0, import_react.useMemo)(() => {
78
+ if (platformProp) return platformProp;
74
79
  if (utils.isMobile) {
75
80
  return utils.isMobile() ? "h5" : "pc";
76
81
  }
77
82
  if (typeof window !== "undefined") {
78
83
  return window.innerWidth <= 768 ? "h5" : "pc";
79
84
  }
80
- }, [utils]);
81
- const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
82
- import_utils.locales.init(import_locales.default, ((_d = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _d.translateLocale) || "en");
85
+ return "pc";
86
+ }, [utils, platformProp]);
87
+ import_utils.locales.init(import_locales.default, ((_d = (_c = context == null ? void 0 : context.engine) == null ? void 0 : _c.props) == null ? void 0 : _d.locale) || "en");
83
88
  import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
84
89
  const _getWalletDetail = (0, import_ahooks.useRequest)(import_serve.getWalletDetail, {
85
90
  manual: true
@@ -89,15 +94,21 @@ var WalletPassGallery = (props) => {
89
94
  const _searchParams = new URLSearchParams(window.location.search);
90
95
  const walletId = _searchParams.get("id");
91
96
  const holderId = _searchParams.get("holder_id");
92
- const res = await (0, import_serve.getWalletPassList)({
93
- available: 1,
94
- num: 20,
95
- skip: (d == null ? void 0 : d.nextId) || 1,
96
- tags: TAGS,
97
- filter_wallet_id: walletId || void 0,
98
- filter_holder_id: holderId || void 0,
99
- with: ["customScheduleSnapshot", "holder.detail"]
100
- });
97
+ const res = await (0, import_serve.getWalletPassList)(
98
+ {
99
+ available: 1,
100
+ num: 20,
101
+ skip: (d == null ? void 0 : d.nextId) || 1,
102
+ tags: TAGS,
103
+ filter_wallet_id: walletId || void 0,
104
+ filter_holder_id: holderId || void 0,
105
+ with: ["customScheduleSnapshot", "holder.detail"],
106
+ customer_id: customer == null ? void 0 : customer.id
107
+ },
108
+ {
109
+ apiPrefix
110
+ }
111
+ );
101
112
  return {
102
113
  list: (res == null ? void 0 : res.list) || [],
103
114
  count: (res == null ? void 0 : res.count) || 0,
@@ -119,15 +130,21 @@ var WalletPassGallery = (props) => {
119
130
  const _searchParams = new URLSearchParams(window.location.search);
120
131
  const walletId = _searchParams.get("id");
121
132
  const holderId = _searchParams.get("holder_id");
122
- const res = await (0, import_serve.getWalletPassList)({
123
- available: 0,
124
- num: 20,
125
- skip: (d == null ? void 0 : d.nextId) || 1,
126
- tags: TAGS,
127
- filter_wallet_id: walletId || void 0,
128
- filter_holder_id: holderId || void 0,
129
- with: ["customScheduleSnapshot", "holder.detail"]
130
- });
133
+ const res = await (0, import_serve.getWalletPassList)(
134
+ {
135
+ available: 0,
136
+ num: 20,
137
+ skip: (d == null ? void 0 : d.nextId) || 1,
138
+ tags: TAGS,
139
+ filter_wallet_id: walletId || void 0,
140
+ filter_holder_id: holderId || void 0,
141
+ with: ["customScheduleSnapshot", "holder.detail"],
142
+ customer_id: customer == null ? void 0 : customer.id
143
+ },
144
+ {
145
+ apiPrefix
146
+ }
147
+ );
131
148
  return {
132
149
  list: (res == null ? void 0 : res.list) || [],
133
150
  count: (res == null ? void 0 : res.count) || 0,
@@ -150,8 +167,8 @@ var WalletPassGallery = (props) => {
150
167
  if (walletId) {
151
168
  _getWalletDetail.runAsync(walletId);
152
169
  }
153
- const req1 = _getAvailableList.loadMoreAsync();
154
- const req2 = _getUnavailableList.loadMoreAsync();
170
+ const req1 = _getAvailableList.reloadAsync();
171
+ const req2 = _getUnavailableList.reloadAsync();
155
172
  let req3 = passId ? (0, import_serve.getWalletPassDetail)(passId, {
156
173
  with: ["holder.detail"]
157
174
  }) : Promise.resolve();
@@ -222,7 +239,22 @@ var WalletPassGallery = (props) => {
222
239
  }
223
240
  }
224
241
  });
242
+ }, [customer]);
243
+ (0, import_react.useEffect)(() => {
244
+ var _a2, _b2;
245
+ (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.mountFunction) == null ? void 0 : _b2.call(_a2, "customer", "new", () => {
246
+ try {
247
+ _getAvailableList.reloadAsync();
248
+ _getUnavailableList.reloadAsync();
249
+ } catch (err) {
250
+ console.error(err);
251
+ }
252
+ });
225
253
  }, []);
254
+ const listReload = () => {
255
+ _getAvailableList.reloadAsync();
256
+ _getUnavailableList.reloadAsync();
257
+ };
226
258
  const _getUnbindList = (0, import_ahooks.useRequest)(import_serve.getUnbindList, {
227
259
  manual: true,
228
260
  onSuccess: (data) => {
@@ -266,6 +298,20 @@ var WalletPassGallery = (props) => {
266
298
  const newId = key === KEYS.unavailable ? (_a2 = _unavailable[0]) == null ? void 0 : _a2.id : (_b2 = _avaliable[0]) == null ? void 0 : _b2.id;
267
299
  setCurrentItemId(newId);
268
300
  };
301
+ const handleAddClick = () => {
302
+ var _a2, _b2;
303
+ if (isTerminalEnv) {
304
+ (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
305
+ module: "customer",
306
+ key: "new",
307
+ data: {
308
+ customer_id: String((customer == null ? void 0 : customer.id) || "")
309
+ }
310
+ });
311
+ return;
312
+ }
313
+ setIsOpenAddModal(true);
314
+ };
269
315
  const _resetSearchState = () => {
270
316
  setCurrentUnbindItem(null);
271
317
  _getUnbindList.mutate([]);
@@ -339,6 +385,32 @@ var WalletPassGallery = (props) => {
339
385
  console.log("pass not found", passId);
340
386
  }
341
387
  };
388
+ const _handleDetailRefresh = (passId, patch) => {
389
+ if (_avaliable.find((item) => item.id === passId)) {
390
+ _getAvailableList.mutate((data) => {
391
+ const newList = data.list.map(
392
+ (item) => item.id === passId ? { ...item, ...patch } : item
393
+ );
394
+ return {
395
+ ...data,
396
+ list: newList
397
+ };
398
+ });
399
+ return;
400
+ }
401
+ if (_unavailable.find((item) => item.id === passId)) {
402
+ _getUnavailableList.mutate((data) => {
403
+ const newList = data.list.map(
404
+ (item) => item.id === passId ? { ...item, ...patch } : item
405
+ );
406
+ return {
407
+ ...data,
408
+ list: newList
409
+ };
410
+ });
411
+ return;
412
+ }
413
+ };
342
414
  const _handleBindHolder = async (holderId) => {
343
415
  setUpdateHolderLoading(true);
344
416
  const { wallet_pass_detail_id: passId } = editHolderData;
@@ -372,15 +444,7 @@ var WalletPassGallery = (props) => {
372
444
  );
373
445
  return found2;
374
446
  }, [currentItemId, _avaliable, _unavailable]);
375
- const _pcTitle = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_title" }, /* @__PURE__ */ import_react.default.createElement(Title, null, ((_g = utils == null ? void 0 : utils.translation) == null ? void 0 : _g.call(utils, (_f = (_e = _getWalletDetail.data) == null ? void 0 : _e.data) == null ? void 0 : _f.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")), platform === "pc" ? /* @__PURE__ */ import_react.default.createElement(
376
- import_antd.Button,
377
- {
378
- icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-plus" }),
379
- size: "large",
380
- onClick: () => setIsOpenAddModal(true)
381
- },
382
- import_utils.locales.getText("wallet-pass-gallery.add")
383
- ) : null);
447
+ const _pcTitle = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_title" }, hideTitle ? null : /* @__PURE__ */ import_react.default.createElement(Title, null, ((_g = utils == null ? void 0 : utils.translation) == null ? void 0 : _g.call(utils, (_f = (_e = _getWalletDetail.data) == null ? void 0 : _e.data) == null ? void 0 : _f.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")));
384
448
  const renderAvaliableList = () => {
385
449
  if (platform === "h5") {
386
450
  return /* @__PURE__ */ import_react.default.createElement(
@@ -407,7 +471,15 @@ var WalletPassGallery = (props) => {
407
471
  onChange: _handleCardClick,
408
472
  onEditHolder: setEditHolderData
409
473
  }
410
- )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })));
474
+ )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(
475
+ import_passDetail.default,
476
+ {
477
+ dataSource: _currentItem,
478
+ platform,
479
+ onDetailRefresh: _handleDetailRefresh,
480
+ onListRefresh: listReload
481
+ }
482
+ )));
411
483
  };
412
484
  const renderUnavailableList = () => {
413
485
  if (platform === "h5") {
@@ -435,9 +507,19 @@ var WalletPassGallery = (props) => {
435
507
  onChange: _handleCardClick,
436
508
  onEditHolder: setEditHolderData
437
509
  }
438
- )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })));
510
+ )), /* @__PURE__ */ import_react.default.createElement(ACol, { flex: "auto" }, /* @__PURE__ */ import_react.default.createElement(
511
+ import_passDetail.default,
512
+ {
513
+ dataSource: _currentItem,
514
+ platform,
515
+ onDetailRefresh: _handleDetailRefresh,
516
+ onListRefresh: listReload
517
+ }
518
+ )));
519
+ };
520
+ const renderTabBar = (props2, DefaultTabBar) => {
521
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { zIndex: 99, position: "sticky", top: 0 } }, /* @__PURE__ */ import_react.default.createElement(DefaultTabBar, { ...props2, style: { background: "white" } }));
439
522
  };
440
- const renderTabBar = (props2, DefaultTabBar) => /* @__PURE__ */ import_react.default.createElement("div", { style: { zIndex: 99, position: "sticky", top: 0 } }, /* @__PURE__ */ import_react.default.createElement(DefaultTabBar, { ...props2, style: { background: "white" } }));
441
523
  const renderContent = () => {
442
524
  var _a2, _b2;
443
525
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery_content" }, /* @__PURE__ */ import_react.default.createElement(
@@ -461,7 +543,16 @@ var WalletPassGallery = (props) => {
461
543
  children: renderUnavailableList(),
462
544
  badge: ((_b2 = _getUnavailableList.data) == null ? void 0 : _b2.count) || 0
463
545
  }
464
- ]
546
+ ],
547
+ tabBarExtraContent: platform === "pc" && !hideAddButton ? /* @__PURE__ */ import_react.default.createElement(
548
+ import_antd.Button,
549
+ {
550
+ icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-plus" }),
551
+ size: "large",
552
+ onClick: handleAddClick
553
+ },
554
+ import_utils.locales.getText("wallet-pass-gallery.add")
555
+ ) : null
465
556
  }
466
557
  ));
467
558
  };
@@ -534,8 +625,8 @@ var WalletPassGallery = (props) => {
534
625
  );
535
626
  };
536
627
  const renderH5Content = () => {
537
- var _a2, _b2, _c2, _d2, _e2, _f2;
538
- const _walletBar = !((_c2 = (_b2 = (_a2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.isAppEnv) == null ? void 0 : _c2.call(_b2)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery-bar" }, /* @__PURE__ */ import_react.default.createElement(
628
+ var _a2, _b2, _c2, _d2;
629
+ const _walletBar = !((_a2 = utils == null ? void 0 : utils.isApp) == null ? void 0 : _a2.call(utils)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-pass-gallery-bar" }, /* @__PURE__ */ import_react.default.createElement(
539
630
  "div",
540
631
  {
541
632
  className: "pisell-wallet-pass-gallery-header-bar-arrow",
@@ -544,15 +635,15 @@ var WalletPassGallery = (props) => {
544
635
  }
545
636
  },
546
637
  /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-chevron-left" })
547
- ), /* @__PURE__ */ import_react.default.createElement("span", { className: "header-title" }, ((_f2 = utils == null ? void 0 : utils.translation) == null ? void 0 : _f2.call(utils, (_e2 = (_d2 = _getWalletDetail.data) == null ? void 0 : _d2.data) == null ? void 0 : _e2.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")));
548
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, _walletBar, renderContent(), /* @__PURE__ */ import_react.default.createElement(
638
+ ), /* @__PURE__ */ import_react.default.createElement("span", { className: "header-title" }, ((_d2 = utils == null ? void 0 : utils.translation) == null ? void 0 : _d2.call(utils, (_c2 = (_b2 = _getWalletDetail.data) == null ? void 0 : _b2.data) == null ? void 0 : _c2.name)) || import_utils.locales.getText("wallet-pass-gallery.wallet")));
639
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, _walletBar, renderContent(), hideAddButton ? null : /* @__PURE__ */ import_react.default.createElement(
549
640
  "div",
550
641
  {
551
642
  style: {
552
643
  padding: 24
553
644
  }
554
645
  },
555
- /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "large", onClick: () => setIsOpenAddModal(true), block: true }, import_utils.locales.getText("wallet-pass-gallery.button.add"))
646
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "large", onClick: handleAddClick, block: true }, import_utils.locales.getText("wallet-pass-gallery.button.add"))
556
647
  ), /* @__PURE__ */ import_react.default.createElement(
557
648
  import_materials.PisellModal,
558
649
  {
@@ -564,7 +655,15 @@ var WalletPassGallery = (props) => {
564
655
  footer: null,
565
656
  title: import_utils.locales.getText("wallet-pass-gallery.details")
566
657
  },
567
- /* @__PURE__ */ import_react.default.createElement(import_passDetail.default, { dataSource: _currentItem, platform })
658
+ /* @__PURE__ */ import_react.default.createElement(
659
+ import_passDetail.default,
660
+ {
661
+ dataSource: _currentItem,
662
+ platform,
663
+ onDetailRefresh: _handleDetailRefresh,
664
+ onListRefresh: listReload
665
+ }
666
+ )
568
667
  ));
569
668
  };
570
669
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
@@ -87,7 +87,9 @@ export declare type ErrorCallback = () => void;
87
87
  * @returns Promise<{list: IWalletListItemProps[], count: number}> 钱包列表和总数
88
88
  * @throws 请求失败时抛出错误
89
89
  */
90
- export declare const getWalletPassList: (params?: IWalletListParmsProps) => Promise<{
90
+ export declare const getWalletPassList: (params: IWalletListParmsProps, options?: {
91
+ apiPrefix: string;
92
+ }) => Promise<{
91
93
  list: IWalletListItemProps[];
92
94
  count: number;
93
95
  }>;
@@ -35,9 +35,9 @@ __export(serve_exports, {
35
35
  module.exports = __toCommonJS(serve_exports);
36
36
  var import_utils = require("../../utils");
37
37
  var import_utils2 = require("@pisell/utils");
38
- var getWalletPassList = async (params) => {
38
+ var getWalletPassList = async (params, options) => {
39
39
  try {
40
- const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/list`, params);
40
+ const { data } = await import_utils.request.getRequest().get(`${(options == null ? void 0 : options.apiPrefix) || "/h5"}/machinecode/lowcode/list`, params);
41
41
  return data || { list: [], count: 0 };
42
42
  } catch (error) {
43
43
  console.error(
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { PopoverProps } from 'antd';
3
+ import './index.less';
4
+ interface PisellPhoneKeyboardProps {
5
+ value?: string;
6
+ onChange: (e: string) => void;
7
+ popoverProps: PopoverProps;
8
+ virtualKeyboardProps?: any;
9
+ keyboardProps?: any;
10
+ virtualKeyInputProps?: any;
11
+ }
12
+ declare const PisellPhoneKeyboard: (props: PisellPhoneKeyboardProps) => React.JSX.Element;
13
+ export default PisellPhoneKeyboard;
@@ -0,0 +1,219 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/pro/pisellPhoneKeyboard/index.tsx
30
+ var pisellPhoneKeyboard_exports = {};
31
+ __export(pisellPhoneKeyboard_exports, {
32
+ default: () => pisellPhoneKeyboard_default
33
+ });
34
+ module.exports = __toCommonJS(pisellPhoneKeyboard_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_materials = require("@pisell/materials");
37
+ var import_antd = require("antd");
38
+ var import_index = require("./index.less");
39
+ var import_Delete = __toESM(require("@pisell/icon/es/Delete"));
40
+ var import_utils = require("@pisell/utils");
41
+ var import_locales = __toESM(require("./locales"));
42
+ var import_locales2 = require("../../utils/locales");
43
+ var PisellPhoneKeyboard = (props) => {
44
+ import_utils.locales.init(import_locales.default, (0, import_locales2.getLocale)());
45
+ const {
46
+ onChange,
47
+ value,
48
+ popoverProps,
49
+ virtualKeyboardProps,
50
+ keyboardProps,
51
+ virtualKeyInputProps
52
+ } = props;
53
+ const [open, setOpen] = (0, import_react.useState)(false);
54
+ const items = [
55
+ {
56
+ value: 1,
57
+ label: "1",
58
+ disabled: false,
59
+ type: "text"
60
+ },
61
+ {
62
+ value: 2,
63
+ label: "2",
64
+ disabled: false,
65
+ type: "text"
66
+ },
67
+ {
68
+ value: 3,
69
+ label: "3",
70
+ disabled: false,
71
+ type: "text"
72
+ },
73
+ {
74
+ value: 4,
75
+ label: "4",
76
+ disabled: false,
77
+ type: "text"
78
+ },
79
+ {
80
+ value: 5,
81
+ label: "5",
82
+ disabled: false,
83
+ type: "text"
84
+ },
85
+ {
86
+ value: 6,
87
+ label: "6",
88
+ disabled: false,
89
+ type: "text"
90
+ },
91
+ {
92
+ value: 7,
93
+ label: "7",
94
+ disabled: false,
95
+ type: "text"
96
+ },
97
+ {
98
+ value: 8,
99
+ label: "8",
100
+ disabled: false,
101
+ type: "text"
102
+ },
103
+ {
104
+ value: 9,
105
+ label: "9",
106
+ disabled: false,
107
+ type: "text"
108
+ },
109
+ {
110
+ value: "delete",
111
+ label: /* @__PURE__ */ import_react.default.createElement(import_Delete.default, { className: "virtual-keyboard-input-delete-icon" }),
112
+ disabled: false,
113
+ type: "text"
114
+ },
115
+ {
116
+ value: "0",
117
+ label: "0",
118
+ disabled: false,
119
+ type: "text"
120
+ },
121
+ {
122
+ value: "ok",
123
+ label: import_utils.locales.getText("pisell2.text.confirm"),
124
+ disabled: false,
125
+ type: "primary"
126
+ }
127
+ ];
128
+ const onOk = (e) => {
129
+ onChange == null ? void 0 : onChange(e);
130
+ setOpen(false);
131
+ };
132
+ const onOpenChange = (e) => {
133
+ setOpen(e);
134
+ };
135
+ (0, import_react.useEffect)(() => {
136
+ if (open) {
137
+ document.body.classList.add("hide-scroll");
138
+ } else {
139
+ setTimeout(() => {
140
+ document.body.classList.remove("hide-scroll");
141
+ }, 150);
142
+ }
143
+ }, [open]);
144
+ (0, import_react.useEffect)(() => {
145
+ document.body.id = "body";
146
+ }, []);
147
+ const adjustFontSize = (0, import_react.useMemo)(() => {
148
+ if (!value) {
149
+ return 30;
150
+ }
151
+ const maxFontSize = 60;
152
+ const minFontSize = 10;
153
+ const defaultFontSize = maxFontSize;
154
+ const inputWidth = 248;
155
+ const span = document.createElement("span");
156
+ span.style.position = "absolute";
157
+ span.style.whiteSpace = "nowrap";
158
+ span.style.visibility = "hidden";
159
+ span.style.fontSize = `${defaultFontSize}px`;
160
+ span.textContent = value;
161
+ document.body.appendChild(span);
162
+ let fontSize = maxFontSize;
163
+ while (span.offsetWidth > inputWidth && fontSize > minFontSize) {
164
+ fontSize -= 0.5;
165
+ span.style.fontSize = `${fontSize}px`;
166
+ }
167
+ document.body.removeChild(span);
168
+ return fontSize;
169
+ }, [value]);
170
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
171
+ import_antd.Popover,
172
+ {
173
+ content: /* @__PURE__ */ import_react.default.createElement(
174
+ import_materials.VirtualKeyboard,
175
+ {
176
+ keyboardProps: {
177
+ keydown: false,
178
+ items,
179
+ onChange: (e) => {
180
+ if (e === "reset") {
181
+ onChange("");
182
+ return;
183
+ }
184
+ if (e === "ok") {
185
+ onOk(value || "");
186
+ return;
187
+ }
188
+ if (e === "delete") {
189
+ onChange((value == null ? void 0 : value.slice(0, -1)) || "");
190
+ return;
191
+ }
192
+ onChange(value + String(e));
193
+ },
194
+ ...keyboardProps
195
+ },
196
+ virtualKeyInputProps: {
197
+ value,
198
+ onChange: (e) => {
199
+ onChange(e.target.value);
200
+ },
201
+ style: {
202
+ textAlign: "left",
203
+ fontSize: adjustFontSize
204
+ },
205
+ ...virtualKeyInputProps
206
+ },
207
+ ...virtualKeyboardProps
208
+ }
209
+ ),
210
+ open,
211
+ arrow: false,
212
+ onOpenChange,
213
+ trigger: ["click"],
214
+ ...popoverProps
215
+ },
216
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { readOnly: true, value, style: { width: "100%" }, size: "large" })
217
+ ));
218
+ };
219
+ var pisellPhoneKeyboard_default = PisellPhoneKeyboard;