@mercurjs/admin 2.0.0-canary.39 → 2.0.0-canary.41

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 (200) hide show
  1. package/dist/{add-campaign-promotions-ZUXBF5G3.js → add-campaign-promotions-7TPECJOT.js} +4 -4
  2. package/dist/{api-key-management-detail-SKJNAZ5L.js → api-key-management-detail-2EFDWJSF.js} +7 -7
  3. package/dist/{api-key-management-list-2D4WKI6Y.js → api-key-management-list-UZLHSM2R.js} +6 -5
  4. package/dist/{api-key-management-sales-channels-C7EWPHC2.js → api-key-management-sales-channels-ER5ZINL7.js} +6 -7
  5. package/dist/{campaign-create-B7XM2FZM.js → campaign-create-AFR3V7P4.js} +3 -3
  6. package/dist/{campaign-detail-7U4CQHU5.js → campaign-detail-UUNEZUY7.js} +9 -8
  7. package/dist/{campaign-list-SC7FLTRM.js → campaign-list-2AAGWYEG.js} +6 -5
  8. package/dist/category-create-LY45Z7YB.js +23 -0
  9. package/dist/{category-detail-HGHR3R2R.js → category-detail-AGTIMI6P.js} +7 -6
  10. package/dist/{category-list-QBBFGHQM.js → category-list-ROM7UTA4.js} +6 -5
  11. package/dist/{chunk-ENMRRG4N.js → chunk-2AWQ4FPA.js} +6 -6
  12. package/dist/{chunk-VBAAYYCS.js → chunk-2HPZJCAF.js} +6 -6
  13. package/dist/{chunk-SFG7JTBH.js → chunk-2LAANNMF.js} +111 -48
  14. package/dist/{chunk-KYUXTS2L.js → chunk-2UN7CNBG.js} +7 -7
  15. package/dist/chunk-3LTXCGNM.js +204 -0
  16. package/dist/{chunk-EDQBUWY7.js → chunk-3NIWL75F.js} +6 -6
  17. package/dist/{product-create-variant-CJPECBV4.js → chunk-4UTK7DZN.js} +63 -69
  18. package/dist/{chunk-5VEYNZSW.js → chunk-5322X23U.js} +9 -4
  19. package/dist/{chunk-U3SFHLUA.js → chunk-53IISBJZ.js} +1 -0
  20. package/dist/{chunk-DGCPYCHU.js → chunk-54RTJBYO.js} +63 -8
  21. package/dist/{chunk-E2AAYIHS.js → chunk-5EFOVNK2.js} +3 -3
  22. package/dist/{chunk-NQPAEBSZ.js → chunk-6E3T6CGY.js} +15 -7
  23. package/dist/{chunk-V2DXJ75C.js → chunk-6OA7JZ5E.js} +1 -1
  24. package/dist/chunk-72IQIAGX.js +245 -0
  25. package/dist/{chunk-3IYIS5UZ.js → chunk-7DOPC5GY.js} +4 -4
  26. package/dist/{chunk-Q6XCCONH.js → chunk-AI6RJGRQ.js} +9 -9
  27. package/dist/{price-list-create-OK7YYLAB.js → chunk-AJZQBGE4.js} +193 -428
  28. package/dist/{chunk-XDVS4B7W.js → chunk-BAV6Y7RC.js} +8 -7
  29. package/dist/{chunk-4WYBW3HK.js → chunk-BCAT7P6B.js} +3 -3
  30. package/dist/{chunk-LYT3RI4O.js → chunk-BHYDGWZ6.js} +18 -9
  31. package/dist/{chunk-DK3U2SRA.js → chunk-BIEYPCHL.js} +5 -5
  32. package/dist/{product-create-NVBKO426.js → chunk-BLG726FI.js} +36 -68
  33. package/dist/chunk-BVRI7YAR.js +100 -0
  34. package/dist/{chunk-2IGCU3KP.js → chunk-DOMRLXOI.js} +2 -2
  35. package/dist/{chunk-K6FXWZ2M.js → chunk-F55UXYYA.js} +10 -0
  36. package/dist/{chunk-AOVEX4EM.js → chunk-FNXSMFGL.js} +5 -5
  37. package/dist/{chunk-IXGP2EEN.js → chunk-FYAYHOCN.js} +2 -3
  38. package/dist/{chunk-QBOXELB5.js → chunk-GJHAVFXL.js} +4 -4
  39. package/dist/{price-list-prices-add-7PGUONDK.js → chunk-GOVOSXUU.js} +90 -290
  40. package/dist/{chunk-66IHH2HG.js → chunk-H6W6Q6YE.js} +3 -3
  41. package/dist/{seller-details-KROISMQC.js → chunk-HVLQFQGD.js} +74 -146
  42. package/dist/{chunk-QD6KYDYH.js → chunk-I6R4I7EF.js} +6 -6
  43. package/dist/{chunk-RIMR3ULR.js → chunk-ISYWL6RZ.js} +64 -33
  44. package/dist/{chunk-HHNJNKCB.js → chunk-KMUEJ3IE.js} +59 -20
  45. package/dist/{chunk-GJTIHFXG.js → chunk-KOILMFJX.js} +29 -31
  46. package/dist/{chunk-3SAH3NUS.js → chunk-LIXRNUG5.js} +1 -1
  47. package/dist/chunk-LOJD5572.js +433 -0
  48. package/dist/{chunk-T25UE7SS.js → chunk-MD56QRKC.js} +6 -6
  49. package/dist/{chunk-S4QUEQQK.js → chunk-MSFNMGFD.js} +48 -48
  50. package/dist/{chunk-YH4VQBAA.js → chunk-MX52GGQO.js} +81 -52
  51. package/dist/{chunk-O6O22BN4.js → chunk-N7BCAAJC.js} +113 -48
  52. package/dist/{chunk-JA2XIIIZ.js → chunk-NXKCVD5F.js} +6 -5
  53. package/dist/{chunk-G4QMLQF2.js → chunk-NZN7PFPB.js} +2 -4
  54. package/dist/{chunk-KUDLPUWR.js → chunk-OFWYMU6K.js} +8 -8
  55. package/dist/chunk-OOAY7PAK.js +1155 -0
  56. package/dist/chunk-PAQH5QQH.js +685 -0
  57. package/dist/{chunk-3H74EI2D.js → chunk-POCHIWE2.js} +100 -40
  58. package/dist/chunk-PXBCTPQO.js +248 -0
  59. package/dist/chunk-QSZ2FIM2.js +223 -0
  60. package/dist/{chunk-23663A2W.js → chunk-R5VKVG6S.js} +1 -1
  61. package/dist/{chunk-DP5U3GQU.js → chunk-RXUUBJSZ.js} +1 -1
  62. package/dist/{chunk-FYB5MS4F.js → chunk-S2GARTQU.js} +6 -6
  63. package/dist/{chunk-7TLEUIAL.js → chunk-SO6PXIPV.js} +21 -16
  64. package/dist/{category-create-UWBJGIED.js → chunk-ST74PSEZ.js} +78 -149
  65. package/dist/{chunk-33FUPXJL.js → chunk-T3OYE2MH.js} +4 -4
  66. package/dist/{chunk-JRWB7VWP.js → chunk-U4RMXPGI.js} +8 -8
  67. package/dist/{chunk-YGSM5PVN.js → chunk-UI2BJVP5.js} +1 -1
  68. package/dist/{chunk-FXU7SL6M.js → chunk-UOIUQC3P.js} +25 -15
  69. package/dist/{chunk-ZU2RNSCP.js → chunk-UONTDHRH.js} +4 -2
  70. package/dist/{chunk-J7SR4GW5.js → chunk-V3SHSLK4.js} +4 -4
  71. package/dist/{chunk-TE5VQBCL.js → chunk-V42ZR4XW.js} +8 -9
  72. package/dist/chunk-V5J73NPW.js +117 -0
  73. package/dist/{chunk-QP6XXG6A.js → chunk-VOFAM7HJ.js} +74 -42
  74. package/dist/{chunk-CR4E2DCR.js → chunk-VT3RBTYK.js} +3 -3
  75. package/dist/{chunk-AOVJTW7M.js → chunk-VWQYMOBM.js} +9 -9
  76. package/dist/{chunk-6L2LSIPR.js → chunk-VXAQZ2ZZ.js} +4 -4
  77. package/dist/{chunk-OSHCUDYY.js → chunk-X3KBQBGW.js} +6 -6
  78. package/dist/{chunk-WZADCDDE.js → chunk-X56THFPA.js} +2 -1
  79. package/dist/{chunk-HZKW7HRU.js → chunk-X7NWBH7T.js} +64 -35
  80. package/dist/{chunk-OFRQZHVQ.js → chunk-XE5ZMNUN.js} +6 -6
  81. package/dist/{chunk-4GVHNYZR.js → chunk-XHVYNMTA.js} +2 -2
  82. package/dist/{chunk-U2UCL2VG.js → chunk-XIZLPYEE.js} +3 -111
  83. package/dist/{chunk-KXPCEVFB.js → chunk-XOKRMMVP.js} +6 -6
  84. package/dist/{chunk-XVKRTPVM.js → chunk-Y5N26ZC3.js} +41 -15
  85. package/dist/{chunk-A6Z2Q7D5.js → chunk-Z2MDPTF2.js} +4 -2
  86. package/dist/{chunk-TKGZBTOS.js → chunk-ZFSZTRZ6.js} +54 -32
  87. package/dist/{chunk-RV6NZTNP.js → chunk-ZZEAWVFX.js} +27 -27
  88. package/dist/{collection-detail-YJ3FV2C6.js → collection-detail-SRR3HSIV.js} +7 -6
  89. package/dist/{collection-list-WDQOBHQN.js → collection-list-MKISW5S4.js} +6 -5
  90. package/dist/{commission-rate-detail-UQDIIMIK.js → commission-rate-detail-GLB733F3.js} +5 -4
  91. package/dist/{commission-rate-list-WTDZLKUR.js → commission-rate-list-5V3FQROA.js} +6 -5
  92. package/dist/{customer-detail-N7CS4IJU.js → customer-detail-SBQF232S.js} +4 -3
  93. package/dist/customer-group-add-customers-LCNDTLXR.js +1 -1
  94. package/dist/{customer-group-detail-UCTY4FF7.js → customer-group-detail-QQSNRM2K.js} +6 -5
  95. package/dist/{customer-group-list-XOQ64CVR.js → customer-group-list-IO7SVK3F.js} +15 -6
  96. package/dist/{customer-list-BUUO6OF7.js → customer-list-TXBAME4V.js} +4 -3
  97. package/dist/customers-add-customer-group-BKEV24N2.js +1 -1
  98. package/dist/index.d.ts +225 -16
  99. package/dist/index.js +581 -387
  100. package/dist/inventory-create-Q4JIXZTT.js +56 -0
  101. package/dist/{inventory-detail-BJT5WEV5.js → inventory-detail-3D37JWQT.js} +7 -6
  102. package/dist/{inventory-list-3LWBPWVK.js → inventory-list-WH42ADNB.js} +6 -5
  103. package/dist/{inventory-stock-G3GP4FZX.js → inventory-stock-DTKOGYT7.js} +6 -6
  104. package/dist/{location-detail-N7J6PEAP.js → location-detail-2SSHXSKL.js} +5 -4
  105. package/dist/location-fulfillment-providers-BHCY2MYC.js +1 -1
  106. package/dist/{location-list-UG6B47NP.js → location-list-LPISOSQI.js} +5 -4
  107. package/dist/{location-sales-channels-3IGHCJEN.js → location-sales-channels-PPH53OHD.js} +6 -7
  108. package/dist/location-service-zone-shipping-option-create-GSXLVEGO.js +57 -0
  109. package/dist/{location-service-zone-shipping-option-pricing-7VMPXDWX.js → location-service-zone-shipping-option-pricing-4CTGXBP3.js} +6 -6
  110. package/dist/marketplace-add-currencies-CIGOPBO6.js +1 -1
  111. package/dist/{marketplace-detail-7KJMXXAJ.js → marketplace-detail-3CBLIYVK.js} +6 -5
  112. package/dist/{order-detail-C25NQSZN.js → order-detail-AJV2PE7J.js} +7 -6
  113. package/dist/{order-edit-billing-address-NVRMPZEU.js → order-edit-billing-address-QQUPIC2H.js} +6 -6
  114. package/dist/{order-list-7NH7LROU.js → order-list-VPQOG5WE.js} +6 -5
  115. package/dist/pages/index.d.ts +2608 -82
  116. package/dist/pages/index.js +238 -156
  117. package/dist/{payout-detail-MDD5SRK5.js → payout-detail-PMR26YQI.js} +5 -4
  118. package/dist/{payout-list-XY2A5KYS.js → payout-list-DMG7MQM7.js} +6 -4
  119. package/dist/price-list-configuration-XK3IZLLX.js +1 -1
  120. package/dist/price-list-create-QS6CVEWS.js +76 -0
  121. package/dist/{price-list-detail-IGFSM77P.js → price-list-detail-IO5ZURVW.js} +7 -6
  122. package/dist/{price-list-list-TBXQ5DOS.js → price-list-list-B3FKB46L.js} +6 -5
  123. package/dist/price-list-prices-add-NSAQWBT6.js +71 -0
  124. package/dist/{price-list-prices-edit-QVGBT6AI.js → price-list-prices-edit-UOAIOS5X.js} +6 -6
  125. package/dist/product-create-UVKMOKRF.js +68 -0
  126. package/dist/product-create-variant-TCXDJ425.js +53 -0
  127. package/dist/{product-detail-ZC37BGPC.js → product-detail-273ME23P.js} +4 -4
  128. package/dist/{product-list-635ZXM2D.js → product-list-2ZHLFSBI.js} +5 -4
  129. package/dist/{product-media-ZMDAVPGI.js → product-media-YMFP6Q6A.js} +3 -3
  130. package/dist/{product-prices-WMRIC7WM.js → product-prices-X6JO3Y5A.js} +5 -5
  131. package/dist/{product-sales-channels-LSN5DVWZ.js → product-sales-channels-2PVBPK6W.js} +2 -3
  132. package/dist/{product-stock-HF42WRSC.js → product-stock-ARRFHDSU.js} +6 -6
  133. package/dist/{product-tag-detail-OJLYO3Q5.js → product-tag-detail-545AVFGA.js} +7 -6
  134. package/dist/{product-tag-list-XFHGJBRF.js → product-tag-list-2Y2Q7K3A.js} +7 -6
  135. package/dist/{product-type-detail-J4UA4AEM.js → product-type-detail-PBP572AM.js} +7 -6
  136. package/dist/{product-type-list-H5EQHCXS.js → product-type-list-XWNUKETZ.js} +6 -5
  137. package/dist/{product-variant-detail-5WKYURFA.js → product-variant-detail-RJUQWBYH.js} +4 -3
  138. package/dist/{profile-detail-EYNXOHGZ.js → profile-detail-H22ZBNOB.js} +5 -4
  139. package/dist/{promotion-add-campaign-B5SF72KC.js → promotion-add-campaign-5LCKEU6H.js} +3 -3
  140. package/dist/promotion-create-KXBEHXPK.js +54 -0
  141. package/dist/{promotion-detail-MVFOMS4E.js → promotion-detail-NZZ2HII7.js} +7 -6
  142. package/dist/{promotion-list-IN4VWEQN.js → promotion-list-KARWNOAQ.js} +9 -8
  143. package/dist/{refund-reason-list-DJZZC7KK.js → refund-reason-list-GTZQBZ7R.js} +3 -2
  144. package/dist/{region-detail-OFZHX57G.js → region-detail-3OPMLS4V.js} +5 -4
  145. package/dist/{region-list-L4FKHVJJ.js → region-list-542EMW5C.js} +6 -5
  146. package/dist/{reservation-detail-LZYEM5NW.js → reservation-detail-IPGIBQW4.js} +5 -4
  147. package/dist/{reservation-list-OGPDB7WG.js → reservation-list-CEFKMB2G.js} +6 -5
  148. package/dist/{reset-password-Q7Y4FWRE.js → reset-password-R5ULRWEM.js} +1 -1
  149. package/dist/{return-reason-list-6ICMSVKF.js → return-reason-list-S7LU655M.js} +5 -4
  150. package/dist/{sales-channel-detail-RRJG7U7R.js → sales-channel-detail-QCJ6OC3H.js} +7 -6
  151. package/dist/{sales-channel-list-LUZ4ZXCY.js → sales-channel-list-KYNBWXUD.js} +7 -7
  152. package/dist/seller-details-A7TYGP67.js +104 -0
  153. package/dist/{seller-list-664H4SI5.js → seller-list-5KPNNC2B.js} +7 -6
  154. package/dist/{shipping-option-type-detail-2RY3NHRO.js → shipping-option-type-detail-OBYOZZWS.js} +5 -4
  155. package/dist/{shipping-option-type-list-IOSOE33S.js → shipping-option-type-list-UGVMQ3DC.js} +6 -5
  156. package/dist/{shipping-profile-detail-RIIAX7VE.js → shipping-profile-detail-RYOFRMLH.js} +5 -4
  157. package/dist/{shipping-profiles-list-AL4EJSJY.js → shipping-profiles-list-XJGQ7AVX.js} +5 -4
  158. package/dist/{tax-region-create-UOTLTCOP.js → tax-region-create-AR2LNF2G.js} +6 -6
  159. package/dist/{tax-region-detail-CA2W5W6A.js → tax-region-detail-PIGY5JQ7.js} +7 -6
  160. package/dist/{tax-region-list-JTZ7KZCX.js → tax-region-list-AMGZWUAI.js} +6 -5
  161. package/dist/{tax-region-province-detail-ZHLX4FF4.js → tax-region-province-detail-D3R4FJT4.js} +6 -5
  162. package/dist/types-DUhfb5tH.d.ts +30 -0
  163. package/dist/{user-detail-YNPBC5MN.js → user-detail-H66ZAR7W.js} +5 -4
  164. package/dist/{user-list-LNTZNT3D.js → user-list-HIUXLIJV.js} +5 -4
  165. package/package.json +3 -3
  166. package/dist/chunk-62ZRA6BZ.js +0 -216
  167. package/dist/chunk-6PNMR6XP.js +0 -192
  168. package/dist/chunk-7COSFMM7.js +0 -163
  169. package/dist/chunk-A2KURGQO.js +0 -151
  170. package/dist/chunk-BHID7W3U.js +0 -78
  171. package/dist/chunk-UKLRBS4W.js +0 -61
  172. package/dist/inventory-create-QLEIHESO.js +0 -620
  173. package/dist/location-service-zone-shipping-option-create-GYPW6SSN.js +0 -811
  174. package/dist/promotion-create-D77SANLX.js +0 -1262
  175. package/dist/{adjust-inventory-HZCWL6SC.js → adjust-inventory-WL7D7TQR.js} +3 -3
  176. package/dist/{campaign-budget-edit-AIXCDGG3.js → campaign-budget-edit-722ECPRI.js} +3 -3
  177. package/dist/{category-products-XLCG2JR7.js → category-products-H3VFYGOU.js} +2 -2
  178. package/dist/{chunk-DEKJJ7NG.js → chunk-OFCUTNGV.js} +3 -3
  179. package/dist/{chunk-KUWNYCGL.js → chunk-U3OWJE7V.js} +0 -0
  180. package/dist/{collection-add-products-IQ7M63BA.js → collection-add-products-BQ2FZKR4.js} +1 -1
  181. package/dist/{commission-rate-create-VC72GTV4.js → commission-rate-create-GFQNADQS.js} +9 -9
  182. package/dist/{commission-rate-edit-AXJKJNFY.js → commission-rate-edit-A2BFZUEI.js} +9 -9
  183. package/dist/{location-service-zone-shipping-option-edit-E3GN4ZF5.js → location-service-zone-shipping-option-edit-KPECMUYB.js} +3 -3
  184. package/dist/{order-create-claim-7WW6MXTT.js → order-create-claim-IWTV2HKL.js} +6 -6
  185. package/dist/{order-create-edit-KAH6ZPLX.js → order-create-edit-H2MHZFIW.js} +5 -5
  186. package/dist/{order-create-exchange-ELLWF3IY.js → order-create-exchange-PPMRSGLD.js} +6 -6
  187. package/dist/{order-create-refund-5QZBOSCA.js → order-create-refund-LZOHRL7T.js} +3 -3
  188. package/dist/{order-create-return-L6DEDPJK.js → order-create-return-WY6R4QMN.js} +6 -6
  189. package/dist/{order-edit-shipping-address-BPU7OL2N.js → order-edit-shipping-address-XQCSN4YO.js} +3 -3
  190. package/dist/{order-receive-return-FW5QZJBM.js → order-receive-return-GKMHYD4G.js} +1 -1
  191. package/dist/{product-edit-LQJDUUVX.js → product-edit-QGRKGJ3H.js} +1 -1
  192. package/dist/{product-variant-edit-66ZUIIMP.js → product-variant-edit-IQLBIHDE.js} +1 -1
  193. package/dist/{product-variant-manage-inventory-items-CV2CC2PV.js → product-variant-manage-inventory-items-C77QHYRT.js} +3 -3
  194. package/dist/{promotion-edit-details-YKS24GBD.js → promotion-edit-details-BFXPUEE6.js} +4 -4
  195. package/dist/{region-create-UMJK3VGL.js → region-create-ZPY6V77Q.js} +3 -3
  196. package/dist/{region-edit-ODVSNJHM.js → region-edit-Q2CBVPR2.js} +3 -3
  197. package/dist/{sales-channel-add-products-EOWFSO35.js → sales-channel-add-products-PIY4PUIW.js} +2 -2
  198. package/dist/{tax-region-province-create-RFYCUDER.js → tax-region-province-create-7BMYABJ6.js} +3 -3
  199. package/dist/{tax-region-tax-override-create-WIWUNXW6.js → tax-region-tax-override-create-EBDKSAXG.js} +6 -6
  200. package/dist/{tax-region-tax-override-edit-SWROFQTP.js → tax-region-tax-override-edit-55ODL7KC.js} +6 -6
@@ -3,60 +3,38 @@ import {
3
3
  PriceListRulesSchema,
4
4
  usePriceListCurrencyData,
5
5
  usePriceListGridColumns
6
- } from "./chunk-S4QUEQQK.js";
7
- import {
8
- PriceListCustomerGroupRuleForm
9
- } from "./chunk-G644AXKV.js";
6
+ } from "./chunk-MSFNMGFD.js";
10
7
  import {
11
8
  exctractPricesFromProducts,
12
9
  isProductRow
13
10
  } from "./chunk-U5MJIHLY.js";
14
- import "./chunk-6IJMSVC6.js";
15
- import "./chunk-54EPH67T.js";
16
- import "./chunk-JHIMVLB2.js";
11
+ import {
12
+ PriceListCustomerGroupRuleForm
13
+ } from "./chunk-G644AXKV.js";
17
14
  import {
18
15
  useProductTableColumns
19
16
  } from "./chunk-3CKTAFTR.js";
20
- import "./chunk-G5OVX555.js";
21
- import "./chunk-FWPGOIFA.js";
22
- import "./chunk-DB6ANJBO.js";
23
- import "./chunk-FQERBIVS.js";
24
- import "./chunk-PHOCVOZ5.js";
25
17
  import {
26
18
  _DataTable,
27
19
  useDataTable
28
20
  } from "./chunk-ULJ3OMWU.js";
29
- import "./chunk-YBZWO4ZV.js";
30
- import "./chunk-KAZ5BYTQ.js";
31
- import "./chunk-3EF54XFY.js";
32
- import "./chunk-WIYFXWRI.js";
33
21
  import {
34
22
  DataGrid
35
- } from "./chunk-KUWNYCGL.js";
36
- import "./chunk-TKGWSUEI.js";
23
+ } from "./chunk-U3OWJE7V.js";
37
24
  import {
38
- KeyboundForm
39
- } from "./chunk-U2ZFCAPX.js";
40
- import "./chunk-IQPN4PZJ.js";
41
- import "./chunk-SMQT3ZNO.js";
42
- import "./chunk-INNFZYX2.js";
43
- import "./chunk-LAVHRER2.js";
25
+ TabbedForm,
26
+ defineTabMeta,
27
+ useTabbedForm
28
+ } from "./chunk-5GG65TKV.js";
44
29
  import {
45
30
  useDocumentDirection
46
31
  } from "./chunk-Y7QKP6QU.js";
47
- import "./chunk-CMHI2RPL.js";
48
- import "./chunk-VKOE5J66.js";
49
32
  import {
50
33
  useProductTableFilters
51
34
  } from "./chunk-FBUH5OLD.js";
52
35
  import {
53
36
  useProductTableQuery
54
37
  } from "./chunk-VVWB3GIK.js";
55
- import "./chunk-KBYZLKI4.js";
56
- import "./chunk-YWWUOGJA.js";
57
- import "./chunk-THHRRYRS.js";
58
- import "./chunk-UZWFZMOX.js";
59
- import "./chunk-XQNVC4Q7.js";
60
38
  import {
61
39
  RouteFocusModal,
62
40
  StackedFocusModal,
@@ -66,50 +44,64 @@ import {
66
44
  import {
67
45
  Form
68
46
  } from "./chunk-3QSRE5LS.js";
69
- import "./chunk-XM6GCWNF.js";
70
- import "./chunk-ODBDAABQ.js";
71
- import "./chunk-CDQJKJMX.js";
72
- import "./chunk-JLATVDLM.js";
73
- import "./chunk-E7ZBQO6E.js";
74
- import "./chunk-GPRBBA7S.js";
75
- import "./chunk-XGHM75N2.js";
76
- import "./chunk-U2GCSKW3.js";
77
- import "./chunk-A4X5VP3G.js";
78
- import "./chunk-RTAIDSDS.js";
79
- import "./chunk-LW3UWYZU.js";
80
- import "./chunk-NNZP4PYP.js";
81
- import "./chunk-JOQ3RTF5.js";
82
47
  import {
83
48
  useCreatePriceList
84
49
  } from "./chunk-V534K7G4.js";
85
- import "./chunk-TQI3DOQ5.js";
86
- import "./chunk-5PB7KCTF.js";
87
- import "./chunk-LU72QEQC.js";
88
- import "./chunk-GF4QHVX3.js";
89
- import "./chunk-A5XOYSDC.js";
90
- import "./chunk-YOIARITB.js";
91
- import "./chunk-W7G64ULL.js";
92
- import "./chunk-6C7TCU42.js";
93
- import "./chunk-4YF3GAKE.js";
94
- import "./chunk-QSM56ZOP.js";
95
- import "./chunk-MIHEJ6Y6.js";
96
- import "./chunk-3VZV6SJQ.js";
97
- import "./chunk-LORVU5II.js";
98
- import "./chunk-36ORDF7W.js";
99
50
  import {
100
51
  useProducts
101
52
  } from "./chunk-K357FGGP.js";
102
- import "./chunk-RHKRREUU.js";
103
- import "./chunk-ZA2KFUFR.js";
104
- import "./chunk-ZYNBKBY3.js";
105
- import "./chunk-NBMM2TZK.js";
53
+
54
+ // src/pages/price-lists/price-list-create/components/price-list-create-form/schema.ts
55
+ import { z } from "zod";
56
+ var PricingCustomerGroupsArray = z.array(
57
+ z.object({
58
+ id: z.string(),
59
+ name: z.string()
60
+ })
61
+ );
62
+ var PricingCreateSchema = z.object({
63
+ type: z.enum(["sale", "override"]),
64
+ status: z.enum(["draft", "active"]),
65
+ title: z.string().min(1),
66
+ description: z.string().min(1),
67
+ starts_at: z.date().nullish(),
68
+ ends_at: z.date().nullish(),
69
+ product_ids: z.array(z.object({ id: z.string() })).min(1),
70
+ products: PriceListCreateProductsSchema,
71
+ rules: PriceListRulesSchema.nullish()
72
+ });
73
+ var PricingDetailsSchema = PricingCreateSchema.pick({
74
+ type: true,
75
+ title: true,
76
+ description: true,
77
+ starts_at: true,
78
+ ends_at: true
79
+ });
80
+ var PricingDetailsFields = Object.keys(
81
+ PricingDetailsSchema.shape
82
+ );
83
+ var PricingProductsSchema = PricingCreateSchema.pick({
84
+ product_ids: true
85
+ });
86
+ var PricingProductsFields = Object.keys(
87
+ PricingProductsSchema.shape
88
+ );
89
+ var PricingPricesSchema = PricingCreateSchema.pick({
90
+ products: true
91
+ });
92
+ var PricingPricesFields = Object.keys(
93
+ PricingPricesSchema.shape
94
+ );
95
+
96
+ // src/pages/price-lists/price-list-create/price-list-create.tsx
97
+ import { Children as Children2 } from "react";
106
98
 
107
99
  // src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx
108
100
  import { zodResolver } from "@hookform/resolvers/zod";
109
- import { Button as Button2, ProgressTabs, toast } from "@medusajs/ui";
101
+ import { toast } from "@medusajs/ui";
102
+ import { Children, useMemo as useMemo2 } from "react";
110
103
  import { useForm } from "react-hook-form";
111
104
  import { useTranslation as useTranslation3 } from "react-i18next";
112
- import { useState as useState2 } from "react";
113
105
 
114
106
  // src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx
115
107
  import { MagnifyingGlass, XMarkMini } from "@medusajs/icons";
@@ -129,8 +121,9 @@ import {
129
121
  import { useFieldArray } from "react-hook-form";
130
122
  import { useTranslation } from "react-i18next";
131
123
  import { jsx, jsxs } from "react/jsx-runtime";
132
- var PriceListDetailsForm = ({ form }) => {
124
+ var Root = () => {
133
125
  const { t } = useTranslation();
126
+ const form = useTabbedForm();
134
127
  const direction = useDocumentDirection();
135
128
  const { fields, remove, append } = useFieldArray({
136
129
  control: form.control,
@@ -182,9 +175,7 @@ var PriceListDetailsForm = ({ form }) => {
182
175
  {
183
176
  value: "sale",
184
177
  label: t("priceLists.fields.type.options.sale.label"),
185
- description: t(
186
- "priceLists.fields.type.options.sale.description"
187
- ),
178
+ description: t("priceLists.fields.type.options.sale.description"),
188
179
  "data-testid": "price-list-details-form-type-option-sale"
189
180
  }
190
181
  ),
@@ -192,12 +183,8 @@ var PriceListDetailsForm = ({ form }) => {
192
183
  RadioGroup.ChoiceBox,
193
184
  {
194
185
  value: "override",
195
- label: t(
196
- "priceLists.fields.type.options.override.label"
197
- ),
198
- description: t(
199
- "priceLists.fields.type.options.override.description"
200
- ),
186
+ label: t("priceLists.fields.type.options.override.label"),
187
+ description: t("priceLists.fields.type.options.override.description"),
201
188
  "data-testid": "price-list-details-form-type-option-override"
202
189
  }
203
190
  )
@@ -217,13 +204,11 @@ var PriceListDetailsForm = ({ form }) => {
217
204
  {
218
205
  control: form.control,
219
206
  name: "title",
220
- render: ({ field }) => {
221
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-title-item", children: [
222
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-title-label", children: t("fields.title") }),
223
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-title-control", children: /* @__PURE__ */ jsx(Input, { ...field, "data-testid": "price-list-details-form-title-input" }) }),
224
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-title-error" })
225
- ] });
226
- }
207
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-title-item", children: [
208
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-title-label", children: t("fields.title") }),
209
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-title-control", children: /* @__PURE__ */ jsx(Input, { ...field, "data-testid": "price-list-details-form-title-input" }) }),
210
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-title-error" })
211
+ ] })
227
212
  }
228
213
  ),
229
214
  /* @__PURE__ */ jsx(
@@ -231,28 +216,26 @@ var PriceListDetailsForm = ({ form }) => {
231
216
  {
232
217
  control: form.control,
233
218
  name: "status",
234
- render: ({ field: { onChange, ref, ...field } }) => {
235
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-status-item", children: [
236
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-status-label", children: t("priceLists.fields.status.label") }),
237
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-status-control", children: /* @__PURE__ */ jsxs(
238
- Select,
239
- {
240
- dir: direction,
241
- ...field,
242
- onValueChange: onChange,
243
- "data-testid": "price-list-details-form-status-select",
244
- children: [
245
- /* @__PURE__ */ jsx(Select.Trigger, { ref, "data-testid": "price-list-details-form-status-trigger", children: /* @__PURE__ */ jsx(Select.Value, { "data-testid": "price-list-details-form-status-value" }) }),
246
- /* @__PURE__ */ jsxs(Select.Content, { "data-testid": "price-list-details-form-status-content", children: [
247
- /* @__PURE__ */ jsx(Select.Item, { value: "active", "data-testid": "price-list-details-form-status-option-active", children: t("priceLists.fields.status.options.active") }),
248
- /* @__PURE__ */ jsx(Select.Item, { value: "draft", "data-testid": "price-list-details-form-status-option-draft", children: t("priceLists.fields.status.options.draft") })
249
- ] })
250
- ]
251
- }
252
- ) }),
253
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-status-error" })
254
- ] });
255
- }
219
+ render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-status-item", children: [
220
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-status-label", children: t("priceLists.fields.status.label") }),
221
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-status-control", children: /* @__PURE__ */ jsxs(
222
+ Select,
223
+ {
224
+ dir: direction,
225
+ ...field,
226
+ onValueChange: onChange,
227
+ "data-testid": "price-list-details-form-status-select",
228
+ children: [
229
+ /* @__PURE__ */ jsx(Select.Trigger, { ref, "data-testid": "price-list-details-form-status-trigger", children: /* @__PURE__ */ jsx(Select.Value, { "data-testid": "price-list-details-form-status-value" }) }),
230
+ /* @__PURE__ */ jsxs(Select.Content, { "data-testid": "price-list-details-form-status-content", children: [
231
+ /* @__PURE__ */ jsx(Select.Item, { value: "active", "data-testid": "price-list-details-form-status-option-active", children: t("priceLists.fields.status.options.active") }),
232
+ /* @__PURE__ */ jsx(Select.Item, { value: "draft", "data-testid": "price-list-details-form-status-option-draft", children: t("priceLists.fields.status.options.draft") })
233
+ ] })
234
+ ]
235
+ }
236
+ ) }),
237
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-status-error" })
238
+ ] })
256
239
  }
257
240
  )
258
241
  ] }),
@@ -261,13 +244,11 @@ var PriceListDetailsForm = ({ form }) => {
261
244
  {
262
245
  control: form.control,
263
246
  name: "description",
264
- render: ({ field }) => {
265
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-description-item", children: [
266
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-description-label", children: t("fields.description") }),
267
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-description-control", children: /* @__PURE__ */ jsx(Textarea, { ...field, "data-testid": "price-list-details-form-description-input" }) }),
268
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-description-error" })
269
- ] });
270
- }
247
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-description-item", children: [
248
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "price-list-details-form-description-label", children: t("fields.description") }),
249
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-description-control", children: /* @__PURE__ */ jsx(Textarea, { ...field, "data-testid": "price-list-details-form-description-input" }) }),
250
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-description-error" })
251
+ ] })
271
252
  }
272
253
  )
273
254
  ] }),
@@ -277,26 +258,24 @@ var PriceListDetailsForm = ({ form }) => {
277
258
  {
278
259
  control: form.control,
279
260
  name: "starts_at",
280
- render: ({ field }) => {
281
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-starts-at-item", children: [
282
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
283
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
284
- /* @__PURE__ */ jsx(Form.Label, { optional: true, "data-testid": "price-list-details-form-starts-at-label", children: t("priceLists.fields.startsAt.label") }),
285
- /* @__PURE__ */ jsx(Form.Hint, { "data-testid": "price-list-details-form-starts-at-hint", children: t("priceLists.fields.startsAt.hint") })
286
- ] }),
287
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-starts-at-control", children: /* @__PURE__ */ jsx(
288
- DatePicker,
289
- {
290
- granularity: "minute",
291
- shouldCloseOnSelect: false,
292
- ...field,
293
- "data-testid": "price-list-details-form-starts-at-input"
294
- }
295
- ) })
261
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-starts-at-item", children: [
262
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
263
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
264
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, "data-testid": "price-list-details-form-starts-at-label", children: t("priceLists.fields.startsAt.label") }),
265
+ /* @__PURE__ */ jsx(Form.Hint, { "data-testid": "price-list-details-form-starts-at-hint", children: t("priceLists.fields.startsAt.hint") })
296
266
  ] }),
297
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-starts-at-error" })
298
- ] });
299
- }
267
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-starts-at-control", children: /* @__PURE__ */ jsx(
268
+ DatePicker,
269
+ {
270
+ granularity: "minute",
271
+ shouldCloseOnSelect: false,
272
+ ...field,
273
+ "data-testid": "price-list-details-form-starts-at-input"
274
+ }
275
+ ) })
276
+ ] }),
277
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-starts-at-error" })
278
+ ] })
300
279
  }
301
280
  ),
302
281
  /* @__PURE__ */ jsx(Divider, {}),
@@ -305,26 +284,24 @@ var PriceListDetailsForm = ({ form }) => {
305
284
  {
306
285
  control: form.control,
307
286
  name: "ends_at",
308
- render: ({ field }) => {
309
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-ends-at-item", children: [
310
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
311
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
312
- /* @__PURE__ */ jsx(Form.Label, { optional: true, "data-testid": "price-list-details-form-ends-at-label", children: t("priceLists.fields.endsAt.label") }),
313
- /* @__PURE__ */ jsx(Form.Hint, { "data-testid": "price-list-details-form-ends-at-hint", children: t("priceLists.fields.endsAt.hint") })
314
- ] }),
315
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-ends-at-control", children: /* @__PURE__ */ jsx(
316
- DatePicker,
317
- {
318
- granularity: "minute",
319
- shouldCloseOnSelect: false,
320
- ...field,
321
- "data-testid": "price-list-details-form-ends-at-input"
322
- }
323
- ) })
287
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "price-list-details-form-ends-at-item", children: [
288
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
289
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
290
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, "data-testid": "price-list-details-form-ends-at-label", children: t("priceLists.fields.endsAt.label") }),
291
+ /* @__PURE__ */ jsx(Form.Hint, { "data-testid": "price-list-details-form-ends-at-hint", children: t("priceLists.fields.endsAt.hint") })
324
292
  ] }),
325
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-ends-at-error" })
326
- ] });
327
- }
293
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "price-list-details-form-ends-at-control", children: /* @__PURE__ */ jsx(
294
+ DatePicker,
295
+ {
296
+ granularity: "minute",
297
+ shouldCloseOnSelect: false,
298
+ ...field,
299
+ "data-testid": "price-list-details-form-ends-at-input"
300
+ }
301
+ ) })
302
+ ] }),
303
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "price-list-details-form-ends-at-error" })
304
+ ] })
328
305
  }
329
306
  ),
330
307
  /* @__PURE__ */ jsx(Divider, {}),
@@ -363,9 +340,7 @@ var PriceListDetailsForm = ({ form }) => {
363
340
  "data-testid": "price-list-details-form-customer-group-search-button",
364
341
  children: [
365
342
  /* @__PURE__ */ jsx(MagnifyingGlass, {}),
366
- t(
367
- "priceLists.fields.customerAvailability.placeholder"
368
- )
343
+ t("priceLists.fields.customerAvailability.placeholder")
369
344
  ]
370
345
  }
371
346
  ) }),
@@ -419,17 +394,23 @@ var PriceListDetailsForm = ({ form }) => {
419
394
  )
420
395
  ] }) });
421
396
  };
397
+ Root._tabMeta = defineTabMeta({
398
+ id: "detail",
399
+ labelKey: "priceLists.create.tabs.details",
400
+ validationFields: ["type", "title", "description", "starts_at", "ends_at"]
401
+ });
402
+ var PriceListDetailsForm = Root;
422
403
 
423
404
  // src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx
424
405
  import { useEffect } from "react";
425
406
  import { useWatch } from "react-hook-form";
426
407
  import { jsx as jsx2 } from "react/jsx-runtime";
427
- var PriceListPricesForm = ({
428
- form,
408
+ var Root2 = ({
429
409
  currencies,
430
410
  regions,
431
411
  pricePreferences
432
412
  }) => {
413
+ const form = useTabbedForm();
433
414
  const ids = useWatch({
434
415
  control: form.control,
435
416
  name: "product_ids"
@@ -487,6 +468,12 @@ var PriceListPricesForm = ({
487
468
  }
488
469
  ) });
489
470
  };
471
+ Root2._tabMeta = defineTabMeta({
472
+ id: "price",
473
+ labelKey: "priceLists.create.tabs.prices",
474
+ validationFields: ["products"]
475
+ });
476
+ var PriceListPricesForm = Root2;
490
477
 
491
478
  // src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-products-form.tsx
492
479
  import { Checkbox } from "@medusajs/ui";
@@ -506,8 +493,9 @@ function getInitialSelection(products) {
506
493
  return acc;
507
494
  }, {});
508
495
  }
509
- var PriceListProductsForm = ({ form }) => {
496
+ var Root3 = () => {
510
497
  const { t } = useTranslation2();
498
+ const form = useTabbedForm();
511
499
  const { control, setValue } = form;
512
500
  const selectedIds = useWatch2({
513
501
  control,
@@ -630,67 +618,25 @@ var useColumns = () => {
630
618
  [base]
631
619
  );
632
620
  };
633
-
634
- // src/pages/price-lists/price-list-create/components/price-list-create-form/schema.ts
635
- import { z } from "zod";
636
- var PricingCustomerGroupsArray = z.array(
637
- z.object({
638
- id: z.string(),
639
- name: z.string()
640
- })
641
- );
642
- var PricingCreateSchema = z.object({
643
- type: z.enum(["sale", "override"]),
644
- status: z.enum(["draft", "active"]),
645
- title: z.string().min(1),
646
- description: z.string().min(1),
647
- starts_at: z.date().nullish(),
648
- ends_at: z.date().nullish(),
649
- product_ids: z.array(z.object({ id: z.string() })).min(1),
650
- products: PriceListCreateProductsSchema,
651
- rules: PriceListRulesSchema.nullish()
652
- });
653
- var PricingDetailsSchema = PricingCreateSchema.pick({
654
- type: true,
655
- title: true,
656
- description: true,
657
- starts_at: true,
658
- ends_at: true
659
- });
660
- var PricingDetailsFields = Object.keys(
661
- PricingDetailsSchema.shape
662
- );
663
- var PricingProductsSchema = PricingCreateSchema.pick({
664
- product_ids: true
665
- });
666
- var PricingProductsFields = Object.keys(
667
- PricingProductsSchema.shape
668
- );
669
- var PricingPricesSchema = PricingCreateSchema.pick({
670
- products: true
621
+ Root3._tabMeta = defineTabMeta({
622
+ id: "product",
623
+ labelKey: "priceLists.create.tabs.products",
624
+ validationFields: ["product_ids"]
671
625
  });
672
- var PricingPricesFields = Object.keys(
673
- PricingPricesSchema.shape
674
- );
626
+ var PriceListProductsForm = Root3;
675
627
 
676
628
  // src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx
677
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
678
- var tabOrder = ["detail" /* DETAIL */, "product" /* PRODUCT */, "price" /* PRICE */];
679
- var initialTabState = {
680
- ["detail" /* DETAIL */]: "in-progress",
681
- ["product" /* PRODUCT */]: "not-started",
682
- ["price" /* PRICE */]: "not-started"
683
- };
629
+ import { jsx as jsx4 } from "react/jsx-runtime";
684
630
  var PriceListCreateForm = ({
685
631
  regions,
686
632
  currencies,
687
- pricePreferences
633
+ pricePreferences,
634
+ children,
635
+ schema,
636
+ defaultValues: extraDefaults
688
637
  }) => {
689
- const [tab, setTab] = useState2("detail" /* DETAIL */);
690
- const [tabState, setTabState] = useState2(initialTabState);
691
638
  const { t } = useTranslation3();
692
639
  const { handleSuccess } = useRouteModal();
693
- const direction = useDocumentDirection();
694
640
  const form = useForm({
695
641
  defaultValues: {
696
642
  type: "sale",
@@ -703,9 +649,10 @@ var PriceListCreateForm = ({
703
649
  products: {},
704
650
  rules: {
705
651
  customer_group_id: []
706
- }
652
+ },
653
+ ...extraDefaults
707
654
  },
708
- resolver: zodResolver(PricingCreateSchema)
655
+ resolver: zodResolver(schema ?? PricingCreateSchema)
709
656
  });
710
657
  const { mutateAsync, isPending } = useCreatePriceList();
711
658
  const handleSubmit = form.handleSubmit(async (data) => {
@@ -738,240 +685,58 @@ var PriceListCreateForm = ({
738
685
  }
739
686
  );
740
687
  });
741
- const partialFormValidation = (fields, schema) => {
742
- form.clearErrors(fields);
743
- const values = fields.reduce(
744
- (acc, key) => {
745
- acc[key] = form.getValues(key);
746
- return acc;
747
- },
748
- {}
749
- );
750
- const validationResult = schema.safeParse(values);
751
- if (!validationResult.success) {
752
- validationResult.error.errors.forEach(({ path, message, code }) => {
753
- form.setError(path.join("."), {
754
- type: code,
755
- message
756
- });
757
- });
758
- return false;
759
- }
760
- return true;
761
- };
762
- const isTabDirty = (tab2) => {
763
- switch (tab2) {
764
- case "detail" /* DETAIL */: {
765
- const fields = PricingDetailsFields;
766
- return fields.some((field) => {
767
- return form.getFieldState(field).isDirty;
768
- });
769
- }
770
- case "product" /* PRODUCT */: {
771
- const fields = PricingProductsFields;
772
- return fields.some((field) => {
773
- return form.getFieldState(field).isDirty;
774
- });
775
- }
776
- case "price" /* PRICE */: {
777
- const fields = PricingPricesFields;
778
- return fields.some((field) => {
779
- return form.getFieldState(field).isDirty;
780
- });
781
- }
782
- }
783
- };
784
- const handleChangeTab = (update) => {
785
- if (tab === update) {
786
- return;
787
- }
788
- if (tabOrder.indexOf(update) < tabOrder.indexOf(tab)) {
789
- const isCurrentTabDirty = isTabDirty(tab);
790
- setTabState((prev) => ({
791
- ...prev,
792
- [tab]: isCurrentTabDirty ? prev[tab] : "not-started",
793
- [update]: "in-progress"
794
- }));
795
- setTab(update);
796
- return;
797
- }
798
- const tabs = tabOrder.slice(0, tabOrder.indexOf(update));
799
- for (const tab2 of tabs) {
800
- if (tab2 === "detail" /* DETAIL */) {
801
- if (!partialFormValidation(PricingDetailsFields, PricingDetailsSchema)) {
802
- setTabState((prev) => ({
803
- ...prev,
804
- [tab2]: "in-progress"
805
- }));
806
- setTab(tab2);
807
- return;
808
- }
809
- setTabState((prev) => ({
810
- ...prev,
811
- [tab2]: "completed"
812
- }));
813
- } else if (tab2 === "product" /* PRODUCT */) {
814
- if (!partialFormValidation(PricingProductsFields, PricingProductsSchema)) {
815
- setTabState((prev) => ({
816
- ...prev,
817
- [tab2]: "in-progress"
818
- }));
819
- setTab(tab2);
820
- return;
821
- }
822
- setTabState((prev) => ({
823
- ...prev,
824
- [tab2]: "completed"
825
- }));
826
- }
827
- }
828
- setTabState((prev) => ({
829
- ...prev,
830
- [tab]: "completed",
831
- [update]: "in-progress"
832
- }));
833
- setTab(update);
834
- };
835
- const handleNextTab = (tab2) => {
836
- if (tabOrder.indexOf(tab2) + 1 >= tabOrder.length) {
837
- return;
838
- }
839
- const nextTab = tabOrder[tabOrder.indexOf(tab2) + 1];
840
- handleChangeTab(nextTab);
841
- };
842
- return /* @__PURE__ */ jsx4(RouteFocusModal.Form, { form, "data-testid": "price-list-create-form", children: /* @__PURE__ */ jsx4(
843
- ProgressTabs,
844
- {
845
- dir: direction,
846
- value: tab,
847
- onValueChange: (tab2) => handleChangeTab(tab2),
848
- className: "flex h-full flex-col overflow-hidden",
849
- "data-testid": "price-list-create-form-tabs",
850
- children: /* @__PURE__ */ jsxs2(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
851
- /* @__PURE__ */ jsx4(RouteFocusModal.Header, { "data-testid": "price-list-create-form-header", children: /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-between gap-x-4", children: /* @__PURE__ */ jsx4("div", { className: "-my-2 w-full max-w-[600px] border-l", children: /* @__PURE__ */ jsxs2(ProgressTabs.List, { className: "grid w-full grid-cols-3", "data-testid": "price-list-create-form-tabs-list", children: [
852
- /* @__PURE__ */ jsx4(
853
- ProgressTabs.Trigger,
854
- {
855
- status: tabState.detail,
856
- value: "detail" /* DETAIL */,
857
- "data-testid": "price-list-create-form-tab-details",
858
- children: t("priceLists.create.tabs.details")
859
- }
860
- ),
861
- /* @__PURE__ */ jsx4(
862
- ProgressTabs.Trigger,
863
- {
864
- status: tabState.product,
865
- value: "product" /* PRODUCT */,
866
- "data-testid": "price-list-create-form-tab-products",
867
- children: t("priceLists.create.tabs.products")
868
- }
869
- ),
870
- /* @__PURE__ */ jsx4(
871
- ProgressTabs.Trigger,
872
- {
873
- status: tabState.price,
874
- value: "price" /* PRICE */,
875
- "data-testid": "price-list-create-form-tab-prices",
876
- children: t("priceLists.create.tabs.prices")
877
- }
878
- )
879
- ] }) }) }) }),
880
- /* @__PURE__ */ jsxs2(RouteFocusModal.Body, { className: "size-full overflow-hidden", "data-testid": "price-list-create-form-body", children: [
881
- /* @__PURE__ */ jsx4(
882
- ProgressTabs.Content,
883
- {
884
- className: "size-full overflow-y-auto",
885
- value: "detail" /* DETAIL */,
886
- "data-testid": "price-list-create-form-content-details",
887
- children: /* @__PURE__ */ jsx4(PriceListDetailsForm, { form })
888
- }
889
- ),
890
- /* @__PURE__ */ jsx4(
891
- ProgressTabs.Content,
892
- {
893
- className: "size-full overflow-y-auto",
894
- value: "product" /* PRODUCT */,
895
- "data-testid": "price-list-create-form-content-products",
896
- children: /* @__PURE__ */ jsx4(PriceListProductsForm, { form })
897
- }
898
- ),
899
- /* @__PURE__ */ jsx4(
900
- ProgressTabs.Content,
901
- {
902
- className: "size-full overflow-hidden",
903
- value: "price" /* PRICE */,
904
- "data-testid": "price-list-create-form-content-prices",
905
- children: /* @__PURE__ */ jsx4(
906
- PriceListPricesForm,
907
- {
908
- form,
909
- regions,
910
- currencies,
911
- pricePreferences
912
- }
913
- )
914
- }
915
- )
916
- ] }),
917
- /* @__PURE__ */ jsx4(RouteFocusModal.Footer, { "data-testid": "price-list-create-form-footer", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-end gap-x-2", children: [
918
- /* @__PURE__ */ jsx4(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx4(Button2, { variant: "secondary", size: "small", "data-testid": "price-list-create-form-cancel-button", children: t("actions.cancel") }) }),
919
- /* @__PURE__ */ jsx4(
920
- PrimaryButton,
921
- {
922
- tab,
923
- next: handleNextTab,
924
- isLoading: isPending
925
- }
926
- )
927
- ] }) })
928
- ] })
929
- }
930
- ) });
931
- };
932
- var PrimaryButton = ({ tab, next, isLoading }) => {
933
- const { t } = useTranslation3();
934
- if (tab === "price" /* PRICE */) {
935
- return /* @__PURE__ */ jsx4(
936
- Button2,
937
- {
938
- type: "submit",
939
- variant: "primary",
940
- size: "small",
941
- isLoading,
942
- "data-testid": "price-list-create-form-save-button",
943
- children: t("actions.save")
944
- },
945
- "submit-button"
946
- );
947
- }
688
+ const defaultTabs = useMemo2(
689
+ () => [
690
+ /* @__PURE__ */ jsx4(PriceListDetailsForm, {}, "detail"),
691
+ /* @__PURE__ */ jsx4(PriceListProductsForm, {}, "product"),
692
+ /* @__PURE__ */ jsx4(
693
+ PriceListPricesForm,
694
+ {
695
+ currencies,
696
+ regions,
697
+ pricePreferences
698
+ },
699
+ "price"
700
+ )
701
+ ],
702
+ [currencies, regions, pricePreferences]
703
+ );
704
+ const hasCustomChildren = Children.count(children) > 0;
948
705
  return /* @__PURE__ */ jsx4(
949
- Button2,
706
+ TabbedForm,
950
707
  {
951
- type: "button",
952
- variant: "primary",
953
- size: "small",
954
- onClick: () => next(tab),
955
- "data-testid": "price-list-create-form-continue-button",
956
- children: t("actions.continue")
957
- },
958
- "next-button"
708
+ form,
709
+ onSubmit: handleSubmit,
710
+ isLoading: isPending,
711
+ children: hasCustomChildren ? children : defaultTabs
712
+ }
959
713
  );
960
714
  };
961
715
 
962
716
  // src/pages/price-lists/price-list-create/price-list-create.tsx
963
717
  import { jsx as jsx5 } from "react/jsx-runtime";
964
- var PriceListCreate = () => {
718
+ var Root4 = ({ children }) => {
965
719
  const { isReady, regions, currencies, pricePreferences } = usePriceListCurrencyData();
966
- return /* @__PURE__ */ jsx5(RouteFocusModal, { children: isReady && /* @__PURE__ */ jsx5(
720
+ return /* @__PURE__ */ jsx5(RouteFocusModal, { children: isReady && (Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx5(
967
721
  PriceListCreateForm,
968
722
  {
969
723
  regions,
970
724
  currencies,
971
725
  pricePreferences
972
726
  }
973
- ) });
727
+ )) });
974
728
  };
729
+ var PriceListCreatePage = Object.assign(Root4, {
730
+ Form: PriceListCreateForm,
731
+ DetailsTab: PriceListDetailsForm,
732
+ ProductsTab: PriceListProductsForm,
733
+ PricesTab: PriceListPricesForm,
734
+ Tab: TabbedForm.Tab
735
+ });
736
+ var PriceListCreate = Root4;
737
+
975
738
  export {
976
- PriceListCreate as Component
739
+ PricingCreateSchema,
740
+ PriceListCreatePage,
741
+ PriceListCreate
977
742
  };