@pisell/private-materials 3.0.202 → 3.0.204

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 (292) 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 +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +27 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +33 -18
  11. package/es/components/booking/components/customSelect/index.d.ts +0 -1
  12. package/es/components/booking/components/customSelect/index.js +2 -6
  13. package/es/components/booking/components/footer/amount.js +22 -46
  14. package/es/components/booking/components/footer/index.js +40 -84
  15. package/es/components/booking/components/footer/utils.js +35 -266
  16. package/es/components/booking/forms/model.d.ts +1 -1
  17. package/es/components/booking/info/addServiceVariant/index.js +1 -8
  18. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  19. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
  20. package/es/components/booking/info/clientVariant/vertical/index.js +9 -124
  21. package/es/components/booking/info/main.js +15 -28
  22. package/es/components/booking/info/model.js +0 -3
  23. package/es/components/booking/info/pet/index.js +5 -54
  24. package/es/components/booking/info/service/addService/index.js +96 -187
  25. package/es/components/booking/info/service/addService/index.less +3 -13
  26. package/es/components/booking/info/service/addService/utils.d.ts +2 -12
  27. package/es/components/booking/info/service/addService/utils.js +26 -103
  28. package/es/components/booking/info/service/editService/index.js +132 -435
  29. package/es/components/booking/info/service/editService/index.less +13 -18
  30. package/es/components/booking/info/service/serve.d.ts +0 -10
  31. package/es/components/booking/info/service/serve.js +0 -28
  32. package/es/components/booking/info/utils.d.ts +0 -20
  33. package/es/components/booking/info/utils.js +0 -37
  34. package/es/components/booking/locales.d.ts +0 -66
  35. package/es/components/booking/locales.js +3 -81
  36. package/es/components/booking/model.d.ts +1 -5
  37. package/es/components/booking/model.js +2 -4
  38. package/es/components/booking/notes/index.d.ts +1 -1
  39. package/es/components/booking/notes/model.d.ts +1 -1
  40. package/es/components/booking/payments/model.d.ts +1 -1
  41. package/es/components/booking/utils.d.ts +3 -12
  42. package/es/components/booking/utils.js +26 -143
  43. package/es/components/eftpos/form/index.js +12 -6
  44. package/es/components/eftpos/group/index.d.ts +1 -2
  45. package/es/components/eftpos/group/index.js +1 -2
  46. package/es/components/eftpos/hooks.d.ts +4 -4
  47. package/es/components/eftpos/index.js +2 -2
  48. package/es/components/eftpos/receipt/index.d.ts +24 -0
  49. package/es/components/eftpos/receipt/index.js +96 -0
  50. package/es/components/eftposPay/app.d.ts +11 -0
  51. package/es/components/eftposPay/app.js +173 -0
  52. package/es/components/eftposPay/component/fail/failCustom.js +1 -0
  53. package/es/components/eftposPay/component/fail/index.js +1 -0
  54. package/es/components/eftposPay/component/manual/index.js +4 -1
  55. package/es/components/eftposPay/component/step/index.d.ts +6 -6
  56. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  57. package/es/components/eftposPay/const.d.ts +27 -1
  58. package/es/components/eftposPay/const.js +22 -0
  59. package/es/components/eftposPay/device.d.ts +1 -1
  60. package/es/components/eftposPay/device.js +2 -2
  61. package/es/components/eftposPay/helper.d.ts +6 -0
  62. package/es/components/eftposPay/helper.js +24 -4
  63. package/es/components/eftposPay/hooks.d.ts +2 -1
  64. package/es/components/eftposPay/hooks.js +22 -16
  65. package/es/components/eftposPay/index.d.ts +1 -1
  66. package/es/components/eftposPay/index.js +130 -179
  67. package/es/components/eftposPay/locales.d.ts +15 -0
  68. package/es/components/eftposPay/locales.js +15 -0
  69. package/es/components/eftposPay/payo/config.js +20 -8
  70. package/es/components/eftposPay/store/index.d.ts +1 -1
  71. package/es/components/eftposPay/tip.d.ts +10 -0
  72. package/es/components/eftposPay/tip.js +177 -0
  73. package/es/components/eftposPay/tip.less +9 -0
  74. package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
  75. package/es/components/eftposPay/tyro/index.js +55 -22
  76. package/es/components/eftposPay/windcave/helper.d.ts +1 -1
  77. package/es/components/eftposPay/windcave/windcave.js +17 -6
  78. package/es/components/schedules/index.d.ts +1 -1
  79. package/es/components/schedules/model.d.ts +1 -1
  80. package/es/index.d.ts +0 -1
  81. package/es/index.js +1 -2
  82. package/lib/components/booking/components/customSelect/index.d.ts +0 -1
  83. package/lib/components/booking/components/customSelect/index.js +2 -6
  84. package/lib/components/booking/components/footer/amount.js +8 -27
  85. package/lib/components/booking/components/footer/index.js +4 -25
  86. package/lib/components/booking/components/footer/utils.js +35 -161
  87. package/lib/components/booking/forms/model.d.ts +1 -1
  88. package/lib/components/booking/info/addServiceVariant/index.js +0 -5
  89. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  90. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
  91. package/lib/components/booking/info/clientVariant/vertical/index.js +11 -87
  92. package/lib/components/booking/info/main.js +9 -17
  93. package/lib/components/booking/info/model.js +0 -3
  94. package/lib/components/booking/info/pet/index.js +25 -61
  95. package/lib/components/booking/info/service/addService/index.js +84 -115
  96. package/lib/components/booking/info/service/addService/index.less +3 -13
  97. package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
  98. package/lib/components/booking/info/service/addService/utils.js +10 -58
  99. package/lib/components/booking/info/service/editService/index.js +182 -425
  100. package/lib/components/booking/info/service/editService/index.less +13 -18
  101. package/lib/components/booking/info/service/serve.d.ts +0 -10
  102. package/lib/components/booking/info/service/serve.js +2 -7
  103. package/lib/components/booking/info/utils.d.ts +0 -20
  104. package/lib/components/booking/info/utils.js +0 -41
  105. package/lib/components/booking/locales.d.ts +0 -66
  106. package/lib/components/booking/locales.js +3 -69
  107. package/lib/components/booking/model.d.ts +1 -5
  108. package/lib/components/booking/model.js +2 -4
  109. package/lib/components/booking/notes/index.d.ts +1 -1
  110. package/lib/components/booking/notes/model.d.ts +1 -1
  111. package/lib/components/booking/payments/model.d.ts +1 -1
  112. package/lib/components/booking/utils.d.ts +3 -12
  113. package/lib/components/booking/utils.js +18 -89
  114. package/lib/components/eftpos/form/index.js +12 -6
  115. package/lib/components/eftpos/group/index.d.ts +1 -2
  116. package/lib/components/eftpos/group/index.js +0 -1
  117. package/lib/components/eftpos/hooks.d.ts +4 -4
  118. package/lib/components/eftpos/index.js +2 -2
  119. package/lib/components/eftpos/receipt/index.d.ts +24 -0
  120. package/lib/components/eftpos/receipt/index.js +88 -0
  121. package/lib/components/eftposPay/app.d.ts +11 -0
  122. package/lib/components/eftposPay/app.js +166 -0
  123. package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
  124. package/lib/components/eftposPay/component/fail/index.js +1 -1
  125. package/lib/components/eftposPay/component/manual/index.js +19 -5
  126. package/lib/components/eftposPay/component/step/index.d.ts +6 -6
  127. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  128. package/lib/components/eftposPay/const.d.ts +27 -1
  129. package/lib/components/eftposPay/const.js +18 -0
  130. package/lib/components/eftposPay/device.d.ts +1 -1
  131. package/lib/components/eftposPay/device.js +2 -2
  132. package/lib/components/eftposPay/helper.d.ts +6 -0
  133. package/lib/components/eftposPay/helper.js +29 -4
  134. package/lib/components/eftposPay/hooks.d.ts +2 -1
  135. package/lib/components/eftposPay/hooks.js +8 -2
  136. package/lib/components/eftposPay/index.d.ts +1 -1
  137. package/lib/components/eftposPay/index.js +106 -144
  138. package/lib/components/eftposPay/locales.d.ts +15 -0
  139. package/lib/components/eftposPay/locales.js +15 -0
  140. package/lib/components/eftposPay/payo/config.js +33 -9
  141. package/lib/components/eftposPay/store/index.d.ts +1 -1
  142. package/lib/components/eftposPay/tip.d.ts +10 -0
  143. package/lib/components/eftposPay/tip.js +159 -0
  144. package/lib/components/eftposPay/tip.less +9 -0
  145. package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
  146. package/lib/components/eftposPay/tyro/index.js +40 -9
  147. package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
  148. package/lib/components/eftposPay/windcave/windcave.js +29 -6
  149. package/lib/components/schedules/index.d.ts +1 -1
  150. package/lib/components/schedules/model.d.ts +1 -1
  151. package/lib/index.d.ts +0 -1
  152. package/lib/index.js +0 -3
  153. package/package.json +4 -4
  154. package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  155. package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
  156. package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  157. package/es/components/booking/info/Provider.d.ts +0 -0
  158. package/es/components/booking/info/Provider.js +0 -54
  159. package/es/components/booking/info/dateRange/index.d.ts +0 -5
  160. package/es/components/booking/info/dateRange/index.js +0 -98
  161. package/es/components/booking/info/dateRange/index.less +0 -21
  162. package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  163. package/es/components/booking/info/pet/ChangePetModal/index.js +0 -134
  164. package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
  165. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
  166. package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
  167. package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
  168. package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
  169. package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
  170. package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
  171. package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
  172. package/es/components/booking/info/service/serviceManager/index.js +0 -277
  173. package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  174. package/es/components/booking/info/service/serviceManager/utils.js +0 -0
  175. package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
  176. package/es/components/booking/info/service2/Group/utils.js +0 -146
  177. package/es/components/booking/info/service2/Lists.d.ts +0 -3
  178. package/es/components/booking/info/service2/Lists.js +0 -152
  179. package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  180. package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
  181. package/es/components/booking/info/service2/index.d.ts +0 -6
  182. package/es/components/booking/info/service2/index.js +0 -57
  183. package/es/components/booking/info/service2/status.d.ts +0 -31
  184. package/es/components/booking/info/service2/status.js +0 -78
  185. package/es/components/booking/info/service2/utils.d.ts +0 -237
  186. package/es/components/booking/info/service2/utils.js +0 -1062
  187. package/es/components/booking/materiels/holder/index.d.ts +0 -7
  188. package/es/components/booking/materiels/holder/index.js +0 -51
  189. package/es/components/shoppingCart/Provider.d.ts +0 -3
  190. package/es/components/shoppingCart/Provider.js +0 -86
  191. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  192. package/es/components/shoppingCart/components/Cart/Product.js +0 -68
  193. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
  194. package/es/components/shoppingCart/components/Cart/index.js +0 -72
  195. package/es/components/shoppingCart/components/Cart/index.less +0 -68
  196. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
  197. package/es/components/shoppingCart/components/Empty/index.js +0 -14
  198. package/es/components/shoppingCart/components/Empty/index.less +0 -19
  199. package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
  200. package/es/components/shoppingCart/components/Render/index.js +0 -69
  201. package/es/components/shoppingCart/components/Render/index.less +0 -2
  202. package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  203. package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -132
  204. package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  205. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  206. package/es/components/shoppingCart/hooks/useAddService.js +0 -23
  207. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  208. package/es/components/shoppingCart/hooks/useClearCart.js +0 -59
  209. package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
  210. package/es/components/shoppingCart/hooks/useContext.js +0 -5
  211. package/es/components/shoppingCart/index.d.ts +0 -4
  212. package/es/components/shoppingCart/index.js +0 -24
  213. package/es/components/shoppingCart/locales.d.ts +0 -33
  214. package/es/components/shoppingCart/locales.js +0 -38
  215. package/es/components/shoppingCart/mock.d.ts +0 -40
  216. package/es/components/shoppingCart/mock.js +0 -40
  217. package/es/components/shoppingCart/status.d.ts +0 -2
  218. package/es/components/shoppingCart/status.js +0 -22
  219. package/es/components/shoppingCart/type.d.ts +0 -39
  220. package/es/components/shoppingCart/type.js +0 -1
  221. package/es/components/shoppingCart/utils.d.ts +0 -63
  222. package/es/components/shoppingCart/utils.js +0 -116
  223. package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  224. package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
  225. package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  226. package/lib/components/booking/info/Provider.d.ts +0 -0
  227. package/lib/components/booking/info/Provider.js +0 -0
  228. package/lib/components/booking/info/dateRange/index.d.ts +0 -5
  229. package/lib/components/booking/info/dateRange/index.js +0 -111
  230. package/lib/components/booking/info/dateRange/index.less +0 -21
  231. package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  232. package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -121
  233. package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
  234. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
  235. package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
  236. package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
  237. package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
  238. package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
  239. package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
  240. package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
  241. package/lib/components/booking/info/service/serviceManager/index.js +0 -207
  242. package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  243. package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
  244. package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
  245. package/lib/components/booking/info/service2/Group/utils.js +0 -142
  246. package/lib/components/booking/info/service2/Lists.d.ts +0 -3
  247. package/lib/components/booking/info/service2/Lists.js +0 -115
  248. package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  249. package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
  250. package/lib/components/booking/info/service2/index.d.ts +0 -6
  251. package/lib/components/booking/info/service2/index.js +0 -75
  252. package/lib/components/booking/info/service2/status.d.ts +0 -31
  253. package/lib/components/booking/info/service2/status.js +0 -81
  254. package/lib/components/booking/info/service2/utils.d.ts +0 -237
  255. package/lib/components/booking/info/service2/utils.js +0 -675
  256. package/lib/components/booking/materiels/holder/index.d.ts +0 -7
  257. package/lib/components/booking/materiels/holder/index.js +0 -65
  258. package/lib/components/shoppingCart/Provider.d.ts +0 -3
  259. package/lib/components/shoppingCart/Provider.js +0 -110
  260. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  261. package/lib/components/shoppingCart/components/Cart/Product.js +0 -73
  262. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
  263. package/lib/components/shoppingCart/components/Cart/index.js +0 -77
  264. package/lib/components/shoppingCart/components/Cart/index.less +0 -68
  265. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
  266. package/lib/components/shoppingCart/components/Empty/index.js +0 -43
  267. package/lib/components/shoppingCart/components/Empty/index.less +0 -19
  268. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
  269. package/lib/components/shoppingCart/components/Render/index.js +0 -75
  270. package/lib/components/shoppingCart/components/Render/index.less +0 -2
  271. package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  272. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
  273. package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  274. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  275. package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
  276. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  277. package/lib/components/shoppingCart/hooks/useClearCart.js +0 -66
  278. package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
  279. package/lib/components/shoppingCart/hooks/useContext.js +0 -31
  280. package/lib/components/shoppingCart/index.d.ts +0 -4
  281. package/lib/components/shoppingCart/index.js +0 -60
  282. package/lib/components/shoppingCart/locales.d.ts +0 -33
  283. package/lib/components/shoppingCart/locales.js +0 -56
  284. package/lib/components/shoppingCart/mock.d.ts +0 -40
  285. package/lib/components/shoppingCart/mock.js +0 -76
  286. package/lib/components/shoppingCart/status.d.ts +0 -2
  287. package/lib/components/shoppingCart/status.js +0 -60
  288. package/lib/components/shoppingCart/type.d.ts +0 -39
  289. package/lib/components/shoppingCart/type.js +0 -17
  290. package/lib/components/shoppingCart/utils.d.ts +0 -63
  291. package/lib/components/shoppingCart/utils.js +0 -86
  292. package/lowcode/shopping-cart/meta.ts +0 -98
@@ -15,7 +15,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import dayjs from 'dayjs';
17
17
  import { locales } from '@pisell/utils';
18
- import { isDayBooking, formatDayDate } from "./info/service2/utils";
19
18
  import { intersectionBy } from 'lodash';
20
19
  var Request = /*#__PURE__*/function () {
21
20
  function Request() {
@@ -45,15 +44,10 @@ export var request = new Request();
45
44
  * @Author: zhiwei.Wang
46
45
  * @Date: 2024-04-26 14:00
47
46
  */
48
- export var getDiscountTime = function getDiscountTime(service_times, isDay) {
49
- if (!service_times || service_times < 0) {
47
+ export var getDiscountTime = function getDiscountTime(service_times) {
48
+ if (!service_times) {
50
49
  return '';
51
50
  }
52
-
53
- // 跨日预约
54
- if (isDay) {
55
- return "".concat(service_times, " ").concat(locales.getText('pisell2.text.day')(service_times));
56
- }
57
51
  if (service_times < 60) {
58
52
  return "".concat(service_times, " ").concat(locales.getText('pisell2.text.min'));
59
53
  } else {
@@ -77,7 +71,7 @@ export var getDiscountTime = function getDiscountTime(service_times, isDay) {
77
71
  * @Author: zhiwei.Wang
78
72
  * @Date: 2024-04-26 13:59
79
73
  */
80
- export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, locale, isDay) {
74
+ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, locale) {
81
75
  var _locale = locale;
82
76
  var dayjsLocale = _locale === 'en-US' || _locale === 'en' ? 'en' : 'zh-cn';
83
77
  dayjs.locale(dayjsLocale);
@@ -88,34 +82,12 @@ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, lo
88
82
  var timeSlices = [];
89
83
  var durationSlicesBasedOnTime = [];
90
84
  var currentTime = startTime;
91
-
92
- // 跨日预约
93
- if (isDay) {
94
- var currentDay = 1;
95
- while (currentDay <= 30) {
96
- var timeLabel = currentTime.format('hh:mm A');
97
- var timeValue = currentTime.format('HH:mm');
98
- timeSlices.push({
99
- label: timeLabel,
100
- value: timeValue
101
- });
102
- durationSlicesBasedOnTime.push({
103
- label: "".concat(currentDay, " ").concat(locales.getText('pisell2.text.day')(currentDay)),
104
- value: currentDay
105
- });
106
- currentDay++;
107
- }
108
- return {
109
- timeSlices: timeSlices,
110
- durationSlicesBasedOnTime: durationSlicesBasedOnTime
111
- };
112
- }
113
85
  while (currentTime.isBefore(endTime)) {
114
- var _timeLabel = currentTime.format('hh:mm A');
115
- var _timeValue = currentTime.format('HH:mm');
86
+ var timeLabel = currentTime.format('hh:mm A');
87
+ var timeValue = currentTime.format('HH:mm');
116
88
  timeSlices.push({
117
- label: _timeLabel,
118
- value: _timeValue
89
+ label: timeLabel,
90
+ value: timeValue
119
91
  });
120
92
  var nextTime = currentTime.add(timeSlice, 'minute');
121
93
  var durationValue = nextTime.diff(startTime, 'minute');
@@ -304,29 +276,6 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
304
276
  * @Date: 2024-01-09 13:57
305
277
  */
306
278
  export var formatTimes = function formatTimes(resourceItem, cacheItem) {
307
- var _cacheItem$_extend;
308
- if ((cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.sub_type) === 'days') {
309
- var isResourceItem = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.form_record_id) > 0;
310
-
311
- // 是否在最大预约数量的区间内
312
- var isMaxLimitRange = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.sold_out) === 1;
313
-
314
- // 是否在日期范围内
315
- var isDateRange = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.available_status) === 1;
316
-
317
- // 是否可用
318
- var isUsable = isDateRange && !isMaxLimitRange;
319
- var usableTime = {
320
- isMaxLimitRange: isMaxLimitRange,
321
- isDateRange: isDateRange,
322
- isUsable: isResourceItem ? isUsable : true
323
- };
324
- resourceItem._extend = _objectSpread(_objectSpread({}, resourceItem._extend), {}, {
325
- usableTime: usableTime
326
- });
327
- return resourceItem;
328
- }
329
-
330
279
  // 可用的time列表
331
280
  var usableTimes = [];
332
281
  var _resourceItem = _objectSpread({}, resourceItem);
@@ -486,7 +435,7 @@ export var getServiceTimes = function getServiceTimes(service) {
486
435
  endDate: endDate
487
436
  };
488
437
  };
489
- export var getErrorList = function getErrorList(resource, cacheItem, isDay) {
438
+ export var getErrorList = function getErrorList(resource, cacheItem) {
490
439
  if (!(cacheItem !== null && cacheItem !== void 0 && cacheItem.id)) {
491
440
  return [{
492
441
  label: locales.getText('pisell2.text.no-product-added'),
@@ -499,7 +448,7 @@ export var getErrorList = function getErrorList(resource, cacheItem, isDay) {
499
448
  var list = [];
500
449
  // 当前资源不可用
501
450
  if (!resource.usable) {
502
- var _resource$_extend, _resource$_extend2, _resource$_extend2$us, _resource$_extend3;
451
+ var _resource$_extend, _resource$_extend2;
503
452
  // 挂接的商品不可用
504
453
  if (!(resource !== null && resource !== void 0 && (_resource$_extend = resource._extend) !== null && _resource$_extend !== void 0 && _resource$_extend.usableProduct)) {
505
454
  list.push({
@@ -507,35 +456,23 @@ export var getErrorList = function getErrorList(resource, cacheItem, isDay) {
507
456
  type: 'product'
508
457
  });
509
458
  }
510
- var startText = '';
511
- var endText = '';
512
-
513
- // 跨日预约
514
- if (isDay) {
515
- var _cacheItem$_extend2 = cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem._extend,
516
- start_date = _cacheItem$_extend2.start_date,
517
- end_date = _cacheItem$_extend2.end_date;
518
- startText = start_date === null || start_date === void 0 ? void 0 : start_date.format('YYYY-MM-DD');
519
- endText = end_date ? end_date === null || end_date === void 0 ? void 0 : end_date.format('YYYY-MM-DD') : '';
520
- } else {
521
- var _getServiceTimes = getServiceTimes(cacheItem),
522
- startDate = _getServiceTimes.startDate,
523
- endDate = _getServiceTimes.endDate;
524
- // 如果跨天 结束时间前面加一个明天
525
- startText = startDate.format('hh:mm A');
526
- endText = endDate.format('hh:mm A');
527
- if (dayjs(endDate).isAfter(startDate, 'day')) {
528
- endText = locales.getText('pisell1.text.tomorrow') + endText;
529
- }
459
+ var _getServiceTimes = getServiceTimes(cacheItem),
460
+ startDate = _getServiceTimes.startDate,
461
+ endDate = _getServiceTimes.endDate;
462
+ // 如果跨天 结束时间前面加一个明天
463
+ var startText = startDate.format('hh:mm A');
464
+ var endText = endDate.format('hh:mm A');
465
+ if (dayjs(endDate).isAfter(startDate, 'day')) {
466
+ endText = locales.getText('pisell1.text.tomorrow') + endText;
530
467
  }
531
- if (isDay ? !((_resource$_extend2 = resource._extend) !== null && _resource$_extend2 !== void 0 && (_resource$_extend2$us = _resource$_extend2.usableTime) !== null && _resource$_extend2$us !== void 0 && _resource$_extend2$us.isDateRange) : !((_resource$_extend3 = resource._extend) !== null && _resource$_extend3 !== void 0 && _resource$_extend3.usableTime)) {
468
+ if (!((_resource$_extend2 = resource._extend) !== null && _resource$_extend2 !== void 0 && _resource$_extend2.usableTime)) {
532
469
  list.push({
533
470
  label: locales.getText('pisell1.text.resource-error-message-2')(resource.labelText, startText, endText),
534
471
  type: 'time'
535
472
  });
536
473
  } else {
537
- var _resource$_extend4, _resource$_extend4$us, _resource$_extend5, _resource$_extend5$us, _resource$_extend5$us2;
538
- if (isDay ? (_resource$_extend4 = resource._extend) === null || _resource$_extend4 === void 0 ? void 0 : (_resource$_extend4$us = _resource$_extend4.usableTime) === null || _resource$_extend4$us === void 0 ? void 0 : _resource$_extend4$us.isMaxLimitRange : !((_resource$_extend5 = resource._extend) !== null && _resource$_extend5 !== void 0 && (_resource$_extend5$us = _resource$_extend5.usableTime) !== null && _resource$_extend5$us !== void 0 && (_resource$_extend5$us2 = _resource$_extend5$us._extend) !== null && _resource$_extend5$us2 !== void 0 && _resource$_extend5$us2.isMaxLimitRange)) {
474
+ var _resource$_extend3;
475
+ if (!((_resource$_extend3 = resource._extend) !== null && _resource$_extend3 !== void 0 && _resource$_extend3.usableTime._extend.isMaxLimitRange)) {
539
476
  list.push({
540
477
  label: locales.getText('pisell1.text.resource-error-message-3')(resource.labelText, startText, endText),
541
478
  type: 'limit'
@@ -555,7 +492,6 @@ export var getErrorList = function getErrorList(resource, cacheItem, isDay) {
555
492
  * @Date: 2024-01-09 13:40
556
493
  */
557
494
  export var formatResource = function formatResource(resourceItem, cacheItem, formatLabel) {
558
- var _cacheItem$_extend3;
559
495
  // 当前资源
560
496
  var _resourceItem = _objectSpread({}, resourceItem);
561
497
 
@@ -568,12 +504,6 @@ export var formatResource = function formatResource(resourceItem, cacheItem, for
568
504
  // 格式化label
569
505
  _resourceItem.labelText = _resourceItem.room_name || _resourceItem.name;
570
506
  var usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
571
-
572
- // 跨日预约
573
- if ((cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$_extend3 = cacheItem._extend) === null || _cacheItem$_extend3 === void 0 ? void 0 : _cacheItem$_extend3.sub_type) === 'days') {
574
- var _resourceItem$_extend, _resourceItem$_extend2, _resourceItem$_extend3;
575
- usable = ((_resourceItem$_extend = _resourceItem._extend) === null || _resourceItem$_extend === void 0 ? void 0 : (_resourceItem$_extend2 = _resourceItem$_extend.usableTime) === null || _resourceItem$_extend2 === void 0 ? void 0 : _resourceItem$_extend2.isUsable) && ((_resourceItem$_extend3 = _resourceItem._extend) === null || _resourceItem$_extend3 === void 0 ? void 0 : _resourceItem$_extend3.usableProduct);
576
- }
577
507
  _resourceItem.usable = usable;
578
508
  if (formatLabel) {
579
509
  _resourceItem.label = formatLabel(_resourceItem);
@@ -595,28 +525,6 @@ export var deleteCacheParams = function deleteCacheParams() {
595
525
  sessionStorage.removeItem('pisell2.booking.serviceParams');
596
526
  };
597
527
 
598
- /**
599
- * @title: 获取跨日预约的时长
600
- * @description:
601
- * @param {any} cacheItem
602
- * @return {*}
603
- * @Author: WangHan
604
- * @Date: 2024-12-01 22:43
605
- */
606
- export var getDays = function getDays(cacheItem, type) {
607
- var _cacheItem$_extend4, _cacheItem$_extend5;
608
- // 计算天数
609
- if (type === 'days') {
610
- var _formatDayDate = formatDayDate(cacheItem._extend),
611
- start_date = _formatDayDate.start_date,
612
- end_date = _formatDayDate.end_date;
613
- return end_date.diff(start_date, 'day');
614
- }
615
- var startDate = dayjs((_cacheItem$_extend4 = cacheItem._extend) === null || _cacheItem$_extend4 === void 0 ? void 0 : _cacheItem$_extend4.start_date);
616
- var endDate = dayjs((_cacheItem$_extend5 = cacheItem._extend) === null || _cacheItem$_extend5 === void 0 ? void 0 : _cacheItem$_extend5.end_date);
617
- return endDate.diff(startDate, type);
618
- };
619
-
620
528
  /**
621
529
  * @title: 创建一个服务商品
622
530
  * @description:
@@ -632,14 +540,13 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
632
540
  if (!cacheItem.new && cacheItem._extend.endDate) {
633
541
  return cacheItem._extend;
634
542
  }
635
- var isDay = isDayBooking(state);
636
543
 
637
544
  // 获取上一个服务商品
638
- var lastServer = isDay ? false : getLastServer(state.service.value);
545
+ var lastServer = getLastServer(state.service.value);
639
546
 
640
547
  // 下一个商品的扩展参数
641
548
  var _extend = {
642
- duration: isDay ? getDays(cacheItem, 'days') : findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
549
+ duration: findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
643
550
  };
644
551
 
645
552
  // 如果有上一个商品, 将上一个商品的某些参数 设置到新商品上
@@ -692,46 +599,22 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
692
599
  }
693
600
  }
694
601
  _extend = _objectSpread(_objectSpread({}, _extend), cacheItem._extend);
695
-
696
- // 跨日预约
697
- if (isDay) {
698
- _extend.end_date = dayjs(_extend.start_date).add(_extend.duration, 'day');
699
- var _formatDayDate2 = formatDayDate(_extend),
700
- start_date = _formatDayDate2.start_date,
701
- end_date = _formatDayDate2.end_date;
702
- _extend = _objectSpread(_objectSpread({}, _extend), {}, {
703
- start_date: start_date,
704
- startDate: start_date,
705
- end_date: end_date,
706
- endDate: end_date
707
- });
708
- }
709
602
  return _extend;
710
603
  };
711
604
 
712
- // 商品价格: (商品价格 + (套餐价格 + 单规格价格 * 单规格数量) * 套餐数量 + 单规格价格 * 单规格数量) * 商品数量
605
+ // 商品价格: (商品价格 + (套餐价格 + 单规格价格 * 单规格数量) * 套餐数量) * 商品数量
713
606
  export var getProductTotalPrice = function getProductTotalPrice(item) {
714
607
  var _item$_extend;
715
- var price = Number(item._extend.price);
608
+ var price = 0;
609
+ price += Number(item._extend.price);
716
610
  var other = (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.other;
717
-
718
- // 多规格
719
- if (other !== null && other !== void 0 && other.product_variant_id) {
720
- price = Number(other === null || other === void 0 ? void 0 : other.price);
721
- }
722
611
  if (other !== null && other !== void 0 && other.bundle) {
723
612
  // bundle
724
613
  price = other === null || other === void 0 ? void 0 : other.bundle.reduce(function (accumulator, currentValue) {
725
614
  return accumulator + Number(currentValue.price) * Number(currentValue.num);
726
615
  }, price);
727
616
  }
728
-
729
- // 单规格
730
- if (other !== null && other !== void 0 && other.option) {
731
- price = other === null || other === void 0 ? void 0 : other.option.reduce(function (accumulator, currentValue) {
732
- return accumulator + Number(currentValue.price) * Number(currentValue.num);
733
- }, price);
734
- }
617
+ price = price;
735
618
  return price;
736
619
  };
737
620
  /**
@@ -9,6 +9,7 @@ import React from 'react';
9
9
  import { Input, InputNumber, Checkbox, Radio, Cascader, DatePicker, Select, Slider, Switch, TimePicker, Transfer, TreeSelect, Upload, Form } from 'antd';
10
10
  import { CheckboxGroup, RadioGroup } from "../group";
11
11
  import Surcharge, { getCommName, getCommDefaultVal } from "../surcharge";
12
+ import Receipt, { getCommName as getCommNameReceipt, getCommDefaultVal as getCommDefaultValReceipt } from "../receipt";
12
13
  import DeviceList from "../deviceList";
13
14
 
14
15
  // 通用表单配置
@@ -32,7 +33,8 @@ var Mapping = {
32
33
  };
33
34
  var CustomMapping = {
34
35
  Surcharge: Surcharge,
35
- DeviceList: DeviceList
36
+ DeviceList: DeviceList,
37
+ Receipt: Receipt
36
38
  };
37
39
 
38
40
  /**
@@ -53,13 +55,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
53
55
  return /*#__PURE__*/React.createElement(CustomFormItem, {
54
56
  formItemList: item.children,
55
57
  onChange: onChange,
56
- key: item.name ? item.name + level : Component + index + level,
58
+ key: item.name ? "".concat(item.name).concat(level) : "".concat(Component).concat(index).concat(level),
57
59
  level: level + 1
58
60
  });
59
61
  }
60
62
  if (_typeof(Component) === 'object') {
61
63
  return /*#__PURE__*/React.createElement(Component, _extends({}, item, {
62
- key: item.name + level
64
+ key: "".concat(item.name).concat(level)
63
65
  }));
64
66
  }
65
67
  if (Mapping[Component]) {
@@ -67,7 +69,7 @@ var CustomFormItem = function CustomFormItem(_ref) {
67
69
  var input = item.input,
68
70
  formItemProps = _objectWithoutProperties(item, _excluded2);
69
71
  return /*#__PURE__*/React.createElement(Form.Item, _extends({}, formItemProps, {
70
- key: item.name + level
72
+ key: "".concat(item.name).concat(level)
71
73
  }), /*#__PURE__*/React.createElement(Comm, input));
72
74
  }
73
75
  if (Mapping[Component]) {
@@ -75,13 +77,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
75
77
  var _input = item.input,
76
78
  _formItemProps = _objectWithoutProperties(item, _excluded3);
77
79
  return /*#__PURE__*/React.createElement(Form.Item, _extends({}, _formItemProps, {
78
- key: item.name + level
80
+ key: "".concat(item.name).concat(level)
79
81
  }), /*#__PURE__*/React.createElement(_Comm, _input));
80
82
  }
81
83
  if (CustomMapping[Component]) {
82
84
  var _Comm2 = CustomMapping[Component];
83
85
  return /*#__PURE__*/React.createElement(_Comm2, _extends({}, item, {
84
- key: item.name + level
86
+ key: "".concat(item.name).concat(level)
85
87
  }));
86
88
  }
87
89
  throw TypeError("pos\u7269\u6599\u5E93 \u8F93\u5165\u7EC4\u4EF6\u7C7B\u578B ".concat(Component, " \u65E0\u6CD5\u6620\u5C04,\u8BF7\u6B63\u786E\u4F20\u5165\u7EC4\u4EF6\u7C7B\u578B"));
@@ -92,5 +94,9 @@ export var helpMapping = {
92
94
  Surcharge: {
93
95
  getCommName: getCommName,
94
96
  getCommDefaultVal: getCommDefaultVal
97
+ },
98
+ Receipt: {
99
+ getCommName: getCommNameReceipt,
100
+ getCommDefaultVal: getCommDefaultValReceipt
95
101
  }
96
102
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from 'antd';
3
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
4
- export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
4
+ export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
5
5
  direction?: "vertical" | undefined;
6
- component: string;
7
6
  }) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["direction", "options"],
2
2
  _excluded2 = ["label", "value"],
3
- _excluded3 = ["direction", "options", "component"],
3
+ _excluded3 = ["direction", "options"],
4
4
  _excluded4 = ["label", "value"];
5
5
  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); }
6
6
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -38,7 +38,6 @@ export var CheckboxGroup = function CheckboxGroup(_ref) {
38
38
  export var RadioGroup = function RadioGroup(_ref2) {
39
39
  var direction = _ref2.direction,
40
40
  options = _ref2.options,
41
- component = _ref2.component,
42
41
  props = _objectWithoutProperties(_ref2, _excluded3);
43
42
  if (direction === 'vertical') {
44
43
  return /*#__PURE__*/React.createElement(Radio.Group, props, /*#__PURE__*/React.createElement(Space, {
@@ -6,8 +6,8 @@ import { Eftpos } from './const';
6
6
  * @Date: 2024-08-20 13:23
7
7
  */
8
8
  export declare const usePairTerminalo: (type: Eftpos, params: {
9
- url?: string;
10
- version?: string;
9
+ url?: string | undefined;
10
+ version?: string | undefined;
11
11
  }) => ({ mid, tid, apiKey, posProductData, }: {
12
12
  mid: string;
13
13
  tid: string;
@@ -29,6 +29,6 @@ export declare const usePairTerminalo: (type: Eftpos, params: {
29
29
  * @Date: 2024-08-19 18:36
30
30
  */
31
31
  export declare const useTyro: (params: {
32
- url?: string;
33
- version?: string;
32
+ url?: string | undefined;
33
+ version?: string | undefined;
34
34
  }) => readonly [import("react").MutableRefObject<any>, boolean];
@@ -24,8 +24,8 @@ import Drawer from "../booking/components/drawer";
24
24
  import Log from "./log";
25
25
  import localeTexts from "./locales";
26
26
  import { usePairTerminalo } from "./hooks";
27
- import ApiKeyIcon from "./icon/apiKey";
28
- import DeviceIcon from "./icon/device";
27
+ import DeviceIcon from "./icon/apiKey";
28
+ import ApiKeyIcon from "./icon/device";
29
29
  import { Eftpos, getCommByFields, DeviceEnum, getDefaultValue } from "./const";
30
30
  import "./index.less";
31
31
  locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ /**
3
+ * @title: 自定义组件设置
4
+ * @description: 自定义组件设置
5
+ * @param {any} commConfig 当前组件配置
6
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
7
+ * @return {*}
8
+ * @Author: hongbing.wang
9
+ * @Date: 2024-08-20 11:10
10
+ */
11
+ export declare const getCommName: (commConfig: any, name: string[]) => any;
12
+ /**
13
+ * @title: 自定义组件结果设置
14
+ * @description: 自定义组件结果设置
15
+ * @param {any} commConfig 当前组件配置
16
+ * @return {*}
17
+ * @Author: hongbing.wang
18
+ * @Date: 2024-08-20 11:11
19
+ */
20
+ export declare const getCommDefaultVal: (commConfig: any) => {
21
+ [x: number]: any;
22
+ };
23
+ declare const _default: (props: any) => React.JSX.Element;
24
+ export default _default;
@@ -0,0 +1,96 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["input"],
3
+ _excluded2 = ["input"];
4
+ 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); }
5
+ 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; }
6
+ 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; }
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 _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ 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; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
+ 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); }
17
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
+ 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; }
20
+ import React, { useMemo, useState } from 'react';
21
+ import { Form } from 'antd';
22
+ import { CheckboxGroup, RadioGroup } from "../group";
23
+
24
+ /**
25
+ * @title: 自定义组件设置
26
+ * @description: 自定义组件设置
27
+ * @param {any} commConfig 当前组件配置
28
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
29
+ * @return {*}
30
+ * @Author: hongbing.wang
31
+ * @Date: 2024-08-20 11:10
32
+ */
33
+ export var getCommName = function getCommName(commConfig, name) {
34
+ commConfig.receipts.__sourceName = commConfig.receipts.name;
35
+ commConfig.receiptList.__sourceName = commConfig.receiptList.name;
36
+ commConfig.receipts.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receipts.name]) : commConfig.receipts.name;
37
+ commConfig.receiptList.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receiptList.name]) : commConfig.receiptList.name;
38
+ return commConfig;
39
+ };
40
+
41
+ /**
42
+ * @title: 自定义组件结果设置
43
+ * @description: 自定义组件结果设置
44
+ * @param {any} commConfig 当前组件配置
45
+ * @return {*}
46
+ * @Author: hongbing.wang
47
+ * @Date: 2024-08-20 11:11
48
+ */
49
+ export var getCommDefaultVal = function getCommDefaultVal(commConfig) {
50
+ var _ref;
51
+ var receipts = commConfig.receipts.input.defaultValue;
52
+ var receiptList = commConfig.receiptList.input.defaultValue;
53
+ console.log('receipts = ', receipts);
54
+ return _ref = {}, _defineProperty(_ref, commConfig.receipts.__sourceName, typeof receipts === 'undefined' ? true : receipts), _defineProperty(_ref, commConfig.receiptList.__sourceName, typeof receiptList === 'undefined' ? ['merchant', 'customer'] : receiptList), _ref;
55
+ };
56
+ export default (function (props) {
57
+ var receipts = props.receipts,
58
+ receiptList = props.receiptList;
59
+ // const {input:receiptsInput,...receiptsOther} = receipts
60
+ var _useMemo = useMemo(function () {
61
+ var input = receipts.input,
62
+ other = _objectWithoutProperties(receipts, _excluded);
63
+ return [input, other];
64
+ }, [receipts]),
65
+ _useMemo2 = _slicedToArray(_useMemo, 2),
66
+ receiptsInput = _useMemo2[0],
67
+ receiptsOther = _useMemo2[1];
68
+ var _useMemo3 = useMemo(function () {
69
+ var input = receiptList.input,
70
+ other = _objectWithoutProperties(receiptList, _excluded2);
71
+ return [input, other];
72
+ }, [receipts]),
73
+ _useMemo4 = _slicedToArray(_useMemo3, 2),
74
+ receiptListInput = _useMemo4[0],
75
+ receiptListOther = _useMemo4[1];
76
+ var _useState = useState(receiptsInput.defaultValue),
77
+ _useState2 = _slicedToArray(_useState, 2),
78
+ type = _useState2[0],
79
+ setType = _useState2[1];
80
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, _extends({
81
+ style: {
82
+ marginBottom: '12px'
83
+ }
84
+ }, receiptsOther), /*#__PURE__*/React.createElement(RadioGroup, _extends({}, receiptsInput, {
85
+ onChange: function onChange(event) {
86
+ setType(event.target.value);
87
+ }
88
+ }))), /*#__PURE__*/React.createElement(Form.Item, _extends({}, receiptListOther, {
89
+ style: type ? {
90
+ marginLeft: '24px',
91
+ display: 'none'
92
+ } : {
93
+ marginLeft: '24px'
94
+ }
95
+ }), /*#__PURE__*/React.createElement(CheckboxGroup, receiptListInput)));
96
+ });
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { PosProps, RouteType } from './const';
3
+ declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "mode" | "type" | "getApi"> & {
4
+ action: RouteType;
5
+ device_number: string | number;
6
+ api: ReturnType<PosProps['getApi']>;
7
+ isMobile: boolean;
8
+ channel?: string | undefined;
9
+ formatAmount(amount: number | string, precision: number, symbol: string): string;
10
+ }) => React.JSX.Element;
11
+ export default App;