@pisell/private-materials 3.2.20 → 3.2.22

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 (249) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/components/Cart/Item/index.js +7 -2
  12. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Date/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  16. package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  17. package/es/components/appointmentBooking/components/Voucher/index.js +228 -0
  18. package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
  19. package/es/components/appointmentBooking/hooks.d.ts +1 -0
  20. package/es/components/appointmentBooking/hooks.js +4 -0
  21. package/es/components/appointmentBooking/index.d.ts +1 -0
  22. package/es/components/appointmentBooking/locales.d.ts +27 -0
  23. package/es/components/appointmentBooking/locales.js +30 -3
  24. package/es/components/appointmentBooking/utils.js +3 -1
  25. package/es/components/booking/addons/index.js +1 -0
  26. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  27. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  28. package/es/components/booking/components/footer/index.js +5 -1
  29. package/es/components/booking/components/footer/utils.js +18 -2
  30. package/es/components/booking/components/voucher/index.d.ts +3 -0
  31. package/es/components/booking/components/voucher/index.js +237 -0
  32. package/es/components/booking/components/voucher/index.less +88 -0
  33. package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
  34. package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
  35. package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
  36. package/es/components/booking/deposit/index.d.ts +1 -0
  37. package/es/components/booking/forms/single/index.d.ts +1 -0
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  40. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  41. package/es/components/booking/info/date/index.d.ts +1 -0
  42. package/es/components/booking/info/header/index.d.ts +1 -0
  43. package/es/components/booking/info/index.d.ts +1 -0
  44. package/es/components/booking/info/notes/index.d.ts +1 -0
  45. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  46. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  47. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  48. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  49. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  50. package/es/components/booking/info/service2/utils.d.ts +1 -1
  51. package/es/components/booking/info/utils.js +1 -1
  52. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  53. package/es/components/booking/info2/service/addService/index.d.ts +1 -0
  54. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  55. package/es/components/booking/info2/service/editService/index.js +9 -0
  56. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  57. package/es/components/booking/locales.d.ts +18 -0
  58. package/es/components/booking/locales.js +21 -3
  59. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  60. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  61. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  62. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  63. package/es/components/booking/payments/index.js +1 -0
  64. package/es/components/eftpos/form/index.d.ts +1 -0
  65. package/es/components/eftpos/hooks.d.ts +1 -0
  66. package/es/components/eftpos/index.d.ts +1 -0
  67. package/es/components/eftpos/pos.d.ts +1 -0
  68. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  69. package/es/components/eftposPay/amount.d.ts +1 -1
  70. package/es/components/eftposPay/app.d.ts +1 -0
  71. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  72. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  73. package/es/components/eftposPay/component/fail/network.d.ts +1 -0
  74. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  75. package/es/components/eftposPay/component/manual/index.d.ts +1 -0
  76. package/es/components/eftposPay/component/signature/index.d.ts +1 -0
  77. package/es/components/eftposPay/device.d.ts +1 -1
  78. package/es/components/eftposPay/hooks.d.ts +1 -1
  79. package/es/components/eftposPay/index.d.ts +1 -0
  80. package/es/components/eftposPay/pay.d.ts +1 -0
  81. package/es/components/eftposPay/store/index.d.ts +3 -3
  82. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  83. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  84. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  85. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  87. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  88. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  89. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  90. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  91. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  92. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  93. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  94. package/es/components/eventBooking/index.d.ts +1 -0
  95. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  96. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  97. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  98. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  99. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  100. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  101. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  102. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  103. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  104. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  105. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  106. package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  110. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  111. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  112. package/es/components/schedules/products/index.d.ts +1 -0
  113. package/es/components/schedules/resources/index.d.ts +1 -0
  114. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  115. package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  116. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  117. package/es/components/schedules/schedules/index.d.ts +1 -0
  118. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  119. package/es/components/shoppingCart/index.d.ts +1 -0
  120. package/es/components/taxSelect/index.d.ts +1 -0
  121. package/es/components/wallet/Detail/index.js +20 -14
  122. package/es/components/wallet/Voucher/index.js +1 -0
  123. package/es/components/wallet/index.js +15 -1
  124. package/es/components/wallet/locales.d.ts +3 -0
  125. package/es/components/wallet/locales.js +3 -0
  126. package/es/components/wallet/model.d.ts +1 -1
  127. package/es/components/wallet/utils/formatUtils.js +1 -1
  128. package/es/components/walletList/index.js +5 -1
  129. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  130. package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -2
  131. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  132. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  133. package/lib/components/appointmentBooking/components/Date/index.d.ts +1 -0
  134. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  135. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  136. package/lib/components/appointmentBooking/components/Voucher/index.js +209 -0
  137. package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
  138. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  139. package/lib/components/appointmentBooking/hooks.js +8 -2
  140. package/lib/components/appointmentBooking/index.d.ts +1 -0
  141. package/lib/components/appointmentBooking/locales.d.ts +27 -0
  142. package/lib/components/appointmentBooking/locales.js +30 -3
  143. package/lib/components/appointmentBooking/utils.js +3 -1
  144. package/lib/components/booking/addons/index.js +1 -1
  145. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  146. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  147. package/lib/components/booking/components/footer/index.js +2 -1
  148. package/lib/components/booking/components/footer/utils.js +18 -1
  149. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  150. package/lib/components/booking/components/voucher/index.js +211 -0
  151. package/lib/components/booking/components/voucher/index.less +88 -0
  152. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
  153. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
  154. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
  155. package/lib/components/booking/deposit/index.d.ts +1 -0
  156. package/lib/components/booking/forms/single/index.d.ts +1 -0
  157. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  158. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  159. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  160. package/lib/components/booking/info/date/index.d.ts +1 -0
  161. package/lib/components/booking/info/header/index.d.ts +1 -0
  162. package/lib/components/booking/info/index.d.ts +1 -0
  163. package/lib/components/booking/info/notes/index.d.ts +1 -0
  164. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  165. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  166. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  167. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  168. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  169. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  170. package/lib/components/booking/info/utils.js +1 -1
  171. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  172. package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
  173. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  174. package/lib/components/booking/info2/service/editService/index.js +8 -0
  175. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  176. package/lib/components/booking/locales.d.ts +18 -0
  177. package/lib/components/booking/locales.js +21 -3
  178. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  179. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  180. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  181. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  182. package/lib/components/booking/payments/index.js +1 -1
  183. package/lib/components/eftpos/form/index.d.ts +1 -0
  184. package/lib/components/eftpos/hooks.d.ts +1 -0
  185. package/lib/components/eftpos/index.d.ts +1 -0
  186. package/lib/components/eftpos/pos.d.ts +1 -0
  187. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  188. package/lib/components/eftposPay/amount.d.ts +1 -1
  189. package/lib/components/eftposPay/app.d.ts +1 -0
  190. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  191. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  192. package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
  193. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  194. package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
  195. package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
  196. package/lib/components/eftposPay/device.d.ts +1 -1
  197. package/lib/components/eftposPay/hooks.d.ts +1 -1
  198. package/lib/components/eftposPay/index.d.ts +1 -0
  199. package/lib/components/eftposPay/pay.d.ts +1 -0
  200. package/lib/components/eftposPay/store/index.d.ts +3 -3
  201. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  202. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  203. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  204. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  205. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  206. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  207. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  208. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  209. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  210. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  211. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  212. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  213. package/lib/components/eventBooking/index.d.ts +1 -0
  214. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  215. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  216. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  217. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  218. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  219. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  220. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  221. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  222. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  223. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  224. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  225. package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
  226. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  227. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  228. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  229. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  230. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  231. package/lib/components/schedules/products/index.d.ts +1 -0
  232. package/lib/components/schedules/resources/index.d.ts +1 -0
  233. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  234. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  235. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  236. package/lib/components/schedules/schedules/index.d.ts +1 -0
  237. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  238. package/lib/components/shoppingCart/index.d.ts +1 -0
  239. package/lib/components/taxSelect/index.d.ts +1 -0
  240. package/lib/components/wallet/Detail/index.js +6 -1
  241. package/lib/components/wallet/Voucher/index.js +1 -0
  242. package/lib/components/wallet/index.js +15 -1
  243. package/lib/components/wallet/locales.d.ts +3 -0
  244. package/lib/components/wallet/locales.js +3 -0
  245. package/lib/components/wallet/model.d.ts +1 -1
  246. package/lib/components/wallet/utils/formatUtils.js +1 -1
  247. package/lib/components/walletList/index.js +6 -2
  248. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  249. package/package.json +2 -2
@@ -0,0 +1,237 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ 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; }
3
+ 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); } }
4
+ 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
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ 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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ 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); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ 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); }
13
+ 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; }
14
+ 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; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
17
+ import ChevronDown from '@pisell/icon/es/ChevronDown';
18
+ import classNames from 'classnames';
19
+ import { Button } from 'antd';
20
+ import { locales } from '@pisell/utils';
21
+ import useEngineContext from "../../../../hooks/useEngineContext";
22
+ import { PisellInput, PisellTooltip, PisellGoodPassCard, PisellToast } from '@pisell/materials';
23
+ import { QuestionCircleOutlined } from '@ant-design/icons';
24
+ import "./index.less";
25
+ var ShopDiscountHooks = {
26
+ onInited: 'shopDiscount:onInited',
27
+ onDestroy: 'shopDiscount:onDestroy',
28
+ onLoadDiscountList: 'shopDiscount:onLoadDiscountList',
29
+ onCustomerChange: 'shopDiscount:onCustomerChange',
30
+ onDiscountListChange: 'shopDiscount:onDiscountListChange',
31
+ onRulesListChange: 'shopDiscount:onRulesListChange',
32
+ onLoadPrepareCalcResult: 'shopDiscount:onLoadPrepareCalcResult'
33
+ };
34
+ var VoucherCard = function VoucherCard(props) {
35
+ var _context$appHelper, _state$client$value;
36
+ var context = useEngineContext();
37
+ var _useState = useState(true),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ showDetail = _useState2[0],
40
+ setShowDetail = _useState2[1];
41
+ var state = props.state,
42
+ dispatch = props.dispatch;
43
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
44
+ pisellos = _context$appHelper$ut.pisellos;
45
+ var _useState3 = useState(''),
46
+ _useState4 = _slicedToArray(_useState3, 2),
47
+ code = _useState4[0],
48
+ setCode = _useState4[1];
49
+ var _useState5 = useState([]),
50
+ _useState6 = _slicedToArray(_useState5, 2),
51
+ discountList = _useState6[0],
52
+ setDisCountList = _useState6[1];
53
+ var productRef = useRef(state.service.value);
54
+ var shopDiscount = pisellos.getModule('shopDiscount');
55
+ var availableData = useMemo(function () {
56
+ var shopDiscount = pisellos.getModule('shopDiscount');
57
+ return discountList.filter(function (item) {
58
+ return !!item.isAvailable;
59
+ }).map(function (discount) {
60
+ return _objectSpread(_objectSpread({}, discount), {}, {
61
+ savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
62
+ });
63
+ });
64
+ }, [discountList]);
65
+
66
+ // 设置client
67
+ useEffect(function () {
68
+ shopDiscount.setCustomer(state.client.value);
69
+ }, [(_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id]);
70
+
71
+ // 设置productList
72
+ useEffect(function () {
73
+ shopDiscount.setProductList(state.service.value);
74
+ }, [state.service.value]);
75
+
76
+ // 更新productList
77
+ useEffect(function () {
78
+ if (productRef.current === state.service.value) {
79
+ return;
80
+ }
81
+ var val = shopDiscount.calcDiscount(state.service.value);
82
+ console.log('input: ', state.service.value);
83
+ console.log('output: ', val);
84
+ productRef.current = val.productList;
85
+ dispatch({
86
+ type: 'setService',
87
+ payload: {
88
+ value: val.productList
89
+ }
90
+ });
91
+ }, [state.service.value]);
92
+
93
+ // 监听customer变化
94
+ useEffect(function () {
95
+ pisellos.effects.on(ShopDiscountHooks.onCustomerChange, function (customer) {
96
+ console.log(customer, 'customerChange');
97
+ // 更新客户
98
+ dispatch({
99
+ type: 'setClient',
100
+ payload: {
101
+ value: customer
102
+ }
103
+ });
104
+ });
105
+ pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, function (result) {
106
+ dispatch({
107
+ type: 'setService',
108
+ payload: {
109
+ value: result.productList
110
+ }
111
+ });
112
+ });
113
+ pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
114
+ console.log(discount, 'discountChange');
115
+ setDisCountList(discount);
116
+ });
117
+ return function () {
118
+ shopDiscount.clear();
119
+ pisellos.effects.off(ShopDiscountHooks.onCustomerChange);
120
+ pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult);
121
+ pisellos.effects.off(ShopDiscountHooks.onDiscountListChange);
122
+ };
123
+ }, [state.bookingId]);
124
+
125
+ // apply code
126
+ var onScanCode = /*#__PURE__*/function () {
127
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
128
+ var val;
129
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
130
+ while (1) switch (_context.prev = _context.next) {
131
+ case 0:
132
+ _context.next = 2;
133
+ return shopDiscount.scanCode(code);
134
+ case 2:
135
+ val = _context.sent;
136
+ console.log(val);
137
+ if (val !== null && val !== void 0 && val.isAvailable) {
138
+ dispatch({
139
+ type: 'setService',
140
+ payload: {
141
+ value: val.productList
142
+ }
143
+ });
144
+ } else {
145
+ PisellToast({
146
+ content: locales.getText('pisell2.text.goodpass.code-invalid')
147
+ });
148
+ }
149
+ case 5:
150
+ case "end":
151
+ return _context.stop();
152
+ }
153
+ }, _callee);
154
+ }));
155
+ return function onScanCode() {
156
+ return _ref.apply(this, arguments);
157
+ };
158
+ }();
159
+
160
+ // if (
161
+ // !isBooking4Shop(
162
+ // context.appHelper.utils.store?.getState?.()?.global?.globalConfig?.id,
163
+ // state.renderType
164
+ // )
165
+ // ) {
166
+ // return null;
167
+ // }
168
+
169
+ return /*#__PURE__*/React.createElement("div", {
170
+ className: "pisell-lowcode__booking-footer-voucher-container"
171
+ }, /*#__PURE__*/React.createElement("div", {
172
+ className: "voucher-title"
173
+ }, /*#__PURE__*/React.createElement("span", {
174
+ className: "voucher-title-left"
175
+ }, locales.getText('pisell2.text.goodpass')), /*#__PURE__*/React.createElement("span", {
176
+ className: "voucher-title-right",
177
+ onClick: function onClick() {
178
+ console.log('showDetail: ', showDetail);
179
+ setShowDetail(!showDetail);
180
+ }
181
+ }, locales.getText('pisell2.text.details'), ' ', /*#__PURE__*/React.createElement(ChevronDown, {
182
+ className: classNames('voucher-right-icon', {
183
+ show: showDetail
184
+ })
185
+ }))), /*#__PURE__*/React.createElement("div", {
186
+ className: classNames('voucher-detail', {
187
+ show: showDetail
188
+ })
189
+ }, (availableData === null || availableData === void 0 ? void 0 : availableData.length) > 0 ? /*#__PURE__*/React.createElement(PisellGoodPassCard, {
190
+ style: {
191
+ width: '100%'
192
+ },
193
+ dataSource: availableData,
194
+ onChange: function onChange(val) {
195
+ var shopDiscount = pisellos.getModule('shopDiscount');
196
+ var detail = shopDiscount.setDiscountSelected({
197
+ discountId: val.id,
198
+ isSelected: val.isSelected
199
+ });
200
+ console.log('setDiscountSelected:', detail);
201
+ dispatch({
202
+ type: 'setService',
203
+ payload: {
204
+ value: detail.productList
205
+ }
206
+ });
207
+ }
208
+ }) : null, /*#__PURE__*/React.createElement("div", {
209
+ className: "voucher-code-input-wrapper"
210
+ }, /*#__PURE__*/React.createElement("div", {
211
+ className: "voucher-code-input"
212
+ }, /*#__PURE__*/React.createElement("div", {
213
+ style: {
214
+ whiteSpace: 'nowrap'
215
+ }
216
+ }, locales.getText('pisell2.text.goodpass.code'), ":"), /*#__PURE__*/React.createElement(PisellInput, {
217
+ value: code,
218
+ onChange: function onChange(e) {
219
+ var _e$target;
220
+ setCode((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
221
+ },
222
+ size: "small",
223
+ placeholder: locales.getText('pisell2.text.goodpass.enter-code'),
224
+ suffix: /*#__PURE__*/React.createElement(PisellTooltip, {
225
+ title: ""
226
+ }, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
227
+ style: {
228
+ color: 'rgba(0,0,0,.45)'
229
+ }
230
+ }))
231
+ })), /*#__PURE__*/React.createElement(Button, {
232
+ size: "small",
233
+ onClick: onScanCode,
234
+ disabled: !code
235
+ }, locales.getText('pisell2.text.apply')))));
236
+ };
237
+ export default VoucherCard;
@@ -0,0 +1,88 @@
1
+ .pisell-lowcode__booking-footer-voucher-container {
2
+ margin-bottom: 8px;
3
+ .voucher-title {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: space-between;
7
+ margin-bottom: 10px;
8
+
9
+ .voucher-title-left {
10
+ color: var(--base-black, #000);
11
+ font-size: 18px;
12
+ font-style: normal;
13
+ font-weight: 600;
14
+ line-height: 28px;
15
+ display: flex;
16
+ flex-direction: column;
17
+ }
18
+
19
+ .voucher-title-right {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ gap: 4px;
24
+ color: #7f56d9;
25
+ cursor: pointer;
26
+ font-size: 18px;
27
+ font-style: normal;
28
+ font-weight: 500;
29
+ }
30
+
31
+ .voucher-right-icon {
32
+ font-size: 20px;
33
+ width: 24px;
34
+ height: 24px;
35
+ color: #7f56d9;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+
40
+ &.show {
41
+ transform: rotate(180deg);
42
+ }
43
+ }
44
+ }
45
+
46
+ .voucher-detail {
47
+ width: 100%;
48
+ transition: 0.2s;
49
+ max-height: 0;
50
+ overflow: hidden;
51
+ display: flex;
52
+ flex-direction: column;
53
+
54
+ &.show {
55
+ max-height: unset;
56
+ }
57
+ }
58
+
59
+ .voucher-code-input-wrapper {
60
+ margin-top: 6px;
61
+ display: flex;
62
+ width: 100%;
63
+ height: 42px;
64
+ padding: 8px;
65
+ justify-content: space-between;
66
+ align-items: center;
67
+ gap: 8px;
68
+ flex-shrink: 0;
69
+ border-radius: 8px;
70
+ border: 1px solid var(--Gray-300, #d0d5dd);
71
+ background: #fff;
72
+ }
73
+
74
+ .voucher-code-input {
75
+ display: flex;
76
+ align-items: center;
77
+ > div {
78
+ color: var(--Gray-500, #667085);
79
+ text-align: center;
80
+ font-family: Inter;
81
+ font-size: 16px;
82
+ font-style: normal;
83
+ font-weight: 600;
84
+ line-height: 20px;
85
+ margin-right: 8px;
86
+ }
87
+ }
88
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface ApplicableProductDetails {
4
+ amount: string;
5
+ type: string;
6
+ resource_id: number;
7
+ title: string;
8
+ original_amount: string;
9
+ }
10
+ interface Discount {
11
+ id: number;
12
+ product_name: string;
13
+ encoded: string;
14
+ code: string;
15
+ tag: string;
16
+ expire_time?: string;
17
+ product_id: number;
18
+ relation_type: string;
19
+ par_value: string;
20
+ used_par_value: string;
21
+ limit_status: string;
22
+ limited_relation_product_data: any;
23
+ balance: string;
24
+ format_title: any;
25
+ product: any;
26
+ savedAmount: number;
27
+ isDisabled: boolean;
28
+ isSelected?: boolean;
29
+ isAvailable?: boolean;
30
+ isUsed?: boolean;
31
+ applicableProductIds?: number[];
32
+ applicableProductDetails: ApplicableProductDetails[];
33
+ appliedProductDetails: any[];
34
+ }
35
+ export interface PisellGoodPassCardProps {
36
+ /**数据源 */
37
+ dataSource: Array<Discount>;
38
+ /**事件 */
39
+ onChange?: (current: {
40
+ id: string | number;
41
+ isSelected: boolean;
42
+ }) => void;
43
+ /**样式 */
44
+ style: React.CSSProperties;
45
+ }
46
+ declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
47
+ export default index;
@@ -0,0 +1,115 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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); }
10
+ 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; }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useState } from 'react';
14
+ import { Checkbox, Divider, Typography } from 'antd';
15
+ import { locales } from '@pisell/utils';
16
+ import { PisellText, PisellCard, PisellModal } from '@pisell/materials';
17
+ import useEngineContext from "../../../../../hooks/useEngineContext";
18
+ import "./index.less";
19
+ var clsPrefix = 'pisell-good-pass-card';
20
+ var index = function index(props) {
21
+ var _context$appHelper;
22
+ var context = useEngineContext();
23
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
24
+ translationShop = _context$appHelper$ut.translationShop;
25
+ var _props$dataSource = props.dataSource,
26
+ dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
27
+ onChange = props.onChange,
28
+ _props$style = props.style,
29
+ style = _props$style === void 0 ? {} : _props$style;
30
+ var _useState = useState(false),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ showModal = _useState2[0],
33
+ setShowModal = _useState2[1];
34
+ console.log('pisell good card datasource', dataSource);
35
+ var handleChange = function handleChange(newValue) {
36
+ if (onChange) {
37
+ onChange(newValue);
38
+ }
39
+ };
40
+ var handleItemChange = function handleItemChange(item, checked) {
41
+ handleChange({
42
+ id: item.id,
43
+ isSelected: checked
44
+ });
45
+ };
46
+ var renderVoucherContent = function renderVoucherContent(item) {
47
+ return /*#__PURE__*/React.createElement("span", null, "Save ", /*#__PURE__*/React.createElement(PisellText.Amount, {
48
+ value: item.savedAmount
49
+ }));
50
+ };
51
+ var renderActionElement = function renderActionElement(item) {
52
+ var isChecked = item.isSelected;
53
+ return /*#__PURE__*/React.createElement(Checkbox, {
54
+ disabled: item.isDisabled,
55
+ style: {
56
+ marginLeft: 8
57
+ },
58
+ checked: isChecked,
59
+ onChange: function onChange(e) {
60
+ return handleItemChange(item, e.target.checked);
61
+ }
62
+ });
63
+ };
64
+ var renderVoucherItem = function renderVoucherItem(item) {
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ key: item.id,
67
+ className: "".concat(clsPrefix, "-voucher-item")
68
+ }, /*#__PURE__*/React.createElement("div", {
69
+ className: "item-title"
70
+ }, translationShop(item.format_title)), /*#__PURE__*/React.createElement("div", {
71
+ className: "item-content"
72
+ }, renderVoucherContent(item), renderActionElement(item)));
73
+ };
74
+ var renderModal = function renderModal() {
75
+ return /*#__PURE__*/React.createElement(PisellModal, {
76
+ title: 'Vouchers',
77
+ footer: null,
78
+ open: showModal,
79
+ onCancel: function onCancel() {
80
+ return setShowModal(false);
81
+ },
82
+ className: "".concat(clsPrefix, "-all-items-modal")
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ style: {
85
+ padding: '10px 0'
86
+ }
87
+ }, dataSource.map(renderVoucherItem)));
88
+ };
89
+ var renderMixedMode = function renderMixedMode() {
90
+ var list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
91
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
92
+ className: "".concat(clsPrefix, "-header")
93
+ }, /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.text.goodpass.product-vouchers')), /*#__PURE__*/React.createElement(Typography.Text, {
94
+ underline: true,
95
+ onClick: function onClick() {
96
+ return setShowModal(true);
97
+ }
98
+ }, locales.getText('pisell2.text.goodpass.view-more'))), /*#__PURE__*/React.createElement(Divider, {
99
+ style: {
100
+ margin: 4
101
+ }
102
+ }), /*#__PURE__*/React.createElement("div", {
103
+ className: "".concat(clsPrefix, "-body")
104
+ }, list.map(renderVoucherItem)));
105
+ };
106
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderModal(), /*#__PURE__*/React.createElement(PisellCard, {
107
+ padding: 8,
108
+ borderRadius: 8,
109
+ style: _objectSpread({
110
+ width: 378
111
+ }, style),
112
+ className: clsPrefix
113
+ }, renderMixedMode()));
114
+ };
115
+ export default index;
@@ -0,0 +1,52 @@
1
+ .pisell-good-pass-card-all-items-modal,
2
+ .pisell-good-pass-card {
3
+ .pisell-good-pass-card-header,
4
+ .pisell-good-pass-card-group-header {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ align-items: center;
8
+ color: var(--Gray-900, #101828);
9
+ text-align: center;
10
+ font-family: Inter;
11
+ font-size: 14px;
12
+ font-style: normal;
13
+ font-weight: 600;
14
+ line-height: 20px;
15
+ }
16
+
17
+ .pisell-good-pass-card-voucher-item {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ height: 22px;
22
+
23
+ .item-title {
24
+ color: var(--Gray-500, #667085);
25
+ text-align: center;
26
+ font-family: Inter;
27
+ font-size: 14px;
28
+ font-style: normal;
29
+ font-weight: 600;
30
+ line-height: 20px;
31
+ }
32
+
33
+ .item-content {
34
+ color: var(--, #8157d5);
35
+ font-family: Inter;
36
+ font-size: 14px;
37
+ font-style: normal;
38
+ font-weight: 400;
39
+ line-height: 20px;
40
+
41
+ .add-btn {
42
+ color: var(--, #8157d5);
43
+ text-align: center;
44
+ font-family: Inter;
45
+ font-size: 14px;
46
+ font-style: normal;
47
+ font-weight: 600;
48
+ line-height: 20px; /* 142.857% */
49
+ }
50
+ }
51
+ }
52
+ }
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Deposit: (props: any) => JSX.Element;
2
3
  export default Deposit;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  /**
3
4
  * @title: 表单选择器
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useClearCart: (state: any, dispatch: any) => false | JSX.Element;
3
2
  export default useClearCart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from '../../../model';
2
3
  interface useClientFnParams {
3
4
  state: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  export declare const updateServiceDate: (services: any[], date: any, isTime: boolean) => any[];
3
4
  declare const DateCom: () => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const header: ({ state, dispatch }: any) => JSX.Element;
3
4
  export default header;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InfoProps } from './main';
2
3
  declare const APP: (props: InfoProps) => JSX.Element;
3
4
  export default APP;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Notes: () => JSX.Element | null;
2
3
  export default Notes;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const Actions: ({ currentService }: {
3
4
  currentService: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellDrawerProps } from '../../../components/drawer';
2
3
  import './index.less';
3
4
  interface AddServiceProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceList: ({ onEdit }: {
3
4
  onEdit: any;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -237,4 +237,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
237
237
  * @Author: WangHan
238
238
  * @Date: 2024-12-24 11:32
239
239
  */
240
- export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
240
+ export declare const updateServicePrice: (state: any) => Promise<any> | never[];
@@ -93,7 +93,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
93
93
  if (renderType === 'eventBooking') {
94
94
  return false;
95
95
  }
96
- var booking4Shops = [9, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586];
96
+ var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586];
97
97
  return booking4Shops.includes(shopId);
98
98
  };
99
99
  function generateDateRange(start, end) {