@pisell/private-materials 3.3.82 → 3.3.83

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 (261) 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 +13 -13
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +5 -5
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/businessModel/SalesModel/Sales/index.js +4 -37
  12. package/es/components/Sales/Resource/index.js +2 -2
  13. package/es/components/Sales/Resource/serve.d.ts +0 -7
  14. package/es/components/Sales/Resource/serve.js +0 -10
  15. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  16. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  17. package/es/components/appointmentBooking/components/Header/index.js +14 -8
  18. package/es/components/appointmentBooking/components/Services/index.js +36 -38
  19. package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
  20. package/es/components/appointmentBooking/index.js +0 -14
  21. package/es/components/appointmentBooking/index.less +1 -1
  22. package/es/components/appointmentBooking/locales.d.ts +3 -0
  23. package/es/components/appointmentBooking/locales.js +3 -0
  24. package/es/components/booking/addons/model.d.ts +1 -10
  25. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  26. package/es/components/booking/components/browserSelect/index.js +1 -1
  27. package/es/components/booking/components/footer/utils.d.ts +0 -1
  28. package/es/components/booking/components/footer/utils.js +1 -1
  29. package/es/components/booking/components/voucher/index.js +2 -2
  30. package/es/components/booking/forms/model.d.ts +1 -10
  31. package/es/components/booking/forms/model.js +5 -5
  32. package/es/components/booking/info/model.d.ts +1 -10
  33. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  34. package/es/components/booking/info/service/like/index.js +1 -1
  35. package/es/components/booking/info/service2/utils.d.ts +1 -1
  36. package/es/components/booking/info/service2/utils.js +2 -3
  37. package/es/components/booking/info/utils.d.ts +50 -0
  38. package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
  39. package/es/components/booking/info2/service/addService/utils.js +13 -44
  40. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  41. package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
  42. package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
  43. package/es/components/booking/info2/utilsByBooking.js +0 -9
  44. package/es/components/booking/locales.d.ts +0 -3
  45. package/es/components/booking/locales.js +0 -3
  46. package/es/components/booking/materiels/startTime/index.js +1 -1
  47. package/es/components/booking/model.d.ts +1 -9
  48. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  49. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  50. package/es/components/booking/notes/model.d.ts +1 -10
  51. package/es/components/booking/notes/model.js +5 -5
  52. package/es/components/booking/payments/model.d.ts +1 -10
  53. package/es/components/booking/payments/model.js +5 -5
  54. package/es/components/eftposPay/amount.d.ts +1 -1
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +2 -2
  57. package/es/components/eftposPay/store/index.d.ts +3 -3
  58. package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
  59. package/es/components/eventBooking/components/bookingDetailModal/index.js +3 -19
  60. package/es/components/eventBooking/index.js +7 -21
  61. package/es/components/eventBooking/locales.js +3 -3
  62. package/es/components/index.d.ts +1 -3
  63. package/es/components/index.js +1 -3
  64. package/es/components/listComponent/index.js +5 -5
  65. package/es/components/pay/toC/PaymentMethods/index.js +4 -5
  66. package/es/components/pay/toC/model.d.ts +1 -9
  67. package/es/components/productExtension/card/index.js +3 -3
  68. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  69. package/es/components/productExtension/fields/Forms/index.js +12 -12
  70. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  71. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  72. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  73. package/es/components/productExtension/server.js +2 -2
  74. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  75. package/es/components/schedules/calendar/index.js +4 -4
  76. package/es/components/schedules/calendar/serve.js +2 -2
  77. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  78. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  79. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  80. package/es/components/schedules/components/ResourceList/index.js +1 -1
  81. package/es/components/schedules/components/Search/index.js +5 -5
  82. package/es/components/schedules/model.d.ts +1 -9
  83. package/es/components/schedules/model.js +5 -5
  84. package/es/components/schedules/openHours/index.js +1 -1
  85. package/es/components/schedules/openHours/serve.js +2 -2
  86. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  87. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  88. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  89. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  90. package/es/components/schedules/products/serve.js +2 -2
  91. package/es/components/schedules/products/utils.js +5 -5
  92. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  93. package/es/components/schedules/resources/detail/index.js +10 -10
  94. package/es/components/schedules/resources/list/index.js +2 -2
  95. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  96. package/es/components/schedules/resources/serve.js +2 -2
  97. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  98. package/es/components/schedules/utils.d.ts +1 -1
  99. package/es/components/schedules/utils.js +4 -4
  100. package/es/components/selectModal/index.js +2 -2
  101. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  102. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  103. package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
  104. package/es/components/ticketBooking/locales.d.ts +146 -164
  105. package/es/components/ticketBooking/locales.js +147 -195
  106. package/es/components/wallet/Detail/model.d.ts +1 -13
  107. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  108. package/es/components/wallet/PointCard/model.d.ts +1 -13
  109. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  110. package/es/components/wallet/Voucher/model.d.ts +1 -13
  111. package/es/components/wallet/model.d.ts +1 -9
  112. package/es/hooks/useComponents.js +1 -1
  113. package/es/index.d.ts +0 -2
  114. package/es/index.js +1 -3
  115. package/es/utils/index.d.ts +1 -1
  116. package/lib/businessModel/SalesModel/Sales/index.js +8 -22
  117. package/lib/components/Sales/Resource/index.js +1 -1
  118. package/lib/components/Sales/Resource/serve.d.ts +0 -7
  119. package/lib/components/Sales/Resource/serve.js +2 -9
  120. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  121. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  122. package/lib/components/appointmentBooking/components/Header/index.js +3 -2
  123. package/lib/components/appointmentBooking/components/Services/index.js +18 -19
  124. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -1
  125. package/lib/components/appointmentBooking/index.js +0 -11
  126. package/lib/components/appointmentBooking/index.less +1 -1
  127. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  128. package/lib/components/appointmentBooking/locales.js +3 -0
  129. package/lib/components/booking/addons/model.d.ts +1 -10
  130. package/lib/components/booking/components/footer/utils.d.ts +0 -1
  131. package/lib/components/booking/components/footer/utils.js +0 -2
  132. package/lib/components/booking/components/voucher/index.js +23 -11
  133. package/lib/components/booking/forms/model.d.ts +1 -10
  134. package/lib/components/booking/info/model.d.ts +1 -10
  135. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  136. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  137. package/lib/components/booking/info/service2/utils.js +2 -2
  138. package/lib/components/booking/info/utils.d.ts +50 -0
  139. package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
  140. package/lib/components/booking/info2/service/addService/utils.js +4 -27
  141. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  142. package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
  143. package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
  144. package/lib/components/booking/info2/utilsByBooking.js +0 -6
  145. package/lib/components/booking/locales.d.ts +0 -3
  146. package/lib/components/booking/locales.js +0 -3
  147. package/lib/components/booking/model.d.ts +1 -9
  148. package/lib/components/booking/notes/model.d.ts +1 -10
  149. package/lib/components/booking/payments/model.d.ts +1 -10
  150. package/lib/components/eftposPay/amount.d.ts +1 -1
  151. package/lib/components/eftposPay/device.d.ts +1 -1
  152. package/lib/components/eftposPay/hooks.d.ts +2 -2
  153. package/lib/components/eftposPay/store/index.d.ts +3 -3
  154. package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
  155. package/lib/components/eventBooking/components/bookingDetailModal/index.js +3 -9
  156. package/lib/components/eventBooking/index.js +7 -11
  157. package/lib/components/eventBooking/locales.js +3 -3
  158. package/lib/components/index.d.ts +1 -3
  159. package/lib/components/index.js +0 -6
  160. package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
  161. package/lib/components/pay/toC/model.d.ts +1 -9
  162. package/lib/components/schedules/model.d.ts +1 -9
  163. package/lib/components/schedules/utils.d.ts +1 -1
  164. package/lib/components/schedules/utils.js +1 -1
  165. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  166. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  167. package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
  168. package/lib/components/ticketBooking/locales.d.ts +146 -164
  169. package/lib/components/ticketBooking/locales.js +4 -22
  170. package/lib/components/wallet/Detail/model.d.ts +1 -13
  171. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  172. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  173. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  174. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  175. package/lib/components/wallet/model.d.ts +1 -9
  176. package/lib/index.d.ts +0 -2
  177. package/lib/index.js +0 -6
  178. package/lib/utils/index.d.ts +1 -1
  179. package/package.json +4 -4
  180. package/es/components/booking/editBookingModal/index.d.ts +0 -5
  181. package/es/components/booking/editBookingModal/index.js +0 -386
  182. package/es/components/booking/editBookingModal/index.less +0 -8
  183. package/es/components/booking/editBookingModal/locales.d.ts +0 -21
  184. package/es/components/booking/editBookingModal/locales.js +0 -20
  185. package/es/components/booking/editBookingModal/mock.d.ts +0 -807
  186. package/es/components/booking/editBookingModal/mock.js +0 -2993
  187. package/es/components/booking/editBookingModal/serve.d.ts +0 -51
  188. package/es/components/booking/editBookingModal/serve.js +0 -288
  189. package/es/components/booking/editBookingModal/type.d.ts +0 -12
  190. package/es/components/booking/editBookingModal/type.js +0 -1
  191. package/es/components/booking/editBookingModal/utils.d.ts +0 -12
  192. package/es/components/booking/editBookingModal/utils.js +0 -157
  193. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  194. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
  195. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  196. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
  197. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  198. package/es/components/stepController/components/Content/index.d.ts +0 -7
  199. package/es/components/stepController/components/Content/index.js +0 -9
  200. package/es/components/stepController/components/Content/index.less +0 -8
  201. package/es/components/stepController/components/Footer/index.d.ts +0 -8
  202. package/es/components/stepController/components/Footer/index.js +0 -15
  203. package/es/components/stepController/components/Footer/index.less +0 -39
  204. package/es/components/stepController/components/Header/index.d.ts +0 -20
  205. package/es/components/stepController/components/Header/index.js +0 -97
  206. package/es/components/stepController/components/Header/index.less +0 -21
  207. package/es/components/stepController/index.d.ts +0 -5
  208. package/es/components/stepController/index.js +0 -64
  209. package/es/components/stepController/index.less +0 -11
  210. package/es/components/stepController/locales.d.ts +0 -27
  211. package/es/components/stepController/locales.js +0 -32
  212. package/es/components/stepController/types.d.ts +0 -23
  213. package/es/components/stepController/types.js +0 -1
  214. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  215. package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
  216. package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
  217. package/es/components/ticketBooking/utils/formatTime.js +0 -144
  218. package/es/hooks/useWindowSize.d.ts +0 -5
  219. package/es/hooks/useWindowSize.js +0 -26
  220. package/lib/components/booking/editBookingModal/index.d.ts +0 -5
  221. package/lib/components/booking/editBookingModal/index.js +0 -363
  222. package/lib/components/booking/editBookingModal/index.less +0 -8
  223. package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
  224. package/lib/components/booking/editBookingModal/locales.js +0 -44
  225. package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
  226. package/lib/components/booking/editBookingModal/mock.js +0 -3314
  227. package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
  228. package/lib/components/booking/editBookingModal/serve.js +0 -178
  229. package/lib/components/booking/editBookingModal/type.d.ts +0 -12
  230. package/lib/components/booking/editBookingModal/type.js +0 -17
  231. package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
  232. package/lib/components/booking/editBookingModal/utils.js +0 -158
  233. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  234. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
  235. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  236. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
  237. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  238. package/lib/components/stepController/components/Content/index.d.ts +0 -7
  239. package/lib/components/stepController/components/Content/index.js +0 -40
  240. package/lib/components/stepController/components/Content/index.less +0 -8
  241. package/lib/components/stepController/components/Footer/index.d.ts +0 -8
  242. package/lib/components/stepController/components/Footer/index.js +0 -49
  243. package/lib/components/stepController/components/Footer/index.less +0 -39
  244. package/lib/components/stepController/components/Header/index.d.ts +0 -20
  245. package/lib/components/stepController/components/Header/index.js +0 -104
  246. package/lib/components/stepController/components/Header/index.less +0 -21
  247. package/lib/components/stepController/index.d.ts +0 -5
  248. package/lib/components/stepController/index.js +0 -89
  249. package/lib/components/stepController/index.less +0 -11
  250. package/lib/components/stepController/locales.d.ts +0 -27
  251. package/lib/components/stepController/locales.js +0 -50
  252. package/lib/components/stepController/types.d.ts +0 -23
  253. package/lib/components/stepController/types.js +0 -17
  254. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  255. package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
  256. package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
  257. package/lib/components/ticketBooking/utils/formatTime.js +0 -139
  258. package/lib/hooks/useWindowSize.d.ts +0 -5
  259. package/lib/hooks/useWindowSize.js +0 -51
  260. package/lowcode/edit-booking-modal/meta.ts +0 -53
  261. 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,7 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface ContentProps {
4
- children?: React.ReactNode;
5
- }
6
- declare const Content: React.FC<ContentProps>;
7
- export default Content;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import "./index.less";
3
- var Content = function Content(_ref) {
4
- var children = _ref.children;
5
- return /*#__PURE__*/React.createElement("div", {
6
- className: "pisell-step-controller-content"
7
- }, children);
8
- };
9
- export default Content;
@@ -1,8 +0,0 @@
1
- .pisell-step-controller-content {
2
- flex: 1;
3
- width: 1000px;
4
- max-width: 100%;
5
- border-right: 1px solid var(--Gray-100, #f2f4f7);
6
- border-left: 1px solid var(--Gray-100, #f2f4f7);
7
- background: #fff;
8
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface FooterProps {
4
- isMobile?: boolean;
5
- children?: React.ReactNode;
6
- }
7
- declare const Footer: React.FC<FooterProps>;
8
- export default Footer;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import classNames from 'classnames';
3
- import "./index.less";
4
- var Footer = function Footer(_ref) {
5
- var isMobile = _ref.isMobile,
6
- children = _ref.children;
7
- return /*#__PURE__*/React.createElement("div", {
8
- className: classNames('pisell-step-controller-footer-wrap', {
9
- 'pisell-step-controller-footer-wrap-mobile': isMobile
10
- })
11
- }, /*#__PURE__*/React.createElement("div", {
12
- className: "pisell-step-controller-footer"
13
- }, children));
14
- };
15
- export default Footer;
@@ -1,39 +0,0 @@
1
- .pisell-step-controller-footer-wrap {
2
- position: sticky;
3
- left: 0;
4
- right: 0;
5
- bottom: 0;
6
- width: 100%;
7
- background: #fff;
8
- // box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
9
- padding: 24px;
10
- z-index: 100;
11
- border-top: 1px solid var(--Gray-100, #f2f4f7);
12
-
13
- .pisell-step-controller-footer {
14
- width: 1000px;
15
- margin: 0 auto;
16
- max-width: 100%;
17
- display: flex;
18
- gap: 12px;
19
- justify-content: flex-end;
20
-
21
- .pisell-section-headers-main {
22
- color: var(--Gray-900, #101828);
23
- font-size: 14px;
24
- font-weight: 400;
25
- line-height: 20px;
26
- justify-content: start;
27
-
28
- .select-text {
29
- font-size: 18px;
30
- font-weight: 600;
31
- line-height: 24px;
32
- }
33
- }
34
- }
35
- }
36
-
37
- .pisell-step-controller-footer-wrap-mobile {
38
- border-top: 1px solid #eaecf0;
39
- }
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import { Step } from '../../types';
3
- import './index.less';
4
- export interface HeaderProps {
5
- steps: Step[];
6
- currentStepIndex: number;
7
- className?: string;
8
- style?: React.CSSProperties;
9
- onBack?: (key: string) => void;
10
- onClose?: () => void;
11
- confirmCloseProps?: {
12
- isConfirmClose?: boolean;
13
- title?: string;
14
- content?: string;
15
- okText?: string;
16
- cancelText?: string;
17
- };
18
- }
19
- declare const Header: React.FC<HeaderProps>;
20
- export default Header;
@@ -1,97 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useState } from 'react';
8
- import { PisellHeaderProgressBar, PisellModal } from '@pisell/materials';
9
- import { locales } from '@pisell/utils';
10
- import "./index.less";
11
- var Header = function Header(_ref) {
12
- var _steps$currentStepInd;
13
- var steps = _ref.steps,
14
- currentStepIndex = _ref.currentStepIndex,
15
- style = _ref.style,
16
- onBack = _ref.onBack,
17
- onClose = _ref.onClose,
18
- confirmCloseProps = _ref.confirmCloseProps;
19
- var _useState = useState(false),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- open = _useState2[0],
22
- setOpen = _useState2[1];
23
-
24
- /**
25
- * @title: 点击关闭
26
- * @description:
27
- * @return {*}
28
- * @Author: WangHan
29
- * @Date: 2025-01-14 22:41
30
- */
31
- var handleClose = function handleClose() {
32
- // 二次确认
33
- if (confirmCloseProps !== null && confirmCloseProps !== void 0 && confirmCloseProps.isConfirmClose) {
34
- setOpen(true);
35
- } else {
36
- onClose === null || onClose === void 0 || onClose();
37
- }
38
- };
39
-
40
- /**
41
- * @title: 点击退出
42
- * @description:
43
- * @return {*}
44
- * @Author: WangHan
45
- * @Date: 2025-02-10 17:46
46
- */
47
- var handleOk = function handleOk() {
48
- setOpen(false);
49
- onClose === null || onClose === void 0 || onClose();
50
- };
51
-
52
- /**
53
- * @title: 返回上一步
54
- * @description:
55
- * @return {*}
56
- * @Author: WangHan
57
- * @Date: 2025-06-12 16:44
58
- */
59
- var handleBack = function handleBack() {
60
- if (!steps) return;
61
- if (currentStepIndex > 0) {
62
- var prevKey = steps[currentStepIndex - 1].key;
63
- onBack === null || onBack === void 0 || onBack(prevKey);
64
- }
65
- };
66
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellHeaderProgressBar, {
67
- className: "pisell-step-controller-header",
68
- style: style,
69
- stepText: locales.getText('pisell2.step.controller.step')(currentStepIndex + 1),
70
- title: steps === null || steps === void 0 || (_steps$currentStepInd = steps[currentStepIndex]) === null || _steps$currentStepInd === void 0 ? void 0 : _steps$currentStepInd.description,
71
- showClose: true,
72
- onBack: handleBack,
73
- onClose: handleClose,
74
- enableBorder: true,
75
- borderColor: "#EAECF0",
76
- showBack: currentStepIndex > 0 || false
77
- }), /*#__PURE__*/React.createElement(PisellModal.Information, {
78
- open: open,
79
- title: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.title) || '',
80
- describe: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.content) || '',
81
- okText: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.okText) || '',
82
- cancelText: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.cancelText) || '',
83
- closable: true,
84
- okButtonProps: {
85
- style: {
86
- backgroundColor: '#D92D20'
87
- }
88
- },
89
- onCancel: function onCancel() {
90
- setOpen(false);
91
- },
92
- onOk: function onOk() {
93
- return handleOk();
94
- }
95
- }));
96
- };
97
- export default Header;
@@ -1,21 +0,0 @@
1
- .pisell-step-controller-header {
2
- .pisell-section-headers-content {
3
- width: 1000px;
4
- margin: 0 auto;
5
- max-width: 100%;
6
-
7
- .pisell-section-headers-main {
8
- color: var(--Gray-900, #101828);
9
- font-size: 14px;
10
- font-weight: 400;
11
- line-height: 20px;
12
- justify-content: start;
13
-
14
- .select-text {
15
- font-size: 18px;
16
- font-weight: 600;
17
- line-height: 24px;
18
- }
19
- }
20
- }
21
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { StepControllerProps } from './types';
3
- import './index.less';
4
- declare const StepController: React.FC<StepControllerProps>;
5
- export default StepController;
@@ -1,64 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import classNames from 'classnames';
3
- import { locales } from '@pisell/utils';
4
- import { usePisellConfig } from '@pisell/materials';
5
- import useEngineContext from "../../hooks/useEngineContext";
6
- import { useWindowSize } from "../../hooks/useWindowSize";
7
- import Header from "./components/Header";
8
- import Footer from "./components/Footer";
9
- import Content from "./components/Content";
10
- import localeTexts from "./locales";
11
- import "./index.less";
12
- var StepController = function StepController(_ref) {
13
- var _context$engine;
14
- var steps = _ref.steps,
15
- currentStep = _ref.currentStep,
16
- children = _ref.children,
17
- onBack = _ref.onBack,
18
- confirmCloseProps = _ref.confirmCloseProps,
19
- showFooter = _ref.showFooter,
20
- footerContent = _ref.footerContent,
21
- onClose = _ref.onClose;
22
- var context = useEngineContext();
23
- locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
24
-
25
- // 监听窗口大小变化,重新计算vh
26
- useWindowSize({
27
- debounceMs: 200
28
- });
29
-
30
- /**
31
- * @title: 是否是移动端
32
- * @description:
33
- * @return {*}
34
- * @Author: WangHan
35
- * @Date: 2025-06-12 15:56
36
- */
37
- var isMobile = useMemo(function () {
38
- var config = usePisellConfig();
39
- var platform = (config === null || config === void 0 ? void 0 : config.platform) || 'h5';
40
- return platform === 'h5';
41
- }, []);
42
- var currentStepIndex = useMemo(function () {
43
- return (steps === null || steps === void 0 ? void 0 : steps.findIndex(function (step) {
44
- return step.key === currentStep;
45
- })) || 0;
46
- }, [steps, currentStep]);
47
- return /*#__PURE__*/React.createElement("div", {
48
- className: classNames('pisell-step-controller', {
49
- 'pisell-step-controller-mobile': isMobile
50
- })
51
- }, /*#__PURE__*/React.createElement(Header, {
52
- steps: steps,
53
- currentStepIndex: currentStepIndex,
54
- confirmCloseProps: confirmCloseProps,
55
- onBack: onBack,
56
- onClose: onClose
57
- }), /*#__PURE__*/React.createElement(Content, {
58
- children: children
59
- }), showFooter && footerContent ? /*#__PURE__*/React.createElement(Footer, {
60
- children: footerContent,
61
- isMobile: isMobile
62
- }) : null);
63
- };
64
- export default StepController;