@pisell/private-materials 3.3.87 → 3.3.88

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 (253) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/businessModel/SalesModel/Sales/index.js +4 -37
  12. package/es/components/Sales/Cart/index.js +1 -5
  13. package/es/components/Sales/Cart/utils.d.ts +0 -40
  14. package/es/components/Sales/Cart/utils.js +0 -167
  15. package/es/components/Sales/Checkout/index.d.ts +0 -4
  16. package/es/components/Sales/Checkout/index.js +8 -52
  17. package/es/components/Sales/Checkout/serve.d.ts +0 -13
  18. package/es/components/Sales/Checkout/serve.js +2 -16
  19. package/es/components/Sales/Checkout/utils.js +1 -7
  20. package/es/components/Sales/Resource/index.js +2 -2
  21. package/es/components/Sales/Resource/serve.d.ts +0 -7
  22. package/es/components/Sales/Resource/serve.js +0 -10
  23. package/es/components/Sales/Summary/index.d.ts +0 -10
  24. package/es/components/Sales/Summary/index.js +2 -17
  25. package/es/components/Sales/Summary/serve.d.ts +0 -1
  26. package/es/components/Sales/Summary/serve.js +0 -6
  27. package/es/components/Sales/Summary/utils.d.ts +0 -15
  28. package/es/components/Sales/Summary/utils.js +1 -43
  29. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  30. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  31. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  32. package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
  33. package/es/components/appointmentBooking/components/Services/index.js +27 -23
  34. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
  35. package/es/components/appointmentBooking/deposit/index.js +2 -4
  36. package/es/components/appointmentBooking/index.js +0 -14
  37. package/es/components/appointmentBooking/index.less +1 -1
  38. package/es/components/booking/components/footer/utils.d.ts +0 -1
  39. package/es/components/booking/components/footer/utils.js +1 -1
  40. package/es/components/booking/components/voucher/index.js +2 -2
  41. package/es/components/booking/info/service2/utils.js +2 -3
  42. package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
  43. package/es/components/booking/info2/service/addService/utils.js +13 -44
  44. package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
  45. package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
  46. package/es/components/booking/info2/utilsByBooking.js +0 -9
  47. package/es/components/booking/locales.d.ts +0 -3
  48. package/es/components/booking/locales.js +0 -3
  49. package/es/components/eftposPay/const.d.ts +1 -4
  50. package/es/components/eftposPay/const.js +1 -3
  51. package/es/components/eftposPay/hooks.d.ts +1 -1
  52. package/es/components/eftposPay/hooks.js +1 -3
  53. package/es/components/eftposPay/index.js +1 -1
  54. package/es/components/eftposPay/manufacturer.d.ts +0 -1
  55. package/es/components/eftposPay/manufacturer.js +0 -4
  56. package/es/components/eftposPay/pay.d.ts +1 -1
  57. package/es/components/eftposPay/pay.js +2 -6
  58. package/es/components/eftposPay/store/index.d.ts +1 -1
  59. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
  60. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
  61. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  62. package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
  63. package/es/components/eventBooking/components/bookingDetailModal/index.js +4 -22
  64. package/es/components/eventBooking/index.js +7 -21
  65. package/es/components/eventBooking/locales.d.ts +0 -24
  66. package/es/components/eventBooking/locales.js +6 -30
  67. package/es/components/index.d.ts +1 -3
  68. package/es/components/index.js +1 -3
  69. package/es/components/pay/toC/PaymentMethods/index.js +4 -5
  70. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  71. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  72. package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
  73. package/es/components/ticketBooking/locales.d.ts +146 -164
  74. package/es/components/ticketBooking/locales.js +147 -195
  75. package/es/index.d.ts +0 -2
  76. package/es/index.js +1 -3
  77. package/lib/businessModel/SalesModel/Sales/index.js +8 -22
  78. package/lib/components/Sales/Cart/index.js +0 -1
  79. package/lib/components/Sales/Cart/utils.d.ts +0 -40
  80. package/lib/components/Sales/Cart/utils.js +0 -117
  81. package/lib/components/Sales/Checkout/index.d.ts +0 -4
  82. package/lib/components/Sales/Checkout/index.js +7 -39
  83. package/lib/components/Sales/Checkout/serve.d.ts +0 -13
  84. package/lib/components/Sales/Checkout/serve.js +2 -7
  85. package/lib/components/Sales/Checkout/utils.js +0 -2
  86. package/lib/components/Sales/Resource/index.js +1 -1
  87. package/lib/components/Sales/Resource/serve.d.ts +0 -7
  88. package/lib/components/Sales/Resource/serve.js +2 -9
  89. package/lib/components/Sales/Summary/index.d.ts +0 -10
  90. package/lib/components/Sales/Summary/index.js +1 -7
  91. package/lib/components/Sales/Summary/serve.d.ts +0 -1
  92. package/lib/components/Sales/Summary/serve.js +0 -32
  93. package/lib/components/Sales/Summary/utils.d.ts +0 -15
  94. package/lib/components/Sales/Summary/utils.js +1 -30
  95. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  96. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  97. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  98. package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
  99. package/lib/components/appointmentBooking/components/Services/index.js +11 -6
  100. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
  101. package/lib/components/appointmentBooking/deposit/index.js +2 -4
  102. package/lib/components/appointmentBooking/index.js +0 -11
  103. package/lib/components/appointmentBooking/index.less +1 -1
  104. package/lib/components/booking/components/footer/utils.d.ts +0 -1
  105. package/lib/components/booking/components/footer/utils.js +0 -2
  106. package/lib/components/booking/components/voucher/index.js +2 -2
  107. package/lib/components/booking/info/service2/utils.js +2 -2
  108. package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
  109. package/lib/components/booking/info2/service/addService/utils.js +4 -27
  110. package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
  111. package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
  112. package/lib/components/booking/info2/utilsByBooking.js +0 -6
  113. package/lib/components/booking/locales.d.ts +0 -3
  114. package/lib/components/booking/locales.js +0 -3
  115. package/lib/components/eftposPay/const.d.ts +1 -4
  116. package/lib/components/eftposPay/const.js +0 -2
  117. package/lib/components/eftposPay/hooks.d.ts +1 -1
  118. package/lib/components/eftposPay/hooks.js +4 -11
  119. package/lib/components/eftposPay/index.js +1 -1
  120. package/lib/components/eftposPay/manufacturer.d.ts +0 -1
  121. package/lib/components/eftposPay/manufacturer.js +0 -6
  122. package/lib/components/eftposPay/pay.d.ts +1 -1
  123. package/lib/components/eftposPay/pay.js +2 -13
  124. package/lib/components/eftposPay/store/index.d.ts +1 -1
  125. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
  126. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
  127. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  128. package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
  129. package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -10
  130. package/lib/components/eventBooking/index.js +7 -11
  131. package/lib/components/eventBooking/locales.d.ts +0 -24
  132. package/lib/components/eventBooking/locales.js +6 -30
  133. package/lib/components/index.d.ts +1 -3
  134. package/lib/components/index.js +0 -6
  135. package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
  136. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  137. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  138. package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
  139. package/lib/components/ticketBooking/locales.d.ts +146 -164
  140. package/lib/components/ticketBooking/locales.js +4 -22
  141. package/lib/index.d.ts +0 -2
  142. package/lib/index.js +0 -6
  143. package/package.json +3 -3
  144. package/es/components/booking/editBookingModal/index.d.ts +0 -5
  145. package/es/components/booking/editBookingModal/index.js +0 -386
  146. package/es/components/booking/editBookingModal/index.less +0 -8
  147. package/es/components/booking/editBookingModal/locales.d.ts +0 -21
  148. package/es/components/booking/editBookingModal/locales.js +0 -20
  149. package/es/components/booking/editBookingModal/mock.d.ts +0 -807
  150. package/es/components/booking/editBookingModal/mock.js +0 -2993
  151. package/es/components/booking/editBookingModal/serve.d.ts +0 -51
  152. package/es/components/booking/editBookingModal/serve.js +0 -288
  153. package/es/components/booking/editBookingModal/type.d.ts +0 -12
  154. package/es/components/booking/editBookingModal/type.js +0 -1
  155. package/es/components/booking/editBookingModal/utils.d.ts +0 -12
  156. package/es/components/booking/editBookingModal/utils.js +0 -157
  157. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  158. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
  159. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  160. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
  161. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  162. package/es/components/eftposPay/linkly/const.d.ts +0 -23
  163. package/es/components/eftposPay/linkly/const.js +0 -82
  164. package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  165. package/es/components/eftposPay/linkly/hooks/index.js +0 -2
  166. package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  167. package/es/components/eftposPay/linkly/hooks/normal.js +0 -318
  168. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  169. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
  170. package/es/components/eftposPay/linkly/index.d.ts +0 -2
  171. package/es/components/eftposPay/linkly/index.js +0 -197
  172. package/es/components/eftposPay/linkly/service.d.ts +0 -32
  173. package/es/components/eftposPay/linkly/service.js +0 -73
  174. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  175. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
  176. package/es/components/stepController/components/Content/index.d.ts +0 -7
  177. package/es/components/stepController/components/Content/index.js +0 -9
  178. package/es/components/stepController/components/Content/index.less +0 -8
  179. package/es/components/stepController/components/Footer/index.d.ts +0 -8
  180. package/es/components/stepController/components/Footer/index.js +0 -15
  181. package/es/components/stepController/components/Footer/index.less +0 -39
  182. package/es/components/stepController/components/Header/index.d.ts +0 -20
  183. package/es/components/stepController/components/Header/index.js +0 -97
  184. package/es/components/stepController/components/Header/index.less +0 -21
  185. package/es/components/stepController/index.d.ts +0 -5
  186. package/es/components/stepController/index.js +0 -64
  187. package/es/components/stepController/index.less +0 -11
  188. package/es/components/stepController/locales.d.ts +0 -27
  189. package/es/components/stepController/locales.js +0 -32
  190. package/es/components/stepController/types.d.ts +0 -23
  191. package/es/components/stepController/types.js +0 -1
  192. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  193. package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
  194. package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
  195. package/es/components/ticketBooking/utils/formatTime.js +0 -144
  196. package/es/hooks/useWindowSize.d.ts +0 -5
  197. package/es/hooks/useWindowSize.js +0 -26
  198. package/lib/components/booking/editBookingModal/index.d.ts +0 -5
  199. package/lib/components/booking/editBookingModal/index.js +0 -363
  200. package/lib/components/booking/editBookingModal/index.less +0 -8
  201. package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
  202. package/lib/components/booking/editBookingModal/locales.js +0 -44
  203. package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
  204. package/lib/components/booking/editBookingModal/mock.js +0 -3314
  205. package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
  206. package/lib/components/booking/editBookingModal/serve.js +0 -178
  207. package/lib/components/booking/editBookingModal/type.d.ts +0 -12
  208. package/lib/components/booking/editBookingModal/type.js +0 -17
  209. package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
  210. package/lib/components/booking/editBookingModal/utils.js +0 -158
  211. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  212. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
  213. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  214. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
  215. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  216. package/lib/components/eftposPay/linkly/const.d.ts +0 -23
  217. package/lib/components/eftposPay/linkly/const.js +0 -102
  218. package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  219. package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
  220. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  221. package/lib/components/eftposPay/linkly/hooks/normal.js +0 -239
  222. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  223. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
  224. package/lib/components/eftposPay/linkly/index.d.ts +0 -2
  225. package/lib/components/eftposPay/linkly/index.js +0 -208
  226. package/lib/components/eftposPay/linkly/service.d.ts +0 -32
  227. package/lib/components/eftposPay/linkly/service.js +0 -55
  228. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  229. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
  230. package/lib/components/stepController/components/Content/index.d.ts +0 -7
  231. package/lib/components/stepController/components/Content/index.js +0 -40
  232. package/lib/components/stepController/components/Content/index.less +0 -8
  233. package/lib/components/stepController/components/Footer/index.d.ts +0 -8
  234. package/lib/components/stepController/components/Footer/index.js +0 -49
  235. package/lib/components/stepController/components/Footer/index.less +0 -39
  236. package/lib/components/stepController/components/Header/index.d.ts +0 -20
  237. package/lib/components/stepController/components/Header/index.js +0 -104
  238. package/lib/components/stepController/components/Header/index.less +0 -21
  239. package/lib/components/stepController/index.d.ts +0 -5
  240. package/lib/components/stepController/index.js +0 -89
  241. package/lib/components/stepController/index.less +0 -11
  242. package/lib/components/stepController/locales.d.ts +0 -27
  243. package/lib/components/stepController/locales.js +0 -50
  244. package/lib/components/stepController/types.d.ts +0 -23
  245. package/lib/components/stepController/types.js +0 -17
  246. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  247. package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
  248. package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
  249. package/lib/components/ticketBooking/utils/formatTime.js +0 -139
  250. package/lib/hooks/useWindowSize.d.ts +0 -5
  251. package/lib/hooks/useWindowSize.js +0 -51
  252. package/lowcode/edit-booking-modal/meta.ts +0 -53
  253. package/lowcode/step-controller/meta.ts +0 -88
@@ -1,308 +0,0 @@
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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- 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; }
5
- 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; }
6
- 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; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- 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); }
9
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
- 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."); }
11
- 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); }
12
- 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; }
13
- 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; } }
14
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
- import React, { useState, useMemo, forwardRef, useCallback, useImperativeHandle } from 'react';
16
- import classNames from 'classnames';
17
- import { Col, Form, Select, Button, Alert, Checkbox, Tooltip, Row } from 'antd';
18
- import { Iconfont } from '@pisell/materials';
19
- import MaxLengthSelect from "./MaxLengthSelect";
20
- import Like from "../../../../info/service/like";
21
- import "./index.less";
22
- import { locales } from '@pisell/utils';
23
- import { getErrorList } from "../../../utilsByBooking";
24
- import { isArray } from 'lodash';
25
- import { getAutoAllocationStorage, setAutoAllocationStorage } from "../utils";
26
- import { useUpdate } from 'ahooks';
27
- import { QuestionCircleOutlined } from '@ant-design/icons';
28
- var Resources = function Resources(_ref, ref) {
29
- var _cacheItem$_data2, _originCacheItem$_dat, _cacheItem$_data5;
30
- var state = _ref.state,
31
- cacheItem = _ref.cacheItem,
32
- originCacheItem = _ref.originCacheItem,
33
- getCurrentCacheItem = _ref.getCurrentCacheItem,
34
- onChange = _ref.onChange,
35
- value = _ref.value,
36
- originValue = _ref.originValue,
37
- _ref$config = _ref.config,
38
- config = _ref$config === void 0 ? {
39
- // 是否显示自动分配
40
- autoAllocation: true,
41
- // 是否显示资源错误图标
42
- resourceErrorIcon: true,
43
- disabled: false,
44
- size: 'large'
45
- } : _ref$config;
46
- var _useState = useState(false),
47
- _useState2 = _slicedToArray(_useState, 2),
48
- showError = _useState2[0],
49
- setShowError = _useState2[1];
50
- var update = useUpdate();
51
-
52
- // 需要渲染的列表, 资源二级结构数据
53
- var data = useMemo(function () {
54
- var _cacheItem$_data;
55
- return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data = cacheItem._data) === null || _cacheItem$_data === void 0 ? void 0 : _cacheItem$_data.resources) || [];
56
- }, [cacheItem === null || cacheItem === void 0 || (_cacheItem$_data2 = cacheItem._data) === null || _cacheItem$_data2 === void 0 ? void 0 : _cacheItem$_data2.resources]);
57
- var originData = useMemo(function () {
58
- var _cacheItem$_data3;
59
- return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data3 = cacheItem._data) === null || _cacheItem$_data3 === void 0 ? void 0 : _cacheItem$_data3.resources) || [];
60
- }, [originCacheItem === null || originCacheItem === void 0 || (_originCacheItem$_dat = originCacheItem._data) === null || _originCacheItem$_dat === void 0 ? void 0 : _originCacheItem$_dat.resource]);
61
-
62
- // 同上, 只是map结构,方便计算
63
- var resourceMaps = useMemo(function () {
64
- var _cacheItem$_data4;
65
- return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data4 = cacheItem._data) === null || _cacheItem$_data4 === void 0 ? void 0 : _cacheItem$_data4.resourceMaps) || [];
66
- }, [cacheItem === null || cacheItem === void 0 || (_cacheItem$_data5 = cacheItem._data) === null || _cacheItem$_data5 === void 0 ? void 0 : _cacheItem$_data5.resourceMaps]);
67
-
68
- // 默认值
69
- var defaultValue = useMemo(function () {
70
- return data.reduce(function (pre, cur) {
71
- pre[cur.form_id] = [];
72
- return pre;
73
- }, {});
74
- }, [data]);
75
-
76
- // 当前的值
77
- var _value = useMemo(function () {
78
- return value || defaultValue;
79
- }, [value, defaultValue]);
80
- var handleCheckAutoAllocation = function handleCheckAutoAllocation(id, checked) {
81
- setAutoAllocationStorage(_defineProperty({}, id, checked));
82
- update();
83
- };
84
-
85
- /**
86
- * @title: 当选择资源时
87
- * @description:
88
- * @param {any} val
89
- * @param {number} form_id
90
- * @param {string} key
91
- * @return {*}
92
- * @Author: zhiwei.Wang
93
- * @Date: 2024-09-19 21:04
94
- */
95
- var _onChange = function _onChange(val, form_id, key) {
96
- var _val = _objectSpread({}, _value);
97
- // 将当前数据map化, 减少循环次数
98
- var maps = _val[form_id] ? _val[form_id].reduce(function (pre, cur) {
99
- pre[cur.relation_id] = cur;
100
- return pre;
101
- }, {}) : {};
102
- // 重新赋值, 因为select返回的是数字列表, 需要补充额外的数据
103
- _val[form_id] = val.map(function (d) {
104
- var _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _currentForm$renderLi5;
105
- var _d = maps[d];
106
- if (_d) {
107
- if (key === 'like_status') {
108
- d[key].like_status = val;
109
- }
110
- }
111
- var currentForm = (resourceMaps === null || resourceMaps === void 0 ? void 0 : resourceMaps[form_id]) || {};
112
- return (
113
- // maps[d] 为真时, 说明是之前已选择, 否则为新增的值,补充数据
114
- maps[d] || {
115
- relation_type: ((_currentForm$renderLi = currentForm.renderListMaps[d]) === null || _currentForm$renderLi === void 0 || (_currentForm$renderLi = _currentForm$renderLi.usable) === null || _currentForm$renderLi === void 0 ? void 0 : _currentForm$renderLi.relation_type) || 'form',
116
- form_id: form_id,
117
- relation_id: d,
118
- like_status: 'common',
119
- children: (_currentForm$renderLi2 = currentForm.renderListMaps) === null || _currentForm$renderLi2 === void 0 || (_currentForm$renderLi2 = _currentForm$renderLi2[d]) === null || _currentForm$renderLi2 === void 0 ? void 0 : _currentForm$renderLi2.children,
120
- // 新添加的数据补充错误信息
121
- errors: getErrorList((_currentForm$renderLi3 = currentForm.renderListMaps) === null || _currentForm$renderLi3 === void 0 ? void 0 : _currentForm$renderLi3[d], getCurrentCacheItem()),
122
- metadata: _objectSpread(_objectSpread({}, (_currentForm$renderLi4 = currentForm.renderListMaps) === null || _currentForm$renderLi4 === void 0 || (_currentForm$renderLi4 = _currentForm$renderLi4[d]) === null || _currentForm$renderLi4 === void 0 ? void 0 : _currentForm$renderLi4.metadata), {}, {
123
- form_name: currentForm.title,
124
- resource_name: (_currentForm$renderLi5 = currentForm.renderListMaps[d]) === null || _currentForm$renderLi5 === void 0 ? void 0 : _currentForm$renderLi5.main_field
125
- })
126
- }
127
- );
128
- });
129
- setShowError(false);
130
- onChange === null || onChange === void 0 || onChange(_val);
131
- };
132
- var setLikeStatus = function setLikeStatus(val, form_id, key) {
133
- var _val$form_id;
134
- var _val = _objectSpread({}, _value);
135
- if (_val !== null && _val !== void 0 && (_val$form_id = _val[form_id]) !== null && _val$form_id !== void 0 && _val$form_id[0]) {
136
- _val[form_id][0][key] = val;
137
- onChange === null || onChange === void 0 || onChange(_val);
138
- }
139
- };
140
-
141
- /**
142
- * @title: 渲染下拉框
143
- * @description:
144
- * @return {*}
145
- * @Author: zhiwei.Wang
146
- * @Date: 2024-01-09 14:02
147
- */
148
- var renderOptions = useCallback(function (array) {
149
- var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
150
- var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'label';
151
- var type = arguments.length > 3 ? arguments[3] : undefined;
152
- return array.map(function (d) {
153
- var props = {};
154
- if (type === 'resource') {
155
- props.labelText = d.labelText;
156
- }
157
- return /*#__PURE__*/React.createElement(Select.Option, _extends({
158
- value: d[value],
159
- key: d[value]
160
- }, props, {
161
- relation_type: d.relation_type
162
- }), d[label]);
163
- });
164
- }, [config === null || config === void 0 ? void 0 : config.resourceErrorIcon]);
165
-
166
- /**
167
- * @title: 检查当前资源最小选择数量
168
- * @description:
169
- * @return {*}
170
- * @Author: zhiwei.Wang
171
- * @Date: 2024-09-19 21:08
172
- */
173
- var check = function check() {
174
- var _iterator = _createForOfIteratorHelper(data),
175
- _step;
176
- try {
177
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
178
- var _value$item$form_id;
179
- var item = _step.value;
180
- var _length = (_value$item$form_id = _value[item.form_id]) === null || _value$item$form_id === void 0 ? void 0 : _value$item$form_id.length;
181
- if (item.select_type.min > _length) {
182
- setShowError(true);
183
- return false;
184
- }
185
- }
186
- } catch (err) {
187
- _iterator.e(err);
188
- } finally {
189
- _iterator.f();
190
- }
191
- return true;
192
- };
193
- useImperativeHandle(ref, function () {
194
- return {
195
- check: check
196
- };
197
- });
198
- var getIsAutoAllocation = function getIsAutoAllocation(id) {
199
- return getAutoAllocationStorage(id);
200
- };
201
- var renderItem = function renderItem(item, isOrigin) {
202
- var _cur$2;
203
- if (!item) return null;
204
- var disabled = isOrigin || (config === null || config === void 0 ? void 0 : config.disabled);
205
- var cur = isOrigin ? originValue[item.form_id] : _value[item.form_id];
206
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, {
207
- flex: "1 0"
208
- }, /*#__PURE__*/React.createElement("div", {
209
- className: "resource-v2 resource-col"
210
- }, item.select_type.type === 'multiple' ? null : /*#__PURE__*/React.createElement(Button, {
211
- className: classNames('resource-col-like-wrap', {
212
- 'resource-col-like-wrap-disabled': disabled
213
- }, (config === null || config === void 0 ? void 0 : config.size) || 'large'),
214
- size: config === null || config === void 0 ? void 0 : config.size,
215
- onClick: function onClick() {
216
- var _cur$;
217
- if (disabled) {
218
- return;
219
- }
220
- setLikeStatus((cur === null || cur === void 0 || (_cur$ = cur[0]) === null || _cur$ === void 0 ? void 0 : _cur$.like_status) === 'like' ? 'common' : 'like', item.form_id, 'like_status');
221
- }
222
- }, /*#__PURE__*/React.createElement(Like, {
223
- status: cur === null || cur === void 0 || (_cur$2 = cur[0]) === null || _cur$2 === void 0 ? void 0 : _cur$2.like_status,
224
- className: "".concat(disabled ? 'like-icon-disabled' : '')
225
- })), /*#__PURE__*/React.createElement(MaxLengthSelect, {
226
- className: "resource-col-select",
227
- size: (config === null || config === void 0 ? void 0 : config.size) || 'large',
228
- maxLength: item.select_type.max,
229
- mode: item.select_type.type === 'multiple' ? 'multiple' : undefined,
230
- onChange: function onChange(e) {
231
- var val = e;
232
- if (!isArray(e)) {
233
- if (e || e === 0) {
234
- val = [e];
235
- }
236
- }
237
- _onChange(val, item.form_id, 'value');
238
- },
239
- value: cur === null || cur === void 0 ? void 0 : cur.map(function (d) {
240
- return d.relation_id;
241
- }),
242
- showSearch: true,
243
- filterOption: function filterOption(str, option) {
244
- return ((option === null || option === void 0 ? void 0 : option.labelText) || '').toLowerCase().includes((str || '').toLowerCase());
245
- },
246
- disabled: disabled
247
- }, renderOptions(item.renderList, 'id', config !== null && config !== void 0 && config.resourceErrorIcon ? 'label' : 'labelText', 'resource')), config !== null && config !== void 0 && config.autoAllocation ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
248
- checked: getIsAutoAllocation(item.form_id),
249
- onChange: function onChange(e) {
250
- handleCheckAutoAllocation(item.form_id, e.target.checked);
251
- }
252
- }), /*#__PURE__*/React.createElement(Tooltip, {
253
- title: locales.getText('page.booking.text.resource.check-auto-allocation-tip')
254
- }, /*#__PURE__*/React.createElement(QuestionCircleOutlined, null))) : null)));
255
- };
256
- var renderErrors = function renderErrors(item) {
257
- var cur = _value[item.form_id];
258
- var errors = (cur || []).reduce(function (pre, d) {
259
- return pre.concat((d === null || d === void 0 ? void 0 : d.errors) || []);
260
- }, []);
261
- return state.renderType !== 'eventBooking' && (errors || []).map(function (d) {
262
- return /*#__PURE__*/React.createElement(Alert, {
263
- key: d.type,
264
- message: d.label,
265
- type: "warning",
266
- showIcon: true,
267
- style: {
268
- marginBottom: 12
269
- }
270
- });
271
- });
272
- };
273
- return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
274
- var _cur;
275
- // 原资源表单信息
276
- var originItem = originData === null || originData === void 0 ? void 0 : originData.find(function (originDataItem) {
277
- return originDataItem.form_id === item.form_id;
278
- });
279
- return /*#__PURE__*/React.createElement(React.Fragment, {
280
- key: item.form_id
281
- }, /*#__PURE__*/React.createElement(Form.Item, {
282
- label: item.title,
283
- required: true,
284
- labelCol: config === null || config === void 0 ? void 0 : config.labelCol,
285
- extra: showError && item.select_type.min > ((_cur = cur) === null || _cur === void 0 ? void 0 : _cur.length) ? /*#__PURE__*/React.createElement("span", {
286
- style: {
287
- color: '#ff4d4f'
288
- }
289
- }, locales.getText('page.booking.text.resource.min-length-error')(item.select_type.min, item.title)) : undefined
290
- }, /*#__PURE__*/React.createElement(Row, {
291
- gutter: [16, 16],
292
- wrap: false
293
- }, renderItem(originItem, true), !!originItem ? /*#__PURE__*/React.createElement(Col, {
294
- flex: "none",
295
- style: {
296
- display: 'flex',
297
- alignItems: 'center'
298
- }
299
- }, /*#__PURE__*/React.createElement(Iconfont, {
300
- type: "pisell2-arrow-block-right",
301
- style: {
302
- fontSize: 24,
303
- color: '#1b1b1b'
304
- }
305
- })) : null, renderItem(item, false))), renderErrors(item));
306
- }));
307
- };
308
- export default /*#__PURE__*/forwardRef(Resources);
@@ -1,44 +0,0 @@
1
- .resource-col.resource-v2 {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- gap: 10px;
6
- width: 100%;
7
- overflow: hidden;
8
-
9
- .resource-col-like-wrap {
10
- width: 32px;
11
- height: 32px;
12
-
13
- &.large {
14
- width: 40px;
15
- height: 40px;
16
- }
17
-
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- padding: 0;
22
- flex-shrink: 0;
23
-
24
- .like-resource {
25
- }
26
- }
27
-
28
- .resource-col-like-wrap-disabled,
29
- .like-icon-disabled {
30
- opacity: 0.5;
31
- cursor: not-allowed;
32
- }
33
-
34
- .resource-col-select {
35
- flex: 1;
36
- overflow: hidden;
37
-
38
- .resource-option-label-text {
39
- display: inline-block;
40
- overflow: hidden;
41
- text-overflow: ellipsis;
42
- }
43
- }
44
- }
@@ -1,23 +0,0 @@
1
- import { State } from '../store';
2
- import { ModeEnum } from '../const';
3
- export declare const getStep: (mode?: ModeEnum) => State['steps'];
4
- declare const _default: (params: any) => State;
5
- export default _default;
6
- export declare enum EVisibleButtonType {
7
- /** 取消按钮 */
8
- CancelButton = "CancelButton",
9
- /** 等待按钮 */
10
- WaitButton = "WaitButton"
11
- }
12
- export declare enum LinklyActionStatus {
13
- /** 空 */
14
- Empty = "Empty",
15
- /** 取消 */
16
- Cancel = "Cancel",
17
- /** 取消中 */
18
- CancelWaiting = "CancelWaiting",
19
- /** 签名 */
20
- Signature = "Signature",
21
- /** 签名等待中 */
22
- SignatureWaiting = "SignatureWaiting"
23
- }
@@ -1,82 +0,0 @@
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
- var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
3
- 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; }
4
- 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; }
5
- 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; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- 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); }
8
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { locales } from '@pisell/utils';
11
- import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
12
- export var getStep = function getStep() {
13
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
14
- return [{
15
- key: Date.now(),
16
- title: locales.getText('page.eftpos-pay.text.loading')(mode),
17
- // 'Payment in process...',
18
- text: locales.getText('page.eftpos-pay.text.waiting.processing'),
19
- // 'Waiting for the processing...',
20
- warn: '',
21
- tip: locales.getText('page.eftpos-pay.text.processing'),
22
- // 'processing...',
23
- status: StatusEnum.Loading
24
- }];
25
- };
26
- export default (function (params) {
27
- var _ref = params || {
28
- mode: ModeEnum.Pay
29
- },
30
- order_id = _ref.order_id,
31
- name = _ref.name,
32
- symbol = _ref.symbol,
33
- amount = _ref.amount,
34
- mode = _ref.mode,
35
- number = _ref.number,
36
- pay = _ref.pay,
37
- device = _ref.device,
38
- net = _ref.net,
39
- client = _ref.client,
40
- other = _objectWithoutProperties(_ref, _excluded);
41
- console.log('params =>>>>>> ', params);
42
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
43
- order_id: order_id,
44
- name: name,
45
- symbol: symbol,
46
- amount: amount,
47
- mode: mode,
48
- eftpos: EftposEnum.Linkly,
49
- key: Date.now(),
50
- step: 0,
51
- type: PayRouteEnum.Step,
52
- title: locales.getText('page.eftpos-pay.text.loading')(mode),
53
- component: '',
54
- status: StatusEnum.Loading,
55
- steps: getStep(mode),
56
- render: true,
57
- client: client !== 'undefined' ? client : ClientEnum.Merchant,
58
- warn: '',
59
- custom: other || {}
60
- }, typeof net !== 'undefined' ? {
61
- net: net
62
- } : {}), typeof number !== 'undefined' ? {
63
- number: number
64
- } : {}), typeof pay !== 'undefined' ? {
65
- pay: pay
66
- } : {}), typeof device !== 'undefined' ? {
67
- device: device
68
- } : {});
69
- });
70
- export var EVisibleButtonType = /*#__PURE__*/function (EVisibleButtonType) {
71
- EVisibleButtonType["CancelButton"] = "CancelButton";
72
- EVisibleButtonType["WaitButton"] = "WaitButton";
73
- return EVisibleButtonType;
74
- }({});
75
- export var LinklyActionStatus = /*#__PURE__*/function (LinklyActionStatus) {
76
- LinklyActionStatus["Empty"] = "Empty";
77
- LinklyActionStatus["Cancel"] = "Cancel";
78
- LinklyActionStatus["CancelWaiting"] = "CancelWaiting";
79
- LinklyActionStatus["Signature"] = "Signature";
80
- LinklyActionStatus["SignatureWaiting"] = "SignatureWaiting";
81
- return LinklyActionStatus;
82
- }({});
@@ -1,2 +0,0 @@
1
- export * from './normal';
2
- export * from './useTimeQuery';
@@ -1,2 +0,0 @@
1
- export * from "./normal";
2
- export * from "./useTimeQuery";
@@ -1,30 +0,0 @@
1
- /**
2
- * 支付或退款
3
- * @param failAction 失败回调
4
- */
5
- export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
6
- action: {
7
- pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
8
- };
9
- payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
10
- };
11
- /**
12
- * @title: 取消支付或退款
13
- * @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
14
- */
15
- export declare const useLinklyCancel: (handleCheck: () => boolean) => {
16
- action: {
17
- cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
18
- };
19
- linklyCancel: (resultQuery: any) => void;
20
- };
21
- /**
22
- * @title: 支付或退款签名
23
- * @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
24
- */
25
- export declare const useLinklySignature: (handleCheck: () => boolean) => {
26
- action: {
27
- signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
28
- };
29
- linklySignature: (status: number, resultQuery: any) => void;
30
- };