@pisell/private-materials 6.7.9 → 6.8.1

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 (421) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
  12. package/es/components/booking/addons/index.js +25 -17
  13. package/es/components/booking/components/footer/amount.d.ts +1 -0
  14. package/es/components/booking/components/footer/amount.js +548 -84
  15. package/es/components/booking/components/footer/index.js +77 -56
  16. package/es/components/booking/components/footer/utils.d.ts +19 -0
  17. package/es/components/booking/components/footer/utils.js +194 -73
  18. package/es/components/booking/components/voucher/index.js +23 -7
  19. package/es/components/booking/hooks/useQuotation.js +4 -1
  20. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  21. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  22. package/es/components/booking/info/service2/utils.js +1 -0
  23. package/es/components/booking/info2/cartClientCard/index.js +30 -6
  24. package/es/components/booking/info2/index.js +1 -1
  25. package/es/components/booking/info2/service/addService/index.js +2 -3
  26. package/es/components/booking/info2/service/editNormalService/index.js +6 -0
  27. package/es/components/booking/info2/service/editService/index.js +16 -6
  28. package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
  29. package/es/components/booking/info2/service/editService/utils.js +66 -0
  30. package/es/components/booking/utils.d.ts +1 -0
  31. package/es/components/booking/utils.js +16 -3
  32. package/es/components/checkout/PaymentModal.d.ts +13 -5
  33. package/es/components/checkout/PaymentModal.js +304 -252
  34. package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
  35. package/es/components/checkout/components/AdditionalModule/index.js +52 -12
  36. package/es/components/checkout/components/AmountSummary/index.js +9 -76
  37. package/es/components/checkout/components/AmountSummary/index.less +5 -6
  38. package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  39. package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
  40. package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
  41. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
  42. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
  43. package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
  44. package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
  45. package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
  46. package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
  47. package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
  48. package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
  49. package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
  50. package/es/components/checkout/components/SearchAndClientModule/index.js +39 -40
  51. package/es/components/checkout/index.less +1 -1
  52. package/es/components/checkout/locales.d.ts +6 -0
  53. package/es/components/checkout/locales.js +6 -0
  54. package/es/components/checkout/plugin.d.ts +2 -0
  55. package/es/components/checkout/plugin.js +303 -0
  56. package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
  57. package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
  58. package/es/components/eftpos/hooks.d.ts +0 -1
  59. package/es/components/eftposPay/hooks.d.ts +1 -1
  60. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
  61. package/es/components/eftposPay/payo/config.js +70 -32
  62. package/es/components/eftposPay/payo/payment.d.ts +66 -0
  63. package/es/components/eftposPay/payo/payment.js +579 -0
  64. package/es/components/eftposPay/store/index.d.ts +4 -4
  65. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  66. package/es/components/eftposPay/tyro/index.js +12 -0
  67. package/es/components/eftposPay/utils/log/index.d.ts +110 -0
  68. package/es/components/eftposPay/utils/log/index.js +371 -0
  69. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  73. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  77. package/es/components/index.d.ts +2 -1
  78. package/es/components/index.js +2 -1
  79. package/es/components/list/List.js +99 -56
  80. package/es/components/list/hooks/useListState.d.ts +5 -3
  81. package/es/components/list/hooks/useListState.js +10 -2
  82. package/es/components/list/styles/base.less +4 -0
  83. package/es/components/list/styles/content.less +1 -1
  84. package/es/components/list/styles/header.less +4 -4
  85. package/es/components/list/types.d.ts +1 -0
  86. package/es/components/list/utils/index.d.ts +13 -1
  87. package/es/components/list/utils/index.js +43 -1
  88. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
  89. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  90. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  91. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  92. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  93. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  94. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
  95. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
  96. package/es/components/pay/toC/index.js +7 -4
  97. package/es/components/pay/toC/locales.d.ts +3 -0
  98. package/es/components/pay/toC/locales.js +6 -3
  99. package/es/components/pay/toC/status.d.ts +1 -0
  100. package/es/components/pay/toC/status.js +3 -0
  101. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  102. package/es/components/subTotal/index.js +1 -1
  103. package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
  104. package/es/components/{checkout/PaymentPlugin.js → systemSettings/registry/components/GroupModal.js} +132 -171
  105. package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
  106. package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
  107. package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
  108. package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
  109. package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
  110. package/es/components/systemSettings/registry/components/SectionList.js +174 -0
  111. package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
  112. package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
  113. package/es/components/systemSettings/registry/components/index.d.ts +4 -0
  114. package/es/components/systemSettings/registry/components/index.js +4 -0
  115. package/es/components/systemSettings/registry/index.d.ts +5 -0
  116. package/es/components/systemSettings/registry/index.js +1059 -0
  117. package/es/components/systemSettings/registry/index.less +410 -0
  118. package/es/components/systemSettings/registry/locales.d.ts +272 -0
  119. package/es/components/systemSettings/registry/locales.js +300 -0
  120. package/es/components/systemSettings/registry/services.d.ts +77 -0
  121. package/es/components/systemSettings/registry/services.js +472 -0
  122. package/es/components/systemSettings/registry/types.d.ts +126 -0
  123. package/es/components/systemSettings/registry/types.js +1 -0
  124. package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  125. package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
  126. package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
  127. package/es/components/systemSettings/registry/utils/validators.js +44 -0
  128. package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +58 -11
  129. package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
  130. package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
  131. package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +149 -36
  132. package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -86
  133. package/es/components/ticketBooking/components/menuBar/index.js +109 -12
  134. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
  135. package/es/components/ticketBooking/components/timeBar/index.js +112 -7
  136. package/es/components/ticketBooking/components/timeBar/index.less +59 -0
  137. package/es/components/ticketBooking/hooks/pisellos/useProducts.js +29 -18
  138. package/es/components/ticketBooking/locales.d.ts +9 -0
  139. package/es/components/ticketBooking/locales.js +12 -3
  140. package/es/components/ticketBooking/utils/index.d.ts +3 -0
  141. package/es/components/ticketBooking/utils/index.js +36 -13
  142. package/es/components/wallet/Detail/index.js +34 -2
  143. package/es/components/wallet/Detail/index.less +11 -0
  144. package/es/components/wallet/Detail/locales.d.ts +6 -0
  145. package/es/components/wallet/Detail/locales.js +14 -2
  146. package/es/components/wallet/Voucher/index.js +11 -10
  147. package/es/components/wallet/components/WalletCard.js +5 -1
  148. package/es/components/wallet/index.js +4 -2
  149. package/es/components/wallet/serve.d.ts +7 -0
  150. package/es/components/wallet/utils.d.ts +48 -0
  151. package/es/components/wallet/utils.js +342 -0
  152. package/es/index.d.ts +5 -0
  153. package/es/index.js +6 -1
  154. package/es/plus/clientCard/locales.js +3 -3
  155. package/es/plus/clinetSearch/index.js +28 -30
  156. package/es/plus/clinetSearch/locales.d.ts +3 -0
  157. package/es/plus/clinetSearch/locales.js +7 -4
  158. package/es/plus/clinetSearch/types.d.ts +12 -0
  159. package/es/plus/productSelect/CategoryTabs/index.d.ts +1 -0
  160. package/es/plus/productSelect/CategoryTabs/index.js +2 -1
  161. package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
  162. package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
  163. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  164. package/es/plus/walletPassGallery/components/passDetail/index.js +84 -31
  165. package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
  166. package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
  167. package/es/plus/walletPassGallery/index.js +7 -3
  168. package/es/plus/walletPassGallery/serve.d.ts +3 -0
  169. package/es/plus/walletPassGallery/serve.js +4 -2
  170. package/es/pro/Login2.0/index.less +15 -8
  171. package/es/pro/Selector/BatchSelectorDemo.d.ts +3 -0
  172. package/es/pro/Selector/BatchSelectorDemo.js +470 -0
  173. package/es/pro/Selector/Selector.d.ts +5 -0
  174. package/es/pro/Selector/Selector.js +283 -0
  175. package/es/pro/Selector/SelectorGroup.d.ts +11 -0
  176. package/es/pro/Selector/SelectorGroup.js +537 -0
  177. package/es/pro/Selector/components/Card/index.d.ts +27 -0
  178. package/es/pro/Selector/components/Card/index.js +96 -0
  179. package/es/pro/Selector/components/Card/index.less +132 -0
  180. package/es/pro/Selector/components/IntersectionObserver.d.ts +105 -0
  181. package/es/pro/Selector/components/IntersectionObserver.js +384 -0
  182. package/es/pro/Selector/components/NumericStepper/index.d.ts +41 -0
  183. package/es/pro/Selector/components/NumericStepper/index.js +198 -0
  184. package/es/pro/Selector/components/NumericStepper/index.less +221 -0
  185. package/es/pro/Selector/components/index.d.ts +2 -0
  186. package/es/pro/Selector/components/index.js +2 -0
  187. package/es/pro/Selector/demo.d.ts +3 -0
  188. package/es/pro/Selector/demo.js +158 -0
  189. package/es/pro/Selector/hooks/useSelectionController.d.ts +42 -0
  190. package/es/pro/Selector/hooks/useSelectionController.js +414 -0
  191. package/es/pro/Selector/index.d.ts +8 -0
  192. package/es/pro/Selector/index.js +5 -0
  193. package/es/pro/Selector/locales.d.ts +42 -0
  194. package/es/pro/Selector/locales.js +80 -0
  195. package/es/pro/Selector/selector.less +3 -0
  196. package/es/pro/Selector/selectorGroup.less +8 -0
  197. package/es/pro/Selector/types.d.ts +114 -0
  198. package/es/pro/Selector/types.js +1 -0
  199. package/es/pro/Selector/utils/index.d.ts +49 -0
  200. package/es/pro/Selector/utils/index.js +229 -0
  201. package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  202. package/es/pro/comprehensiveSearch/locales.js +1 -1
  203. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +45 -36
  204. package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
  205. package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
  206. package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
  207. package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
  208. package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
  209. package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
  210. package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
  211. package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
  212. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  213. package/lib/components/booking/addons/index.js +15 -7
  214. package/lib/components/booking/components/footer/amount.d.ts +1 -0
  215. package/lib/components/booking/components/footer/amount.js +293 -41
  216. package/lib/components/booking/components/footer/index.js +30 -11
  217. package/lib/components/booking/components/footer/utils.d.ts +19 -0
  218. package/lib/components/booking/components/footer/utils.js +138 -41
  219. package/lib/components/booking/components/voucher/index.js +25 -9
  220. package/lib/components/booking/hooks/useQuotation.js +2 -1
  221. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  222. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  223. package/lib/components/booking/info/service2/utils.js +1 -0
  224. package/lib/components/booking/info2/cartClientCard/index.js +25 -5
  225. package/lib/components/booking/info2/index.js +7 -2
  226. package/lib/components/booking/info2/service/addService/index.js +1 -2
  227. package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
  228. package/lib/components/booking/info2/service/editService/index.js +12 -3
  229. package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
  230. package/lib/components/booking/info2/service/editService/utils.js +40 -3
  231. package/lib/components/booking/utils.d.ts +1 -0
  232. package/lib/components/booking/utils.js +11 -0
  233. package/lib/components/checkout/PaymentModal.d.ts +13 -5
  234. package/lib/components/checkout/PaymentModal.js +190 -147
  235. package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
  236. package/lib/components/checkout/components/AdditionalModule/index.js +52 -11
  237. package/lib/components/checkout/components/AmountSummary/index.js +5 -46
  238. package/lib/components/checkout/components/AmountSummary/index.less +5 -6
  239. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  240. package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
  241. package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
  242. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
  243. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
  244. package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
  245. package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
  246. package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
  247. package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
  248. package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
  249. package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
  250. package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
  251. package/lib/components/checkout/components/SearchAndClientModule/index.js +29 -3
  252. package/lib/components/checkout/index.less +1 -1
  253. package/lib/components/checkout/locales.d.ts +6 -0
  254. package/lib/components/checkout/locales.js +6 -0
  255. package/lib/components/checkout/plugin.d.ts +2 -0
  256. package/lib/components/checkout/plugin.js +263 -0
  257. package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
  258. package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
  259. package/lib/components/eftpos/hooks.d.ts +0 -1
  260. package/lib/components/eftposPay/hooks.d.ts +1 -1
  261. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
  262. package/lib/components/eftposPay/payo/config.js +98 -73
  263. package/lib/components/eftposPay/payo/payment.d.ts +66 -0
  264. package/lib/components/eftposPay/payo/payment.js +357 -0
  265. package/lib/components/eftposPay/store/index.d.ts +4 -4
  266. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  267. package/lib/components/eftposPay/tyro/index.js +12 -0
  268. package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
  269. package/lib/components/eftposPay/utils/log/index.js +294 -0
  270. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  271. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  272. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  273. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  274. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  275. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  276. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  277. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  278. package/lib/components/index.d.ts +2 -1
  279. package/lib/components/index.js +3 -0
  280. package/lib/components/list/List.js +58 -36
  281. package/lib/components/list/hooks/useListState.d.ts +5 -3
  282. package/lib/components/list/hooks/useListState.js +9 -1
  283. package/lib/components/list/styles/base.less +4 -0
  284. package/lib/components/list/styles/content.less +1 -1
  285. package/lib/components/list/styles/header.less +4 -4
  286. package/lib/components/list/types.d.ts +1 -0
  287. package/lib/components/list/utils/index.d.ts +13 -1
  288. package/lib/components/list/utils/index.js +27 -0
  289. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
  290. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  291. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  292. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  293. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  294. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  295. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
  296. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
  297. package/lib/components/pay/toC/index.js +4 -1
  298. package/lib/components/pay/toC/locales.d.ts +3 -0
  299. package/lib/components/pay/toC/locales.js +6 -3
  300. package/lib/components/pay/toC/status.d.ts +1 -0
  301. package/lib/components/pay/toC/status.js +5 -0
  302. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  303. package/lib/components/subTotal/index.js +1 -1
  304. package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
  305. package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
  306. package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
  307. package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
  308. package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
  309. package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
  310. package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
  311. package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
  312. package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
  313. package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
  314. package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
  315. package/lib/components/systemSettings/registry/components/index.js +48 -0
  316. package/lib/components/systemSettings/registry/index.d.ts +5 -0
  317. package/lib/components/systemSettings/registry/index.js +529 -0
  318. package/lib/components/systemSettings/registry/index.less +410 -0
  319. package/lib/components/systemSettings/registry/locales.d.ts +272 -0
  320. package/lib/components/systemSettings/registry/locales.js +324 -0
  321. package/lib/components/systemSettings/registry/services.d.ts +77 -0
  322. package/lib/components/systemSettings/registry/services.js +290 -0
  323. package/lib/components/systemSettings/registry/types.d.ts +126 -0
  324. package/lib/components/systemSettings/registry/types.js +17 -0
  325. package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  326. package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
  327. package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
  328. package/lib/components/systemSettings/registry/utils/validators.js +54 -0
  329. package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +40 -5
  330. package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
  331. package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
  332. package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +93 -24
  333. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  334. package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
  335. package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
  336. package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
  337. package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
  338. package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +17 -13
  339. package/lib/components/ticketBooking/locales.d.ts +9 -0
  340. package/lib/components/ticketBooking/locales.js +12 -3
  341. package/lib/components/ticketBooking/utils/index.d.ts +3 -0
  342. package/lib/components/ticketBooking/utils/index.js +20 -6
  343. package/lib/components/wallet/Detail/index.js +31 -3
  344. package/lib/components/wallet/Detail/index.less +11 -0
  345. package/lib/components/wallet/Detail/locales.d.ts +6 -0
  346. package/lib/components/wallet/Detail/locales.js +14 -2
  347. package/lib/components/wallet/Voucher/index.js +8 -8
  348. package/lib/components/wallet/components/WalletCard.js +4 -0
  349. package/lib/components/wallet/index.js +2 -2
  350. package/lib/components/wallet/serve.d.ts +7 -0
  351. package/lib/components/wallet/utils.d.ts +48 -0
  352. package/lib/components/wallet/utils.js +287 -0
  353. package/lib/index.d.ts +5 -0
  354. package/lib/index.js +15 -0
  355. package/lib/plus/clientCard/locales.js +3 -3
  356. package/lib/plus/clinetSearch/index.js +17 -8
  357. package/lib/plus/clinetSearch/locales.d.ts +3 -0
  358. package/lib/plus/clinetSearch/locales.js +7 -4
  359. package/lib/plus/clinetSearch/types.d.ts +12 -0
  360. package/lib/plus/productSelect/CategoryTabs/index.d.ts +1 -0
  361. package/lib/plus/productSelect/CategoryTabs/index.js +2 -1
  362. package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
  363. package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
  364. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  365. package/lib/plus/walletPassGallery/components/passDetail/index.js +54 -15
  366. package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
  367. package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
  368. package/lib/plus/walletPassGallery/index.js +7 -3
  369. package/lib/plus/walletPassGallery/serve.d.ts +3 -0
  370. package/lib/plus/walletPassGallery/serve.js +3 -2
  371. package/lib/pro/Login2.0/index.less +15 -8
  372. package/lib/pro/Selector/BatchSelectorDemo.d.ts +3 -0
  373. package/lib/pro/Selector/BatchSelectorDemo.js +376 -0
  374. package/lib/pro/Selector/Selector.d.ts +5 -0
  375. package/lib/pro/Selector/Selector.js +264 -0
  376. package/lib/pro/Selector/SelectorGroup.d.ts +11 -0
  377. package/lib/pro/Selector/SelectorGroup.js +463 -0
  378. package/lib/pro/Selector/components/Card/index.d.ts +27 -0
  379. package/lib/pro/Selector/components/Card/index.js +114 -0
  380. package/lib/pro/Selector/components/Card/index.less +132 -0
  381. package/lib/pro/Selector/components/IntersectionObserver.d.ts +105 -0
  382. package/lib/pro/Selector/components/IntersectionObserver.js +281 -0
  383. package/lib/pro/Selector/components/NumericStepper/index.d.ts +41 -0
  384. package/lib/pro/Selector/components/NumericStepper/index.js +221 -0
  385. package/lib/pro/Selector/components/NumericStepper/index.less +221 -0
  386. package/lib/pro/Selector/components/index.d.ts +2 -0
  387. package/lib/pro/Selector/components/index.js +42 -0
  388. package/lib/pro/Selector/demo.d.ts +3 -0
  389. package/lib/pro/Selector/demo.js +102 -0
  390. package/lib/pro/Selector/hooks/useSelectionController.d.ts +42 -0
  391. package/lib/pro/Selector/hooks/useSelectionController.js +338 -0
  392. package/lib/pro/Selector/index.d.ts +8 -0
  393. package/lib/pro/Selector/index.js +39 -0
  394. package/lib/pro/Selector/locales.d.ts +42 -0
  395. package/lib/pro/Selector/locales.js +80 -0
  396. package/lib/pro/Selector/selector.less +3 -0
  397. package/lib/pro/Selector/selectorGroup.less +8 -0
  398. package/lib/pro/Selector/types.d.ts +114 -0
  399. package/lib/pro/Selector/types.js +17 -0
  400. package/lib/pro/Selector/utils/index.d.ts +49 -0
  401. package/lib/pro/Selector/utils/index.js +221 -0
  402. package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  403. package/lib/pro/comprehensiveSearch/locales.js +1 -1
  404. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +42 -43
  405. package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
  406. package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
  407. package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
  408. package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
  409. package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
  410. package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
  411. package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
  412. package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
  413. package/lowcode/payment-modal/meta.ts +135 -0
  414. package/lowcode/selector/meta.ts +352 -0
  415. package/lowcode/selector.group/meta.ts +200 -0
  416. package/lowcode/settings-registry/meta.ts +29 -0
  417. package/lowcode/wallet-pass-detail/meta.ts +89 -0
  418. package/package.json +4 -4
  419. package/es/components/checkout/PaymentPlugin.d.ts +0 -3
  420. package/lib/components/checkout/PaymentPlugin.d.ts +0 -3
  421. package/lib/components/checkout/PaymentPlugin.js +0 -181
@@ -0,0 +1,376 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/pro/Selector/BatchSelectorDemo.tsx
30
+ var BatchSelectorDemo_exports = {};
31
+ __export(BatchSelectorDemo_exports, {
32
+ BatchSelectorDemo: () => BatchSelectorDemo,
33
+ default: () => BatchSelectorDemo_default
34
+ });
35
+ module.exports = __toCommonJS(BatchSelectorDemo_exports);
36
+ var import_react = __toESM(require("react"));
37
+ var import_antd = require("antd");
38
+ var import_SelectorGroup = __toESM(require("./SelectorGroup"));
39
+ var import_icons = require("@ant-design/icons");
40
+ var { Title } = import_antd.Typography;
41
+ var dataSource = [
42
+ {
43
+ id: 1,
44
+ title: "主菜",
45
+ mode: "single",
46
+ valueType: "primitive",
47
+ fieldNames: { value: "value", label: "title" },
48
+ dataSource: [
49
+ { id: 1, title: "汉堡", value: "burger" },
50
+ { id: 2, title: "披萨", value: "pizza" }
51
+ ],
52
+ grid: {
53
+ columns: 2,
54
+ gutter: 16,
55
+ colConfig: {
56
+ span: 3
57
+ }
58
+ },
59
+ ruleConfig: {
60
+ required: 1,
61
+ autoValidate: true
62
+ }
63
+ },
64
+ {
65
+ id: 4,
66
+ title: "汉堡定制",
67
+ mode: "single",
68
+ valueType: "object",
69
+ fieldNames: { value: "value", label: "title" },
70
+ dataSource: [
71
+ {
72
+ id: 1,
73
+ title: "加倍牛肉",
74
+ value: "double-meat",
75
+ ruleConfig: { min: 1, max: 3 }
76
+ },
77
+ { id: 2, title: "额外芝士", value: "extra-cheese" }
78
+ ],
79
+ item: {
80
+ variant: "card",
81
+ selectedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, null)
82
+ },
83
+ ruleConfig: {
84
+ required: 1,
85
+ autoValidate: true
86
+ }
87
+ },
88
+ {
89
+ id: 5,
90
+ title: "披萨定制",
91
+ mode: "multiple",
92
+ valueType: "object",
93
+ fieldNames: { value: "value", label: "title" },
94
+ dataSource: [
95
+ {
96
+ id: 1,
97
+ title: "额外芝士",
98
+ value: "extra-cheese",
99
+ cover: "https://file.mypisell-dev.com/pisel/image/9/52fe9ca4233877f2c06865d27b9fb7912022_12_01_13_32_47_147_00076174656__1080_1073__.jpeg",
100
+ ruleConfig: { min: 1, max: 3 }
101
+ },
102
+ {
103
+ id: 2,
104
+ title: "薄底",
105
+ value: "thin-crust",
106
+ cover: "https://file.mypisell-dev.com/pisel/image/9/52fe9ca4233877f2c06865d27b9fb7912022_12_01_13_32_47_147_00076174656__1080_1073__.jpeg"
107
+ },
108
+ {
109
+ id: 3,
110
+ title: "额外洋葱",
111
+ value: "extra-onion",
112
+ cover: "https://file.mypisell-dev.com/pisel/image/9/52fe9ca4233877f2c06865d27b9fb7912022_12_01_13_32_47_147_00076174656__1080_1073__.jpeg"
113
+ }
114
+ ],
115
+ grid: {
116
+ columns: 3,
117
+ gutter: 16
118
+ },
119
+ item: {
120
+ variant: "card",
121
+ layout: "vertical",
122
+ selectedTypeVariant: "cornered",
123
+ renderContent: (dataSource2) => /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
124
+ "img",
125
+ {
126
+ src: dataSource2.cover,
127
+ alt: dataSource2.title,
128
+ style: { width: "100%", height: "120px", objectFit: "cover" }
129
+ }
130
+ ), /* @__PURE__ */ import_react.default.createElement("div", null, dataSource2.title))
131
+ },
132
+ ruleConfig: {
133
+ min: 1,
134
+ max: 2,
135
+ required: 1,
136
+ autoValidate: true
137
+ }
138
+ },
139
+ {
140
+ id: 31,
141
+ title: "汉堡定制1",
142
+ mode: "single",
143
+ valueType: "object",
144
+ fieldNames: { value: "value", label: "title" },
145
+ dataSource: [
146
+ {
147
+ id: 1,
148
+ title: "加倍牛肉",
149
+ value: "double-meat",
150
+ ruleConfig: { min: 1, max: 3 }
151
+ },
152
+ { id: 2, title: "额外芝士", value: "extra-cheese" }
153
+ ],
154
+ item: {
155
+ variant: "card",
156
+ selectedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, null)
157
+ }
158
+ },
159
+ {
160
+ id: 32,
161
+ title: "汉堡定制2",
162
+ mode: "single",
163
+ valueType: "object",
164
+ fieldNames: { value: "value", label: "title" },
165
+ dataSource: [
166
+ {
167
+ id: 1,
168
+ title: "加倍牛肉",
169
+ value: "double-meat",
170
+ ruleConfig: { min: 1, max: 3 }
171
+ },
172
+ { id: 2, title: "额外芝士", value: "extra-cheese" }
173
+ ],
174
+ item: {
175
+ variant: "card",
176
+ selectedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, null)
177
+ }
178
+ },
179
+ {
180
+ id: 33,
181
+ title: "汉堡定制3",
182
+ mode: "single",
183
+ valueType: "object",
184
+ fieldNames: { value: "value", label: "title" },
185
+ dataSource: [
186
+ {
187
+ id: 1,
188
+ title: "加倍牛肉",
189
+ value: "double-meat",
190
+ ruleConfig: { min: 1, max: 3 }
191
+ },
192
+ { id: 2, title: "额外芝士", value: "extra-cheese" }
193
+ ],
194
+ item: {
195
+ variant: "card",
196
+ selectedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, null)
197
+ }
198
+ },
199
+ {
200
+ id: 34,
201
+ title: "汉堡定制4",
202
+ mode: "single",
203
+ valueType: "object",
204
+ fieldNames: { value: "value", label: "title" },
205
+ dataSource: [
206
+ {
207
+ id: 1,
208
+ title: "加倍牛肉",
209
+ value: "double-meat",
210
+ ruleConfig: { min: 1, max: 3 }
211
+ },
212
+ { id: 2, title: "额外芝士", value: "extra-cheese" }
213
+ ],
214
+ item: {
215
+ variant: "card",
216
+ selectedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, null)
217
+ }
218
+ }
219
+ ];
220
+ var linkageRules = [
221
+ {
222
+ type: "expr",
223
+ when: {
224
+ and: [{ groupId: "1", op: "eq", value: "burger" }]
225
+ },
226
+ then: [{ type: "show", groupId: "4" }],
227
+ stopAfterApply: true
228
+ },
229
+ {
230
+ type: "expr",
231
+ when: {
232
+ and: [{ groupId: "1", op: "eq", value: "pizza" }]
233
+ },
234
+ then: [{ type: "show", groupId: "5" }],
235
+ priority: 10
236
+ }
237
+ ];
238
+ var BatchSelectorDemo = () => {
239
+ const [values1, setValues1] = (0, import_react.useState)({});
240
+ const [values2, setValues2] = (0, import_react.useState)({});
241
+ const ref = (0, import_react.useRef)(null);
242
+ const containerRef = (0, import_react.useRef)(null);
243
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "0", maxWidth: "900px", margin: "0 auto", height: "100vh", overflow: "auto" }, ref: containerRef }, /* @__PURE__ */ import_react.default.createElement(Title, { level: 2 }, "嵌套条件 + 分支控制(elseThen/stopAfterApply)演示"), /* @__PURE__ */ import_react.default.createElement(
244
+ import_antd.Alert,
245
+ {
246
+ message: "说明",
247
+ description: "当选择汉堡且不为多糖时显示“汉堡定制”(短路);未命中时显示“默认定制”(不短路,可继续评估后续规则);当选择披萨且满足(温度为热/烫 或 糖度为少糖)时显示“披萨定制”。未命中时,定制分组默认隐藏。",
248
+ type: "info",
249
+ showIcon: true,
250
+ style: { marginBottom: 16 }
251
+ }
252
+ ), /* @__PURE__ */ import_react.default.createElement(import_antd.Card, { title: "BatchSelector" }, /* @__PURE__ */ import_react.default.createElement(
253
+ import_SelectorGroup.default,
254
+ {
255
+ dataSource,
256
+ linkageRules,
257
+ allowedValuesPolicy: "strict",
258
+ value: values1,
259
+ onChange: (v) => setValues1({ ...v || {} }),
260
+ customScrollParent: containerRef.current
261
+ }
262
+ ), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ import_react.default.createElement(
263
+ import_antd.Alert,
264
+ {
265
+ message: "实时值",
266
+ description: /* @__PURE__ */ import_react.default.createElement("pre", { style: { margin: 0, whiteSpace: "pre-wrap" } }, JSON.stringify(values1, null, 2)),
267
+ type: "success",
268
+ showIcon: true
269
+ }
270
+ ))), /* @__PURE__ */ import_react.default.createElement(Title, { level: 2, style: { marginTop: 32 } }, "联动演示:选项影响另一个分组的可选项"), /* @__PURE__ */ import_react.default.createElement(
271
+ import_antd.Alert,
272
+ {
273
+ message: "说明",
274
+ description: "当选择饮品为 Coffee 时,加料仅允许 Milk/Sugar;选择 Tea 时,加料仅允许 Lemon/Honey。未允许的选项会在 UI 中禁用(soft 模式演示)。",
275
+ type: "info",
276
+ showIcon: true,
277
+ style: { marginBottom: 16 }
278
+ }
279
+ ), /* @__PURE__ */ import_react.default.createElement("div", { style: { height: "1000px" } }), (() => {
280
+ const dataSource2 = [
281
+ {
282
+ id: 11,
283
+ title: "饮品",
284
+ mode: "single",
285
+ valueType: "primitive",
286
+ fieldNames: { value: "value", label: "title" },
287
+ dataSource: [
288
+ { id: 1, title: "Coffee", value: "coffee" },
289
+ { id: 2, title: "Tea", value: "tea" }
290
+ ]
291
+ },
292
+ {
293
+ id: 12,
294
+ title: "加料",
295
+ mode: "single",
296
+ valueType: "primitive",
297
+ fieldNames: { value: "value", label: "title" },
298
+ dataSource: [
299
+ { id: 1, title: "Milk", value: "milk" },
300
+ { id: 2, title: "Sugar", value: "sugar" },
301
+ { id: 3, title: "Lemon", value: "lemon" },
302
+ { id: 4, title: "Honey", value: "honey" }
303
+ ],
304
+ item: {
305
+ variant: "card"
306
+ },
307
+ titleProps: {
308
+ tip: {
309
+ visible: true,
310
+ text: "加料"
311
+ }
312
+ }
313
+ }
314
+ ];
315
+ const linkageRules2 = [
316
+ // 当选择 Coffee 时,仅允许 milk/sugar;未选择或选择 Tea 时不受这条规则影响
317
+ {
318
+ type: "expr",
319
+ when: { and: [{ groupId: "11", op: "eq", value: "coffee" }] },
320
+ then: [
321
+ {
322
+ type: "allowOnly",
323
+ groupId: "12",
324
+ values: ["milk", "sugar"],
325
+ message: "请选择 Milk 或 Sugar",
326
+ tip: "加料仅允许 Milk/Sugar"
327
+ }
328
+ ],
329
+ priority: 30
330
+ },
331
+ // 当选择 Tea 时,仅允许 lemon/honey;未选择或选择 Coffee 时不受这条规则影响
332
+ {
333
+ type: "expr",
334
+ when: { and: [{ groupId: "11", op: "eq", value: "tea" }] },
335
+ then: [
336
+ {
337
+ type: "allowOnly",
338
+ groupId: "12",
339
+ values: ["lemon", "honey"],
340
+ message: "请选择 Lemon 或 Honey",
341
+ tip: "加料仅允许 Lemon/Honey"
342
+ }
343
+ ],
344
+ priority: 30
345
+ }
346
+ ];
347
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Card, { title: "BatchSelector(选项联动示例)" }, /* @__PURE__ */ import_react.default.createElement(
348
+ import_SelectorGroup.default,
349
+ {
350
+ ref,
351
+ dataSource: dataSource2,
352
+ linkageRules: linkageRules2,
353
+ allowedValuesPolicy: "relaxed",
354
+ value: values2,
355
+ onChange: (v) => setValues2({ ...v || {} }),
356
+ customScrollParent: containerRef.current
357
+ }
358
+ ), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => {
359
+ var _a;
360
+ return (_a = ref.current) == null ? void 0 : _a.validate();
361
+ } }, "validate")), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ import_react.default.createElement(
362
+ import_antd.Alert,
363
+ {
364
+ message: "实时值",
365
+ description: /* @__PURE__ */ import_react.default.createElement("pre", { style: { margin: 0, whiteSpace: "pre-wrap" } }, JSON.stringify(values2, null, 2)),
366
+ type: "success",
367
+ showIcon: true
368
+ }
369
+ )));
370
+ })());
371
+ };
372
+ var BatchSelectorDemo_default = BatchSelectorDemo;
373
+ // Annotate the CommonJS export names for ESM import in node:
374
+ 0 && (module.exports = {
375
+ BatchSelectorDemo
376
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SelectorProps } from './types';
3
+ import './selector.less';
4
+ declare const Selector: React.ForwardRefExoticComponent<SelectorProps<import("./types").OptionKey> & React.RefAttributes<unknown>>;
5
+ export default Selector;
@@ -0,0 +1,264 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/pro/Selector/Selector.tsx
30
+ var Selector_exports = {};
31
+ __export(Selector_exports, {
32
+ default: () => Selector_default
33
+ });
34
+ module.exports = __toCommonJS(Selector_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_icons = require("@ant-design/icons");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_locales = __toESM(require("./locales"));
40
+ var import_components = require("./components");
41
+ var import_useSelectionController = __toESM(require("./hooks/useSelectionController"));
42
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
43
+ var import_selector = require("./selector.less");
44
+ var ARow = import_antd.Row;
45
+ var ACol = import_antd.Col;
46
+ var ATag = import_antd.Tag;
47
+ var Selector = (0, import_react.forwardRef)((props, ref) => {
48
+ var _a, _b, _c;
49
+ const {
50
+ disabled,
51
+ titleProps,
52
+ mode = "single",
53
+ valueType = "primitive",
54
+ variant = "default",
55
+ grid,
56
+ renderItem,
57
+ item: itemConfig,
58
+ ruleConfig,
59
+ fieldNames
60
+ } = props;
61
+ const context = (0, import_useEngineContext.default)();
62
+ import_utils.locales.init(
63
+ import_locales.default,
64
+ ((_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.storage) == null ? void 0 : _c.get("umi_locale")) || "en"
65
+ );
66
+ const { state, actions } = (0, import_useSelectionController.default)(props);
67
+ const { options, showQuantity, errors, validated } = state;
68
+ (0, import_react.useImperativeHandle)(ref, () => ({
69
+ validate: () => {
70
+ return actions.validate();
71
+ },
72
+ getErrors: () => {
73
+ return errors || [];
74
+ },
75
+ reset: () => {
76
+ return actions.reset();
77
+ },
78
+ clear: () => {
79
+ return actions.clear();
80
+ }
81
+ }));
82
+ (0, import_react.useEffect)(() => {
83
+ document.body.id = "body";
84
+ }, []);
85
+ const renderIndicator = (option, isDefault) => {
86
+ if (mode === "single") {
87
+ return /* @__PURE__ */ import_react.default.createElement(
88
+ import_antd.Radio,
89
+ {
90
+ className: "pisell-selector_radio-trigger",
91
+ checked: option.selected,
92
+ disabled: disabled || option.disabled,
93
+ onChange: (e) => {
94
+ e.stopPropagation();
95
+ if (option.selected) {
96
+ actions.update(option._key, { quantity: 0 });
97
+ } else {
98
+ actions.update(option._key, {});
99
+ }
100
+ },
101
+ children: isDefault ? option._label : void 0
102
+ }
103
+ );
104
+ } else {
105
+ return /* @__PURE__ */ import_react.default.createElement(
106
+ import_antd.Checkbox,
107
+ {
108
+ className: "pisell-selector_checkbox-trigger",
109
+ checked: option.selected,
110
+ disabled: disabled || option.disabled,
111
+ onChange: (e) => {
112
+ e.stopPropagation();
113
+ actions.toggle(option._key);
114
+ },
115
+ children: isDefault ? option._label : void 0
116
+ }
117
+ );
118
+ }
119
+ };
120
+ const renderQuantitySelector = (option) => {
121
+ var _a2, _b2;
122
+ if (valueType === "primitive") return null;
123
+ if (!showQuantity) return null;
124
+ return /* @__PURE__ */ import_react.default.createElement(
125
+ import_components.NumericStepper,
126
+ {
127
+ min: ((_a2 = option == null ? void 0 : option.ruleConfig) == null ? void 0 : _a2.min) ?? 0,
128
+ max: ((_b2 = option == null ? void 0 : option.ruleConfig) == null ? void 0 : _b2.max) ?? Number.MAX_SAFE_INTEGER,
129
+ value: option.quantity,
130
+ disabled: disabled || option.disabled,
131
+ onChange: (value) => actions.update(option._key, { quantity: value })
132
+ }
133
+ );
134
+ };
135
+ const renderOption = (option) => {
136
+ const { disabled: optionDisabled } = option;
137
+ const handleClick = () => {
138
+ if (disabled || optionDisabled) return;
139
+ actions.toggle(option._key);
140
+ };
141
+ if (renderItem) {
142
+ return renderItem({
143
+ dataSource: option,
144
+ actions,
145
+ trigger: renderIndicator(option),
146
+ numberSelector: renderQuantitySelector(option),
147
+ onClick: handleClick
148
+ });
149
+ }
150
+ if (!variant || variant === "default") {
151
+ return renderIndicator(option, true);
152
+ }
153
+ const numberSelector = renderQuantitySelector(option);
154
+ const trigger = renderIndicator(option);
155
+ return /* @__PURE__ */ import_react.default.createElement(
156
+ import_components.CardItem,
157
+ {
158
+ ...itemConfig,
159
+ key: option._key,
160
+ dataSource: option,
161
+ selected: option.selected,
162
+ disabled: disabled || option.disabled,
163
+ trigger,
164
+ numberSelector,
165
+ onClick: handleClick
166
+ }
167
+ );
168
+ };
169
+ const renderOptions = () => {
170
+ if (variant === "select" && valueType === "primitive") {
171
+ const _value = state.values;
172
+ return /* @__PURE__ */ import_react.default.createElement(
173
+ import_antd.Select,
174
+ {
175
+ size: "large",
176
+ style: { width: "100%" },
177
+ mode: mode === "multiple" ? "multiple" : void 0,
178
+ options,
179
+ fieldNames,
180
+ value: _value,
181
+ onChange: (value) => actions.setValue(value),
182
+ disabled
183
+ }
184
+ );
185
+ }
186
+ if (grid) {
187
+ const {
188
+ columns = 1,
189
+ align,
190
+ gutter = 16,
191
+ justify,
192
+ wrap,
193
+ colConfig = {}
194
+ } = grid;
195
+ return /* @__PURE__ */ import_react.default.createElement(ARow, { gutter, justify, align, wrap }, options.map((option) => /* @__PURE__ */ import_react.default.createElement(ACol, { key: option._key, span: 24 / columns, ...colConfig }, renderOption(option))));
196
+ }
197
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 16 } }, options.map(renderOption));
198
+ };
199
+ const renderErrorMsg = () => {
200
+ if (!(errors == null ? void 0 : errors.length)) return null;
201
+ return /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#D92D20" } }, errors[0].message);
202
+ };
203
+ const renderRequiredTag = () => {
204
+ const { required = false } = ruleConfig || {};
205
+ if (!required) return null;
206
+ const style = { borderRadius: 16 };
207
+ if (errors.find((item) => item.type === "required")) {
208
+ return /* @__PURE__ */ import_react.default.createElement(ATag, { icon: /* @__PURE__ */ import_react.default.createElement(import_icons.ExclamationCircleOutlined, null), color: "error", style }, import_utils.locales.getText("pisell2.pro.selector.required-tag"));
209
+ }
210
+ if (validated) {
211
+ return /* @__PURE__ */ import_react.default.createElement(ATag, { icon: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckCircleOutlined, null), color: "success", style }, import_utils.locales.getText("pisell2.pro.selector.required-tag"));
212
+ }
213
+ return /* @__PURE__ */ import_react.default.createElement(ATag, { style }, import_utils.locales.getText("pisell2.pro.selector.required-tag"));
214
+ };
215
+ const renderTip = () => {
216
+ var _a2, _b2, _c2;
217
+ if (((_a2 = titleProps == null ? void 0 : titleProps.tip) == null ? void 0 : _a2.visible) === false) return null;
218
+ let text = (_b2 = titleProps == null ? void 0 : titleProps.tip) == null ? void 0 : _b2.text;
219
+ if ((ruleConfig == null ? void 0 : ruleConfig.min) || (ruleConfig == null ? void 0 : ruleConfig.max)) {
220
+ text = import_utils.locales.getText("pisell2.pro.selector.validate.min-max-selection")(
221
+ ruleConfig == null ? void 0 : ruleConfig.min,
222
+ ruleConfig == null ? void 0 : ruleConfig.max
223
+ );
224
+ }
225
+ if (!text) {
226
+ if (mode === "multiple") {
227
+ text = import_utils.locales.getText("pisell2.pro.selector.mode.multiple");
228
+ } else {
229
+ text = import_utils.locales.getText("pisell2.pro.selector.mode.single");
230
+ }
231
+ }
232
+ if (!text) return null;
233
+ return /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#475467", ...(_c2 = titleProps == null ? void 0 : titleProps.tip) == null ? void 0 : _c2.style } }, "(", text, ")");
234
+ };
235
+ const renderTitle = () => {
236
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
237
+ if ((titleProps == null ? void 0 : titleProps.visible) === false) return null;
238
+ return /* @__PURE__ */ import_react.default.createElement(
239
+ "div",
240
+ {
241
+ style: {
242
+ marginBottom: 12,
243
+ display: "flex",
244
+ alignItems: "center",
245
+ ...(titleProps == null ? void 0 : titleProps.style) || {}
246
+ }
247
+ },
248
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1 } }, ((_a2 = titleProps == null ? void 0 : titleProps.icon) == null ? void 0 : _a2.visible) === false || !((_b2 = titleProps == null ? void 0 : titleProps.icon) == null ? void 0 : _b2.icon) ? null : /* @__PURE__ */ import_react.default.createElement("span", { style: (_c2 = titleProps == null ? void 0 : titleProps.icon) == null ? void 0 : _c2.style }, (_d = titleProps == null ? void 0 : titleProps.icon) == null ? void 0 : _d.icon), ((_e = titleProps == null ? void 0 : titleProps.title) == null ? void 0 : _e.visible) === false || !((_f = titleProps == null ? void 0 : titleProps.title) == null ? void 0 : _f.text) && !props.title ? null : /* @__PURE__ */ import_react.default.createElement(
249
+ "span",
250
+ {
251
+ style: {
252
+ fontSize: 16,
253
+ fontWeight: 600,
254
+ ...((_g = titleProps == null ? void 0 : titleProps.title) == null ? void 0 : _g.style) || {}
255
+ }
256
+ },
257
+ ((_h = titleProps == null ? void 0 : titleProps.title) == null ? void 0 : _h.text) ?? props.title
258
+ ), renderTip(), renderErrorMsg()),
259
+ renderRequiredTag()
260
+ );
261
+ };
262
+ return /* @__PURE__ */ import_react.default.createElement("div", { id: `pisell-pro-selector-${props.id}`, style: { width: "100%" } }, renderTitle(), renderOptions());
263
+ });
264
+ var Selector_default = Selector;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { SelectionValue, SelectorGroupProps } from './types';
3
+ import './selectorGroup.less';
4
+ export declare type SelectorGroupRef = {
5
+ getValues: (includeHidden?: boolean) => Record<string, SelectionValue>;
6
+ setValues: (values: Record<string, SelectionValue>) => void;
7
+ validate: () => Promise<Record<string, never>>;
8
+ reset: () => void;
9
+ };
10
+ declare const SelectorGroup: React.ForwardRefExoticComponent<Omit<SelectorGroupProps, "ref"> & React.RefAttributes<SelectorGroupRef>>;
11
+ export default SelectorGroup;